packages feed

egison-3.7.13: sample/efficient-backtracking.egi

(match (between 1 n) (multiset integer)
  {[<cons $x <cons ,x _>> "Matched"]
   [_ "Not matched"]})
; Returns "Not matched" in O(n^2).

(match (between 1 n) (multiset integer)
  {[<cons $x <cons ,x <cons ,x _>>> "Matched"]
   [_ "Not matched"]})
; Returns "Not matched" in O(n^2).

(match (between 1 n) (multiset integer)
  {[<cons $x <cons ,x <cons ,x <cons ,x _>>>> "Matched"]
   [_ "Not matched"]})
; Returns "Not matched" in O(n^2).