Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Amb/PicoLisp/amb.l
Normal file
18
Task/Amb/PicoLisp/amb.l
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
(be amb (@E @Lst)
|
||||
(lst @E @Lst) )
|
||||
|
||||
(be joins (@Left @Right)
|
||||
(^ @T (last (chop (-> @Left))))
|
||||
(^ @R (car (chop (-> @Right))))
|
||||
(or
|
||||
((equal @T @R))
|
||||
((amb @ NIL)) ) ) # Explicitly using amb fail as required
|
||||
|
||||
(be ambExample ((@Word1 @Word2 @Word3 @Word4))
|
||||
(amb @Word1 ("the" "that" "a"))
|
||||
(amb @Word2 ("frog" "elephant" "thing"))
|
||||
(amb @Word3 ("walked" "treaded" "grows"))
|
||||
(amb @Word4 ("slowly" "quickly"))
|
||||
(joins @Word1 @Word2)
|
||||
(joins @Word2 @Word3)
|
||||
(joins @Word3 @Word4) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue