==========================================
reduce in TEST : metaApply(m, 'a.Foo, 'k, none, 0) .
rewrites: 3
result ResultTriple: {'b.Foo, 'Foo, (none).Substitution}
==========================================
reduce in TEST : metaApply(m, 'a.Foo, 'k, none, 1) .
rewrites: 2
result ResultTriple?: (failure).ResultTriple?
==========================================
reduce in TEST : metaApply(m, 'a.Foo, 'k, none, unbounded) .
rewrites: 1
result [ResultTriple?]: metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  op 'a : nil -> 'Foo [none] .
  op 'b : nil -> 'Foo [none] .
  none
  none
  rl 'a.Foo => 'b.Foo [label('k)] .
endm, 'a.Foo, 'k, none, unbounded)
==========================================
reduce in TEST : metaApply(m, 'a.Foo, 'k, none, 10000000000000000000000000000)
    .
rewrites: 2
result ResultTriple?: (failure).ResultTriple?
==========================================
reduce in TEST2 : metaApply(m, 'f['a.Foo, 'b.Foo], 'k, none, 0) .
rewrites: 3
result ResultTriple: {'a.Foo, 'Foo, 
  'X:Foo <- 'a.Foo ; 
  'Y:Foo <- 'b.Foo}
==========================================
reduce in TEST2 : metaApply(m, 'f['a.Foo, 'b.Foo], 'k, none, 1) .
rewrites: 3
result ResultTriple: {'b.Foo, 'Foo, 
  'X:Foo <- 'b.Foo ; 
  'Y:Foo <- 'a.Foo}
==========================================
reduce in TEST2 : metaApply(m, 'f['a.Foo, 'b.Foo], 'k, none, 2) .
rewrites: 2
result ResultTriple?: (failure).ResultTriple?
==========================================
reduce in TEST2 : metaApply(m, 'f['a.Foo, 'b.Foo], 'k, none,
    10000000000000000000000000000) .
rewrites: 2
result ResultTriple?: (failure).ResultTriple?
==========================================
reduce in TEST3 : metaApply(m, 'f['a.Foo, 'b.Foo], 'k, 
  'Y:Foo <- 'b.Foo, 0) .
rewrites: 3
result ResultTriple: {'a.Foo, 'Foo, 
  'X:Foo <- 'a.Foo ; 
  'Y:Foo <- 'b.Foo}
==========================================
reduce in TEST3 : metaApply(m, 'f['a.Foo, 'b.Foo], 'k, 
  'Y:Foo <- 'b.Foo, 1) .
rewrites: 2
result ResultTriple?: (failure).ResultTriple?
==========================================
reduce in TEST3 : metaApply(m, 'f['b.Foo, 'b.Foo], 'k, 
  'X:Foo <- 'b.Foo, 0) .
rewrites: 3
result ResultTriple: {'b.Foo, 'Foo, 
  'X:Foo <- 'b.Foo ; 
  'Y:Foo <- 'b.Foo}
==========================================
reduce in TEST3 : metaApply(m, 'f['b.Foo, 'b.Foo], 'k, 
  'X:Foo <- 'b.Foo, 1) .
rewrites: 2
result ResultTriple?: (failure).ResultTriple?
==========================================
reduce in TEST3 : metaApply(m, 'f['b.Foo, 'b.Foo], 'k, 
  'Z:Foo <- 'b.Foo, 0) .
rewrites: 3
result ResultTriple: {'b.Foo, 'Foo, 
  'X:Foo <- 'b.Foo ; 
  'Y:Foo <- 'b.Foo}
==========================================
reduce in TEST3 : metaApply(m, 'f['b.Foo, 'b.Foo], 'k, 
  'Z:Foo <- 'b.Foo, 1) .
rewrites: 2
result ResultTriple?: (failure).ResultTriple?
==========================================
reduce in TEST4 : metaApply(m, 'f['b.Foo, 'b.Foo], 'k, 
  'Z:Foo <- 'b.Foo, 0) .
rewrites: 3
result ResultTriple: {'f['a.Foo, 'b.Foo], 'Foo, 
  'X:Foo <- 'f['a.Foo, 'b.Foo] ; 
  'Y:Foo <- 'b.Foo}
==========================================
reduce in TEST4 : metaApply(m, 'f['b.Foo, 'b.Foo], 'k, 
  'Z:Foo <- 'b.Foo, 1) .
rewrites: 2
result ResultTriple?: (failure).ResultTriple?
==========================================
reduce in META-LEVEL : metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  (((op 'f : 'Foo 'Foo -> 'Foo [assoc comm] .
  op 'g : 'Foo 'Foo -> 'Foo [assoc comm] .)
  op 'c : nil -> 'Foo [none] .)
  op 'b : nil -> 'Foo [none] .)
  op 'a : nil -> 'Foo [none] .
  none
  none
  crl 'f['X:Foo, 'Y:Foo] => 'Z:Foo if 'Q:Foo := 'g['X:Foo, 'Y:Foo] /\ 'g[
    'Z:Foo, 'A:Foo] := 'Q:Foo [label('k)] .
endm, 'f['a.Foo, 'b.Foo, 'c.Foo], 'k, 
  'A:Foo <- 'b.Foo, 0) .
rewrites: 2
result ResultTriple: {'f['a.Foo, 'c.Foo], 'Foo, 
  'A:Foo <- 'b.Foo ; 
  'Q:Foo <- 'g['b.Foo, 'f['a.Foo, 'c.Foo]] ; 
  'X:Foo <- 'b.Foo ; 
  'Y:Foo <- 'f['a.Foo, 'c.Foo] ; 
  'Z:Foo <- 'f['a.Foo, 'c.Foo]}
==========================================
reduce in META-LEVEL : metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  (((op 'f : 'Foo 'Foo -> 'Foo [assoc comm] .
  op 'g : 'Foo 'Foo -> 'Foo [assoc comm] .)
  op 'c : nil -> 'Foo [none] .)
  op 'b : nil -> 'Foo [none] .)
  op 'a : nil -> 'Foo [none] .
  none
  none
  crl 'f['X:Foo, 'Y:Foo] => 'Z:Foo if 'Q:Foo := 'g['X:Foo, 'Y:Foo] /\ 'g[
    'Z:Foo, 'A:Foo] := 'Q:Foo [label('k)] .
endm, 'f['a.Foo, 'b.Foo, 'c.Foo], 'k, 
  'A:Foo <- 'b.Foo, 1) .
rewrites: 2
result ResultTriple: {'f['a.Foo, 'c.Foo], 'Foo, 
  'A:Foo <- 'b.Foo ; 
  'Q:Foo <- 'g['b.Foo, 'f['a.Foo, 'c.Foo]] ; 
  'X:Foo <- 'f['a.Foo, 'c.Foo] ; 
  'Y:Foo <- 'b.Foo ; 
  'Z:Foo <- 'f['a.Foo, 'c.Foo]}
==========================================
reduce in META-LEVEL : metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  (((op 'f : 'Foo 'Foo -> 'Foo [assoc comm] .
  op 'g : 'Foo 'Foo -> 'Foo [assoc comm] .)
  op 'c : nil -> 'Foo [none] .)
  op 'b : nil -> 'Foo [none] .)
  op 'a : nil -> 'Foo [none] .
  none
  none
  crl 'f['X:Foo, 'Y:Foo] => 'Z:Foo if 'Q:Foo := 'g['X:Foo, 'Y:Foo] /\ 'g[
    'Z:Foo, 'A:Foo] := 'Q:Foo [label('k)] .
endm, 'f['a.Foo, 'b.Foo, 'c.Foo], 'k, 
  'A:Foo <- 'b.Foo, 2) .
rewrites: 1
result ResultTriple?: (failure).ResultTriple?
==========================================
reduce in META-LEVEL : metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  (((op 'f : 'Foo 'Foo -> 'Foo [assoc comm] .
  op 'g : 'Foo 'Foo -> 'Foo [assoc comm] .)
  op 'c : nil -> 'Foo [none] .)
  op 'b : nil -> 'Foo [none] .)
  op 'a : nil -> 'Foo [none] .
  none
  none
  rl 'f['X:Foo, 'Y:Foo] => 'X:Foo [label('k)] .
endm, 'f['a.Foo, 'b.Foo, 'c.Foo], 'k, none, 0) .
rewrites: 2
result ResultTriple: {'a.Foo, 'Foo, 
  'X:Foo <- 'a.Foo ; 
  'Y:Foo <- 'f['b.Foo, 'c.Foo]}
==========================================
reduce in META-LEVEL : metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  (((op 'f : 'Foo 'Foo -> 'Foo [assoc comm] .
  op 'g : 'Foo 'Foo -> 'Foo [assoc comm] .)
  op 'c : nil -> 'Foo [none] .)
  op 'b : nil -> 'Foo [none] .)
  op 'a : nil -> 'Foo [none] .
  none
  none
  rl 'f['X:Foo, 'Y:Foo] => 'X:Foo [label('k)] .
endm, 'f['a.Foo, 'b.Foo, 'c.Foo], 'k, none, 1) .
rewrites: 2
result ResultTriple: {'b.Foo, 'Foo, 
  'X:Foo <- 'b.Foo ; 
  'Y:Foo <- 'f['a.Foo, 'c.Foo]}
==========================================
reduce in META-LEVEL : metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  (((op 'f : 'Foo 'Foo -> 'Foo [assoc comm] .
  op 'g : 'Foo 'Foo -> 'Foo [assoc comm] .)
  op 'c : nil -> 'Foo [none] .)
  op 'b : nil -> 'Foo [none] .)
  op 'a : nil -> 'Foo [none] .
  none
  none
  rl 'f['X:Foo, 'Y:Foo] => 'X:Foo [label('k)] .
endm, 'f['a.Foo, 'b.Foo, 'c.Foo], 'k, none, 2) .
rewrites: 2
result ResultTriple: {'c.Foo, 'Foo, 
  'X:Foo <- 'c.Foo ; 
  'Y:Foo <- 'f['a.Foo, 'b.Foo]}
==========================================
reduce in META-LEVEL : metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  (((op 'f : 'Foo 'Foo -> 'Foo [assoc comm] .
  op 'g : 'Foo 'Foo -> 'Foo [assoc comm] .)
  op 'c : nil -> 'Foo [none] .)
  op 'b : nil -> 'Foo [none] .)
  op 'a : nil -> 'Foo [none] .
  none
  none
  rl 'f['X:Foo, 'Y:Foo] => 'X:Foo [label('k)] .
endm, 'f['a.Foo, 'b.Foo, 'c.Foo], 'k, none, 3) .
rewrites: 2
result ResultTriple: {'f['a.Foo, 'b.Foo], 'Foo, 
  'X:Foo <- 'f['a.Foo, 'b.Foo] ; 
  'Y:Foo <- 'c.Foo}
==========================================
reduce in META-LEVEL : metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  (((op 'f : 'Foo 'Foo -> 'Foo [assoc comm] .
  op 'g : 'Foo 'Foo -> 'Foo [assoc comm] .)
  op 'c : nil -> 'Foo [none] .)
  op 'b : nil -> 'Foo [none] .)
  op 'a : nil -> 'Foo [none] .
  none
  none
  rl 'f['X:Foo, 'Y:Foo] => 'X:Foo [label('k)] .
endm, 'f['a.Foo, 'b.Foo, 'c.Foo], 'k, none, 4) .
rewrites: 2
result ResultTriple: {'f['a.Foo, 'c.Foo], 'Foo, 
  'X:Foo <- 'f['a.Foo, 'c.Foo] ; 
  'Y:Foo <- 'b.Foo}
==========================================
reduce in META-LEVEL : metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  (((op 'f : 'Foo 'Foo -> 'Foo [assoc comm] .
  op 'g : 'Foo 'Foo -> 'Foo [assoc comm] .)
  op 'c : nil -> 'Foo [none] .)
  op 'b : nil -> 'Foo [none] .)
  op 'a : nil -> 'Foo [none] .
  none
  none
  rl 'f['X:Foo, 'Y:Foo] => 'X:Foo [label('k)] .
endm, 'f['a.Foo, 'b.Foo, 'c.Foo], 'k, none, 5) .
rewrites: 2
result ResultTriple: {'f['b.Foo, 'c.Foo], 'Foo, 
  'X:Foo <- 'f['b.Foo, 'c.Foo] ; 
  'Y:Foo <- 'a.Foo}
==========================================
reduce in META-LEVEL : metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  (((op 'f : 'Foo 'Foo -> 'Foo [assoc comm] .
  op 'g : 'Foo 'Foo -> 'Foo [assoc comm] .)
  op 'c : nil -> 'Foo [none] .)
  op 'b : nil -> 'Foo [none] .)
  op 'a : nil -> 'Foo [none] .
  none
  none
  rl 'f['X:Foo, 'Y:Foo] => 'X:Foo [label('k)] .
endm, 'f['a.Foo, 'b.Foo, 'c.Foo], 'k, none, 6) .
rewrites: 1
result ResultTriple?: (failure).ResultTriple?
==========================================
reduce in META-LEVEL : metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  (((op 'f : 'Foo 'Foo -> 'Foo [assoc comm] .
  op 'g : 'Foo 'Foo -> 'Foo [assoc comm] .)
  op 'c : nil -> 'Foo [none] .)
  op 'b : nil -> 'Foo [none] .)
  op 'a : nil -> 'Foo [none] .
  none
  none
  rl 'a.Foo => 'c.Foo [label('k)] .
  rl 'f['X:Foo, 'Y:Foo] => 'X:Foo [label('k)] .
endm, 'f['a.Foo, 'b.Foo], 'k, none, 0) .
rewrites: 2
result ResultTriple: {'a.Foo, 'Foo, 
  'X:Foo <- 'a.Foo ; 
  'Y:Foo <- 'b.Foo}
==========================================
reduce in META-LEVEL : metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  (((op 'f : 'Foo 'Foo -> 'Foo [assoc comm] .
  op 'g : 'Foo 'Foo -> 'Foo [assoc comm] .)
  op 'c : nil -> 'Foo [none] .)
  op 'b : nil -> 'Foo [none] .)
  op 'a : nil -> 'Foo [none] .
  none
  none
  rl 'a.Foo => 'c.Foo [label('k)] .
  rl 'f['X:Foo, 'Y:Foo] => 'X:Foo [label('k)] .
endm, 'f['a.Foo, 'b.Foo], 'k, none, 1) .
rewrites: 2
result ResultTriple: {'b.Foo, 'Foo, 
  'X:Foo <- 'b.Foo ; 
  'Y:Foo <- 'a.Foo}
==========================================
reduce in META-LEVEL : metaApply(mod 'FOO is
  protecting 'BOOL .
  sorts 'Bar ; 'Foo .
  subsort 'Bar < 'Foo .
  (((op 'f : 'Foo 'Foo -> 'Foo [assoc comm] .
  op 'g : 'Foo 'Foo -> 'Foo [assoc comm] .)
  op 'c : nil -> 'Foo [none] .)
  op 'b : nil -> 'Foo [none] .)
  op 'a : nil -> 'Foo [none] .
  none
  none
  rl 'a.Foo => 'c.Foo [label('k)] .
  rl 'f['X:Foo, 'Y:Foo] => 'X:Foo [label('k)] .
endm, 'f['a.Foo, 'b.Foo], 'k, none, 2) .
rewrites: 1
result ResultTriple?: (failure).ResultTriple?
Bye.
