include "primitives.alh" SimpleAttribute Integer { constraint = $ String function constraint(value : Element): if (is_physical_int(value)): return "OK"! else: return "Integer has a non-integer value"! $ } SimpleAttribute String { constraint = $ String function constraint(value : Element): if (is_physical_string(value)): return "OK"! else: return "String has a non-string value"! $ } SimpleAttribute Float { constraint = $ String function constraint(value : Element): if (is_physical_float(value)): return "OK"! else: return "Float has a non-float value"! $ } Class Element { name = "Element" typeID : String } Class Icon : Element { name = "Icon" data : String scale : Float } Class PrimitiveGroup : Element { name = "PrimitiveGroup" } Class Primitive { name = "Primitive" } Class Rectangle : Primitive { name = "Rectangle" x : Integer y : Integer width : Integer height : Integer } Class Circle : Primitive { name = "Circle" x : Integer y : Integer radius : Integer } Association PrimitiveGroupPrimitive(PrimitiveGroup, Primitive) { name = "PrimitiveGroupPrimitive" }