set show timing off .
set show advisories off .

***
***	Test the metaReduce() descent function.
***

red in META-LEVEL :
metaReduce(
fmod 'FOO is
  nil
  sorts 'Foo .
  none
  op 'a : nil -> 'Foo [none] .
  none
  none
endfm, 'a.Foo) .

red in META-LEVEL :
metaReduce(
fmod 'FOO is
  nil
  sorts 'Foo .
  none
  op 'a : nil -> 'Foo [none] .
  op 'b : nil -> 'Foo [none] .
  op 'f : 'Foo -> 'Foo [strat(0)] .
  none
  eq 'a.Foo = 'b.Foo [none] .
endfm, 'f['a.Foo]) .

red in META-LEVEL :
metaReduce(
fmod 'FOO is
  nil
  sorts 'Foo .
  none
  op 'a : nil -> 'Foo [none] .
  op 'b : nil -> 'Foo [none] .
  op 'f : 'Foo -> 'Foo [strat(1 0)] .
  none
  eq 'a.Foo = 'b.Foo [none] .
endfm, 'f['a.Foo]) .

select META-LEVEL .

red metaReduce(
fmod 'FOO is
  protecting 'STRING .
  sorts none .
  none
  none
  none
  none
endfm, '"a".String) .

red metaReduce(
fmod 'FOO is
  protecting 'STRING .
  sorts none .
  none
  none
  none
  none
endfm, '"this is a string".String) .

red metaReduce(
fmod 'FOO is
  protecting 'STRING .
  sorts none .
  none
  none
  none
  none
endfm, '"this is\na string".String) .

red metaReduce(
fmod 'FOO is
  protecting 'STRING .
  sorts none .
  none
  none
  none
  none
endfm, '"\n".String) .

red metaReduce(
fmod 'FOO is
  protecting 'FLOAT .
  sorts none .
  none
  none
  none
  none
endfm, 'pi.Float) .

select META-LEVEL .

red metaReduce(
fmod 'FOO is
  protecting 'INT .
  sorts 'Foo .
  none
  op 'a : nil -> 'Foo  [none] .
  none
  none
endfm, '_+_['s_['0.Int], 's_^12['0.Int]]) .
