adds spot-hint printing and minor fixes

This commit is contained in:
Joe Bryan 2024-05-02 18:51:29 -04:00
parent d62f9b69cb
commit b07a04600e

View File

@ -8,12 +8,15 @@
=| memo=(jar * meme) =| memo=(jar * meme)
:: cole is the cold state :: cole is the cold state
=| cole=cool =| cole=cool
~% %skan ..ride ~
|% |%
++ thus . ++ thus .
:: ::
:: Analyze a subject/formula pair :: Analyze a subject/formula pair
++ rout ++ rout
~/ %rout
|= [soot=* form=*] |= [soot=* form=*]
=/ place-gen *spot
=/ colt cole =/ colt cole
=/ queu=(list todo) [[& soot] form ~]~ =/ queu=(list todo) [[& soot] form ~]~
=| back=(list todo) =| back=(list todo)
@ -83,6 +86,7 @@
wait=(jar @hail @hail) :: sites to finalize wait=(jar @hail @hail) :: sites to finalize
== ==
=^ entr gen [rail.gen gen(rail .+(rail.gen))] :: initial callsite =^ entr gen [rail.gen gen(rail .+(rail.gen))] :: initial callsite
=. wait.gen (~(add ja wait.gen) entr entr)
=^ more gen =^ more gen
=/ less=naan [~ soot.i.queu] :: subject =/ less=naan [~ soot.i.queu] :: subject
=* form form.i.queu :: formula =* form form.i.queu :: formula
@ -92,6 +96,8 @@
:: wrapper for callsite formulas :: wrapper for callsite formulas
|- ^- [naan _gen] |- ^- [naan _gen]
=* arm-loop $ =* arm-loop $
=/ place-arm place-gen
~& [">" place-arm]
=. prot.less (~(tag qui prot.less) [entr 1]) =. prot.less (~(tag qui prot.less) [entr 1])
:: check if memoized :: check if memoized
=/ germ (~(get ja memo.gen) form) =/ germ (~(get ja memo.gen) form)
@ -108,7 +114,8 @@
%- (~(uno by want.gen) pant) %- (~(uno by want.gen) pant)
|= [@hail a=cape b=cape] |= [@hail a=cape b=cape]
~(cut ca (~(uni ca a) b)) ~(cut ca (~(uni ca a) b))
=. call.gen (~(put by call.gen) entr [less more form ~ dire.gen]) =. call.gen (~(put by call.gen) entr [less more form ~ &])
~& ["<" place-arm]
[more gen] [more gen]
=^ [load=nomm more=naan] gen =^ [load=nomm more=naan] gen
:: structurally recur over formula :: structurally recur over formula
@ -138,6 +145,11 @@
=^ [fond=nomm fork=naan] gen $(form f.form) =^ [fond=nomm fork=naan] gen $(form f.form)
?: =(& cape.sock.fork) ?: =(& cape.sock.fork)
:: direct call :: direct call
=/ foo
=/ bat (~(pull so sock.sand) 2)
?. &(?=(^ bat) =(& cape.u.bat) ?=(^ data.u.bat)) ~
(~(get ju batt.cole) data.u.bat)
~? ?=(^ foo) foo
=. kids.gen (~(put ju kids.gen) entr roil) =. kids.gen (~(put ju kids.gen) entr roil)
:: record need :: record need
=/ pant (~(due qui prot.fork) &) :: callsite provenance by needs =/ pant (~(due qui prot.fork) &) :: callsite provenance by needs
@ -243,6 +255,17 @@
[%11 [h=@ v=*] f=*] [%11 [h=@ v=*] f=*]
=^ hare gen [hare.gen gen(hare .+(hare.gen))] =^ hare gen [hare.gen gen(hare .+(hare.gen))]
=^ [vice=nomm mild=naan] gen $(form v.form) =^ [vice=nomm mild=naan] gen $(form v.form)
=? place-gen =(%spot h.form)
;;(spot data.sock.mild) :: XX soft
:: ~? =(%fast h.form)
:: :- %fast-pre
:: =* clue data.sock.mild
:: ?. ?& =(& cape.sock.mild)
:: ?=([name=$@(@tas [@tas @]) pare=* *] clue)
:: ==
:: ~
:: ?@ name.clue name.clue
:: (crip "{(trip -.name.clue)}.{(trip (scot %ud +.name.clue))}")
=^ [then=nomm bite=naan] gen $(form f.form) =^ [then=nomm bite=naan] gen $(form f.form)
:: save body formula :: save body formula
=. hint.gen (~(put ju hint.gen) entr hare) =. hint.gen (~(put ju hint.gen) entr hare)
@ -304,8 +327,19 @@
=/ folk (~(darn so u.bake) a.pare.clue i.coal) =/ folk (~(darn so u.bake) a.pare.clue i.coal)
?> ?=(^ folk) ?> ?=(^ folk)
u.folk u.folk
~> %meme ~& ?: ?!((~(has by core.cole.gen) nape))
~? ?!((~(has by core.cole.gen) nape)) [%cold-into nape] [%cold-into nape]
[%cold-reap nape]
=> ?: =(*spot place-gen) .
=/ tan
:+ %rose [":" ~ ~]
:~ (smyt p.place-gen)
=* l p.q.place-gen
=* r q.q.place-gen
=/ ud |=(a=@u (scow %ud a))
leaf+"<[{(ud p.l)} {(ud q.l)}].[{(ud p.r)} {(ud q.r)}]>"
==
~>(%slog.[0 tan] +)
=. core.cole.gen (~(put ju core.cole.gen) nape naut) =. core.cole.gen (~(put ju core.cole.gen) nape naut)
=. batt.cole.gen (~(put ju batt.cole.gen) data.batt nape) =. batt.cole.gen (~(put ju batt.cole.gen) data.batt nape)
fail fail
@ -325,7 +359,9 @@
=. call.gen (~(put by call.gen) entr [less more form `load dire.gen]) =. call.gen (~(put by call.gen) entr [less more form `load dire.gen])
=/ wise (~(get ja wait.gen) entr) =/ wise (~(get ja wait.gen) entr)
=. wait.gen (~(del by wait.gen) entr) =. wait.gen (~(del by wait.gen) entr)
?: =(~ wise) [more gen] :: no finalizing here ?: =(~ wise)
~& ["<" place-arm]
[more gen] :: no finalizing here
?> =(entr (rear wise)) :: current callsite should be last item of finalization list ?> =(entr (rear wise)) :: current callsite should be last item of finalization list
:: fixed-point loops to propagate their needs and check that they are really loops :: fixed-point loops to propagate their needs and check that they are really loops
=/ sap gen :: for reset =/ sap gen :: for reset
@ -413,15 +449,16 @@
=. kids.gen (~(del by kids.gen) site) =. kids.gen (~(del by kids.gen) site)
=. hint.gen (~(del by hint.gen) site) =. hint.gen (~(del by hint.gen) site)
=/ loan (~(get ja moan.gen) form) =/ loan (~(get ja moan.gen) form)
=? moan.gen (lien loan |=([soot=sock norm=food] =(soot ^soot))) =? moan.gen (levy loan |=([soot=sock norm=food] !=(soot ^soot)))
(~(add ja moan.gen) form [soot u.load ices lope fizz]) (~(add ja moan.gen) form [soot u.load ices lope fizz])
gen gen
~& ["<" place-arm]
[more gen] [more gen]
:: ::
=. moan moan.gen =. moan moan.gen
=. memo memo.gen =. memo memo.gen
=. cole cole.gen =. cole cole.gen
=/ want (~(got by want.gen) entr) =/ want (fall (~(get by want.gen) entr) |)
=/ boot =/ boot
:- :-
=> [s=soot.i.queu w=want so=so ca=ca] => [s=soot.i.queu w=want so=so ca=ca]