Comment : Charset=windows-1252
Comment : test cases for management of types

Comment : try to force an intervaltype over string - should fail
Request : assert intervaltype,intervaltype(tuple(intervaltypename(stringinterval)typename(string)))
Reply   : 201806116:42:Type STRINGINTERVAL has no properties.

Comment : try to force an intervaltype over string in a way that complies with constraint 38 - should fail
Request : cmd(assert intervaltype,intervaltype(tuple(intervaltypename(stringinterval)typename(string))))cmd(assert possrep,possrep(tuple(possrepname(stringinterval)typename(stringinterval))))
Reply   : 201806116:38:Type STRINGINTERVAL has no PossRep.

Comment : try to manipulate possreps and possrepcomponents - should fail
Request : assert possrep,possrep(tuple(possrepname(yesno)typename(boolean)))
Reply   : 201806116:115:The POSSREP relvar is not user-updatable.
Request : assert possrepcomponent,possrepcomponent(tuple(componentname(oct)componenttypename(string)possrepname(hex)typename(int)))
Reply   : 201806116:116:The POSSREPCOMPONENT relvar is not user-updatable.

Comment : define a user-implemented type that uses a type derived from foo as one of its possrep components
Request : assert javabackedtype,javabackedtype(tuple(typename(bar)))
Reply   : 201806116:22:Possrep component RANGE of possrep BAR is defined to be of an unknown type FOOINTERVAL.

Comment : define foo
Request : assert javabackedtype,javabackedtype(tuple(typename(foo)))
Reply   : 

Comment : define a user-implemented type that uses a type derived from foo as one of its possrep components - should now succeed
Request : assert javabackedtype,javabackedtype(tuple(typename(bar)))
Reply   : 

Comment : inquire the effect on the catalog - should yield both the base type and the corresponding intervaltype
Request : inquire restrict(javabackedtype,matches(the_string(typename),string(FOO.*)))
Reply   : RELATION(HEADING(TYPENAME(NAME))BODY(TUPLE(TYPENAME(FOO))))
Request : inquire restrict(intervaltype,matches(the_string(typename),string(FOO.*)))
Reply   : RELATION(HEADING(INTERVALTYPENAME(NAME)TYPENAME(NAME))BODY(TUPLE(INTERVALTYPENAME(FOOINTERVAL)TYPENAME(FOO))))
Request : inquire restrict(typeproperties,matches(the_string(typename),string(FOO.*)))
Reply   : RELATION(HEADING(MINIMUMSIZE(INT)ISSCALAR(BOOLEAN)ISORDERED(BOOLEAN)MAXIMUMSIZE(INT)TYPENAME(NAME))BODY(TUPLE(MINIMUMSIZE(1)ISSCALAR(True)ISORDERED(True)MAXIMUMSIZE(1)TYPENAME(FOO))TUPLE(MINIMUMSIZE(2)ISSCALAR(True)ISORDERED(False)MAXIMUMSIZE(2)TYPENAME(FOOINTERVAL))))
Request : inquire restrict(possrep,matches(the_string(typename),string(FOO.*)))
Reply   : RELATION(HEADING(POSSREPNAME(NAME)TYPENAME(NAME))BODY(TUPLE(POSSREPNAME(FOOINTERVAL)TYPENAME(FOOINTERVAL))TUPLE(POSSREPNAME(FOO)TYPENAME(FOO))))
Request : inquire restrict(possrepcomponent,matches(the_string(typename),string(FOO.*)))
Reply   : RELATION(HEADING(POSSREPNAME(NAME)TYPENAME(NAME)COMPONENTTYPENAME(NAME)COMPONENTNAME(NAME))BODY(TUPLE(POSSREPNAME(FOO)TYPENAME(FOO)COMPONENTTYPENAME(FLOAT)COMPONENTNAME(Y))TUPLE(POSSREPNAME(FOO)TYPENAME(FOO)COMPONENTTYPENAME(FLOAT)COMPONENTNAME(X))TUPLE(POSSREPNAME(FOOINTERVAL)TYPENAME(FOOINTERVAL)COMPONENTTYPENAME(FOO)COMPONENTNAME(BEGIN))TUPLE(POSSREPNAME(FOOINTERVAL)TYPENAME(FOOINTERVAL)COMPONENTTYPENAME(FOO)COMPONENTNAME(END))))

Comment : type should be available
Request : inquire extend(table_dee,foov(foo(x(1.570796)y(1.0))))
Reply   : RELATION(HEADING(FOOV(FOO))BODY(TUPLE(FOOV(X(1.570796)Y(1.0)))))
Request : inquire extend(table_dee,fooiv(foointerval(begin(foo(x(1.570796)y(1.0))))))
Reply   : RELATION(HEADING(FOOIV(FOOINTERVAL))BODY(TUPLE(FOOIV(BEGIN(X(1.570796)Y(1.0))))))

Comment : delete the test type
Request : unassert javabackedtype,javabackedtype(tuple(typename(foo)))
Reply   : 201806116:22:Possrep component RANGE of possrep BAR is defined to be of an unknown type FOOINTERVAL.

Comment : delete the test type
Request : unassert javabackedtype,javabackedtype(tuple(typename(bar)))
Reply   : 

Comment : delete the test type
Request : unassert javabackedtype,javabackedtype(tuple(typename(foo)))
Reply   :

Comment : types should have disappeared from the pools
Request : inquire extend(table_dee,foov(foo(x(1.570796)y(1.0))))
Reply   : 1497858657:252:Comma missing after operand X
END
