Comment : Charset=windows-1252
Comment : test cases for management of user-defined types including non-physical possreps

Comment : wrong non-physical possrep name : same name as the physical one
Request : cmd (assert userdefinedtype,userdefinedtype(tuple(typename(point)sp_expression( )possrepname(point))))cmd (assert udtpossrep,udtpossrep(tuple(typename(point)possrepname(point))))cmd (assert udtpossrepcomponent,udtpossrepcomponent(tuple(typename(point)possrepname(point)componentname(r)sp_expression( sqrt\(plus\(mult\(x,x\),mult\(y,y\)\)\) ))tuple(typename(point)possrepname(point)componentname(theta)sp_expression( atan\(div\(y,x\)\) ))))cmd (assert udtppcvalueselector,udtppcvalueselector(tuple(typename(point)possrepname(point)componentname(x)sp_expression( mult\(r,cos\(theta\)\) ))tuple(typename(point)possrepname(point)componentname(y)sp_expression( mult\(r,sin\(theta\)\) ))))cmd (assert udtphysicalpossrepcomponent,udtphysicalpossrepcomponent(tuple(typename(point)componenttypename(float)componentname(x)ordinal(10)logicallength(1))tuple(typename(point)componenttypename(float)componentname(y)ordinal(20)logicallength(1))))
Reply   : 201806116:144:The non-physical possrep POINT for user-defined type POINT has the same name as the physical possrep of that type.

Comment : Illegal component name : overlap with component name of a physical possrep
Request : cmd (assert userdefinedtype,userdefinedtype(tuple(typename(point)sp_expression(  )possrepname(point))))cmd (assert udtpossrep,udtpossrep(tuple(typename(point)possrepname(polar))))cmd (assert udtpossrepcomponent,udtpossrepcomponent(tuple(typename(point)possrepname(polar)componentname(x)sp_expression( sqrt\(plus\(mult\(x,x\),mult\(y,y\)\)\) ))tuple(typename(point)possrepname(polar)componentname(theta)sp_expression( atan\(div\(y,x\)\) ))))cmd (assert udtppcvalueselector,udtppcvalueselector(tuple(typename(point)possrepname(polar)componentname(x)sp_expression( mult\(x,cos\(theta\)\) ))tuple(typename(point)possrepname(polar)componentname(y)sp_expression( mult\(x,sin\(theta\)\) ))))cmd (assert udtphysicalpossrepcomponent,udtphysicalpossrepcomponent(tuple(typename(point)componenttypename(float)componentname(x)ordinal(10)logicallength(1))tuple(typename(point)componenttypename(float)componentname(y)ordinal(20)logicallength(1))))
Reply   : 201806116:149:The component X cannot be a component in both the non-physical possrep POLAR and the physical possrep of type POINT.

Comment : missing value selector
Request : cmd (assert userdefinedtype,userdefinedtype(tuple(typename(point)sp_expression(  )possrepname(point))))cmd (assert udtpossrep,udtpossrep(tuple(typename(point)possrepname(polar))))cmd (assert udtpossrepcomponent,udtpossrepcomponent(tuple(typename(point)possrepname(polar)componentname(r)sp_expression( sqrt\(plus\(mult\(x,x\),mult\(y,y\)\)\) ))tuple(typename(point)possrepname(polar)componentname(theta)sp_expression( atan\(div\(y,x\)\) ))))cmd (assert udtppcvalueselector,udtppcvalueselector(tuple(typename(point)possrepname(polar)componentname(x)sp_expression( mult\(r,cos\(theta\)\) ))))cmd (assert udtphysicalpossrepcomponent,udtphysicalpossrepcomponent(tuple(typename(point)componenttypename(float)componentname(x)ordinal(10)logicallength(1))tuple(typename(point)componenttypename(float)componentname(y)ordinal(20)logicallength(1))))
Reply   : 201806116:154:A Physical Component Value Selector is missing for selecting the value of component Y of the physical possrep of its type POINT, from a given value denoted in possrep POLAR of the same type.

Comment : valueselectors for the physical possrep
Request : cmd (assert userdefinedtype,userdefinedtype(tuple(typename(point)sp_expression(  )possrepname(point))))cmd (assert udtpossrep,udtpossrep(tuple(typename(point)possrepname(polar))))cmd (assert udtpossrepcomponent,udtpossrepcomponent(tuple(typename(point)possrepname(polar)componentname(r)sp_expression( sqrt\(plus\(mult\(x,x\),mult\(y,y\)\)\) ))tuple(typename(point)possrepname(polar)componentname(theta)sp_expression( atan\(div\(y,x\)\) ))))cmd (assert udtppcvalueselector,udtppcvalueselector(tuple(typename(point)possrepname(point)componentname(x)sp_expression( x ))tuple(typename(point)possrepname(point)componentname(y)sp_expression( y ))))cmd (assert udtphysicalpossrepcomponent,udtphysicalpossrepcomponent(tuple(typename(point)componenttypename(float)componentname(x)ordinal(10)logicallength(1))tuple(typename(point)componenttypename(float)componentname(y)ordinal(20)logicallength(1))))
Reply   : 201806116:154:A Physical Component Value Selector is missing for selecting the value of component Y of the physical possrep of its type POINT, from a given value denoted in possrep POLAR of the same type.

Comment : valueselectors for the non-physical possrep with logically insane expressions
Request : cmd (assert userdefinedtype,userdefinedtype(tuple(typename(point)sp_expression(  )possrepname(point))))cmd (assert udtpossrep,udtpossrep(tuple(typename(point)possrepname(polar))))cmd (assert udtpossrepcomponent,udtpossrepcomponent(tuple(typename(point)possrepname(polar)componentname(r)sp_expression( sqrt\(plus\(mult\(x,x\),mult\(y,y\)\)\) ))tuple(typename(point)possrepname(polar)componentname(theta)sp_expression( atan\(div\(y,x\)\) ))))cmd (assert udtppcvalueselector,udtppcvalueselector(tuple(typename(point)possrepname(polar)componentname(x)sp_expression( x ))tuple(typename(point)possrepname(polar)componentname(y)sp_expression( y ))))cmd (assert udtphysicalpossrepcomponent,udtphysicalpossrepcomponent(tuple(typename(point)componenttypename(float)componentname(x)ordinal(10)logicallength(1))tuple(typename(point)componenttypename(float)componentname(y)ordinal(20)logicallength(1))))
Reply   : 1497858657:325:Name ' x ' did not resolve as an attribute reference in its lexical scope { THETA:ANGLE R:FLOAT }, nor is it equal to an existing relvar name. The cause of this problem was a be.SIRAPRISE.server.NotARelvarException with message Requested Relation variable  X  could not be found in the catalog..

Comment : create a point type with physical possrep cartesian and components X and Y - AND a nonphysical possrep polar with components R and THETA
Request : cmd (assert userdefinedtype,userdefinedtype(tuple(typename(point)sp_expression(  )possrepname(point))))cmd (assert udtpossrep,udtpossrep(tuple(typename(point)possrepname(polar))))cmd (assert udtpossrepcomponent,udtpossrepcomponent(tuple(typename(point)possrepname(polar)componentname(r)sp_expression( sqrt\(plus\(mult\(x,x\),mult\(y,y\)\)\) ))tuple(typename(point)possrepname(polar)componentname(theta)sp_expression( atan\(div\(y,x\)\) ))))cmd (assert udtppcvalueselector,udtppcvalueselector(tuple(typename(point)possrepname(polar)componentname(x)sp_expression( mult\(r,cos\(theta\)\) ))tuple(typename(point)possrepname(polar)componentname(y)sp_expression( mult\(r,sin\(theta\)\) ))))cmd (assert udtphysicalpossrepcomponent,udtphysicalpossrepcomponent(tuple(typename(point)componenttypename(float)componentname(x)ordinal(10)logicallength(1))tuple(typename(point)componenttypename(float)componentname(y)ordinal(20)logicallength(1))))
Reply   : 

Comment : test value selectors of the polar possrep
Request : inquire extend(table_dee,p(point(r(0)theta(angle(radians(0))))))
Reply   : RELATION(HEADING(P(POINT))BODY(TUPLE(P(Y(0.0)X(0.0)))))
Request : inquire extend(table_dee,p(point(r(1)theta(angle(radians(0))))))
Reply   : RELATION(HEADING(P(POINT))BODY(TUPLE(P(Y(0.0)X(1.0)))))
Request : inquire extend(table_dee,p(point(r(0)theta(angle(radians(1))))))
Reply   : RELATION(HEADING(P(POINT))BODY(TUPLE(P(Y(0.0)X(0.0)))))
Request : inquire extend(table_dee,p(point(r(1.414)theta(angle(radians(0.785398))))))
Reply   : RELATION(HEADING(P(POINT))BODY(TUPLE(P(Y(0.9998488252249913)X(0.9998491519705383)))))
Request : inquire extend(table_dee,p(point(r(1.414)theta(angle(radians(-0.785398))))))
Reply   : RELATION(HEADING(P(POINT))BODY(TUPLE(P(Y(-0.9998488252249913)X(0.9998491519705383)))))
Request : inquire extend(table_dee,p(point(r(-1.414)theta(angle(radians(-0.785398))))))
Reply   : RELATION(HEADING(P(POINT))BODY(TUPLE(P(Y(0.9998488252249913)X(-0.9998491519705383)))))
Request : inquire extend(table_dee,p(point(r(-1.414)theta(angle(radians(0.785398))))))
Reply   : RELATION(HEADING(P(POINT))BODY(TUPLE(P(Y(-0.9998488252249913)X(-0.9998491519705383)))))
Request : inquire extend(table_dee,true(eq(point(r(1)theta(angle(radians(0)))),point(x(1)y(0)))))
Reply   : RELATION(HEADING(TRUE(BOOLEAN))BODY(TUPLE(TRUE(True))))
Request : inquire extend(table_dee,r(the_r(point(x(3)y(2)))))
Reply   : RELATION(HEADING(R(FLOAT))BODY(TUPLE(R(3.605551275463989))))
Request : inquire extend(table_dee,theta(the_theta(point(x(3)y(2)))))
Reply   : RELATION(HEADING(THETA(ANGLE))BODY(TUPLE(THETA(DEGREES(33)MINUTES(41)SECONDS(24.243093527226165)))))
Request : inquire extend(table_dee,r(the_r(point(x(0)y(0)))))
Reply   : RELATION(HEADING(R(FLOAT))BODY(TUPLE(R(0.0))))
Request : inquire extend(table_dee,theta(the_theta(point(x(0)y(0)))))
Reply   : 858993459:-1:java.lang.IllegalArgumentException:NaN is not a number.
Request : inquire extend(table_dee,r(the_r(point(x(1)y(0)))))
Reply   : RELATION(HEADING(R(FLOAT))BODY(TUPLE(R(1.0))))
Request : inquire extend(table_dee,theta(the_theta(point(x(1)y(0)))))
Reply   : RELATION(HEADING(THETA(ANGLE))BODY(TUPLE(THETA(DEGREES(0)MINUTES(0)SECONDS(0.0)))))
Request : inquire extend(table_dee,r(the_r(point(x(0)y(2)))))
Reply   : RELATION(HEADING(R(FLOAT))BODY(TUPLE(R(2.0))))
Request : inquire extend(table_dee,theta(the_theta(point(x(0)y(2)))))
Reply   : RELATION(HEADING(THETA(ANGLE))BODY(TUPLE(THETA(DEGREES(90)MINUTES(0)SECONDS(0.0)))))

Comment : delete them back again
Request : cmd (unassert userdefinedtype,restrict(userdefinedtype,eq(typename,name(point))))cmd (unassert udtpossrep,restrict(udtpossrep,eq(typename,name(point))))cmd (unassert udtpossrepcomponent,restrict(udtpossrepcomponent,eq(typename,name(point))))cmd (unassert udtppcvalueselector,restrict(udtppcvalueselector,eq(typename,name(point))))cmd (unassert udtphysicalpossrepcomponent,restrict(udtphysicalpossrepcomponent,eq(typename,name(point))))
Reply   : 
END
