RosettaCodeData/Task/Amb/Bracmat/amb.bracmat

24 lines
510 B
Plaintext

( ( 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)
)
)