packages feed

egison-5.0.0: sample/bipartite-graph.egi

--
-- This file has been auto-generated by egison-translator.
--

def bipartiteGraph {a, b, c, d} (a: Matcher b) (c: Matcher d) : Matcher [Edge b d] := multiset (edge a c)

def edge {a, b, c, d} (a: Matcher b) (c: Matcher d) : Matcher (Edge b d) :=
  algebraicDataMatcher
    | edge a c

def bipartiteGraphData : [Edge Integer String] :=
  [ Edge 1 "a"
  , Edge 1 "a"
  , Edge 1 "a"
  , Edge 1 "a"
  , Edge 1 "b"
  , Edge 1 "c"
  , Edge 2 "a"
  , Edge 2 "a"
  , Edge 2 "a"
  , Edge 2 "a"
  , Edge 2 "a"
  , Edge 3 "c"
  , Edge 4 "a"
  , Edge 5 "a"
  , Edge 5 "b"
  , Edge 5 "c"
  , Edge 6 "c"
  , Edge 6 "c"
  , Edge 6 "c" ]

matchAll bipartiteGraphData as bipartiteGraph integer string with
  | edge #1 $str :: _ -> str

uniqueAs
  integer
  (matchAll bipartiteGraphData as bipartiteGraph integer string with
    | edge $n $str :: edge #n #str :: !(edge #n !#str :: _) -> n)

uniqueAs
  integer
  (matchAll bipartiteGraphData as bipartiteGraph integer string with
    | edge $n $str :: edge #n #str :: !(edge #n !#str :: _) -> n)

uniqueAs
  integer
  (matchAll bipartiteGraphData as bipartiteGraph integer string with
    | edge $n #"a" :: _ -> n)

uniqueAs
  integer
  (matchAll bipartiteGraphData as bipartiteGraph integer string with
    | edge $n #"a" :: edge #n #"c" :: _ -> n)

uniqueAs
  integer
  (matchAll bipartiteGraphData as bipartiteGraph integer string with
    | edge $n2 $str2 :: !(edge #n2 #str2 :: _) -> n2)