7 lines
433 B
Text
7 lines
433 B
Text
; We don't need 'amb' in the code since pattern-matching of Egison automatically do backtracking.
|
|
(match-all {{"the" "that" "a"} {"frog" "elephant" "thing"} {"walked" "treaded" "grows"} {"slowly" "quickly"}} (list (multiset string))
|
|
[<cons <cons (& <snoc $c_1 _> $w_1) _>
|
|
(loop $i [2 $n]
|
|
<cons <cons (& <cons ,c_(- i 1) <snoc $c_i _>> $w_i) _> ...>
|
|
<nil>)>
|
|
(map (lambda [$i] w_i) (between 1 n))])
|