-- FILE: ratDiv.mod -- COMMENT: examples of subsorts and err sorts show RAT select RAT describe all sorts -- ... -- NzNat, NzNat < NzInt Nat -- Nat, Zero NzNat < Nat < Int -- Zero, Zero < Nat -- Int, NzInt Nat < Int < Rat -- NzInt, NzNat < NzInt < NzRat Int -- Rat, NzRat Int < Rat -- NzRat, NzInt < NzRat < Rat -- -- ?Rat -- | -- Rat -- / \ -- NzRat Int -- | / \ -- #0 #0=NzInt Nat -- | / \ -- #1 Zero #1=NzNat -- opening RAT open RAT -- check arity, co-arity, -- and attribute of the operation _/_ -- by opening modules -- you can see the precedence of a operator show op _/_ -- test for _/_ -- erro supper sort parse 2 / 0 . parse 4 / 2 . parse 4/2 . reduce 4 / 2 . parse 6 / 4 . reduce 6 / 4 . parse 3 / 4 . parse 3/4 . reduce 3 / 4 . -- dynamic type checking parse (3 / 2) + (1 / 2) . reduce (3 / 2) + (1 / 2) . reduce ((3 / 2) + (1 / 2)) :is Nat . parse 2 / ((3 / 2) + (1 / 2)) . reduce 2 / ((3 / 2) + (1 / 2)) . reduce (2 / ((3 / 2) + (1 / 2))) :is Nat . close