Ready to test seminouns.

This commit is contained in:
C. Guy Yarvin 2018-02-21 21:27:35 -08:00
parent e2b5379f3d
commit 57eff328d3

View File

@ -1,4 +1,4 @@
:: :: :: ::
:::: /sys/hoon :: :::: /sys/hoon ::
:: :: :: ::
=< ride =< ride
@ -5874,41 +5874,42 @@
:: $json :: json schema? :: $json :: json schema?
:: ::
== ==
:: partial execution ::::
:: +block: abstract identity of resource awaited
:: ::
++ block ++ block
:: abstract identity of resource awaited
::
path path
::::
:: +result: internal interpreter result
:: ::
++ result ++ result
:: internal interpreter result
::
$@(~ seminoun) $@(~ seminoun)
::::
:: +thunk: fragment constructor
:: ::
++ thunk ++ thunk
:: typeless trap, |.(*) $-(@ud (unit noun))
:: ::::
* :: +seminoun:
:: ::
++ seminoun ++ seminoun
:: partial noun; blocked subtrees are ~ :: partial noun; blocked subtrees are ~
:: ::
$~ [[%full ~] ~] $~ [[%full ~] ~]
{mask/stencil data/noun} {mask/stencil data/noun}
::::
:: +stencil: noun knowledge map
:: ::
++ stencil ++ stencil
:: noun knowledge map $% :: %half: noun has partial block substructure
::
$% :: noun has partial block substructure
:: ::
{$half left/stencil rite/stencil} [%half left=stencil rite=stencil]
:: noun is either fully complete, or fully blocked :: %full: noun is either fully complete, or fully blocked
:: ::
{$full blocks/(set block)} [%full blocks=(set block)]
:: noun can be built from a trap :: %lazy: noun can be generated from virtual subtree
:: ::
{$lazy trap/thunk} [%lazy fragment/axis resolve/thunk]
== ==
:: ::
++ output ++ output
@ -6243,7 +6244,16 @@
$full bus $full bus
$lazy :: execute thunk $lazy :: execute thunk
:: ::
[full/~ .*(trap.mask.bus -.trap.mask.bus)] =+ (resolve.mask.bus fragment.mask.bus)
:: if product is nil
::
?~ -
:: then blocked
::
[[%full [~ ~ ~]] ~]
:: else use value
::
[[%full ~] u.-]
$half :: recursive descent $half :: recursive descent
:: ::
%+ combine %+ combine
@ -6264,18 +6274,16 @@
:: 1 is the root :: 1 is the root
:: ::
?: =(1 axe) bus ?: =(1 axe) bus
:: now: 2 or 3, top of axis :: now: top of axis (2 or 3)
:: lat: rest of axis :: lat: rest of axis
:: ::
=+ [now=(cap axe) lat=(mas axe)] =+ [now=(cap axe) lat=(mas axe)]
?- -.mask.bus ?- -.mask.bus
:: subject is lazy %lazy :: propagate laziness
::
bus(fragment.mask (peg fragment.mask.bus axe))
:: ::
$lazy $(bus (complete bus)) %full :: if fully blocked, produce self
::
:: subject is fully blocked or complete
::
$full :: if fully blocked, produce self
:: ::
?^ blocks.mask.bus bus ?^ blocks.mask.bus bus
:: descending into atom, stop :: descending into atom, stop
@ -6284,9 +6292,8 @@
:: descend into complete cell :: descend into complete cell
:: ::
$(axe lat, bus [full/~ ?:(=(2 now) -.data.bus +.data.bus)]) $(axe lat, bus [full/~ ?:(=(2 now) -.data.bus +.data.bus)])
:: subject is partly blocked
:: ::
$half :: descend into partial cell %half :: descend into partial cell
:: ::
%= $ %= $
axe lat axe lat
@ -8987,33 +8994,74 @@
$elm q:(mint(vet |) %noun p.fut) $elm q:(mint(vet |) %noun p.fut)
== ==
:: ::
++ hoof ++ laze
:: lazy formula generator for cores being compiled :: produce lazy core generator for static execution
:: ::
|= dom/(map @ tomb) |= dom/(map @ tomb)
^- seminoun:musk
~+ ~+
|- ^- seminoun:musk ^- seminoun
?: ?=(~ dom) :: tal: map from battery axis to foot
*seminoun:musk ::
=/ dov =; tal/(map @ud foot)
=/ dab/(map term (pair what foot)) q.q.n.dom :: produce lazy battery
|- ^- seminoun:musk ::
?: ?=(~ dab) :_ ~
*seminoun:musk :+ %lazy 1
=/ vad/seminoun:musk =+(hemp [[%lazy -(+< q.q.n.dab)] ~]) |= axe/@ud
?- dab ^- (unit noun)
{* ~ ~} vad %+ bind (~(get by tal) axe)
{* ~ *} (combine:musk vad $(dab r.dab)) |= fut/foot
{* * ~} (combine:musk vad $(dab l.dab)) (hemp(sut (core sut %gold sut *chap [[%lazy 1 ..^$] ~] dom)) fut)
{* * *} :(combine:musk vad $(dab l.dab) $(dab r.dab)) ::
== %- ~(gas by *(map @ud foot))
?- dom =| yeb/(list (pair @ud foot))
{* ~ ~} dov =+ axe=1
{* ~ *} (combine:musk dov $(dom r.dom)) |^ ?- dom
{* * ~} (combine:musk dov $(dom l.dom)) ~ yeb
{* * *} :(combine:musk dov $(dom l.dom) $(dom r.dom)) [* ~ ~] (chapter q.q.n.dom)
== [* * ~] %= $
dom l.dom
axe (peg axe 3)
yeb (chapter(axe (peg axe 2)) q.q.n.dom)
==
[* ~ *] %= $
dom r.dom
axe (peg axe 3)
yeb (chapter(axe (peg axe 2)) q.q.n.dom)
==
[* * *] %= $
dom r.dom
axe (peg axe 7)
yeb %= $
dom l.dom
axe (peg axe 6)
yeb (chapter(axe (peg axe 2)) q.q.n.dom)
== == ==
++ chapter
|= dab/(map term (pair what foot))
^+ yeb
?- dab
~ yeb
[* ~ ~] [[axe q.q.n.dab] yeb]
[* * ~] %= $
dab l.dab
axe (peg axe 3)
yeb [[(peg axe 2) q.q.n.dab] yeb]
==
[* ~ *] %= $
dab r.dab
axe (peg axe 3)
yeb [[(peg axe 2) q.q.n.dab] yeb]
==
[* * *] %= $
dab r.dab
axe (peg axe 7)
yeb %= $
dab l.dab
axe (peg axe 6)
yeb [[(peg axe 2) q.q.n.dab] yeb]
== == ==
--
:: ::
++ lose ++ lose
~/ %lose ~/ %lose
@ -9078,6 +9126,7 @@
:: ::
|= [mel/vair wad/chap dom/(map @ tomb)] |= [mel/vair wad/chap dom/(map @ tomb)]
^- (pair type nock) ^- (pair type nock)
=+ foo=(laze dom)
=- :_ [%1 dez] =- :_ [%1 dez]
(core sut mel sut wad [[%full ~] dez] dom) (core sut mel sut wad [[%full ~] dez] dom)
^= dez ^= dez