// ################### FLORA SPECIFIC ######################### // Integrity Constraint to enforce signatures: // If there is an instance X of Class, that has an Attribute Y and // there is a signature definition corresponding to "Attribute" then // Y has to be an instance of RangeofAttribute // This is actually questionable. Should this treated relaxed or // strict, i.e. is a fact invalid when it does not explicit state // that one of the attribute values belongs to the coressponding range defintion // or should it be infered that the attribute value is member of the range given in the signature // Y:Range :- X:Class, X[Attribute->Y], Class[Attribute=>Range], (Class=date;Class=time;Class=dateAndTime). // Integrity Constraint to invalidate instance not corresponding to a signature: // If there is an instance X of Class, that has an Attribute Y and // there is NO signature definition corresponding to Attribute then // X is invalid X[valid(Attribute)] :- X:Class, X[Attribute->_Value], Class[Attribute=>_Range]. invalid(X, Y) :- X:Class, X[Attribute->_Value], tnot X[valid(Attribute)], Y = 'no signature for ' + Attribute + ' in Class ' + Class. invalid(X) :- invalid(X,_Y).