2024-04-21 17:49:24 +03:00
|
|
|
/- noir
|
|
|
|
|.
|
|
|
|
=> $:noir
|
2024-04-21 15:16:57 +03:00
|
|
|
=<
|
|
|
|
:: moan contains analyzed code for the linearizer
|
|
|
|
=| moan=(jar * hone)
|
|
|
|
:: memo contains saved analyses of arms
|
|
|
|
=| memo=(jar * meme)
|
|
|
|
:: cole is the cold state
|
|
|
|
=| cole=cool
|
2024-05-31 17:02:43 +03:00
|
|
|
::
|
|
|
|
:: compile-time verbosity control (un/comment individual faces)
|
|
|
|
::
|
|
|
|
=/ verb
|
|
|
|
:* :: call-site/spot lifecycle rubric:
|
|
|
|
:: memo hit: <1
|
|
|
|
:: melo hit: <2
|
2024-06-03 19:31:20 +03:00
|
|
|
:: pseudo-recursive: <3
|
2024-06-05 23:34:46 +03:00
|
|
|
:: indirect: <4
|
2024-06-03 19:31:20 +03:00
|
|
|
:: analysis: >>
|
|
|
|
:: meloize: >2
|
|
|
|
:: finalize: >3
|
2024-05-31 17:02:43 +03:00
|
|
|
::
|
|
|
|
:: call=&
|
|
|
|
::
|
|
|
|
jet=& :: jet re/registration
|
|
|
|
::
|
|
|
|
~
|
|
|
|
==
|
|
|
|
::
|
2024-05-03 01:51:29 +03:00
|
|
|
~% %skan ..ride ~
|
2024-04-21 15:16:57 +03:00
|
|
|
|%
|
|
|
|
++ thus .
|
|
|
|
::
|
2024-06-03 19:31:20 +03:00
|
|
|
+$ lore
|
|
|
|
$: rail=@hail :: generator for call sites
|
|
|
|
hare=@hint :: generator for hint sites
|
|
|
|
kids=(jug @hail @hail) :: map parent to child callsites
|
|
|
|
hint=(jug @hail @hint) :: hint sites under a callsite
|
|
|
|
forb=(map @hint *) :: hint bodies
|
|
|
|
call=cafe :: finished callsite information
|
|
|
|
want=urge :: callsite needs
|
|
|
|
loop=(map @hail [t=@hail s=sock l=naan]) :: recursion targets
|
|
|
|
memo=_memo :: memoized call analysis
|
|
|
|
moan=_moan
|
|
|
|
cole=_cole :: cold state
|
|
|
|
dire=? :: fully direct?
|
2024-06-06 23:17:17 +03:00
|
|
|
area=(unit spot) :: outermost spot within this site
|
2024-06-03 19:31:20 +03:00
|
|
|
wait=(jar @hail @hail) :: sites to finalize
|
|
|
|
melo=(jar * meal) :: non-final memoization targets
|
|
|
|
remo=(map @hail [site=@hail =sock]) :: non-final memoization hits
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ snak
|
2024-06-04 06:06:07 +03:00
|
|
|
~% %snak ..snak ~
|
2024-06-04 20:02:24 +03:00
|
|
|
=| $: gen=lore
|
|
|
|
$= dad
|
|
|
|
$: sirs=(jar * [site=@hail less=naan])
|
|
|
|
lord=(set @hail) :: enclosing scope
|
|
|
|
tack=(list @hail)
|
2024-06-06 23:17:17 +03:00
|
|
|
seat=(unit spot) :: innermost spot in lord
|
|
|
|
wake=(list spot) :: trace within arm
|
2024-06-04 20:02:24 +03:00
|
|
|
== ==
|
|
|
|
|%
|
2024-06-05 00:07:26 +03:00
|
|
|
:: +memo: check for memoized, finalized analysis
|
|
|
|
::
|
|
|
|
:: hits are guaranteed complete
|
|
|
|
:: XX: add debug sanity-check that entries are never in [melo.gen]
|
|
|
|
::
|
2024-06-03 19:31:20 +03:00
|
|
|
++ memo
|
2024-06-04 06:06:07 +03:00
|
|
|
~/ %memo
|
2024-06-04 20:02:24 +03:00
|
|
|
|= [entr=@hail form=* less=naan]
|
2024-06-03 19:31:20 +03:00
|
|
|
^- (unit [naan lore])
|
2024-04-21 15:16:57 +03:00
|
|
|
=/ germ (~(get ja memo.gen) form)
|
2024-06-03 19:31:20 +03:00
|
|
|
|- ^- (unit [naan lore])
|
2024-06-03 21:19:57 +03:00
|
|
|
?~ germ ~
|
|
|
|
?. (~(huge so soot.i.germ) sock.less)
|
|
|
|
$(germ t.germ)
|
2024-06-06 23:17:17 +03:00
|
|
|
=> !@(call.verb ((outa:blot "<1 " entr seat.dad area.i.germ) .) .)
|
2024-06-03 21:19:57 +03:00
|
|
|
=/ mope (~(rue qui prot.less) have.i.germ)
|
2024-06-04 20:02:24 +03:00
|
|
|
=. mope (~(cut qui mope) lord.dad cape.root.i.germ)
|
2024-06-03 21:19:57 +03:00
|
|
|
=/ more [mope root.i.germ]
|
|
|
|
:: propagate memoized subject needs
|
|
|
|
=/ pant (~(due qui prot.less) want.i.germ)
|
|
|
|
=. want.gen
|
|
|
|
%- (~(uno by want.gen) pant)
|
|
|
|
|= [@hail a=cape b=cape]
|
|
|
|
~(cut ca (~(uni ca a) b))
|
2024-06-06 23:17:17 +03:00
|
|
|
=. call.gen (~(put by call.gen) entr [less more form ~ & ~ seat.dad area.i.germ])
|
2024-06-03 21:19:57 +03:00
|
|
|
`[more gen]
|
2024-06-03 19:31:20 +03:00
|
|
|
::
|
2024-06-05 00:07:26 +03:00
|
|
|
:: +melo: check for in-progress analysis
|
|
|
|
::
|
2024-06-06 05:38:21 +03:00
|
|
|
:: NB: hits are estimates, must be validated in +seal
|
2024-06-05 00:07:26 +03:00
|
|
|
::
|
2024-06-03 19:31:20 +03:00
|
|
|
++ melo
|
2024-06-04 06:06:07 +03:00
|
|
|
~/ %melo
|
2024-06-04 20:02:24 +03:00
|
|
|
|= [entr=@hail form=* less=naan]
|
2024-06-03 19:31:20 +03:00
|
|
|
^- (unit [naan lore])
|
2024-05-22 06:04:04 +03:00
|
|
|
=/ gorm (~(get ja melo.gen) form)
|
2024-06-03 19:31:20 +03:00
|
|
|
|- ^- (unit [naan lore])
|
2024-06-03 21:19:57 +03:00
|
|
|
?~ gorm ~
|
2024-06-12 07:18:45 +03:00
|
|
|
=/ tote
|
|
|
|
=/ cope (~(gut by want.gen) site.i.gorm |)
|
|
|
|
(~(app ca cope) sock.less.i.gorm)
|
|
|
|
?. (~(huge so tote) sock.less)
|
2024-06-03 21:19:57 +03:00
|
|
|
$(gorm t.gorm)
|
2024-06-06 23:17:17 +03:00
|
|
|
=> !@(call.verb ((onto:blot "<2 " entr seat.dad [site seat area]:i.gorm) .) .)
|
2024-06-03 21:19:57 +03:00
|
|
|
=/ mope (~(rue qui prot.less) have.i.gorm)
|
2024-06-04 20:02:24 +03:00
|
|
|
=. mope (~(cut qui mope) lord.dad cape.root.i.gorm)
|
2024-06-03 21:19:57 +03:00
|
|
|
=/ more [mope root.i.gorm]
|
|
|
|
::
|
2024-06-06 05:38:21 +03:00
|
|
|
:+ ~ more
|
|
|
|
%= gen
|
|
|
|
remo (~(put by remo.gen) entr [site.i.gorm sock.less])
|
|
|
|
loop
|
2024-06-03 21:19:57 +03:00
|
|
|
%+ roll loom.i.gorm
|
|
|
|
|= [[c=@hail t=@hail s=sock n=noon] gen=loop=_loop.gen]
|
|
|
|
?~ op=(~(get by loop.gen) c)
|
|
|
|
loop.gen :: NB: got:by has crashed here
|
|
|
|
=/ rot (~(rue qui prot.less) plop.n)
|
|
|
|
%+ ~(put by loop.gen) c
|
|
|
|
u.op(prot.l (~(int qui rot) prot.l.u.op))
|
|
|
|
::
|
2024-06-06 05:38:21 +03:00
|
|
|
call
|
|
|
|
=/ lac (~(got by call.gen) site.i.gorm)
|
|
|
|
(~(put by call.gen) site.i.gorm lac(remos (~(put in remos.lac) entr)))
|
2024-06-03 21:19:57 +03:00
|
|
|
::
|
2024-06-06 05:38:21 +03:00
|
|
|
wait
|
|
|
|
=< +
|
|
|
|
%. site.i.gorm
|
|
|
|
wait(tack.dad +.tack.dad, wait.gen (~(del by wait.gen) entr))
|
|
|
|
==
|
2024-06-03 19:31:20 +03:00
|
|
|
::
|
2024-06-05 23:36:17 +03:00
|
|
|
:: +wait: register dependence on [site] for finalization
|
|
|
|
::
|
|
|
|
++ wait
|
|
|
|
~/ %wait
|
|
|
|
|= site=@hail
|
|
|
|
=| wire=(list (list @hail))
|
|
|
|
|- ^- [@hail _wait.gen]
|
|
|
|
?> ?=(^ tack.dad)
|
|
|
|
=/ fire (~(get ja wait.gen) i.tack.dad)
|
|
|
|
?. (lien fire |=(h=@hail =(site h)))
|
|
|
|
%= $
|
|
|
|
tack.dad t.tack.dad
|
|
|
|
wire [fire wire]
|
|
|
|
wait.gen (~(del by wait.gen) i.tack.dad)
|
|
|
|
==
|
|
|
|
:- i.tack.dad
|
|
|
|
(~(put by wait.gen) i.tack.dad (zing (flop [fire wire])))
|
|
|
|
::
|
2024-06-05 00:07:26 +03:00
|
|
|
:: +loop: check for recursion
|
|
|
|
::
|
|
|
|
:: hits are estimates, must be validated in +mend and +seal
|
|
|
|
:: XX: improve debug output (link site -> target -> finalization site)
|
|
|
|
::
|
2024-06-03 19:31:20 +03:00
|
|
|
++ loop
|
2024-06-04 06:06:07 +03:00
|
|
|
~/ %loop
|
2024-06-04 20:02:24 +03:00
|
|
|
|= [roil=@hail fork=naan sand=naan]
|
2024-06-03 19:31:20 +03:00
|
|
|
^- (unit lore)
|
2024-06-04 20:02:24 +03:00
|
|
|
=/ pore (~(get ja sirs.dad) data.sock.fork)
|
2024-06-03 19:31:20 +03:00
|
|
|
|- ^- (unit lore)
|
2024-06-03 21:19:57 +03:00
|
|
|
?~ pore ~
|
|
|
|
=/ tote
|
2024-06-03 19:31:20 +03:00
|
|
|
=/ cope (~(gut by want.gen) site.i.pore |)
|
2024-06-03 21:19:57 +03:00
|
|
|
(~(app ca cope) sock.less.i.pore)
|
|
|
|
?. (~(huge so tote) sock.sand)
|
2024-06-03 19:31:20 +03:00
|
|
|
$(pore t.pore)
|
2024-06-03 21:19:57 +03:00
|
|
|
:: recursive
|
2024-06-05 23:36:17 +03:00
|
|
|
=. loop.gen (~(put by loop.gen) roil [site.i.pore sock.less.i.pore sand])
|
|
|
|
=^ til=@hail wait.gen (wait site.i.pore)
|
|
|
|
:: XX also print [site.i.pore] and its spot
|
2024-06-06 23:17:17 +03:00
|
|
|
=> !@(call.verb ((onto:blot "<3 " roil seat.dad til ~ ~) .) .)
|
2024-06-05 23:36:17 +03:00
|
|
|
`gen
|
2024-06-03 19:31:20 +03:00
|
|
|
::
|
2024-06-05 00:07:26 +03:00
|
|
|
:: +hint: update lore after analyzing through hint (currently just %fast)
|
|
|
|
::
|
|
|
|
:: XX: validate recursive hint processing, refactor
|
|
|
|
::
|
2024-06-03 19:31:20 +03:00
|
|
|
++ hint
|
2024-06-04 06:06:07 +03:00
|
|
|
~/ %hint
|
2024-06-03 19:31:20 +03:00
|
|
|
|= [form=h=@ mild=naan bite=naan]
|
|
|
|
^- lore
|
|
|
|
?+ h.form gen
|
|
|
|
%fast
|
|
|
|
:: fast hint registration
|
|
|
|
?. =(& cape.sock.mild) ~& %fast-hide-clue gen
|
|
|
|
=* clue data.sock.mild
|
|
|
|
?. ?=([name=$@(@tas [@tas @]) pare=* *] clue)
|
|
|
|
~& [%fast-bad-clue clue] gen
|
|
|
|
=/ pell
|
|
|
|
?@ name.clue
|
|
|
|
name.clue
|
|
|
|
(crip "{(trip -.name.clue)}.{(trip (scot %ud +.name.clue))}")
|
|
|
|
|- ^- lore
|
|
|
|
?+ pare.clue ~& [%fast-bad-clue clue] gen
|
2024-06-03 22:23:36 +03:00
|
|
|
:: XX may elide crashes [%11 [%1 *] *]
|
2024-06-03 19:31:20 +03:00
|
|
|
[%11 * *]
|
|
|
|
$(pare.clue +>.pare.clue)
|
|
|
|
::
|
|
|
|
[%1 %0]
|
|
|
|
:: register root
|
|
|
|
?. =(& cape.sock.bite)
|
|
|
|
~& %fast-hide-root gen
|
2024-06-03 21:19:57 +03:00
|
|
|
%= gen
|
|
|
|
core.cole (~(put ju core.cole.gen) ~[pell] sock.bite)
|
|
|
|
root.cole (~(put ju root.cole.gen) data.sock.bite ~[pell])
|
|
|
|
==
|
2024-06-03 19:31:20 +03:00
|
|
|
::
|
|
|
|
[%0 a=@]
|
|
|
|
?: =(0 @) ~& [%fast-bad-clue clue] gen
|
|
|
|
:: register child core
|
2024-06-11 04:12:07 +03:00
|
|
|
=/ batt (~(pull so sock.bite) 2)
|
2024-06-03 19:31:20 +03:00
|
|
|
?. =(& cape.batt) ~& [%fast-hide-batt pell] gen
|
|
|
|
?. ?=(^ data.batt) gen
|
2024-06-11 04:12:07 +03:00
|
|
|
=/ park (~(pull so sock.bite) a.pare.clue)
|
|
|
|
:: XX ???
|
|
|
|
:: ?. =(& cape.park) ~& %fast-lost-sire gen
|
2024-06-03 19:31:20 +03:00
|
|
|
=/ past=(set path)
|
|
|
|
?. =(& cape.park) ~
|
|
|
|
(~(get ju root.cole.gen) data.park)
|
|
|
|
=/ bork (~(pull so park) 2)
|
2024-06-11 04:12:07 +03:00
|
|
|
=? past &(?=(%& cape.bork) ?=(^ data.bork))
|
|
|
|
(~(uni in past) (~(get ju batt.cole.gen) data.bork))
|
2024-06-03 19:31:20 +03:00
|
|
|
=/ pale ~(tap in past)
|
|
|
|
|- ^- lore
|
|
|
|
=* pale-loop $
|
|
|
|
?~ pale gen
|
|
|
|
=/ nape=path [pell i.pale]
|
|
|
|
=/ coal ~(tap in (~(get ju core.cole.gen) i.pale))
|
|
|
|
|- ^- lore
|
|
|
|
?~ coal pale-loop(pale t.pale)
|
|
|
|
?. (~(huge so i.coal) park) $(coal t.coal)
|
|
|
|
=/ naut
|
2024-06-11 03:57:04 +03:00
|
|
|
=/ bake (~(darn so [| ~]) 2 batt) :: XX [[& |] batt ~]
|
|
|
|
(~(darn so bake) a.pare.clue i.coal)
|
2024-06-03 19:31:20 +03:00
|
|
|
::
|
|
|
|
=> =* dot .
|
|
|
|
!@ jet.verb
|
|
|
|
=/ cod
|
|
|
|
?:(?!((~(has by core.cole.gen) nape)) %cold-into %cold-peat)
|
|
|
|
~> %slog.[0 [%rose [": " ~ ~] cod (smyt nape) ~]]
|
|
|
|
dot
|
|
|
|
dot
|
|
|
|
::
|
2024-06-03 21:19:57 +03:00
|
|
|
%= gen
|
|
|
|
core.cole (~(put ju core.cole.gen) nape naut)
|
|
|
|
batt.cole (~(put ju batt.cole.gen) data.batt nape)
|
|
|
|
==
|
2024-06-03 19:31:20 +03:00
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2024-06-05 00:07:26 +03:00
|
|
|
:: +bide: save non-final results for "meloization"
|
|
|
|
::
|
2024-06-04 23:48:43 +03:00
|
|
|
++ bide
|
|
|
|
~/ %bide
|
2024-06-06 23:17:17 +03:00
|
|
|
|= [entr=@hail form=* less=naan more=naan]
|
2024-06-04 23:48:43 +03:00
|
|
|
^+ melo.gen
|
2024-06-06 23:17:17 +03:00
|
|
|
=> !@(call.verb ((outa:blot ">2 " entr seat.dad area.gen) .) .)
|
2024-06-12 07:18:45 +03:00
|
|
|
=/ want *cape
|
|
|
|
=/ sutt *sock
|
2024-06-04 23:48:43 +03:00
|
|
|
=/ have (~(rel qui prot.more) entr cape.sock.more)
|
|
|
|
=/ loom
|
|
|
|
%- ~(rep by loop.gen)
|
|
|
|
|= [[c=@hail t=@hail s=sock l=naan] loom=(list [c=@hail t=@hail s=sock =noon])]
|
|
|
|
^+ loom
|
|
|
|
:: XX maybe require that t is in sirs
|
|
|
|
=/ p=plop (~(rel qui prot.l) entr &)
|
|
|
|
=/ n=noon [p sock.l]
|
|
|
|
[[c t s n] loom] :: XX skip if ?=(~ p) ?
|
2024-06-12 07:18:45 +03:00
|
|
|
:: XX remove sutt and want
|
|
|
|
(~(add ja melo.gen) form [[sutt want sock.more have area.gen] entr less seat.dad loom])
|
2024-06-04 23:48:43 +03:00
|
|
|
::
|
2024-06-05 00:07:26 +03:00
|
|
|
:: +mend: fixpoints to validate pseudo-recursive estimates
|
|
|
|
::
|
2024-06-12 07:18:45 +03:00
|
|
|
:: XX consider additionally fixpointing into want.gen from remo.gen
|
2024-06-05 00:07:26 +03:00
|
|
|
:: XX performance
|
|
|
|
::
|
2024-06-03 19:31:20 +03:00
|
|
|
++ mend
|
2024-06-04 06:06:07 +03:00
|
|
|
=< $
|
|
|
|
~% %mend ..mend ~
|
|
|
|
|. ^- [? lore]
|
2024-06-03 19:31:20 +03:00
|
|
|
=/ sap gen :: for reset
|
|
|
|
=| nop=(map @hail [t=@hail s=sock l=naan])
|
2024-06-05 23:41:49 +03:00
|
|
|
=| i=@ud
|
2024-06-03 19:31:20 +03:00
|
|
|
|- ^- [? lore]
|
|
|
|
=* redo-loop $
|
|
|
|
=. gen sap
|
|
|
|
=. loop.gen (~(dif by loop.gen) nop)
|
2024-06-05 23:41:49 +03:00
|
|
|
=| j=@ud
|
2024-06-03 19:31:20 +03:00
|
|
|
|- ^- [? lore]
|
|
|
|
=* need-loop $
|
|
|
|
=/ wap want.gen
|
|
|
|
=. gen
|
|
|
|
%- ~(rep by loop.gen)
|
|
|
|
|= [[c=@hail t=@hail s=sock l=naan] =_gen]
|
|
|
|
^- _gen
|
|
|
|
=/ teed=cape (~(gut by want.gen) t |)
|
|
|
|
=? want.gen ?!(.=(| teed))
|
|
|
|
%- (~(uno by want.gen) (~(due qui prot.l) teed))
|
|
|
|
|=([@hail a=cape b=cape] ~(cut ca (~(uni ca a) b)))
|
|
|
|
gen
|
2024-06-05 23:41:49 +03:00
|
|
|
?. =(wap want.gen)
|
2024-06-07 21:51:21 +03:00
|
|
|
~? !=(0 j) [%mend-need i=i j=j]
|
2024-06-05 23:41:49 +03:00
|
|
|
need-loop(j +(j))
|
2024-06-03 19:31:20 +03:00
|
|
|
=/ nap nop
|
|
|
|
=. nop
|
|
|
|
%- ~(rep by loop.gen)
|
|
|
|
|= [[c=@hail t=@hail s=sock l=naan] =_nop]
|
|
|
|
=/ teed (~(gut by want.gen) t |)
|
|
|
|
=. s (~(app ca teed) s)
|
|
|
|
:: XX log non pseudo-recursive
|
|
|
|
?. (~(huge so s) sock.l) (~(put by nop) c *[t=@hail s=sock l=naan])
|
|
|
|
nop
|
2024-06-05 23:41:49 +03:00
|
|
|
?. =(nap nop)
|
|
|
|
~& [%mend-redo i=i j=j]
|
|
|
|
redo-loop(i +(i))
|
2024-06-03 19:31:20 +03:00
|
|
|
[?=(~ nop) gen]
|
|
|
|
::
|
2024-06-05 00:07:26 +03:00
|
|
|
:: +seal: finalize analysis (including recursive descendants)
|
|
|
|
::
|
|
|
|
:: XX: refactor
|
|
|
|
::
|
2024-06-03 19:31:20 +03:00
|
|
|
++ seal
|
2024-06-04 06:06:07 +03:00
|
|
|
~/ %seal
|
2024-06-06 23:17:17 +03:00
|
|
|
|= [entr=@hail sane=? wise=(list @hail)]
|
2024-06-03 19:31:20 +03:00
|
|
|
^- lore
|
2024-06-04 23:48:43 +03:00
|
|
|
=> :: XX also log kid
|
2024-06-06 23:17:17 +03:00
|
|
|
!@(call.verb ((outa:blot ">3 " entr seat.dad area.gen) .) .)
|
2024-06-12 18:03:58 +03:00
|
|
|
:: ~? ?=([* * *] wise) wise=(tail (flop wise))
|
2024-06-04 23:48:43 +03:00
|
|
|
?> =(entr (rear wise)) :: current callsite should be last item of finalization list
|
2024-06-03 19:31:20 +03:00
|
|
|
%+ roll wise
|
|
|
|
|= [site=@hail =_gen]
|
|
|
|
=/ kid (~(get ju kids.gen) site)
|
2024-06-12 18:03:58 +03:00
|
|
|
:: ~? !=(~ kid) [site=site `kid=(set @hail)`kid]
|
2024-06-03 19:31:20 +03:00
|
|
|
=+ (~(got by call.gen) site)
|
|
|
|
?> ?=(^ load)
|
|
|
|
=/ want=cape (~(gut by want.gen) site |)
|
|
|
|
=/ sutt
|
|
|
|
=/ such
|
|
|
|
%- ~(uni ca want)
|
|
|
|
(~(gut by (~(due qui prot.more) cape.sock.more)) site |)
|
|
|
|
~(norm so (~(app ca such) sock.less))
|
|
|
|
=? memo.gen ?&(rect sane)
|
|
|
|
=/ have (~(rel qui prot.more) site cape.sock.more)
|
2024-06-06 23:17:17 +03:00
|
|
|
(~(add ja memo.gen) form [sutt want sock.more have area])
|
2024-06-03 19:31:20 +03:00
|
|
|
=. melo.gen
|
|
|
|
?~ mel=(~(get by melo.gen) form)
|
|
|
|
melo.gen
|
2024-06-06 05:29:03 +03:00
|
|
|
=/ lit (skip u.mel |=([^ lite=@hail *] =(site lite)))
|
|
|
|
:: =+ [len nel]=[(lent lit) (lent u.mel)]
|
|
|
|
:: ~? !=(len nel) [%del-melo nel len]
|
2024-06-03 19:31:20 +03:00
|
|
|
?: =(~ lit)
|
|
|
|
(~(del by melo.gen) form)
|
|
|
|
(~(put by melo.gen) form lit)
|
|
|
|
::
|
|
|
|
=/ soot
|
|
|
|
=> [s=sock.less w=want so=so ca=ca]
|
|
|
|
~+ ~(norm so (~(app ca w) s))
|
|
|
|
=^ [ices=(map @hail [=sock form=*]) lope=(set [=sock form=*])] gen
|
|
|
|
%- ~(rep in kid)
|
|
|
|
|= [k=@hail [ices=(map @hail [=sock form=*]) lope=(set [=sock form=*])] =_gen]
|
|
|
|
=/ rem (~(get by remo.gen) k)
|
|
|
|
=/ n ?~(rem k site.u.rem)
|
|
|
|
=/ m t:(~(gut by loop.gen) k [t=n s=*sock l=*naan])
|
|
|
|
=/ w=cape (~(gut by want.gen) m |)
|
2024-06-06 05:38:21 +03:00
|
|
|
=/ c (~(got by call.gen) m) :: XX would crash on mend-redo?
|
2024-06-03 19:31:20 +03:00
|
|
|
=/ s
|
|
|
|
=> [s=sock.less.c w=w so=so ca=ca]
|
|
|
|
~+ ~(norm so (~(app ca w) s))
|
|
|
|
::
|
2024-06-12 17:54:35 +03:00
|
|
|
~| %ices-melo-sock-nest
|
|
|
|
?> ?| ?=(~ rem)
|
2024-06-03 19:31:20 +03:00
|
|
|
(~(huge so s) (~(app ca w) sock.u.rem))
|
|
|
|
==
|
|
|
|
=. ices (~(put by ices) k [s form.c])
|
|
|
|
=? lope ?!(.=(m n)) (~(put in lope) [s form.c])
|
|
|
|
[[ices lope] gen]
|
|
|
|
:: trim want/call/loop tables
|
|
|
|
=. gen
|
|
|
|
%- ~(rep in kid)
|
|
|
|
|= [k=@hail =_gen]
|
2024-06-12 17:54:35 +03:00
|
|
|
?: (~(has by loop.gen) k)
|
|
|
|
?< (~(has by remo.gen) k)
|
|
|
|
?< (~(has by call.gen) k)
|
|
|
|
gen(want (~(del by want.gen) k), loop (~(del by loop.gen) k))
|
2024-06-06 05:38:21 +03:00
|
|
|
::
|
2024-06-12 17:54:35 +03:00
|
|
|
?~ rem=(~(get by remo.gen) k)
|
|
|
|
=/ lac (~(got by call.gen) k)
|
|
|
|
?^ remos.lac gen
|
|
|
|
gen(want (~(del by want.gen) k), call (~(del by call.gen) k))
|
|
|
|
::
|
|
|
|
?< (~(has by call.gen) k)
|
|
|
|
=. gen
|
|
|
|
?~ lac=(~(get by call.gen) site.u.rem)
|
|
|
|
~& [%missing-call k=k rem=site.u.rem]
|
|
|
|
gen
|
|
|
|
?^ mos=(~(del in remos.u.lac) site) :: XX explain
|
|
|
|
gen(call (~(put by call.gen) site.u.rem u.lac(remos mos)))
|
|
|
|
gen(want (~(del by want.gen) site.u.rem), call (~(del by call.gen) site.u.rem))
|
|
|
|
gen(want (~(del by want.gen) k), remo (~(del by remo.gen) k))
|
|
|
|
|
2024-06-03 19:31:20 +03:00
|
|
|
=/ hiss (~(get ju hint.gen) site)
|
|
|
|
=^ fizz gen
|
|
|
|
%- ~(rep in hiss)
|
|
|
|
|= [h=@hint fizz=(map @hint *) gen=_gen]
|
|
|
|
=. fizz (~(put by fizz) h (~(got by forb.gen) h))
|
|
|
|
:: trim forb table
|
|
|
|
=. forb.gen (~(del by forb.gen) h)
|
|
|
|
[fizz gen]
|
|
|
|
:: trim kids and hint tables
|
|
|
|
=. kids.gen (~(del by kids.gen) site)
|
|
|
|
=. hint.gen (~(del by hint.gen) site)
|
|
|
|
=/ loan (~(get ja moan.gen) form)
|
2024-06-05 23:41:49 +03:00
|
|
|
=? moan.gen (levy loan |=([ss=sock *] !=(soot ss)))
|
2024-06-12 04:50:52 +03:00
|
|
|
(~(add ja moan.gen) form [soot u.load ices lope fizz seat.dad area.gen])
|
2024-06-03 19:31:20 +03:00
|
|
|
gen
|
|
|
|
::
|
2024-06-05 00:07:26 +03:00
|
|
|
:: +scan: statefully analyze formula against subject
|
|
|
|
::
|
2024-06-03 19:31:20 +03:00
|
|
|
++ scan
|
2024-06-04 06:06:07 +03:00
|
|
|
~/ %scan
|
2024-06-03 19:31:20 +03:00
|
|
|
|= queu=i=todo
|
|
|
|
^- [naan lore]
|
|
|
|
=^ entr gen [rail.gen gen(rail .+(rail.gen))] :: initial callsite
|
|
|
|
:: ~> %bout.[0 `tank`?.(?=(^ calm.i.queu) %raw [%rose [": " ~ ~] leaf+['+' (scow %ud +.j.u.calm.i.queu)] (smyt -.j.u.calm.i.queu) ~])]
|
|
|
|
=/ less=naan [~ soot.i.queu] :: subject
|
2024-06-04 20:02:24 +03:00
|
|
|
=* form form.i.queu :: formula
|
|
|
|
=. dad
|
|
|
|
%= dad
|
2024-06-06 23:17:17 +03:00
|
|
|
sirs (~(add ja ^+(sirs.dad ~)) form [entr less])
|
|
|
|
lord ~
|
|
|
|
tack ~[entr]
|
|
|
|
wake ~
|
|
|
|
seat ~
|
2024-06-04 20:02:24 +03:00
|
|
|
==
|
2024-06-03 19:31:20 +03:00
|
|
|
:: wrapper for callsite formulas
|
|
|
|
|- ^- [naan _gen]
|
|
|
|
=* arm-loop $
|
|
|
|
=. prot.less (~(tag qui prot.less) [entr 1])
|
|
|
|
=. wait.gen (~(add ja wait.gen) entr entr)
|
|
|
|
:: check if memoized
|
2024-06-04 20:02:24 +03:00
|
|
|
?^ m=(memo entr form less) u.m
|
|
|
|
?^ m=(melo entr form less) u.m
|
2024-05-22 06:04:04 +03:00
|
|
|
::
|
2024-04-21 15:16:57 +03:00
|
|
|
=^ [load=nomm more=naan] gen
|
|
|
|
:: structurally recur over formula
|
2024-06-06 23:17:17 +03:00
|
|
|
=> !@(call.verb ((into:blot ">> " entr seat.dad) .) .)
|
2024-04-21 15:16:57 +03:00
|
|
|
|- ^- [[=nomm =naan] _gen]
|
|
|
|
?+ form [[[%not 0] [~ | ~]] gen]
|
|
|
|
[b=^ c=*]
|
|
|
|
=^ [leno=nomm lire=naan] gen $(form b.form)
|
|
|
|
=^ [reno=nomm rile=naan] gen $(form c.form)
|
|
|
|
:_ gen
|
|
|
|
:- [%par leno reno]
|
|
|
|
[(~(con qui prot.lire) prot.rile) (~(knit so sock.lire) sock.rile)]
|
|
|
|
::
|
|
|
|
[%0 axe=@]
|
|
|
|
?: =(0 axe.form) [[[%not 0] [~ | ~]] gen]
|
|
|
|
:_ gen
|
2024-06-11 04:12:07 +03:00
|
|
|
:+ [%not axe.form]
|
|
|
|
(~(ask qui prot.less) axe.form)
|
|
|
|
(~(pull so sock.less) axe.form)
|
2024-04-21 15:16:57 +03:00
|
|
|
::
|
|
|
|
[%1 n=*]
|
|
|
|
[[[%one n.form] [~ & n.form]] gen]
|
|
|
|
::
|
|
|
|
[%2 s=* f=*]
|
|
|
|
=^ roil gen [rail.gen gen(rail .+(rail.gen))]
|
2024-06-06 23:17:17 +03:00
|
|
|
=/ area area.gen
|
|
|
|
=: wake.dad ~
|
|
|
|
seat.dad ?~(wake.dad ~ `i.wake.dad)
|
|
|
|
==
|
|
|
|
=^ [sown=nomm sand=naan] gen $(form s.form, area.gen ~)
|
|
|
|
=^ [fond=nomm fork=naan] gen $(form f.form, area.gen ~)
|
2024-06-03 21:19:57 +03:00
|
|
|
?. =(& cape.sock.fork)
|
|
|
|
:: indirect call
|
2024-06-06 23:17:17 +03:00
|
|
|
=> !@(call.verb ((outa:blot "<4 " roil seat.dad ~) .) .)
|
|
|
|
[[[%two sown fond roil] [~ | ~]] gen(dire |, area area)]
|
2024-06-03 21:19:57 +03:00
|
|
|
:: direct call
|
|
|
|
=. kids.gen (~(put ju kids.gen) entr roil)
|
|
|
|
:: record need
|
|
|
|
=/ pant (~(due qui prot.fork) &) :: callsite provenance by needs
|
|
|
|
=. want.gen
|
|
|
|
%- (~(uno by want.gen) pant)
|
|
|
|
|= [@hail a=cape b=cape]
|
|
|
|
~(cut ca (~(uni ca a) b))
|
|
|
|
:: check for recursion
|
2024-06-04 20:21:45 +03:00
|
|
|
?^ l=(loop roil fork sand)
|
2024-06-06 23:17:17 +03:00
|
|
|
[[[%two sown fond roil] [~ | ~]] u.l(area area)]
|
2024-06-03 21:19:57 +03:00
|
|
|
:: not recursive
|
|
|
|
:: analyze through direct call
|
|
|
|
=/ dire dire.gen
|
|
|
|
=^ more gen
|
|
|
|
%= arm-loop
|
|
|
|
form data.sock.fork
|
|
|
|
less sand
|
|
|
|
entr roil
|
2024-06-06 23:17:17 +03:00
|
|
|
gen gen(dire &, area ~)
|
2024-06-04 20:02:24 +03:00
|
|
|
dad %= dad
|
|
|
|
sirs (~(add ja sirs.dad) data.sock.fork [roil sand])
|
|
|
|
lord (~(put in lord.dad) entr)
|
|
|
|
tack [roil tack.dad]
|
|
|
|
== ==
|
2024-06-03 21:19:57 +03:00
|
|
|
:- [[%two sown fond roil] more]
|
2024-06-06 23:17:17 +03:00
|
|
|
gen(dire &(dire dire.gen), area area)
|
2024-04-21 15:16:57 +03:00
|
|
|
::
|
|
|
|
[%3 c=*]
|
|
|
|
=^ [knob=nomm mild=naan] gen $(form c.form)
|
|
|
|
:_ gen
|
|
|
|
[[%the knob] [~ | ~]]
|
|
|
|
::
|
|
|
|
[%4 c=*]
|
|
|
|
=^ [knob=nomm mild=naan] gen $(form c.form)
|
|
|
|
:_ gen
|
|
|
|
[[%for knob] [~ | ~]]
|
|
|
|
::
|
|
|
|
[%5 l=* r=*]
|
|
|
|
=^ [leno=nomm lire=naan] gen $(form l.form)
|
|
|
|
=^ [reno=nomm rile=naan] gen $(form r.form)
|
|
|
|
:_ gen
|
|
|
|
[[%ivy leno reno] [~ | ~]]
|
|
|
|
::
|
|
|
|
[%6 c=* t=* f=*]
|
|
|
|
=^ [xeno=nomm mild=naan] gen $(form c.form)
|
|
|
|
=^ [zero=nomm thin=naan] gen $(form t.form)
|
|
|
|
=^ [once=nomm fast=naan] gen $(form f.form)
|
|
|
|
:_ gen
|
|
|
|
:- [%six xeno zero once]
|
|
|
|
:- (~(int qui prot.thin) prot.fast)
|
|
|
|
(~(purr so sock.thin) sock.fast)
|
|
|
|
::
|
|
|
|
[%7 b=* c=*]
|
|
|
|
=^ [anon=nomm mean=naan] gen $(form b.form)
|
|
|
|
=^ [then=nomm salt=naan] gen $(form c.form, less mean)
|
|
|
|
:_ gen
|
|
|
|
[[%eve anon then] salt]
|
|
|
|
::
|
|
|
|
[%8 b=* c=*]
|
|
|
|
?@ b.form $(form [7 [[0 0] 0 1] c.form])
|
|
|
|
$(form [7 [b.form 0 1] c.form])
|
|
|
|
::
|
|
|
|
[%9 b=@ c=*]
|
|
|
|
$(form [7 c.form 2 [0 1] 0 b.form])
|
|
|
|
::
|
|
|
|
[%10 [a=@ p=*] b=*]
|
|
|
|
?: =(0 a.form) [[[%not 0] [~ | ~]] gen]
|
|
|
|
=^ [twig=nomm bite=naan] gen $(form p.form)
|
|
|
|
=^ [tree=nomm hole=naan] gen $(form b.form)
|
|
|
|
:_ gen
|
2024-06-11 03:57:04 +03:00
|
|
|
:+ [%ten a.form twig tree]
|
|
|
|
(~(put qui prot.hole) a.form prot.bite)
|
|
|
|
(~(darn so sock.hole) a.form sock.bite)
|
2024-04-21 15:16:57 +03:00
|
|
|
::
|
|
|
|
[%11 h=@ f=*]
|
|
|
|
=^ [then=nomm bite=naan] gen $(form f.form)
|
|
|
|
[[[%sip h.form then] bite] gen]
|
|
|
|
::
|
|
|
|
[%11 [h=@ v=*] f=*]
|
|
|
|
=^ hare gen [hare.gen gen(hare .+(hare.gen))]
|
|
|
|
=^ [vice=nomm mild=naan] gen $(form v.form)
|
2024-06-06 23:17:17 +03:00
|
|
|
::
|
|
|
|
:: XX !@ on call.verb?
|
|
|
|
::
|
|
|
|
=> =/ pot=(unit spot)
|
|
|
|
?.(=(%spot h.form) ~ ((soft spot) data.sock.mild))
|
|
|
|
?~ pot +
|
|
|
|
%_ +
|
|
|
|
wake.dad [u.pot wake.dad]
|
|
|
|
area.gen ?~(area.gen pot area.gen)
|
|
|
|
==
|
|
|
|
::
|
2024-04-21 15:16:57 +03:00
|
|
|
=^ [then=nomm bite=naan] gen $(form f.form)
|
|
|
|
:: save body formula
|
|
|
|
=. hint.gen (~(put ju hint.gen) entr hare)
|
|
|
|
=. forb.gen (~(put by forb.gen) hare f.form)
|
2024-06-03 19:31:20 +03:00
|
|
|
:- [[%tip h.form vice then hare] bite]
|
|
|
|
(hint h.form mild bite)
|
2024-04-21 15:16:57 +03:00
|
|
|
::
|
|
|
|
[%12 r=* p=*]
|
|
|
|
=^ [rend=nomm rita=naan] gen $(form r.form)
|
|
|
|
=^ [pond=nomm walk=naan] gen $(form p.form)
|
|
|
|
[[[%elf rend pond] [~ | ~]] gen]
|
|
|
|
==
|
|
|
|
::
|
2024-06-04 20:02:24 +03:00
|
|
|
=. prot.more (~(cut qui prot.more) lord.dad cape.sock.more)
|
2024-06-04 23:48:43 +03:00
|
|
|
:- more
|
|
|
|
:: write to call table
|
2024-06-06 23:17:17 +03:00
|
|
|
=. call.gen (~(put by call.gen) entr [less more form `load dire.gen ~ seat.dad area.gen])
|
2024-06-04 23:48:43 +03:00
|
|
|
=/ wise (~(get ja wait.gen) entr)
|
2024-05-02 00:12:23 +03:00
|
|
|
=. wait.gen (~(del by wait.gen) entr)
|
2024-05-03 01:51:29 +03:00
|
|
|
?: =(~ wise)
|
2024-06-04 23:48:43 +03:00
|
|
|
:: no finalizing here
|
2024-06-06 23:17:17 +03:00
|
|
|
gen(melo (bide entr form less more))
|
2024-05-02 00:12:23 +03:00
|
|
|
:: fixed-point loops to propagate their needs and check that they are really loops
|
2024-06-03 19:31:20 +03:00
|
|
|
=^ sane=? gen mend
|
2024-05-02 00:12:23 +03:00
|
|
|
:: finalize waiting callsites
|
2024-06-06 23:17:17 +03:00
|
|
|
(seal entr sane wise)
|
2024-06-03 19:31:20 +03:00
|
|
|
--
|
|
|
|
::
|
|
|
|
:: Analyze a subject/formula pair
|
|
|
|
++ rout
|
|
|
|
~/ %rout
|
|
|
|
|= [soot=* form=*]
|
|
|
|
=/ colt cole
|
|
|
|
=/ queu=(list todo) [[& soot] form ~]~
|
|
|
|
=| back=(list todo)
|
|
|
|
:: analysis queue: first the actual subject/formula pair,
|
|
|
|
:: then formulas from batteries of any new cold-state registrations
|
|
|
|
|- ^- _thus
|
|
|
|
=* cold-loop $
|
|
|
|
=/ gnat ((dif-ju core.cole) core.colt)
|
|
|
|
=. colt cole
|
|
|
|
=. back
|
|
|
|
:: queue unanalyzed cold-state batteries
|
|
|
|
:: (shortest-path first gives a rough topo-sort)
|
|
|
|
::
|
|
|
|
%+ roll
|
|
|
|
%+ sort
|
|
|
|
%+ turn ~(tap by gnat)
|
|
|
|
|=([p=path q=(set sock)] [(lent p) p q])
|
|
|
|
|=([l=[len=@ *] r=[len=@ *]] (lth len.l len.r))
|
|
|
|
|: [[len=*@ p=*path q=*(set sock)] b=back]
|
|
|
|
%- ~(rep in q)
|
|
|
|
|: [s=*sock b=b]
|
|
|
|
=/ batt (~(pull so s) 2)
|
2024-06-11 04:12:07 +03:00
|
|
|
?. =(& cape.batt) ~& [%cold-miss-batt p] b
|
2024-06-03 19:31:20 +03:00
|
|
|
:: split up battery at autocons sites
|
2024-06-11 04:12:07 +03:00
|
|
|
=* f data.batt
|
2024-06-03 19:31:20 +03:00
|
|
|
=/ a=@ 1
|
|
|
|
|- ^- _b
|
|
|
|
?. ?=([^ *] f)
|
|
|
|
[[s f `[| p a]] b]
|
|
|
|
=. b $(f -.f, a (peg a 2))
|
|
|
|
=. b $(f +.f, a (peg a 3))
|
|
|
|
[[s f `[& p a]] b]
|
|
|
|
?~ queu
|
|
|
|
?~ back thus
|
|
|
|
~& [%cold-loop (lent back)]
|
|
|
|
cold-loop(queu (flop back), back ~)
|
|
|
|
:: finish analysis of an autocons from a cold-state battery
|
|
|
|
?: ?&(?=(^ calm.i.queu) auto.u.calm.i.queu)
|
|
|
|
=* j j.u.calm.i.queu
|
|
|
|
=/ balk=(list [sock *]) ~(tap in (~(get ju back.cole) [-.j (peg +.j 2)]))
|
|
|
|
=/ bark=(list [sock *]) ~(tap in (~(get ju back.cole) [-.j (peg +.j 3)]))
|
|
|
|
?> ?=(^ form.i.queu)
|
|
|
|
|- ^- _thus
|
|
|
|
=* balk-loop $
|
|
|
|
?~ balk cold-loop(queu t.queu)
|
|
|
|
?. =(-.form.i.queu +.i.balk) balk-loop(balk t.balk)
|
|
|
|
?. (~(huge so -.i.balk) soot.i.queu) balk-loop(balk t.balk)
|
|
|
|
=/ bart bark
|
|
|
|
|- ^- _thus
|
|
|
|
=* bart-loop $
|
|
|
|
?~ bart balk-loop(balk t.balk)
|
|
|
|
?. =(+.form.i.queu +.i.bart) bart-loop(bart t.bart)
|
|
|
|
?. (~(huge so -.i.bart) soot.i.queu) bart-loop(bart t.bart)
|
|
|
|
=/ soot (~(pack so -.i.balk) -.i.bart)
|
|
|
|
=. call.cole (~(put by call.cole) [soot form.i.queu] j)
|
|
|
|
=. back.cole (~(put ju back.cole) j [soot form.i.queu])
|
|
|
|
bart-loop(bart t.bart)
|
|
|
|
:: analyze a formula
|
|
|
|
=/ gen=lore +:(scan:snak i.queu)
|
2024-06-03 21:19:57 +03:00
|
|
|
%= cold-loop
|
|
|
|
queu t.queu
|
|
|
|
moan moan.gen
|
|
|
|
memo memo.gen
|
|
|
|
cole
|
|
|
|
?~ calm.i.queu cole.gen
|
|
|
|
=/ boot
|
2024-08-03 05:05:31 +03:00
|
|
|
:_ form.i.queu
|
2024-06-03 21:19:57 +03:00
|
|
|
=/ want (fall (~(get by want.gen) `@hail`0x0) |) :: first site is always 0x0
|
2024-04-21 15:16:57 +03:00
|
|
|
=> [s=soot.i.queu w=want so=so ca=ca]
|
|
|
|
~+ ~(norm so (~(app ca w) s))
|
2024-06-03 21:19:57 +03:00
|
|
|
=* pax j.u.calm.i.queu
|
|
|
|
%= cole.gen
|
|
|
|
call (~(put by call.cole.gen) boot pax)
|
|
|
|
back (~(put ju back.cole.gen) pax boot)
|
|
|
|
==
|
|
|
|
==
|
2024-04-21 15:16:57 +03:00
|
|
|
--
|
|
|
|
=<
|
|
|
|
:: utilities
|
|
|
|
|%
|
|
|
|
::
|
|
|
|
:: operations on provenance
|
|
|
|
++ qui
|
|
|
|
|_ prog=prot
|
|
|
|
::
|
|
|
|
:: provenance tree for +axis
|
|
|
|
++ ask
|
|
|
|
|= axe=@
|
|
|
|
?< =(0 axe)
|
2024-06-08 05:35:59 +03:00
|
|
|
=/ rev 1
|
|
|
|
=| don=(list (pair @ (list peon)))
|
2024-04-21 15:16:57 +03:00
|
|
|
|- ^- prot
|
2024-06-08 05:35:59 +03:00
|
|
|
=+ [n l r]=?@(prog [~ ~ ~] prog)
|
|
|
|
?. =(1 axe)
|
|
|
|
?- (cap axe)
|
|
|
|
%2 $(axe (mas axe), don [[rev n] don], rev (peg rev 2), prog l)
|
|
|
|
%3 $(axe (mas axe), don [[rev n] don], rev (peg rev 3), prog r)
|
|
|
|
==
|
|
|
|
=. n
|
|
|
|
%+ roll don
|
|
|
|
|= [[axe=@ lit=(list peon)] out=_n]
|
|
|
|
?: =(~ lit) out
|
|
|
|
=/ rel (hub axe rev)
|
|
|
|
%+ roll lit
|
|
|
|
|=([p=peon =_out] [p(axe (peg axe.p rel)) out])
|
|
|
|
?: ?&(?=(~ n) ?=(~ l) ?=(~ r)) ~
|
|
|
|
[n l r]
|
|
|
|
::
|
2024-04-21 15:16:57 +03:00
|
|
|
++ put
|
|
|
|
|= [axe=@ poor=prot]
|
|
|
|
?< =(0 axe)
|
2024-06-08 06:09:27 +03:00
|
|
|
?: &(?=(~ prog) ?=(~ poor)) ~
|
2024-04-21 15:16:57 +03:00
|
|
|
=| tack=(list [c=?(%2 %3) p=prot])
|
|
|
|
|- ^- prot
|
|
|
|
?. =(1 axe)
|
|
|
|
?- (cap axe)
|
|
|
|
%2 $(axe (mas axe), prog hed, tack [[%2 tal] tack])
|
|
|
|
%3 $(axe (mas axe), prog tal, tack [[%3 hed] tack])
|
|
|
|
==
|
|
|
|
|- ^- prot
|
|
|
|
?~ tack poor
|
|
|
|
?- c.i.tack
|
2024-06-08 06:09:27 +03:00
|
|
|
%2 $(poor [~ poor p.i.tack], tack t.tack)
|
|
|
|
%3 $(poor [~ p.i.tack poor], tack t.tack)
|
2024-04-21 15:16:57 +03:00
|
|
|
==
|
2024-04-22 03:52:47 +03:00
|
|
|
++ cut
|
|
|
|
|= [sire=(set @hail) =cape]
|
|
|
|
^- prot
|
2024-06-07 00:44:47 +03:00
|
|
|
?: |(?=(%| cape) ?=(~ prog)) ~
|
|
|
|
=/ n (skim n.prog |=([s=@hail @] (~(has in sire) s)))
|
|
|
|
=+ [p q]=?@(cape [& &] cape)
|
|
|
|
=/ l $(prog l.prog, cape p)
|
|
|
|
=/ r $(prog l.prog, cape q)
|
2024-04-22 03:52:47 +03:00
|
|
|
?: ?&(?=(~ n) ?=(~ l) ?=(~ r)) ~
|
|
|
|
[n l r]
|
2024-04-21 15:16:57 +03:00
|
|
|
::
|
|
|
|
:: provenance tree for +2
|
|
|
|
++ hed
|
|
|
|
^- prot
|
|
|
|
?~ prog ~
|
2024-06-08 05:35:04 +03:00
|
|
|
=+ [n l r]=?@(l.prog [~ ~ ~] l.prog)
|
|
|
|
:_ [l r]
|
|
|
|
%+ roll n.prog
|
|
|
|
|=([p=peon out=_n] [p(axe (peg axe.p 2)) out])
|
2024-04-21 15:16:57 +03:00
|
|
|
::
|
|
|
|
:: provenance tree for +3
|
|
|
|
++ tal
|
|
|
|
^- prot
|
|
|
|
?~ prog ~
|
2024-06-08 05:35:04 +03:00
|
|
|
=+ [n l r]=?@(r.prog [~ ~ ~] r.prog)
|
|
|
|
:_ [l r]
|
|
|
|
%+ roll n.prog
|
|
|
|
|=([p=peon out=_n] [p(axe (peg axe.p 3)) out])
|
2024-04-21 15:16:57 +03:00
|
|
|
::
|
|
|
|
:: provenance tree from two subtrees (cons)
|
|
|
|
++ con
|
|
|
|
|= poor=prot
|
|
|
|
^- prot
|
2024-06-08 06:09:27 +03:00
|
|
|
?: &(?=(~ prog) ?=(~ poor)) ~
|
2024-04-21 15:16:57 +03:00
|
|
|
[~ prog poor]
|
|
|
|
::
|
|
|
|
:: provenance tree of intersection
|
|
|
|
++ int
|
|
|
|
|= poor=prot
|
|
|
|
^- prot
|
|
|
|
?~ prog poor
|
|
|
|
?~ poor prog
|
|
|
|
=/ n ~(tap in (~(gas in (~(gas in *(set peon)) n.poor)) n.prog))
|
|
|
|
[n $(prog l.prog, poor l.poor) $(prog r.prog, poor r.poor)]
|
|
|
|
::
|
|
|
|
:: add a label to the root
|
|
|
|
++ tag
|
|
|
|
|= =peon
|
|
|
|
?~ prog [~[peon] ~ ~]
|
|
|
|
prog(n [peon n.prog])
|
|
|
|
::
|
|
|
|
:: given a cape, distribute that cape to callsites by provenance
|
|
|
|
++ due
|
2024-06-07 00:21:30 +03:00
|
|
|
!.
|
2024-04-21 15:16:57 +03:00
|
|
|
=/ unica |=([@hail a=cape b=cape] (~(uni ca a) b))
|
|
|
|
|= cave=cape
|
2024-06-07 00:21:30 +03:00
|
|
|
^- (map @hail cape)
|
|
|
|
?: |(?=(%| cave) ?=(~ prog)) ~
|
|
|
|
=/ n
|
|
|
|
%+ roll n.prog
|
|
|
|
|= [[s=@hail a=@] m=(map @hail cape)]
|
|
|
|
(~(put by m) s (~(pat ca cave) a))
|
|
|
|
=+ [p q]=?@(cave [& &] cave)
|
|
|
|
=/ l $(prog l.prog, cave p)
|
|
|
|
=/ r $(prog r.prog, cave q)
|
|
|
|
((~(uno by ((~(uno by l) r) unica)) n) unica)
|
2024-04-21 15:16:57 +03:00
|
|
|
::
|
|
|
|
:: given a callsite produce a new provenance tree only retaining
|
|
|
|
:: provenance for that callsite's subject
|
|
|
|
++ rel
|
2024-04-22 03:52:47 +03:00
|
|
|
|= [site=@hail =cape]
|
2024-04-21 15:16:57 +03:00
|
|
|
^- plop
|
2024-06-07 00:44:47 +03:00
|
|
|
?: |(?=(%| cape) ?=(~ prog)) ~
|
2024-04-21 15:16:57 +03:00
|
|
|
=/ n (murn n.prog |=(p=peon ?:(=(site site.p) `axe.p ~)))
|
2024-06-07 00:44:47 +03:00
|
|
|
=+ [p q]=?@(cape [& &] cape)
|
|
|
|
=/ l $(prog l.prog, cape p)
|
|
|
|
=/ r $(prog r.prog, cape q)
|
|
|
|
?: &(?=(~ l) ?=(~ r) ?=(~ n)) ~
|
2024-04-21 15:16:57 +03:00
|
|
|
[n l r]
|
|
|
|
::
|
|
|
|
:: relocate cached provenance
|
|
|
|
++ rue
|
|
|
|
|= prop=plop
|
|
|
|
=| t=prot
|
|
|
|
|- ^- prot
|
|
|
|
?~ prop t
|
|
|
|
=. t
|
|
|
|
%+ roll n.prop
|
|
|
|
|: [a=*@ t=t]
|
|
|
|
(int(prog (ask a)) t)
|
|
|
|
?~ t
|
|
|
|
=/ l $(prop l.prop)
|
|
|
|
=/ r $(prop r.prop)
|
|
|
|
?:(?&(?=(~ l) ?=(~ r)) ~ [~ l r])
|
|
|
|
=/ l $(prop l.prop, t l.t)
|
|
|
|
=/ r $(prop r.prop, t r.t)
|
|
|
|
[n.t l r]
|
|
|
|
--
|
|
|
|
::
|
|
|
|
:: push down axes on a list of peons
|
|
|
|
++ pepe
|
|
|
|
|= [slav=(list peon) axe=@]
|
|
|
|
^- _slav
|
|
|
|
%+ turn slav
|
|
|
|
|= =peon
|
|
|
|
peon(axe (peg axe.peon axe))
|
2024-06-08 05:35:59 +03:00
|
|
|
::
|
|
|
|
++ hub
|
|
|
|
:: ~/ %hub
|
|
|
|
:: axis after axis
|
|
|
|
::
|
|
|
|
:: computes the remainder of axis {b} when navigating to {a}.
|
|
|
|
:: (crashes if not `(pin a b)`)
|
|
|
|
|= [a=@ b=@]
|
|
|
|
?< =(0 a)
|
|
|
|
?< =(0 b)
|
|
|
|
|- ^- @
|
|
|
|
?: =(a 1) b
|
|
|
|
?> =((cap a) (cap b))
|
|
|
|
$(a (mas a), b (mas b))
|
|
|
|
::
|
2024-04-21 15:16:57 +03:00
|
|
|
++ dif-ju
|
|
|
|
|* a=(jug)
|
|
|
|
|* b=_a
|
|
|
|
^+ a
|
|
|
|
=/ c=_a (~(dif by a) b)
|
|
|
|
=/ i=_a (~(int by a) b)
|
|
|
|
?: =(~ i) c
|
|
|
|
%- ~(rep by i)
|
|
|
|
|= [[p=_?>(?=(^ i) p.n.i) q=_?>(?=(^ i) q.n.i)] =_c]
|
|
|
|
=/ r=_q (~(get ju b) p)
|
|
|
|
=/ s=_q (~(dif in q) r)
|
|
|
|
?: =(~ s) c
|
|
|
|
(~(put by c) p s)
|
2024-05-03 06:05:01 +03:00
|
|
|
::
|
|
|
|
++ blot
|
2024-05-06 20:26:49 +03:00
|
|
|
|%
|
|
|
|
++ ren
|
|
|
|
|= pot=spot
|
|
|
|
^- tank
|
|
|
|
:+ %rose [":" ~ ~]
|
|
|
|
:~ (smyt p.pot)
|
|
|
|
=* l p.q.pot
|
|
|
|
=* r q.q.pot
|
|
|
|
=/ ud |=(a=@u (scow %ud a))
|
|
|
|
leaf+"<[{(ud p.l)} {(ud q.l)}].[{(ud p.r)} {(ud q.r)}]>"
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ hal (cury scot %x)
|
|
|
|
::
|
|
|
|
++ one
|
|
|
|
|= [tap=tape ale=@hail pot=spot]
|
|
|
|
^- tank
|
|
|
|
[%rose [": " tap ~] (hal ale) (ren pot) ~]
|
|
|
|
::
|
|
|
|
++ two
|
|
|
|
|= [tap=tape ale=@hail pot=spot top=spot]
|
|
|
|
^- tank
|
|
|
|
:+ %rose [": " tap ~]
|
2024-05-27 05:50:16 +03:00
|
|
|
:~ (hal ale)
|
|
|
|
[%rose [" -> " ~ ~] (ren pot) (ren top) ~]
|
2024-05-06 20:26:49 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ into
|
|
|
|
|= [tap=tape ale=@hail f=(unit spot)]
|
2024-05-27 05:50:16 +03:00
|
|
|
%- slog :_ ~
|
|
|
|
:^ %rose
|
|
|
|
[": " tap ~]
|
|
|
|
(hal ale)
|
|
|
|
?~ f ~
|
|
|
|
[(ren u.f) ~]
|
2024-05-06 20:26:49 +03:00
|
|
|
::
|
|
|
|
++ outa
|
|
|
|
|= [tap=tape ale=@hail f=(unit spot) t=(unit spot)]
|
2024-05-27 05:50:16 +03:00
|
|
|
?~ t
|
|
|
|
(into tap ale f)
|
|
|
|
%- slog :_ ~
|
|
|
|
:+ %rose [": " tap ~]
|
|
|
|
:~ (hal ale)
|
|
|
|
[%rose [" -> " ~ ~] ?~(f '??' (ren u.f)) (ren u.t) ~]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ onto
|
|
|
|
|= $: tap=tape
|
|
|
|
ale=@hail
|
|
|
|
s=(unit spot)
|
|
|
|
ole=@hail
|
|
|
|
f=(unit spot)
|
|
|
|
t=(unit spot)
|
|
|
|
==
|
|
|
|
%- slog :_ ~
|
|
|
|
:^ %rose
|
|
|
|
[": " tap ~]
|
|
|
|
(hal ale)
|
|
|
|
?~ s ~
|
|
|
|
:+ (ren u.s)
|
|
|
|
(hal ole)
|
|
|
|
?: |(?=(~ f) ?=(~ t)) ~
|
|
|
|
[[%rose [" -> " ~ ~] (ren u.f) (ren u.t) ~] ~]
|
2024-05-06 20:26:49 +03:00
|
|
|
--
|
2024-04-21 15:16:57 +03:00
|
|
|
--
|
|
|
|
:: utility types
|
|
|
|
::
|
|
|
|
|%
|
|
|
|
::
|
|
|
|
:: abstract noun with provenance
|
|
|
|
+$ naan [=prot =sock]
|
|
|
|
::
|
2024-05-22 00:03:37 +03:00
|
|
|
:: abstract noun with local provenance
|
|
|
|
+$ noon [=plop =sock]
|
|
|
|
::
|
2024-04-21 15:16:57 +03:00
|
|
|
:: callsite information
|
2024-06-06 23:17:17 +03:00
|
|
|
+$ cafe (map @hail [less=naan more=naan form=* load=(unit nomm) rect=? remos=(set @hail) seat=(unit spot) area=(unit spot)])
|
2024-04-21 15:16:57 +03:00
|
|
|
::
|
|
|
|
:: subject requirements for callsites
|
|
|
|
+$ urge (map @hail cape)
|
|
|
|
::
|
|
|
|
:: individual provenance tag: callsite and subject axis
|
|
|
|
+$ peon [site=@hail axe=@]
|
|
|
|
::
|
|
|
|
:: provenance information to go with a sock
|
|
|
|
+$ prot (tree (list peon))
|
|
|
|
::
|
|
|
|
:: single-site provenance tree (axes only, no callsites)
|
|
|
|
+$ plop (tree (list @))
|
|
|
|
::
|
|
|
|
:: analysis queue entry
|
|
|
|
+$ todo
|
|
|
|
$: soot=sock
|
|
|
|
form=*
|
|
|
|
calm=(unit [auto=? j=[path @]])
|
|
|
|
==
|
|
|
|
::
|
|
|
|
:: analysis memoization entry
|
2024-06-06 23:17:17 +03:00
|
|
|
+$ meme [soot=sock want=cape root=sock have=plop area=(unit spot)]
|
2024-05-22 00:03:37 +03:00
|
|
|
::
|
|
|
|
:: loop-local analysis memoization entry
|
2024-06-12 07:18:45 +03:00
|
|
|
:: XX skip meal, remove [soot] and [want]
|
|
|
|
+$ meal [meme site=@hail less=naan seat=(unit spot) loom=(list [c=@hail t=@hail s=sock n=noon])]
|
2024-04-21 15:16:57 +03:00
|
|
|
--
|