@@ -4672,6 +4672,7 @@
4672 [%collection name=term args=(list itype)]
4672 [%collection name=term args=(list itype)]
4673 [%recursive module=term name=term label=(unit @t)]
4673 [%recursive module=term name=term label=(unit @t)]
4674 [%jrec at=path name=term label=(unit @t) head=term aura=@ta tail=term]
4674 [%jrec at=path name=term label=(unit @t) head=term aura=@ta tail=term]
4675+ [%grec at=path name=term label=(unit @t) proof=shape args=(list itype)]
4675 [%union cases=(list itype) origin=(unit [at=path name=term]) label=(unit @t) args=(list itype)]
4676 [%union cases=(list itype) origin=(unit [at=path name=term]) label=(unit @t) args=(list itype)]
4676 [%face name=term body=itype]
4677 [%face name=term body=itype]
4677 [%fn sample=itype product=itype]
4678 [%fn sample=itype product=itype]
@@ -4743,6 +4744,7 @@
4743 %union |((lien cases.t |=(c=itype (itype-occurs n c sub))) (lien args.t |=(c=itype (itype-occurs n c sub))))
4744 %union |((lien cases.t |=(c=itype (itype-occurs n c sub))) (lien args.t |=(c=itype (itype-occurs n c sub))))
4744 %recursive |
4745 %recursive |
4747+ %grec (lien args.t |=(c=itype (itype-occurs n c sub)))
4746 %collection (lien args.t |=(c=itype (itype-occurs n c sub)))
4748 %collection (lien args.t |=(c=itype (itype-occurs n c sub)))
4747 %face $(t body.t)
4749 %face $(t body.t)
4748 %fn |($(t sample.t) $(t product.t))
4750 %fn |($(t sample.t) $(t product.t))
@@ -4761,6 +4763,9 @@
4761 =. a (itype-walk a sub)
4763 =. a (itype-walk a sub)
4762 =. b (itype-walk b sub)
4764 =. b (itype-walk b sub)
4763 ?: =(a b) `sub
4765 ?: =(a b) `sub
4766+ ?: &(?=(%grec -.a) ?=(%grec -.b))
4767+ ?. &(=(at.a at.b) =(name.a name.b)) ~
4768+ (itype-unify-args args.a args.b sub)
4764 ?: &(?=(%jrec -.a) ?=(%jrec -.b))
4769 ?: &(?=(%jrec -.a) ?=(%jrec -.b))
4765 ?:(&(=(at.a at.b) =(name.a name.b) =(head.a head.b) =(aura.a aura.b) =(tail.a tail.b)) `sub ~)
4770 ?:(&(=(at.a at.b) =(name.a name.b) =(head.a head.b) =(aura.a aura.b) =(tail.a tail.b)) `sub ~)
4766 ?: &(?=(%recursive -.a) ?=(%recursive -.b))
4771 ?: &(?=(%recursive -.a) ?=(%recursive -.b))
@@ -4871,6 +4876,7 @@
4871 %union |((lien cases.t |=(c=itype (itype-has-any-atom c sub))) (lien args.t |=(c=itype (itype-has-any-atom c sub))))
4876 %union |((lien cases.t |=(c=itype (itype-has-any-atom c sub))) (lien args.t |=(c=itype (itype-has-any-atom c sub))))
4872 %recursive |
4877 %recursive |
4879+ %grec (lien args.t |=(c=itype (itype-has-any-atom c sub)))
4874 %collection (lien args.t |=(c=itype (itype-has-any-atom c sub)))
4880 %collection (lien args.t |=(c=itype (itype-has-any-atom c sub)))
4875 %face $(t body.t)
4881 %face $(t body.t)
4876 %fn |($(t sample.t) $(t product.t))
4882 %fn |($(t sample.t) $(t product.t))
@@ -4945,6 +4951,7 @@
4945 %union |((lien cases.typ |=(c=itype (itype-has-fixed-atom c))) (lien args.typ |=(c=itype (itype-has-fixed-atom c))))
4951 %union |((lien cases.typ |=(c=itype (itype-has-fixed-atom c))) (lien args.typ |=(c=itype (itype-has-fixed-atom c))))
4946 %recursive |
4952 %recursive |
4954+ %grec (lien args.typ |=(c=itype (itype-has-fixed-atom c)))
4948 %collection (lien args.typ |=(c=itype (itype-has-fixed-atom c)))
4955 %collection (lien args.typ |=(c=itype (itype-has-fixed-atom c)))
4949 %face $(typ body.typ)
4956 %face $(typ body.typ)
4950 %fn |($(typ sample.typ) $(typ product.typ))
4957 %fn |($(typ sample.typ) $(typ product.typ))
@@ -4973,6 +4980,7 @@
4974 =. t (itype-walk t sub)
4981 =. t (itype-walk t sub)
4983+ %grec (lien args.t |=(c=itype (itype-has-face c sub)))
4976 %collection (lien args.t |=(c=itype (itype-has-face c sub)))
4984 %collection (lien args.t |=(c=itype (itype-has-face c sub)))
4978 %cell |($(t hed.t) $(t tal.t))
4986 %cell |($(t hed.t) $(t tal.t))
@@ -5029,6 +5037,9 @@
5030 =. a (itype-walk a sub)
5038 =. a (itype-walk a sub)
5031 =. b (itype-walk b sub)
5039 =. b (itype-walk b sub)
5040+ ?: &(?=(%grec -.a) ?=(%grec -.b))
5041+ ?. &(=(at.a at.b) =(name.a name.b)) |
5042+ (itype-face-asym-collection-args args.a args.b sub)
5032 ?: &(?=(%collection -.a) ?=(%collection -.b))
5043 ?: &(?=(%collection -.a) ?=(%collection -.b))
5033 ?. =(name.a name.b) |
5044 ?. =(name.a name.b) |
5034 (itype-face-asym-collection-args args.a args.b sub)
5045 (itype-face-asym-collection-args args.a args.b sub)
@@ -5091,6 +5102,7 @@
5091 %union &
5102 %union &
5092 %recursive &
5103 %recursive &
5095 %collection &
5107 %collection &
5096 %face $(t body.t)
5108 %face $(t body.t)
@@ -5120,6 +5132,7 @@
5135+ %grec (lien args.t |=(c=itype (itype-has-tag c)))
5123 %collection (lien args.t |=(c=itype (itype-has-tag c)))
5136 %collection (lien args.t |=(c=itype (itype-has-tag c)))
5124 %face $(t body.t)
5137 %face $(t body.t)
5125 %fn |($(t sample.t) $(t product.t))
5138 %fn |($(t sample.t) $(t product.t))
@@ -5133,6 +5146,7 @@
5135 %union &
5148 %union &
5149+ %grec (lien args.t |=(c=itype (itype-has-union c)))
5136 %collection (lien args.t |=(c=itype (itype-has-union c)))
5150 %collection (lien args.t |=(c=itype (itype-has-union c)))
5137 %face $(t body.t)
5151 %face $(t body.t)
5138 %fn |($(t sample.t) $(t product.t))
5152 %fn |($(t sample.t) $(t product.t))
@@ -5151,6 +5165,7 @@
5152 ?: &(?=(~ label.t) ?=(^ args.t)) &
5166 ?: &(?=(~ label.t) ?=(^ args.t)) &
5153 (lien (weld args.t cases.t) |=(c=itype (itype-has-hidden-generic c)))
5167 (lien (weld args.t cases.t) |=(c=itype (itype-has-hidden-generic c)))
5168+ %grec |(?=(~ label.t) (lien args.t |=(c=itype (itype-has-hidden-generic c))))
5154 %collection (lien args.t |=(c=itype (itype-has-hidden-generic c)))
5169 %collection (lien args.t |=(c=itype (itype-has-hidden-generic c)))
5155 %face $(t body.t)
5170 %face $(t body.t)
5156 %fn |($(t sample.t) $(t product.t))
5171 %fn |($(t sample.t) $(t product.t))
@@ -5164,6 +5179,7 @@
5165 %recursive &
5180 %recursive &
5167 %collection (lien args.t |=(c=itype (itype-has-recursive c)))
5183 %collection (lien args.t |=(c=itype (itype-has-recursive c)))
5168 %union (lien (weld args.t cases.t) |=(c=itype (itype-has-recursive c)))
5184 %union (lien (weld args.t cases.t) |=(c=itype (itype-has-recursive c)))
5169 %face $(t body.t)
5185 %face $(t body.t)
@@ -5178,6 +5194,7 @@
5179 %recursive ?=(~ label.t)
5195 %recursive ?=(~ label.t)
5180 %jrec ?=(~ label.t)
5196 %jrec ?=(~ label.t)
5197+ %grec |(?=(~ label.t) (lien args.t |=(c=itype (itype-has-hidden-recursive c))))
5181 %collection (lien args.t |=(c=itype (itype-has-hidden-recursive c)))
5198 %collection (lien args.t |=(c=itype (itype-has-hidden-recursive c)))
5182 %union (lien (weld args.t cases.t) |=(c=itype (itype-has-hidden-recursive c)))
5199 %union (lien (weld args.t cases.t) |=(c=itype (itype-has-hidden-recursive c)))
5183 %face $(t body.t)
5200 %face $(t body.t)
@@ -5223,7 +5240,7 @@
5223 ?: ?=(%var -.raw)
5240 ?: ?=(%var -.raw)
5224 $(cases t.cases, pending &)
5241 $(cases t.cases, pending &)
5225 =/ c=itype (itype-walk raw sub)
5242 =/ c=itype (itype-walk raw sub)
5226− ?: ?=(?(%var %tag %recursive %jrec %union %face) -.c)
5243+ ?: ?=(?(%var %tag %recursive %jrec %grec %union %face) -.c)
5227 $(cases t.cases, pending &)
5244 $(cases t.cases, pending &)
5228 ?. ?=(%cell -.c) $(cases t.cases)
5245 ?. ?=(%cell -.c) $(cases t.cases)
5229 =/ raw-head=itype hed.c
5246 =/ raw-head=itype hed.c
@@ -5236,7 +5253,7 @@
5236 ?: ?=(?(%atom %any-atom %flag %avar %rvar %nvar %rnvar) -.body.head)
5253 ?: ?=(?(%atom %any-atom %flag %avar %rvar %nvar %rnvar) -.body.head)
5237 $(cases t.cases)
5254 $(cases t.cases)
5238 $(cases t.cases, pending &)
5255 $(cases t.cases, pending &)
5239− ?: ?=(?(%var %tag %recursive %jrec %union) -.head)
5256+ ?: ?=(?(%var %tag %recursive %jrec %grec %union) -.head)
5240 $(cases t.cases, pending &)
5257 $(cases t.cases, pending &)
5241 ?. ?=(%const -.head) $(cases t.cases)
5258 ?. ?=(%const -.head) $(cases t.cases)
5242 ?. =(val.literal.head val.tag) $(cases t.cases)
5259 ?. =(val.literal.head val.tag) $(cases t.cases)
@@ -5285,6 +5302,14 @@
5285 [%ok sub next]
5302 [%ok sub next]
5286 :: An arbitrary noun is not known to fit a narrower type.
5303 :: An arbitrary noun is not known to fit a narrower type.
5287 ?: &(?=(%noun -.actual) !?=(%var -.expected)) [%unknown ~]
5304 ?: &(?=(%noun -.actual) !?=(%var -.expected)) [%unknown ~]
5305+ ?: &(!uncertain ?=(%grec -.actual) ?=(%face -.expected)) $(expected body.expected)
5306+ ?: &(!uncertain ?=(%face -.actual) ?=(%grec -.expected)) $(actual body.actual)
5307+ ?: &(?=(%grec -.actual) ?=(%grec -.expected))
5308+ ?. &(=(at.actual at.expected) =(name.actual name.expected)) [%unknown ~]
5309+ =/ matched=(unit isub) (itype-unify-args args.actual args.expected sub)
5310+ ?~ matched [%unknown ~]
5311+ [%ok u.matched next]
5312+ ?: &(|(?=(%grec -.actual) ?=(%grec -.expected)) !|(?=(%var -.actual) ?=(%var -.expected))) [%unknown ~]
5288 ?: &(!uncertain ?=(%jrec -.actual) ?=(%face -.expected)) $(expected body.expected)
5313 ?: &(!uncertain ?=(%jrec -.actual) ?=(%face -.expected)) $(expected body.expected)
5289 ?: &(!uncertain ?=(%face -.actual) ?=(%jrec -.expected)) $(actual body.actual)
5314 ?: &(!uncertain ?=(%face -.actual) ?=(%jrec -.expected)) $(actual body.actual)
5290 ?: &(?=(%jrec -.actual) ?=(%jrec -.expected))
5315 ?: &(?=(%jrec -.actual) ?=(%jrec -.expected))
@@ -5674,10 +5699,11 @@
5674 %tag [%unknown | fuel ~]
5699 %tag [%unknown | fuel ~]
5675 %recursive [%unknown | fuel ~]
5700 %recursive [%unknown | fuel ~]
5676 %jrec [%yes & fuel ~]
5701 %jrec [%yes & fuel ~]
5702+ %grec [%unknown | fuel ~]
5679+$ igate-prelude-evidence [iface=ifile gates=(map term def)]
5705+$ igate-prelude-evidence [iface=ifile gates=(map term def)]
5680−+$ 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)]
5706++$ 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) grec-index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)])]
5681+$ idiag [msg=tape sites=(list [at=span note=tape])]
5707+$ idiag [msg=tape sites=(list [at=span note=tape])]
5682+$ iresult (each [typ=itype state=istate] idiag)
5708+$ iresult (each [typ=itype state=istate] idiag)
5683+$ isample-result (each [typ=itype env=ienv state=istate] tape)
5709+$ isample-result (each [typ=itype env=ienv state=istate] tape)
@@ -5697,6 +5723,7 @@
5697 |= [t=itype sub=isub]
5723 |= [t=itype sub=isub]
5698 ^- itype
5724 ^- itype
5699 =. t (itype-walk t sub)
5725 =. t (itype-walk t sub)
5726+ ?: ?=(%grec -.t) t(args (turn args.t |=(c=itype (itype-normalize c sub))))
5700 ?: ?=(%collection -.t) [%collection name.t (turn args.t |=(c=itype (itype-normalize c sub)))]
5727 ?: ?=(%collection -.t) [%collection name.t (turn args.t |=(c=itype (itype-normalize c sub)))]
5701 ?: ?=(%union -.t)
5728 ?: ?=(%union -.t)
5702 [%union (turn cases.t |=(c=itype (itype-normalize c sub))) origin.t label.t (turn args.t |=(c=itype (itype-normalize c sub)))]
5729 [%union (turn cases.t |=(c=itype (itype-normalize c sub))) origin.t label.t (turn args.t |=(c=itype (itype-normalize c sub)))]
@@ -5723,6 +5750,7 @@
5723 %cell |($(t hed.t) $(t tal.t))
5750 %cell |($(t hed.t) $(t tal.t))
5724 %recursive |
5751 %recursive |
5726 %collection (lien args.t |=(c=itype (itype-has-gate c)))
5754 %collection (lien args.t |=(c=itype (itype-has-gate c)))
5727 %face $(t body.t)
5755 %face $(t body.t)
5728 %union (lien cases.t |=(c=itype (itype-has-gate c)))
5756 %union (lien cases.t |=(c=itype (itype-has-gate c)))
@@ -5746,6 +5774,7 @@
5747 %nvar [%atom %ud]
5775 %nvar [%atom %ud]
5748 %rnvar [%atom %ud]
5776 %rnvar [%atom %ud]
5777+ %grec t(args (turn args.t |=(c=itype (default-decimals c))))
5749 %collection [%collection name.t (turn args.t |=(c=itype (default-decimals c)))]
5778 %collection [%collection name.t (turn args.t |=(c=itype (default-decimals c)))]
5750 %face [%face name.t $(t body.t)]
5779 %face [%face name.t $(t body.t)]
5751 %cell [%cell $(t hed.t) $(t tal.t)]
5780 %cell [%cell $(t hed.t) $(t tal.t)]
@@ -5787,6 +5816,7 @@
5788 %any-atom &
5817 %any-atom &
5789 %union &((levy cases.t |=(c=itype (hole-known c state))) (levy args.t |=(c=itype (hole-known c state))))
5818 %union &((levy cases.t |=(c=itype (hole-known c state))) (levy args.t |=(c=itype (hole-known c state))))
5819+ %grec (levy args.t |=(c=itype (hole-known c state)))
5790 %collection (levy args.t |=(c=itype (hole-known c state)))
5820 %collection (levy args.t |=(c=itype (hole-known c state)))
5791 %face $(t body.t)
5821 %face $(t body.t)
5792 %fn &($(t sample.t) $(t product.t))
5822 %fn &($(t sample.t) $(t product.t))
@@ -5834,6 +5864,7 @@
5835 ?(%tag %nvar %rnvar %avar %rvar) !(hole-known t state)
5865 ?(%tag %nvar %rnvar %avar %rvar) !(hole-known t state)
5836 %union |((lien cases.t |=(c=itype (hole-uncertain c state))) (lien args.t |=(c=itype (hole-uncertain c state))))
5866 %union |((lien cases.t |=(c=itype (hole-uncertain c state))) (lien args.t |=(c=itype (hole-uncertain c state))))
5867+ %grec (lien args.t |=(c=itype (hole-uncertain c state)))
5837 %collection (lien args.t |=(c=itype (hole-uncertain c state)))
5868 %collection (lien args.t |=(c=itype (hole-uncertain c state)))
5838 %face $(t body.t)
5869 %face $(t body.t)
5839 %fn |($(t sample.t) $(t product.t))
5870 %fn |($(t sample.t) $(t product.t))
@@ -5870,6 +5901,7 @@
5870 %union (zing (turn (weld args.t cases.t) |=(c=itype (itype-vars c))))
5901 %union (zing (turn (weld args.t cases.t) |=(c=itype (itype-vars c))))
5871 %recursive ~
5902 %recursive ~
5904+ %grec (zing (turn args.t |=(c=itype (itype-vars c))))
5873 %collection (zing (turn args.t |=(c=itype (itype-vars c))))
5905 %collection (zing (turn args.t |=(c=itype (itype-vars c))))
5874 %face $(t body.t)
5906 %face $(t body.t)
5875 %fn (weld $(t sample.t) $(t product.t))
5907 %fn (weld $(t sample.t) $(t product.t))
@@ -5918,6 +5950,7 @@
5918 %union [%union (turn cases.t |=(c=itype (itype-rename c ren))) origin.t label.t (turn args.t |=(c=itype (itype-rename c ren)))]
5950 %union [%union (turn cases.t |=(c=itype (itype-rename c ren))) origin.t label.t (turn args.t |=(c=itype (itype-rename c ren)))]
5919 %recursive t
5951 %recursive t
5953+ %grec t(args (turn args.t |=(c=itype (itype-rename c ren))))
5921 %collection [%collection name.t (turn args.t |=(c=itype (itype-rename c ren)))]
5954 %collection [%collection name.t (turn args.t |=(c=itype (itype-rename c ren)))]
5922 %face [%face name.t $(t body.t)]
5955 %face [%face name.t $(t body.t)]
5923 %fn [%fn $(t sample.t) $(t product.t)]
5956 %fn [%fn $(t sample.t) $(t product.t)]
@@ -5945,6 +5978,7 @@
5945 %union |((lien cases.t |=(c=itype (itype-var-is-atom n c))) (lien args.t |=(c=itype (itype-var-is-atom n c))))
5978 %union |((lien cases.t |=(c=itype (itype-var-is-atom n c))) (lien args.t |=(c=itype (itype-var-is-atom n c))))
5946 %recursive |
5979 %recursive |
5981+ %grec (lien args.t |=(c=itype (itype-var-is-atom n c)))
5948 %collection (lien args.t |=(c=itype (itype-var-is-atom n c)))
5982 %collection (lien args.t |=(c=itype (itype-var-is-atom n c)))
5949 %face $(t body.t)
5983 %face $(t body.t)
5950 %fn |($(t sample.t) $(t product.t))
5984 %fn |($(t sample.t) $(t product.t))
@@ -5968,6 +6002,7 @@
5968 %union |((lien cases.t |=(c=itype (itype-var-is-restricted n c))) (lien args.t |=(c=itype (itype-var-is-restricted n c))))
6002 %union |((lien cases.t |=(c=itype (itype-var-is-restricted n c))) (lien args.t |=(c=itype (itype-var-is-restricted n c))))
5969 %recursive |
6003 %recursive |
6005+ %grec (lien args.t |=(c=itype (itype-var-is-restricted n c)))
5971 %collection (lien args.t |=(c=itype (itype-var-is-restricted n c)))
6006 %collection (lien args.t |=(c=itype (itype-var-is-restricted n c)))
5972 %face $(t body.t)
6007 %face $(t body.t)
5973 %fn |($(t sample.t) $(t product.t))
6008 %fn |($(t sample.t) $(t product.t))
@@ -6398,6 +6433,16 @@
6398 ?: &(?=(~ vars.template) ?=(%jrec -.typ.template) =(at.typ.template origin) =(name.typ.template name)) `name.i.molds
6433 ?: &(?=(~ vars.template) ?=(%jrec -.typ.template) =(at.typ.template origin) =(name.typ.template name)) `name.i.molds
6399 $(molds t.molds)
6434 $(molds t.molds)
6436+++ grec-visible-alias
6437+ |= [origin=path name=term proof=shape args=(list itype) molds=imold-types]
6440+ =/ template=ischeme template.i.molds
6441+ ?. ?=(%grec -.typ.template) $(molds t.molds)
6442+ ?. &(=(at.typ.template origin) =(name.typ.template name) =(proof.typ.template proof)) $(molds t.molds)
6443+ ?. &((identity-union-parameters vars.template args.typ.template) =((lent vars.template) (lent args))) $(molds t.molds)
6401++ itype-in-import
6446++ itype-in-import
6402 |= [t=itype iface=ifile face=term prelude=(unit ifile)]
6447 |= [t=itype iface=ifile face=term prelude=(unit ifile)]
6403 ^- itype
6448 ^- itype
@@ -6417,6 +6462,11 @@
6417 `(crip "{(trip u.alias)}.{(trip face)}")
6462 `(crip "{(trip u.alias)}.{(trip face)}")
6418 [%union (turn cases.t |=(c=itype (itype-in-import c iface face prelude))) origin.t label (turn args.t |=(c=itype (itype-in-import c iface face prelude)))]
6463 [%union (turn cases.t |=(c=itype (itype-in-import c iface face prelude))) origin.t label (turn args.t |=(c=itype (itype-in-import c iface face prelude)))]
6419 %recursive [%recursive module.t name.t ~]
6464 %recursive [%recursive module.t name.t ~]
6466+ =/ public=(unit term) ?~(prelude ~ (grec-visible-alias at.t name.t proof.t args.t molds.u.prelude))
6467+ =/ alias=(unit term) ?~(public (grec-visible-alias at.t name.t proof.t args.t molds.iface) public)
6468+ =/ label=(unit @t) ?~(alias ~ ?~(public `(crip "{(trip u.alias)}.{(trip face)}") `u.alias))
6469+ t(label label, args (turn args.t |=(c=itype (itype-in-import c iface face prelude))))
6421 =/ public=(unit term) ?~(prelude ~ (jrec-alias at.t name.t molds.u.prelude))
6471 =/ public=(unit term) ?~(prelude ~ (jrec-alias at.t name.t molds.u.prelude))
6422 ?^ public t(label `u.public)
6472 ?^ public t(label `u.public)
@@ -6529,9 +6579,29 @@
6529 ?. =(names.tail ~[name]) ~
6579 ?. =(names.tail ~[name]) ~
6530 `[%jrec at.state name `name name.i.fs aura.shape.i.fs name.i.t.fs]
6580 `[%jrec at.state name `name name.i.fs aura.shape.i.fs name.i.t.fs]
6582+++ simple-source-generic-recursive
6583+ |= [name=term sh=shape args=(list itype) state=istate]
6585+ ?. ?=(%generic -.sh) ~
6586+ ?. ?=([@ ~] vars.sh) ~
6587+ ?. ?=([* ~] args) ~
6588+ ?~ grec-index.state ~
6589+ ?. =(at.u.grec-index.state at.state) ~
6591+ ?. =(prelude.u.grec-index.state u.prelude.state) ~
6592+ =/ proof=(unit shape) (~(get by shapes.u.grec-index.state) name)
6595+ `[%grec at.state name `name sh args]
6532++ infer-mold-template
6598++ infer-mold-template
6533 |= [sh=shape state=istate]
6599 |= [sh=shape state=istate]
6534 ^- (unit [template=ischeme state=istate])
6600 ^- (unit [template=ischeme state=istate])
6601+ =/ generic=(unit itype)
6602+ ?. ?=([@ ~] active.state) ~
6603+ (simple-source-generic-recursive i.active.state sh ~[[%var next.state]] state)
6604+ ?^ generic `[[u.generic ~[next.state]] state(next +(next.state))]
6535 =/ direct=(unit itype)
6605 =/ direct=(unit itype)
6536 ?. ?=([@ ~] active.state) ~
6606 ?. ?=([@ ~] active.state) ~
6537 (simple-source-recursive i.active.state sh state)
6607 (simple-source-recursive i.active.state sh state)
@@ -6744,6 +6814,8 @@
6744 ?~ applied ~
6814 ?~ applied ~
6745 `[u.applied state.u.args]
6815 `[u.applied state.u.args]
6746 ?. ?=(%generic -.u.found) ~
6816 ?. ?=(%generic -.u.found) ~
6817+ =/ grec=(unit itype) (simple-source-generic-recursive n u.found types.u.args state.u.args)
6818+ ?^ grec `[u.grec state.u.args]
6747 ?. (distinct-params vars.u.found) ~
6819 ?. (distinct-params vars.u.found) ~
6748 =/ params=(unit iparams) (bind-params vars.u.found types.u.args)
6820 =/ params=(unit iparams) (bind-params vars.u.found types.u.args)
6749 ?~ params ~
6821 ?~ params ~
@@ -8982,7 +9054,7 @@
8982 ?~ t.names |
9054 ?~ t.names |
8983 =. typ (itype-walk typ sub)
9055 =. typ (itype-walk typ sub)
8984 ?: ?=(%cell -.typ) $(typ tal.typ, names t.names)
9056 ?: ?=(%cell -.typ) $(typ tal.typ, names t.names)
8985− |(?=(%union -.typ) ?=(%collection -.typ) ?=(%recursive -.typ) ?=(%jrec -.typ) ?=(%noun -.typ) ?=(%fn -.typ) ?=(%tag -.typ))
9057+ |(?=(%union -.typ) ?=(%collection -.typ) ?=(%recursive -.typ) ?=(%jrec -.typ) ?=(%grec -.typ) ?=(%noun -.typ) ?=(%fn -.typ) ?=(%tag -.typ))
8987++ cell-binder-pattern
9059++ cell-binder-pattern
8988 |= e=expr
9060 |= e=expr
@@ -9061,6 +9133,7 @@
9061 "({(trip u.label.t)} {(show-itype-cases args.t sub)})"
9133 "({(trip u.label.t)} {(show-itype-cases args.t sub)})"
9062 %recursive ?~(label.t "recursive mold" (trip u.label.t))
9134 %recursive ?~(label.t "recursive mold" (trip u.label.t))
9063 %jrec ?~(label.t "recursive mold" (trip u.label.t))
9135 %jrec ?~(label.t "recursive mold" (trip u.label.t))
9136+ %grec ?~(label.t "recursive mold" "({(trip u.label.t)} {(show-itype-cases args.t sub)})")
9064 %collection "({(trip name.t)} {(show-itype-cases args.t sub)})"
9137 %collection "({(trip name.t)} {(show-itype-cases args.t sub)})"
9065 %face "[{(trip name.t)}={(show-itype-context body.t sub)}]"
9138 %face "[{(trip name.t)}={(show-itype-context body.t sub)}]"
9066 %fn "$-({(show-itype-context sample.t sub)} {(show-itype-context product.t sub)})"
9139 %fn "$-({(show-itype-context sample.t sub)} {(show-itype-context product.t sub)})"
@@ -9109,6 +9182,7 @@
9109 %union |((lien cases.typ |=(c=itype (itype-has-nvar c))) (lien args.typ |=(c=itype (itype-has-nvar c))))
9182 %union |((lien cases.typ |=(c=itype (itype-has-nvar c))) (lien args.typ |=(c=itype (itype-has-nvar c))))
9110 %recursive |
9183 %recursive |
9185+ %grec (lien args.typ |=(c=itype (itype-has-nvar c)))
9112 %collection (lien args.typ |=(c=itype (itype-has-nvar c)))
9186 %collection (lien args.typ |=(c=itype (itype-has-nvar c)))
9113 %face $(typ body.typ)
9187 %face $(typ body.typ)
9114 %fn |($(typ sample.typ) $(typ product.typ))
9188 %fn |($(typ sample.typ) $(typ product.typ))
@@ -9225,6 +9299,7 @@
9225 %union |((lien cases.t |=(c=itype (has-atom-var n c))) (lien args.t |=(c=itype (has-atom-var n c))))
9299 %union |((lien cases.t |=(c=itype (has-atom-var n c))) (lien args.t |=(c=itype (has-atom-var n c))))
9226 %recursive |
9300 %recursive |
9302+ %grec (lien args.t |=(c=itype (has-atom-var n c)))
9228 %collection (lien args.t |=(c=itype (has-atom-var n c)))
9303 %collection (lien args.t |=(c=itype (has-atom-var n c)))
9229 %face $(t body.t)
9304 %face $(t body.t)
9230 %fn |($(t sample.t) $(t product.t))
9305 %fn |($(t sample.t) $(t product.t))
@@ -9633,36 +9708,9 @@
9633++ add-supported-defs
9708++ add-supported-defs
9634 |= [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)]
9709 |= [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)]
9635 ^- [env=ienv artifacts=(list iwidth-definition)]
9710 ^- [env=ienv artifacts=(list iwidth-definition)]
9636− ?~ ds [env artifacts]
9638− ?: ?=(%mold -.d) $(ds t.ds)
9639− ?. (unique-value-name name.d globals) $(ds t.ds)
9640− ?^ (ienv-lookup name.d env) $(ds t.ds)
9641− =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
9642− =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~]
9711+ (add-supported-defs-core ds all-defs checked heads env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts ~)
9643− =. gate-defs.initial checked
9644− =. head-evidence.initial heads
9645− =. initial (reserve-def-caps val.d initial)
9646− =/ result=iresult (infer-fragment val.d env initial)
9647− =? result ?=(%| -.result) (infer-recursive-gate d env initial)
9648− ?: ?=(%| -.result) $(ds t.ds)
9649− =. state.p.result (promote-restricted-numbers state.p.result env)
9650− =. state.p.result (default-hole-numbers holes.state.p.result holes.initial state.p.result env !(itype-has-gate (itype-normalize typ.p.result sub.state.p.result)))
9651− ?^ (unresolved-hole holes.state.p.result holes.initial state.p.result) $(ds t.ds)
9652− ?: (constrained-capitals caps.state.p.result sub.state.p.result) $(ds t.ds)
9653− =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
9654− ?: |((pending-tags tags.state.p.result sub.state.p.result) (itype-has-tag typ)) $(ds t.ds)
9655− ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result) $(ds t.ds)
9656− =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
9657− ?: (gth (lent vars) 26) $(ds t.ds)
9658− =/ finalized=(unit (list iwprojection))
9659− (width-finalize projections.state.p.result sub.state.p.result vars)
9660− ?~ finalized $(ds t.ds)
9661− =? artifacts ?=(^ u.finalized)
9662− [[name.d val.d typ sub.state.p.result (flop u.finalized)] artifacts]
9663− =? checked |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) (~(put by checked) name.d d)
9664− $(ds t.ds, env [[name.d [typ vars]] env], checked checked)
9666+$ iresolved [env=ienv grouped=(list term) artifacts=(list iwidth-definition)]
9714+$ iresolved [env=ienv grouped=(list term) artifacts=(list iwidth-definition)]
9667+$ iadj (map term (list term))
9715+$ iadj (map term (list term))
9668+$ ivisited (map term ?)
9716+$ ivisited (map term ?)
@@ -9776,6 +9824,46 @@
9776++ resolve-groups
9824++ resolve-groups
9777 |= [ds=(list def) 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)]
9825 |= [ds=(list def) 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)]
9778 ^- iresolved
9826 ^- iresolved
9827+ (resolve-groups-core ds molds globals externals surs mark-externals marks jimports reserved-molds at prelude ~)
9830+++ add-supported-defs-core
9831+ |= [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) index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)])]
9832+ ^- [env=ienv artifacts=(list iwidth-definition)]
9833+ ?~ ds [env artifacts]
9835+ ?: ?=(%mold -.d) $(ds t.ds)
9836+ ?. (unique-value-name name.d globals) $(ds t.ds)
9837+ ?^ (ienv-lookup name.d env) $(ds t.ds)
9838+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
9839+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~]
9840+ =. grec-index.initial index
9841+ =. gate-defs.initial checked
9842+ =. head-evidence.initial heads
9843+ =. initial (reserve-def-caps val.d initial)
9844+ =/ result=iresult (infer-fragment val.d env initial)
9845+ =? result ?=(%| -.result) (infer-recursive-gate d env initial)
9846+ ?: ?=(%| -.result) $(ds t.ds)
9847+ =. state.p.result (promote-restricted-numbers state.p.result env)
9848+ =. state.p.result (default-hole-numbers holes.state.p.result holes.initial state.p.result env !(itype-has-gate (itype-normalize typ.p.result sub.state.p.result)))
9849+ ?^ (unresolved-hole holes.state.p.result holes.initial state.p.result) $(ds t.ds)
9850+ ?: (constrained-capitals caps.state.p.result sub.state.p.result) $(ds t.ds)
9851+ =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
9852+ ?: |((pending-tags tags.state.p.result sub.state.p.result) (itype-has-tag typ)) $(ds t.ds)
9853+ ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result) $(ds t.ds)
9854+ =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
9855+ ?: (gth (lent vars) 26) $(ds t.ds)
9856+ =/ finalized=(unit (list iwprojection))
9857+ (width-finalize projections.state.p.result sub.state.p.result vars)
9858+ ?~ finalized $(ds t.ds)
9859+ =? artifacts ?=(^ u.finalized)
9860+ [[name.d val.d typ sub.state.p.result (flop u.finalized)] artifacts]
9861+ =? checked |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) (~(put by checked) name.d d)
9862+ $(ds t.ds, env [[name.d [typ vars]] env], checked checked)
9864+++ resolve-groups-core
9865+ |= [ds=(list def) 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) index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)])]
9779 =/ env=ienv ~
9867 =/ env=ienv ~
9780 =/ grouped=(list term) ~
9868 =/ grouped=(list term) ~
9781 =/ artifacts=(list iwidth-definition) ~
9869 =/ artifacts=(list iwidth-definition) ~
@@ -9787,8 +9875,9 @@
9787 =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude)
9875 =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude)
9789 =/ next=[env=ienv artifacts=(list iwidth-definition)]
9877 =/ next=[env=ienv artifacts=(list iwidth-definition)]
9790− (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)
9878+ (add-supported-defs-core ds ds (direct-checked-gates ds env) heads env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts index)
9791− =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~]
9879+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~]
9880+ =. grec-index.initial index
9792 =/ out=iresolved (add-groups ds components graph env.next grouped artifacts.next initial)
9881 =/ out=iresolved (add-groups ds components graph env.next grouped artifacts.next initial)
9793 ?: =(env env.out) out
9882 ?: =(env env.out) out
9794 $(env env.out, grouped grouped.out, artifacts artifacts.out)
9883 $(env env.out, grouped grouped.out, artifacts artifacts.out)
@@ -10588,6 +10677,9 @@
10588 |= [typ=itype name=term vars=(list @ud)]
10677 |= [typ=itype name=term vars=(list @ud)]
10589 ^- itype
10678 ^- itype
10590 ?: ?=(%jrec -.typ) typ(label `name)
10679 ?: ?=(%jrec -.typ) typ(label `name)
10680+ ?: ?=(%grec -.typ)
10681+ ?. (identity-union-parameters vars args.typ) typ(label ~)
10591 ?. ?=(%union -.typ) typ
10683 ?. ?=(%union -.typ) typ
10592 ?. (identity-union-parameters vars args.typ)
10684 ?. (identity-union-parameters vars args.typ)
10593 ?~ origin.typ typ
10685 ?~ origin.typ typ
@@ -10661,7 +10753,7 @@
10661 =/ source-unit=(unit ischeme)
10753 =/ source-unit=(unit ischeme)
10662 ?~ unit-decl ~
10754 ?~ unit-decl ~
10663 =/ unit-molds=imolds ~[[%unit u.unit-decl]]
10755 =/ unit-molds=imolds ~[[%unit u.unit-decl]]
10664− =/ unit-state=istate [0 ~ ~ ~ unit-molds ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | /lib/jibb/prelude/jibb ~[%unit] ~ ~ 256 ~ ~ ~]
10756+ =/ unit-state=istate [0 ~ ~ ~ unit-molds ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | /lib/jibb/prelude/jibb ~[%unit] ~ ~ 256 ~ ~ ~ ~]
10665 =/ unit-types=imold-types (partial-prelude-molds unit-molds unit-state)
10757 =/ unit-types=imold-types (partial-prelude-molds unit-molds unit-state)
10666 =/ unit-iface=ifile [~ unit-types /lib/jibb/prelude/jibb ~ ~ ~ ~ ~]
10758 =/ unit-iface=ifile [~ unit-types /lib/jibb/prelude/jibb ~ ~ ~ ~ ~]
10667 =/ found=(unit ischeme) (find-jibb-mold %unit unit-iface)
10759 =/ found=(unit ischeme) (find-jibb-mold %unit unit-iface)
@@ -10676,7 +10768,7 @@
10676 =/ js=ijimports ~[[face.i.imports.mod primitive]]
10768 =/ js=ijimports ~[[face.i.imports.mod primitive]]
10677 =/ reserved=(list term) ~[face.i.imports.mod]
10769 =/ reserved=(list term) ~[face.i.imports.mod]
10678 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
10770 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
10679− =/ state=istate [0 ~ ~ ~ molds globals ~ ~ ~ ~ js reserved ~ ~ ~ | at top ~ ~ 256 ~ ~ ~]
10771+ =/ state=istate [0 ~ ~ ~ molds globals ~ ~ ~ ~ js reserved ~ ~ ~ | at top ~ ~ 256 ~ ~ ~ ~]
10680 =/ mts=(each imold-types @t) (module-mold-types molds state)
10772 =/ mts=(each imold-types @t) (module-mold-types molds state)
10681 =/ usable=(unit imold-types)
10773 =/ usable=(unit imold-types)
10682 ?: ?=(%& -.mts) `p.mts
10774 ?: ?=(%& -.mts) `p.mts
@@ -10732,7 +10824,7 @@
10732 =? env-molds declared
10824 =? env-molds declared
10733 (skim molds |=(m=[name=term body=shape] !=(%list name.m)))
10825 (skim molds |=(m=[name=term body=shape] !=(%list name.m)))
10734 =/ reserved=(list term) ?:(declared ~[%list] ~)
10826 =/ reserved=(list term) ?:(declared ~[%list] ~)
10735− =/ state=istate [0 ~ ~ ~ env-molds globals ~ ~ ~ ~ u.private reserved ~ ~ ~ | at names ~ ~ 256 ~ ~ ~]
10827+ =/ state=istate [0 ~ ~ ~ env-molds globals ~ ~ ~ ~ u.private reserved ~ ~ ~ | at names ~ ~ 256 ~ ~ ~ ~]
10736 :: Other prelude molds may use list only after its source has passed
10828 :: Other prelude molds may use list only after its source has passed
10737 :: the standard-list check. The raw declaration remains removed.
10829 :: the standard-list check. The raw declaration remains removed.
10738 =/ declared-list=(unit shape) (find-simple-mold %list molds)
10830 =/ declared-list=(unit shape) (find-simple-mold %list molds)
@@ -11261,7 +11353,7 @@
11261 =/ surs=(list term) (collect-sur-imports imports.mod)
11353 =/ surs=(list term) (collect-sur-imports imports.mod)
11262 =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
11354 =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
11263 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11355 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11264− =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~ ~ ~]
11356+ =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~ ~ ~ ~]
11265 =/ mts=(each imold-types @t) (module-mold-types molds state)
11357 =/ mts=(each imold-types @t) (module-mold-types molds state)
11266 ?: ?=(%| -.mts) [%| p.mts]
11358 ?: ?=(%| -.mts) [%| p.mts]
11267 =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
11359 =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
@@ -11295,7 +11387,7 @@
11295 =/ surs=(list term) (collect-sur-imports imports.mod)
11387 =/ surs=(list term) (collect-sur-imports imports.mod)
11296 =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
11388 =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
11297 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11389 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11298− =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~ ~ ~]
11390+ =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~ ~ ~ ~]
11299 =/ mts=(each imold-types @t) (module-mold-types molds state)
11391 =/ mts=(each imold-types @t) (module-mold-types molds state)
11300 ?: ?=(%| -.mts) [%| p.mts]
11392 ?: ?=(%| -.mts) [%| p.mts]
11301 =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
11393 =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
@@ -11671,16 +11763,35 @@
11671 [%| (crip "module kind needs unsupported inference: {(spud at)}")]
11763 [%| (crip "module kind needs unsupported inference: {(spud at)}")]
11672 =/ js=jimports-result (resolve-jibb-imports imports.mod externals mark-externals modules active prelude-values prelude-molds cache prelude)
11764 =/ js=jimports-result (resolve-jibb-imports imports.mod externals mark-externals modules active prelude-values prelude-molds cache prelude)
11673 ?: ?=(%| -.js) [%| p.js]
11765 ?: ?=(%| -.js) [%| p.js]
11766+ =/ collected=grec-collected
11674− =/ molds=imolds (collect-simple-molds defs.mod)
11767+ ?^ imports.mod [(collect-simple-molds defs.mod) *(map term shape)]
11768+ (grec-collect-molds defs.mod)
11769+ =/ molds=imolds molds.collected
11675 =/ globals=(list term) (weld prelude-values (weld (import-binding-names imports.mod) vals))
11770 =/ globals=(list term) (weld prelude-values (weld (import-binding-names imports.mod) vals))
11676 =/ surs=(list term) (collect-sur-imports imports.mod)
11771 =/ surs=(list term) (collect-sur-imports imports.mod)
11677 =/ marks=(list term) (collect-mark-imports imports.mod)
11772 =/ marks=(list term) (collect-mark-imports imports.mod)
11678 =/ reserved=(list term) (weld prelude-molds (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
11773 =/ reserved=(list term) (weld prelude-molds (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
11679 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11774 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11680− =/ state=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks resolved.p.js reserved ~ ~ ~ | at top prelude ~ 256 ~ ~ ~]
11775+ =/ state=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks resolved.p.js reserved ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~]
11776+ :: Source and scope were checked above; preserve that exact root and prelude.
11777+ :: This first integration only indexes import-free library sources.
11778+ =/ index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)])
11781+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude)
11783+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]]) ~
11784+ =/ index=(map term shape) proofs.collected
11785+ ?. !=(index *(map term shape)) ~
11786+ ?: (lien molds |=(m=[name=term body=shape] =(%list name.m))) ~
11787+ `[at src u.prelude index]
11788+ =. grec-index.state index
11681 =/ mts=(each imold-types @t) (module-mold-types molds state)
11789 =/ mts=(each imold-types @t) (module-mold-types molds state)
11682 ?: ?=(%| -.mts) [%| (crip "{(trip p.mts)}: {(spud at)}")]
11790 ?: ?=(%| -.mts) [%| (crip "{(trip p.mts)}: {(spud at)}")]
11791+ =/ resolution=iresolved
11683− =/ resolution=iresolved (resolve-groups defs.mod molds globals externals surs mark-externals marks resolved.p.js reserved at prelude)
11793+ (resolve-groups defs.mod molds globals externals surs mark-externals marks resolved.p.js reserved at prelude)
11794+ (resolve-groups-core defs.mod molds globals externals surs mark-externals marks resolved.p.js reserved at prelude index)
11684 =/ env=ienv env.resolution
11795 =/ env=ienv env.resolution
11685 ?. (module-values-complete defs.mod env)
11796 ?. (module-values-complete defs.mod env)
11686 [%| (crip "module definitions need unsupported inference: {(spud at)}")]
11797 [%| (crip "module definitions need unsupported inference: {(spud at)}")]
@@ -11733,7 +11844,7 @@
11733 =/ declared=(list term) (collect-mark-imports imports.mod)
11844 =/ declared=(list term) (collect-mark-imports imports.mod)
11734 =/ reserved=(list term) (weld molds.u.prepared (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
11845 =/ reserved=(list term) (weld molds.u.prepared (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
11735 =/ top=(list term) (turn ms |=(m=[name=term body=shape] name.m))
11846 =/ top=(list term) (turn ms |=(m=[name=term body=shape] name.m))
11736− =/ state=istate [0 ~ ~ ~ ms globals externals surs marks declared resolved.p.js reserved ~ ~ ~ | file top `public ~ 256 ~ ~ ~]
11847+ =/ state=istate [0 ~ ~ ~ ms globals externals surs marks declared resolved.p.js reserved ~ ~ ~ | file top `public ~ 256 ~ ~ ~ ~]
11737 =/ inferred=(unit [template=ischeme state=istate])
11848 =/ inferred=(unit [template=ischeme state=istate])
11738 (infer-mold-template shape.i.selected state(active ~[name], in-mold &))
11849 (infer-mold-template shape.i.selected state(active ~[name], in-mold &))
11739 ?~ inferred [%| 'selected mold needs unsupported inference']
11850 ?~ inferred [%| 'selected mold needs unsupported inference']
@@ -11871,7 +11982,7 @@
11871 =/ line=@t (crip "++ {(trip name.d)}: {(show-itype typ ~)}{(show-atom-constraint typ)}")
11982 =/ line=@t (crip "++ {(trip name.d)}: {(show-itype typ ~)}{(show-atom-constraint typ)}")
11872 $(ds t.ds, lines [line lines])
11983 $(ds t.ds, lines [line lines])
11873 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11984 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11874− =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | file top prelude ~ 256 ~ ~ ~]
11985+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | file top prelude ~ 256 ~ ~ ~ ~]
11875 =. gate-defs.initial source-defs
11986 =. gate-defs.initial source-defs
11876 =. head-evidence.initial heads
11987 =. head-evidence.initial heads
11877 =. initial (reserve-def-caps val.d initial)
11988 =. initial (reserve-def-caps val.d initial)
@@ -11913,4 +12024,79 @@
11913 =/ printable=itype (canonical-itype typ vars)
12024 =/ printable=itype (canonical-itype typ vars)
11914 =/ line=@t (crip "++ {(trip name.d)}: {(show-itype printable ~)}{(show-atom-constraint printable)}")
12025 =/ line=@t (crip "++ {(trip name.d)}: {(show-itype printable ~)}{(show-atom-constraint printable)}")
11915 $(ds t.ds, lines [line lines])
12026 $(ds t.ds, lines [line lines])
12027+:: Experimental per-module, source-derived recursive tree index.
12028+:: The two tags and the exact children/list/self layout are fixed-shape
12029+:: checks, so ordinary definitions incur no type-tree or source scans.
12030+++ grec-tagged-fields
12032+ ^- (unit [tag=@ fields=(list field)])
12033+ ?. ?=(%cell -.sh) ~
12035+ =/ head=field i.fields.sh
12036+ ?. ?=(%bare -.head) ~
12037+ ?. ?=(%const -.shape.head) ~
12038+ ?. &(?=(%term form.lit.shape.head) =(%tas aura.lit.shape.head)) ~
12039+ `[val.lit.shape.head t.fields.sh]
12040+++ grec-tree-children
12041+ |= [fs=(list field) param=@t]
12046+ =/ event=field i.fs
12047+ =/ kids=field i.t.fs
12048+ ?. &(?=(%face -.event) ?=(%face -.kids)) ~
12049+ ?. !=(name.event name.kids) ~
12050+ ?. ?=(%fn -.shape.event) ~
12051+ ?. ?=(%aura -.sample.shape.event) ~
12052+ ?. =(%t aura.sample.shape.event) ~
12053+ ?. ?=(%tvar -.product.shape.event) ~
12054+ ?. =(param name.product.shape.event) ~
12058+ |= [name=term sh=shape]
12060+ ?. ?=(%generic -.sh) |
12061+ ?. ?=([@ ~] vars.sh) |
12062+ =/ param=@t i.vars.sh
12063+ ?. ?=(%union -.body.sh) |
12064+ ?. ?=([* [* ~]] cases.body.sh) |
12065+ =/ a=(unit [tag=@ fields=(list field)]) (grec-tagged-fields i.cases.body.sh)
12066+ =/ b=(unit [tag=@ fields=(list field)]) (grec-tagged-fields i.t.cases.body.sh)
12069+ ?. !=(tag.u.a tag.u.b) |
12070+ ?. ?=([* ~] fields.u.a) |
12071+ =/ value=field i.fields.u.a
12072+ ?. ?=(%face -.value) |
12073+ ?. ?=(%aura -.shape.value) |
12074+ ?. =(%t aura.shape.value) |
12075+ =/ selected=(unit field) (grec-tree-children fields.u.b param)
12077+ =/ kids=field u.selected
12078+ ?. ?=(%face -.kids) |
12079+ ?. ?=(%apply -.shape.kids) |
12080+ ?. =(ref.shape.kids ~[%list]) |
12081+ ?. ?=([* ~] args.shape.kids) |
12082+ =/ self=shape i.args.shape.kids
12083+ ?. ?=(%apply -.self) |
12084+ ?. =(ref.self ~[name]) |
12085+ ?. ?=([* ~] args.self) |
12086+ ?. ?=(%tvar -.i.args.self) |
12087+ =(name.i.args.self param)
12088++$ grec-collected [molds=imolds proofs=(map term shape)]
12089+++ grec-collect-molds
12092+ ?~ ds [~ *(map term shape)]
12093+ =/ rest=grec-collected $(ds t.ds)
12094+ ?. ?=(%mold -.i.ds) rest
12095+ =/ name=term name.i.ds
12096+ =/ body=shape shape.i.ds
12097+ =/ proofs=(map term shape) proofs.rest
12098+ =? proofs (grec-tree-proof name body) (~(put by proofs) name body)
12099+ [[[name body] molds.rest] proofs]