fmod TEST is
  sorts Bool Zero NzNat Nat Foo{Nat} .
  subsorts Zero NzNat < Nat .
  op if_then_else_fi : Bool Universal Universal -> Universal [poly (2 3 0) prec
    0 gather (& & &) special (
    id-hook BranchSymbol
    term-hook 1 (true)
    term-hook 2 (false))] .
  op _==_ : Universal Universal -> Bool [poly (1 2) prec 51 gather (E E)
    special (
    id-hook EqualitySymbol
    term-hook equalTerm (true)
    term-hook notEqualTerm (false))] .
  op _=/=_ : Universal Universal -> Bool [poly (1 2) prec 51 gather (E E)
    special (
    id-hook EqualitySymbol
    term-hook equalTerm (false)
    term-hook notEqualTerm (true))] .
  op true : -> Bool [ctor special (
    id-hook SystemTrue)] .
  op false : -> Bool [ctor special (
    id-hook SystemFalse)] .
  op _and_ : Bool Bool -> Bool [assoc comm prec 55 gather (e E)] .
  op _or_ : Bool Bool -> Bool [assoc comm prec 59 gather (e E)] .
  op _xor_ : Bool Bool -> Bool [assoc comm prec 57 gather (e E)] .
  op not_ : Bool -> Bool [prec 53 gather (E)] .
  op _implies_ : Bool Bool -> Bool [prec 61 gather (e E)] .
  op 0 : -> Zero [ctor] .
  op s_ : Nat -> NzNat [ctor iter prec 15 gather (E) special (
    id-hook SuccSymbol
    term-hook zeroTerm (0))] .
  op _+_ : NzNat Nat -> NzNat [assoc comm prec 33 gather (e E) special (
    id-hook ACU_NumberOpSymbol (+)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _+_ : Nat Nat -> Nat [assoc comm prec 33 gather (e E) special (
    id-hook ACU_NumberOpSymbol (+)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op sd : Nat Nat -> Nat [comm special (
    id-hook CUI_NumberOpSymbol (sd)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _*_ : NzNat NzNat -> NzNat [assoc comm prec 31 gather (e E) special (
    id-hook ACU_NumberOpSymbol (*)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _*_ : Nat Nat -> Nat [assoc comm prec 31 gather (e E) special (
    id-hook ACU_NumberOpSymbol (*)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _quo_ : Nat NzNat -> Nat [prec 31 gather (E e) special (
    id-hook NumberOpSymbol (quo)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _rem_ : Nat NzNat -> Nat [prec 31 gather (E e) special (
    id-hook NumberOpSymbol (rem)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _^_ : Nat Nat -> Nat [prec 29 gather (E e) special (
    id-hook NumberOpSymbol (^)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _^_ : NzNat Nat -> NzNat [prec 29 gather (E e) special (
    id-hook NumberOpSymbol (^)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op modExp : [Nat] [Nat] [Nat] -> [Nat] [special (
    id-hook NumberOpSymbol (modExp)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op gcd : NzNat Nat -> NzNat [assoc comm special (
    id-hook ACU_NumberOpSymbol (gcd)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op gcd : Nat Nat -> Nat [assoc comm special (
    id-hook ACU_NumberOpSymbol (gcd)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op lcm : NzNat NzNat -> NzNat [assoc comm special (
    id-hook ACU_NumberOpSymbol (lcm)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op lcm : Nat Nat -> Nat [assoc comm special (
    id-hook ACU_NumberOpSymbol (lcm)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op min : NzNat NzNat -> NzNat [assoc comm special (
    id-hook ACU_NumberOpSymbol (min)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op min : Nat Nat -> Nat [assoc comm special (
    id-hook ACU_NumberOpSymbol (min)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op max : NzNat Nat -> NzNat [assoc comm special (
    id-hook ACU_NumberOpSymbol (max)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op max : Nat Nat -> Nat [assoc comm special (
    id-hook ACU_NumberOpSymbol (max)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _xor_ : Nat Nat -> Nat [assoc comm prec 55 gather (e E) special (
    id-hook ACU_NumberOpSymbol (xor)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _&_ : Nat Nat -> Nat [assoc comm prec 53 gather (e E) special (
    id-hook ACU_NumberOpSymbol (&)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _|_ : NzNat Nat -> NzNat [assoc comm prec 57 gather (e E) special (
    id-hook ACU_NumberOpSymbol (|)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _|_ : Nat Nat -> Nat [assoc comm prec 57 gather (e E) special (
    id-hook ACU_NumberOpSymbol (|)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _>>_ : Nat Nat -> Nat [prec 35 gather (E e) special (
    id-hook NumberOpSymbol (>>)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _<<_ : Nat Nat -> Nat [prec 35 gather (E e) special (
    id-hook NumberOpSymbol (<<)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _<_ : Nat Nat -> Bool [prec 37 gather (E E) special (
    id-hook NumberOpSymbol (<)
    op-hook succSymbol (s_ : Nat ~> NzNat)
    term-hook trueTerm (true)
    term-hook falseTerm (false))] .
  op _<=_ : Nat Nat -> Bool [prec 37 gather (E E) special (
    id-hook NumberOpSymbol (<=)
    op-hook succSymbol (s_ : Nat ~> NzNat)
    term-hook trueTerm (true)
    term-hook falseTerm (false))] .
  op _>_ : Nat Nat -> Bool [prec 37 gather (E E) special (
    id-hook NumberOpSymbol (>)
    op-hook succSymbol (s_ : Nat ~> NzNat)
    term-hook trueTerm (true)
    term-hook falseTerm (false))] .
  op _>=_ : Nat Nat -> Bool [prec 37 gather (E E) special (
    id-hook NumberOpSymbol (>=)
    op-hook succSymbol (s_ : Nat ~> NzNat)
    term-hook trueTerm (true)
    term-hook falseTerm (false))] .
  op _divides_ : NzNat Nat -> Bool [prec 51 gather (E E) special (
    id-hook NumberOpSymbol (divides)
    op-hook succSymbol (s_ : Nat ~> NzNat)
    term-hook trueTerm (true)
    term-hook falseTerm (false))] .
  op g : -> Foo{Nat} .
  eq true and A:Bool = A:Bool .
  eq false and A:Bool = false .
  eq A:Bool and A:Bool = A:Bool .
  eq false xor A:Bool = A:Bool .
  eq A:Bool xor A:Bool = false .
  eq A:Bool and (B:Bool xor C:Bool) = A:Bool and B:Bool xor A:Bool and C:Bool .
  eq not A:Bool = true xor A:Bool .
  eq A:Bool or B:Bool = A:Bool and B:Bool xor A:Bool xor B:Bool .
  eq A:Bool implies B:Bool = not (A:Bool xor A:Bool and B:Bool) .
  eq g = g .
endfm
mod TEST is
  sorts Bool Attribute AttributeSet Oid Cid Object Msg Portal Configuration
    Zero NzNat Nat Bar{Nat} .
  subsort Attribute < AttributeSet .
  subsort Bar{Nat} < Cid .
  subsorts Object Msg Portal < Configuration .
  subsorts Zero NzNat < Nat .
  op if_then_else_fi : Bool Universal Universal -> Universal [poly (2 3 0) prec
    0 gather (& & &) special (
    id-hook BranchSymbol
    term-hook 1 (true)
    term-hook 2 (false))] .
  op _==_ : Universal Universal -> Bool [poly (1 2) prec 51 gather (E E)
    special (
    id-hook EqualitySymbol
    term-hook equalTerm (true)
    term-hook notEqualTerm (false))] .
  op _=/=_ : Universal Universal -> Bool [poly (1 2) prec 51 gather (E E)
    special (
    id-hook EqualitySymbol
    term-hook equalTerm (false)
    term-hook notEqualTerm (true))] .
  op true : -> Bool [ctor special (
    id-hook SystemTrue)] .
  op false : -> Bool [ctor special (
    id-hook SystemFalse)] .
  op _and_ : Bool Bool -> Bool [assoc comm prec 55 gather (e E)] .
  op _or_ : Bool Bool -> Bool [assoc comm prec 59 gather (e E)] .
  op _xor_ : Bool Bool -> Bool [assoc comm prec 57 gather (e E)] .
  op not_ : Bool -> Bool [prec 53 gather (E)] .
  op _implies_ : Bool Bool -> Bool [prec 61 gather (e E)] .
  op none : -> AttributeSet [ctor] .
  op _,_ : AttributeSet AttributeSet -> AttributeSet [ctor assoc comm id: none
    prec 41 gather (e E)] .
  op <_:_|_> : Oid Cid AttributeSet -> Object [ctor obj prec 0 gather (& & &)
    special (
    id-hook ObjectConstructorSymbol
    op-hook attributeSetSymbol (_,_ : AttributeSet AttributeSet ~>
    AttributeSet))] .
  op none : -> Configuration [ctor] .
  op __ : Configuration Configuration -> Configuration [ctor assoc comm id:
    none config prec 41 gather (e E)] .
  op <> : -> Portal [ctor portal] .
  op getClass : Object -> Cid .
  op 0 : -> Zero [ctor] .
  op s_ : Nat -> NzNat [ctor iter prec 15 gather (E) special (
    id-hook SuccSymbol
    term-hook zeroTerm (0))] .
  op _+_ : NzNat Nat -> NzNat [assoc comm prec 33 gather (e E) special (
    id-hook ACU_NumberOpSymbol (+)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _+_ : Nat Nat -> Nat [assoc comm prec 33 gather (e E) special (
    id-hook ACU_NumberOpSymbol (+)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op sd : Nat Nat -> Nat [comm special (
    id-hook CUI_NumberOpSymbol (sd)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _*_ : NzNat NzNat -> NzNat [assoc comm prec 31 gather (e E) special (
    id-hook ACU_NumberOpSymbol (*)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _*_ : Nat Nat -> Nat [assoc comm prec 31 gather (e E) special (
    id-hook ACU_NumberOpSymbol (*)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _quo_ : Nat NzNat -> Nat [prec 31 gather (E e) special (
    id-hook NumberOpSymbol (quo)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _rem_ : Nat NzNat -> Nat [prec 31 gather (E e) special (
    id-hook NumberOpSymbol (rem)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _^_ : Nat Nat -> Nat [prec 29 gather (E e) special (
    id-hook NumberOpSymbol (^)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _^_ : NzNat Nat -> NzNat [prec 29 gather (E e) special (
    id-hook NumberOpSymbol (^)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op modExp : [Nat] [Nat] [Nat] -> [Nat] [special (
    id-hook NumberOpSymbol (modExp)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op gcd : NzNat Nat -> NzNat [assoc comm special (
    id-hook ACU_NumberOpSymbol (gcd)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op gcd : Nat Nat -> Nat [assoc comm special (
    id-hook ACU_NumberOpSymbol (gcd)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op lcm : NzNat NzNat -> NzNat [assoc comm special (
    id-hook ACU_NumberOpSymbol (lcm)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op lcm : Nat Nat -> Nat [assoc comm special (
    id-hook ACU_NumberOpSymbol (lcm)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op min : NzNat NzNat -> NzNat [assoc comm special (
    id-hook ACU_NumberOpSymbol (min)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op min : Nat Nat -> Nat [assoc comm special (
    id-hook ACU_NumberOpSymbol (min)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op max : NzNat Nat -> NzNat [assoc comm special (
    id-hook ACU_NumberOpSymbol (max)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op max : Nat Nat -> Nat [assoc comm special (
    id-hook ACU_NumberOpSymbol (max)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _xor_ : Nat Nat -> Nat [assoc comm prec 55 gather (e E) special (
    id-hook ACU_NumberOpSymbol (xor)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _&_ : Nat Nat -> Nat [assoc comm prec 53 gather (e E) special (
    id-hook ACU_NumberOpSymbol (&)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _|_ : NzNat Nat -> NzNat [assoc comm prec 57 gather (e E) special (
    id-hook ACU_NumberOpSymbol (|)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _|_ : Nat Nat -> Nat [assoc comm prec 57 gather (e E) special (
    id-hook ACU_NumberOpSymbol (|)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _>>_ : Nat Nat -> Nat [prec 35 gather (E e) special (
    id-hook NumberOpSymbol (>>)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _<<_ : Nat Nat -> Nat [prec 35 gather (E e) special (
    id-hook NumberOpSymbol (<<)
    op-hook succSymbol (s_ : Nat ~> NzNat))] .
  op _<_ : Nat Nat -> Bool [prec 37 gather (E E) special (
    id-hook NumberOpSymbol (<)
    op-hook succSymbol (s_ : Nat ~> NzNat)
    term-hook trueTerm (true)
    term-hook falseTerm (false))] .
  op _<=_ : Nat Nat -> Bool [prec 37 gather (E E) special (
    id-hook NumberOpSymbol (<=)
    op-hook succSymbol (s_ : Nat ~> NzNat)
    term-hook trueTerm (true)
    term-hook falseTerm (false))] .
  op _>_ : Nat Nat -> Bool [prec 37 gather (E E) special (
    id-hook NumberOpSymbol (>)
    op-hook succSymbol (s_ : Nat ~> NzNat)
    term-hook trueTerm (true)
    term-hook falseTerm (false))] .
  op _>=_ : Nat Nat -> Bool [prec 37 gather (E E) special (
    id-hook NumberOpSymbol (>=)
    op-hook succSymbol (s_ : Nat ~> NzNat)
    term-hook trueTerm (true)
    term-hook falseTerm (false))] .
  op _divides_ : NzNat Nat -> Bool [prec 51 gather (E E) special (
    id-hook NumberOpSymbol (divides)
    op-hook succSymbol (s_ : Nat ~> NzNat)
    term-hook trueTerm (true)
    term-hook falseTerm (false))] .
  op Bar{Nat} : -> Bar{Nat} [ctor] .
  op className : -> Cid .
  eq true and A:Bool = A:Bool .
  eq false and A:Bool = false .
  eq A:Bool and A:Bool = A:Bool .
  eq false xor A:Bool = A:Bool .
  eq A:Bool xor A:Bool = false .
  eq A:Bool and (B:Bool xor C:Bool) = A:Bool and B:Bool xor A:Bool and C:Bool .
  eq not A:Bool = true xor A:Bool .
  eq A:Bool or B:Bool = A:Bool and B:Bool xor A:Bool xor B:Bool .
  eq A:Bool implies B:Bool = not (A:Bool xor A:Bool and B:Bool) .
  eq getClass(< O:Oid : C:Cid | A:AttributeSet >) = C:Cid .
  eq className = Bar{Nat} .
endm
Bye.
