RosettaCodeData/Task/Amb/Bracmat/amb.bracmat
2015-02-20 09:02:09 -05:00

23 lines
510 B
Text

( ( Amb
= first last list words word solution
. !arg:(?first.?list)
& ( !list:
| !list:(.?words) ?list
& !words
: ?
%( @(?word:!first ? @?last)
& Amb$(!last.!list):?solution
& !word !solution:?solution
)
?
& !solution
)
)
& Amb
$ (
. (.the that a)
(.frog elephant thing)
(.walked treaded grows)
(.slowly quickly)
)
)