

last edited 12 years ago 
1  
Editor:
Time: 2007/11/18 17:57:08 GMT8 

Note: update tests 
changed:  This page was renamed to AnonymousCategories. You can delete this one if no longer needed. Or click 'edit' or Add Comments to make further online tests here. **On Aug 12, 2007 6:35 PM Weiss, Juergen wrote:** I found the old document about type equivalence in Scratchpad. It's: *A New Algebra System, May, 29 th 1984, James H Davenport*. I have only found a paper version. Maybe someone has an online version. It states that: 1. Two named types are only equivalent if the names are the same. 2. Anonymous types are equivalent when stucturally equivalent 3. An anonymous type is never equivalent to a named type. So following 1:: t1 == List Term t2 == List Term x : t1 y : t2 y := x is not supposed to work, ![t1 and t2 should be treated as different types] \begin{spad} )abbrev package TEST test test(): with main:()>Integer == add main() == t1:IntegerNumberSystem == Integer t2:IntegerNumberSystem == Integer x : t1 x := 1$t1 y : t2 y := x \end{spad} There should be a compile error above. \begin{axiom} main() \end{axiom} but following 2:: x : List Term y : List Term y := x is ok, \begin{spad} )abbrev package TEST test2 test2(): with main2:()>Integer == add main2()== x : Integer x := 1 y : Integer y := x \end{spad} \begin{axiom} main2() \end{axiom} also \begin{spad} )abbrev package TEST test4 test4(): with main4:()>Integer == add main4():Integer == t1():IntegerNumberSystem == Integer x : t1 x := 1$t1 y : t1 y := x 1 \end{spad} This compiles ok but there is a runtime error. Why? \begin{axiom} main4() \end{axiom} and following 3:: t == List Term x : List Term y : t y := x is not supposed to work as well \begin{spad} )abbrev package TEST test3 test3(): with main3:()>Integer == add main3() == t:IntegerNumberSystem == Integer x : Integer x := 1 y : t y := x \end{spad} There should produce a compile error above. \begin{axiom} main3() \end{axiom} All examples are taken from the paper. I am not sure how much of this design is preserved in the current system. But without having had an intense look at the examples, I got the impression, that they follow the rules above. Regards Juergen Weiss From wyscc Mon Aug 13 01:35:25 0500 2007 From: wyscc Date: Mon, 13 Aug 2007 01:35:25 0500 Subject: test MessageID: <200708130135250500@wiki.axiomdeveloper.org> The failure above is not convincing, since the spad code did not compile. It's not clear where the failure lies. For example, in Test4, the compiler message says t1 is not defined. A slight modification causes a different error (for example adding () after t1 in test4): \begin{spad} )abbrev package TESTFIVE test5 test5(): with main5:()>Integer == add main5():Integer == t1():IntegerNumberSystem == Integer x : t1() x := 1$t1() y : t1() y := x 1$Integer \end{spad} \begin{axiom} main5() \end{axiom} The better way to test equivalence of domains is to actually construct new domains. \begin{spad} )abbrev domain TEEONE tee1 tee1():IntegerNumberSystem == Integer )abbrev domain TEETWO tee2 tee2():IntegerNumberSystem == Integer )abbrev package TESTSIX test6 test6(): with main6:()>Integer == add main6():Integer == x : tee1 x := 1$tee1 y : tee1 y := x 1$Integer \end{spad} \begin{axiom} main6() \end{axiom} \begin{spad} )abbrev package TESTSEV test7 test7(): with foo7:tee1 > tee2 main7:(tee1, tee2) > tee2 == add foo7(x) == 5$tee2 main7(x,y) == foo7(x) + y \end{spad} Would you have expected a compile error with test7? This shows there is no automatic coercion in the compiler from Integer to tee2. \begin{spad} )abbrev package TESTEGT test8 test8(): with foo8:tee1 > tee2 main8:(tee1, tee2) > tee2 == add foo8(x) == 1$tee2 + 1$tee2 + 1$tee2 + 1$tee2 + 1$tee2 main8(x,y) == foo8(x) + y \end{spad} Note that tee2 does have a multiplicative unit without requiring a coercion from Integer! So test8 compiles okay. Let's see this in action. \begin{axiom}  expects 6 main8(1$tee1, 1$tee2)  expects error main8(1$tee2, 1$tee1)  expects error main8(1$tee1, 1$tee1)  expects error main8(1$tee2, 1$tee2) \end{axiom} So even the interpreter does not coerce tee1 into tee2. Guess the next three: \begin{axiom} main8(1$Integer, 1$Integer) main8(2$tee1, 5$tee2) main8(3::tee1, (2$tee1)::tee2) \end{axiom} The compiler would not recognize 5$tee2, but the interpreter has no problem coercing any integer automatically to tee1 or tee2. This shows Integer is very special for the interpreter, and not treated the same as tee1. Let's see if we change the name of foo8 to 'convert' and make the converted value to be 4 instead of 5. \begin{spad} )abbrev package TESTNINE test9 test9(): with convert:tee1 > tee2 main9:(tee1, tee2) > tee2 == add convert(x) == 1$tee2 + 1$tee2 + 1$tee2 + 1$tee2 main9(x,y) == convert(x) + y \end{spad} test9 also compiles okay. Let's see this in action. Recall that there is a convert: tee1 > tee2, but no coerce. \begin{axiom}  expects 5 main9(1$tee1, 1$tee2)  expects error main9(1$tee2, 1$tee1)  you make a guess :) main9(1$tee1, 1$tee1)  expects error main9(1$tee2, 1$tee2)  now expecting 5 main9(1$Integer, 1$Integer) \end{axiom} Note 'convert' is not automatically used by the interpreter. Now let's change convert to coerce. Even though there is now a coerce, tee1 is not declared to be CoercibleTo(tee2) (to do so would have made the two domain constructors different in structure). We use a value 1 this time for coerce. \begin{spad} )abbrev package TESTTEN test10 test10(): with coerce:tee1 > tee2 main10:(tee1, tee2) > tee2 == add coerce(x) == 1$tee2 main10(x,y) == coerce(x) + y \end{spad} \begin{axiom}  expects 2 main10(1$tee1, 1$tee2)  expects error main10(1$tee2, 1$tee1)  you make a guess :) main10(1$tee1, 1$tee1)  expects error main10(1$tee2, 1$tee2)  you know this one main10(1$Integer, 1$Integer)  make a guess tee1 has CoercibleTo(tee2) \end{axiom} Now '1\$tee1' is automatically coerced to '1\$tee2' even though tee1 does not have CoercibleTo(tee2), but this is the interpreter! The next thing to do would be to test equivalence of categories. Some other time.
This page was renamed to AnonymousCategories?. You can delete this one if no longer needed.
Or click edit
or Add Comments to make further online tests here.
On Aug 12, 2007 6:35 PM Weiss, Juergen wrote:
I found the old document about type equivalence in Scratchpad. It's: A New Algebra System, May, 29 th 1984, James H Davenport. I have only found a paper version. Maybe someone has an online version.
It states that:
So following 1:
t1 == List Term t2 == List Term x : t1 y : t2 y := x
is not supposed to work, [t1 and t2 should be treated as different types]
)abbrev package TEST test test(): with main:()>Integer == add main() == t1:IntegerNumberSystem == Integer t2:IntegerNumberSystem == Integer x : t1 x := 1$t1 y : t2 y := x
Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiomwiki/var/LatexWiki/440604918159108132925px001.spad using old system compiler. TEST abbreviates package test  initializing NRLIB TEST for test compiling into NRLIB TEST compiling exported main : () > Integer Semantic Errors: [1] main: +> is not a known type
****** comp fails at level 3 with expression: ****** error in function main
(SEQ (DEF (t1) ((IntegerNumberSystem)) (NIL) (Integer)) (DEF (t2) ((IntegerNumberSystem)) (NIL) (Integer)) (: x t1) (LET x  <<  (elt t1 1)  >> ) (: y t2) (exit 1 (LET y x))) ****** level 3 ****** $x:= (elt t1 (One)) $m:= t1 $f:= ((((x #) (t2 #) (t1 #) ($Information #) ...)))
>> Apparent user error: Operation (One) missing from domain: t1
There should be a compile error above.
main()
There are no library operations named main Use HyperDoc Browse or issue )what op main to learn if there is any operation containing " main " in its name.
Cannot find a noargument definition or library operation named main .
but following 2:
x : List Term y : List Term y := x
is ok,
)abbrev package TEST test2 test2(): with main2:()>Integer == add main2()== x : Integer x := 1 y : Integer y := x
Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiomwiki/var/LatexWiki/315419222770479817625px003.spad using old system compiler. TEST abbreviates package test2  initializing NRLIB TEST for test2 compiling into NRLIB TEST compiling exported main2 : () > Integer Time: 0 SEC.
(time taken in buildFunctor: 0)
;;; *** test2 REDEFINED
;;; *** test2 REDEFINED Time: 0 SEC.
Cumulative Statistics for Constructor test2 Time: 0 seconds
finalizing NRLIB TEST Processing test2 for Browser database: >>test2(constructor): Not documented!!!! >>test2((main2 ((Integer)))): Not documented!!!! >>test2(): Missing Description ; compiling file "/var/aw/var/LatexWiki/TEST.NRLIB/TEST.lsp" (written 31 JUL 2013 05:18:05 PM):
; /var/aw/var/LatexWiki/TEST.NRLIB/TEST.fasl written ; compilation finished in 0:00:00.011  test2 is now explicitly exposed in frame initial test2 will be automatically loaded when needed from /var/aw/var/LatexWiki/TEST.NRLIB/TEST
main2()
(1) 
also
)abbrev package TEST test4 test4(): with main4:()>Integer == add main4():Integer == t1():IntegerNumberSystem == Integer x : t1 x := 1$t1 y : t1 y := x 1
Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiomwiki/var/LatexWiki/34673062568259166825px005.spad using old system compiler. TEST abbreviates package test4  initializing NRLIB TEST for test4 compiling into NRLIB TEST compiling exported main4 : () > Integer Semantic Errors: [1] main4: +> is not a known type
****** comp fails at level 3 with expression: ****** error in function main4
(SEQ (DEF (t1) ((IntegerNumberSystem)) (NIL) (Integer)) (: x t1) (LET x  <<  (elt t1 1)  >> ) (: y t1) (LET y x) (exit 1 1)) ****** level 3 ****** $x:= (elt t1 (One)) $m:= t1 $f:= ((((x #) (t1 #) ($Information #) (main4 #) ...)))
>> Apparent user error: Operation (One) missing from domain: t1
This compiles ok but there is a runtime error. Why?
main4()
There are no library operations named main4 Use HyperDoc Browse or issue )what op main4 to learn if there is any operation containing " main4 " in its name.
Cannot find a noargument definition or library operation named main4 .
and following 3:
t == List Term x : List Term y : t y := x
is not supposed to work as well
)abbrev package TEST test3 test3(): with main3:()>Integer == add main3() == t:IntegerNumberSystem == Integer x : Integer x := 1 y : t y := x
Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiomwiki/var/LatexWiki/223226118302766329625px007.spad using old system compiler. TEST abbreviates package test3  initializing NRLIB TEST for test3 compiling into NRLIB TEST compiling exported main3 : () > Integer Semantic Errors: [1] main3: +> is not a known type
****** comp fails at level 3 with expression: ****** error in function main3
(SEQ (DEF (t) ((IntegerNumberSystem)) (NIL) (Integer)) (: x (Integer)) (LET x 1) (: y t) (exit 1  <<  (LET y x)  >> )) ****** level 3 ****** $x:= (LET y x) $m:= (Integer) $f:= ((((y #) (x # #) (t #) ($Information #) ...)))
>> Apparent user error: CANNOT ASSIGN: x OF MODE: (Integer) TO: y OF MODE: t
There should produce a compile error above.
main3()
There are no library operations named main3 Use HyperDoc Browse or issue )what op main3 to learn if there is any operation containing " main3 " in its name.
Cannot find a noargument definition or library operation named main3 .
All examples are taken from the paper.
I am not sure how much of this design is preserved in the current system. But without having had an intense look at the examples, I got the impression, that they follow the rules above.
Regards
Juergen Weiss
)abbrev package TESTFIVE test5 test5(): with main5:()>Integer == add main5():Integer == t1():IntegerNumberSystem == Integer x : t1() x := 1$t1() y : t1() y := x 1$Integer
Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiomwiki/var/LatexWiki/361164187010294162225px009.spad using old system compiler. TESTFIVE abbreviates package test5  initializing NRLIB TESTFIVE for test5 compiling into NRLIB TESTFIVE compiling exported main5 : () > Integer Internal Error Error while instantiating type t1
main5()
There are no library operations named main5 Use HyperDoc Browse or issue )what op main5 to learn if there is any operation containing " main5 " in its name.
Cannot find a noargument definition or library operation named main5 .
The better way to test equivalence of domains is to actually construct new domains.
)abbrev domain TEEONE tee1 tee1():IntegerNumberSystem == Integer
)abbrev domain TEETWO tee2 tee2():IntegerNumberSystem == Integer
)abbrev package TESTSIX test6 test6(): with main6:()>Integer == add main6():Integer == x : tee1 x := 1$tee1 y : tee1 y := x 1$Integer
Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiomwiki/var/LatexWiki/505851042578839414025px011.spad using old system compiler. TEEONE abbreviates domain tee1  initializing NRLIB TEEONE for tee1 compiling into NRLIB TEEONE (time taken in buildFunctor: 0)
;;; *** tee1 REDEFINED
;;; *** tee1 REDEFINED Time: 0 SEC.
Cumulative Statistics for Constructor tee1 Time: 0 seconds
(RealConstant) extends (ConvertibleTo (DoubleFloat)) but not (ConvertibleTo (String)) non extending category .. tee1 of cat (IntegerNumberSystem) has no (ConvertibleTo (String)) finalizing NRLIB TEEONE Processing tee1 for Browser database: >>tee1(): Missing Description ; compiling file "/var/aw/var/LatexWiki/TEEONE.NRLIB/TEEONE.lsp" (written 31 JUL 2013 05:18:05 PM):
; /var/aw/var/LatexWiki/TEEONE.NRLIB/TEEONE.fasl written ; compilation finished in 0:00:00.008  tee1 is now explicitly exposed in frame initial tee1 will be automatically loaded when needed from /var/aw/var/LatexWiki/TEEONE.NRLIB/TEEONE
TEETWO abbreviates domain tee2  initializing NRLIB TEETWO for tee2 compiling into NRLIB TEETWO (time taken in buildFunctor: 0)
;;; *** tee2 REDEFINED
;;; *** tee2 REDEFINED Time: 0 SEC.
Cumulative Statistics for Constructor tee2 Time: 0 seconds
(RealConstant) extends (ConvertibleTo (DoubleFloat)) but not (ConvertibleTo (String)) non extending category .. tee2 of cat (IntegerNumberSystem) has no (ConvertibleTo (String)) finalizing NRLIB TEETWO Processing tee2 for Browser database: >>tee2(): Missing Description ; compiling file "/var/aw/var/LatexWiki/TEETWO.NRLIB/TEETWO.lsp" (written 31 JUL 2013 05:18:05 PM):
; /var/aw/var/LatexWiki/TEETWO.NRLIB/TEETWO.fasl written ; compilation finished in 0:00:00.008  tee2 is now explicitly exposed in frame initial tee2 will be automatically loaded when needed from /var/aw/var/LatexWiki/TEETWO.NRLIB/TEETWO
TESTSIX abbreviates package test6  initializing NRLIB TESTSIX for test6 compiling into NRLIB TESTSIX compiling exported main6 : () > Integer Time: 0 SEC.
(time taken in buildFunctor: 0)
;;; *** test6 REDEFINED
;;; *** test6 REDEFINED Time: 0 SEC.
Cumulative Statistics for Constructor test6 Time: 0 seconds
finalizing NRLIB TESTSIX Processing test6 for Browser database: >>test6(constructor): Not documented!!!! >>test6((main6 ((Integer)))): Not documented!!!! >>test6(): Missing Description ; compiling file "/var/aw/var/LatexWiki/TESTSIX.NRLIB/TESTSIX.lsp" (written 31 JUL 2013 05:18:05 PM):
; /var/aw/var/LatexWiki/TESTSIX.NRLIB/TESTSIX.fasl written ; compilation finished in 0:00:00.007  test6 is now explicitly exposed in frame initial test6 will be automatically loaded when needed from /var/aw/var/LatexWiki/TESTSIX.NRLIB/TESTSIX
main6()
(2) 
)abbrev package TESTSEV test7 test7(): with foo7:tee1 > tee2 main7:(tee1,tee2) > tee2 == add foo7(x) == 5$tee2 main7(x, y) == foo7(x) + y
Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiomwiki/var/LatexWiki/519383858665901583925px013.spad using old system compiler. TESTSEV abbreviates package test7  initializing NRLIB TESTSEV for test7 compiling into NRLIB TESTSEV compiling exported foo7 : tee1 > tee2 ****** comp fails at level 1 with expression: ****** error in function foo7
((elt (tee2) 5)) ****** level 1 ****** $x:= (elt (tee2) 5) $m:= (tee2) $f:= ((((x # #) ($Information #) (main7 #) (foo7 #) ...)))
>> Apparent user error: Operation 5 missing from domain: (tee2)
Would you have expected a compile error with test7? This shows there is no automatic coercion in the compiler from Integer to tee2.
)abbrev package TESTEGT test8 test8(): with foo8:tee1 > tee2 main8:(tee1,tee2) > tee2 == add foo8(x) == 1$tee2 + 1$tee2 + 1$tee2 + 1$tee2 + 1$tee2 main8(x, y) == foo8(x) + y
Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiomwiki/var/LatexWiki/205216118448638344625px014.spad using old system compiler. TESTEGT abbreviates package test8  initializing NRLIB TESTEGT for test8 compiling into NRLIB TESTEGT compiling exported foo8 : tee1 > tee2 Time: 0 SEC.
compiling exported main8 : (tee1,tee2) > tee2 Time: 0 SEC.
(time taken in buildFunctor: 0)
;;; *** test8 REDEFINED
;;; *** test8 REDEFINED Time: 0.01 SEC.
Cumulative Statistics for Constructor test8 Time: 0.01 seconds
finalizing NRLIB TESTEGT Processing test8 for Browser database: >>test8(constructor): Not documented!!!! >>test8((foo8 ((tee2) (tee1)))): Not documented!!!! >>test8((main8 ((tee2) (tee1) (tee2)))): Not documented!!!! >>test8(): Missing Description ; compiling file "/var/aw/var/LatexWiki/TESTEGT.NRLIB/TESTEGT.lsp" (written 31 JUL 2013 05:18:05 PM):
; /var/aw/var/LatexWiki/TESTEGT.NRLIB/TESTEGT.fasl written ; compilation finished in 0:00:00.015  test8 is now explicitly exposed in frame initial test8 will be automatically loaded when needed from /var/aw/var/LatexWiki/TESTEGT.NRLIB/TESTEGT
Note that tee2 does have a multiplicative unit without requiring a coercion from Integer! So test8 compiles okay. Let's see this in action.
 expects 6 main8(1$tee1,1$tee2)
(3) 
 expects error main8(1$tee2,1$tee1)
There are 1 exposed and 0 unexposed library operations named main8 having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse,or issue )display op main8 to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named main8 with argument type(s) tee2 tee1
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.  expects error main8(1$tee1, 1$tee1)
There are 1 exposed and 0 unexposed library operations named main8 having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse,or issue )display op main8 to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named main8 with argument type(s) tee1 tee1
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.  expects error main8(1$tee2, 1$tee2)
There are 1 exposed and 0 unexposed library operations named main8 having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse,or issue )display op main8 to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named main8 with argument type(s) tee2 tee2
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.
So even the interpreter does not coerce tee1 into tee2. Guess the next three:
main8(1$Integer,1$Integer)
(4) 
main8(2$tee1,5$tee2)
(5) 
main8(3::tee1,(2$tee1)::tee2)
Cannot convert from type tee1 to tee2 for value 2
The compiler would not recognize 5$tee2, but the interpreter has no problem coercing any integer automatically to tee1 or tee2. This shows Integer is very special for the interpreter, and not treated the same as tee1.
Let's see if we change the name of foo8 to convert
and make the converted value to be 4 instead of 5.
)abbrev package TESTNINE test9 test9(): with convert:tee1 > tee2 main9:(tee1,tee2) > tee2 == add convert(x) == 1$tee2 + 1$tee2 + 1$tee2 + 1$tee2 main9(x, y) == convert(x) + y
Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiomwiki/var/LatexWiki/860888652008593368025px017.spad using old system compiler. TESTNINE abbreviates package test9  initializing NRLIB TESTNINE for test9 compiling into NRLIB TESTNINE compiling exported convert : tee1 > tee2 Time: 0.01 SEC.
compiling exported main9 : (tee1,tee2) > tee2 Time: 0 SEC.
(time taken in buildFunctor: 0)
;;; *** test9 REDEFINED
;;; *** test9 REDEFINED Time: 0 SEC.
Cumulative Statistics for Constructor test9 Time: 0.01 seconds
finalizing NRLIB TESTNINE Processing test9 for Browser database: >>test9(constructor): Not documented!!!! >>test9((convert ((tee2) (tee1)))): Not documented!!!! >>test9((main9 ((tee2) (tee1) (tee2)))): Not documented!!!! >>test9(): Missing Description ; compiling file "/var/aw/var/LatexWiki/TESTNINE.NRLIB/TESTNINE.lsp" (written 31 JUL 2013 05:18:05 PM):
; /var/aw/var/LatexWiki/TESTNINE.NRLIB/TESTNINE.fasl written ; compilation finished in 0:00:00.014  test9 is now explicitly exposed in frame initial test9 will be automatically loaded when needed from /var/aw/var/LatexWiki/TESTNINE.NRLIB/TESTNINE
test9 also compiles okay. Let's see this in action. Recall that there is a convert: tee1 > tee2, but no coerce.
 expects 5 main9(1$tee1,1$tee2)
(6) 
 expects error main9(1$tee2,1$tee1)
There are 1 exposed and 0 unexposed library operations named main9 having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse,or issue )display op main9 to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named main9 with argument type(s) tee2 tee1
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.  you make a guess :) main9(1$tee1, 1$tee1)
There are 1 exposed and 0 unexposed library operations named main9 having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse,or issue )display op main9 to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named main9 with argument type(s) tee1 tee1
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.  expects error main9(1$tee2, 1$tee2)
There are 1 exposed and 0 unexposed library operations named main9 having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse,or issue )display op main9 to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named main9 with argument type(s) tee2 tee2
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.  now expecting 5 main9(1$Integer, 1$Integer)
(7) 
Note convert
is not automatically used by the interpreter. Now let's change convert to coerce. Even though there is now a coerce, tee1 is not declared to be CoercibleTo?(tee2) (to do so would have made the two domain constructors different in structure). We use a value 1 this time for coerce.
)abbrev package TESTTEN test10 test10(): with coerce:tee1 > tee2 main10:(tee1,tee2) > tee2 == add coerce(x) == 1$tee2 main10(x, y) == coerce(x) + y
Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiomwiki/var/LatexWiki/731794686125671872025px019.spad using old system compiler. TESTTEN abbreviates package test10  initializing NRLIB TESTTEN for test10 compiling into NRLIB TESTTEN compiling exported coerce : tee1 > tee2 Time: 0 SEC.
compiling exported main10 : (tee1,tee2) > tee2 Time: 0 SEC.
(time taken in buildFunctor: 0)
;;; *** test10 REDEFINED
;;; *** test10 REDEFINED Time: 0 SEC.
Cumulative Statistics for Constructor test10 Time: 0 seconds
finalizing NRLIB TESTTEN Processing test10 for Browser database: >>test10(constructor): Not documented!!!! >>test10((coerce ((tee2) (tee1)))): Not documented!!!! >>test10((main10 ((tee2) (tee1) (tee2)))): Not documented!!!! >>test10(): Missing Description ; compiling file "/var/aw/var/LatexWiki/TESTTEN.NRLIB/TESTTEN.lsp" (written 31 JUL 2013 05:18:05 PM):
; /var/aw/var/LatexWiki/TESTTEN.NRLIB/TESTTEN.fasl written ; compilation finished in 0:00:00.010  test10 is now explicitly exposed in frame initial test10 will be automatically loaded when needed from /var/aw/var/LatexWiki/TESTTEN.NRLIB/TESTTEN
 expects 2 main10(1$tee1,1$tee2)
(8) 
 expects error main10(1$tee2,1$tee1)
There are 1 exposed and 0 unexposed library operations named main10 having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse,or issue )display op main10 to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named main10 with argument type(s) tee2 tee1
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.  you make a guess :) main10(1$tee1, 1$tee1)
(9) 
 expects error main10(1$tee2,1$tee2)
There are 1 exposed and 0 unexposed library operations named main10 having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse,or issue )display op main10 to learn more about the available operations. Perhaps packagecalling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named main10 with argument type(s) tee2 tee2
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.  you know this one main10(1$Integer, 1$Integer)
(10) 
 make a guess tee1 has CoercibleTo(tee2)
(11) 
Now 1$tee1
is automatically coerced to 1$tee2
even though tee1 does not have CoercibleTo?(tee2), but this is the interpreter!
The next thing to do would be to test equivalence of categories. Some other time.