Amb: Difference between revisions

436 bytes added ,  10 months ago
Insitux implementation
m (Added language identifier.)
(Insitux implementation)
Line 1,989:
return s
end</syntaxhighlight>
 
=={{header|Insitux}}==
<syntaxhighlight lang="insitux">(function amb
(let [op res aargs] ((juxt 0 1 (skip 2)) args))
(sieve (.. for #(when (= res (.. op args)) args) aargs)))
(var safe= #(.. = (append (0 args) args)))
(amb #(.. and (-> (map (juxt 0 -1) args) flatten (skip 1) (partition 2) (map (.. safe=)))) true ["the" "that" "a"] ["frog" "elephant" "thing"] ["walked" "treaded" "grows"] ["slowly" "quickly"])</syntaxhighlight>
 
=={{header|J}}==
Line 2,023 ⟶ 2,030:
│that│thing│grows│slowly│
└────┴─────┴─────┴──────┘</syntaxhighlight>
 
 
=={{header|Java}}==
5

edits