CONTEXT RAP PATTERN Contexts IDENT Context: Context(ctxnm) ctxnm ::Context->Conid [INJ] MEANING IN ENGLISH "The name of a context." ctxpats::Context*Pattern MEANING IN ENGLISH "The patterns in a context." ctxcs ::Context*Concept MEANING IN ENGLISH "A concept, mentioned anywhere in a context, is declared." ctxgE :: Context*GenR MEANING IN ENGLISH "The generalization relation of a concept." ENDPATTERN PATTERN Patterns IDENT Pattern: Pattern(ptnm) ptnm :: Pattern->Conid [INJ] MEANING IN ENGLISH "The name of a pattern." ptrls :: Pattern*Rule MEANING IN ENGLISH "The user-defined rules in a pattern." ptgns :: Pattern*Gen MEANING IN ENGLISH "The user-defined generalization rules in a pattern." ptdcs :: Pattern*Declaration MEANING IN ENGLISH "The relation declarations in a pattern." ptxps :: Pattern*Blob MEANING IN ENGLISH "The purposes of a pattern." ptctx :: Pattern*Context PRAGMA "" "is used in" -- @Han, wil je deze relatie toevoegen en invullen met de inhoud van ctxpats~ Uitleg volgt mondeling. ENDPATTERN PATTERN Gens IDENT Gen: Gen( genspc, gengen ) VIEW Gen: Gen( TXT "CLASSIFY ", genspc;cptnm , TXT " ISA " , gengen;cptnm ) RULE "eq gen": gengen;gengen~ /\ genspc;genspc~ |- I[Gen] MEANING IN ENGLISH "Two generalization rules are identical when the specific concepts are identical and the generic concepts are identical." gengen :: Gen->PlainConcept MEANING IN ENGLISH "A generalization rule refers to a more generic concept." genspc :: Gen->PlainConcept MEANING IN ENGLISH "A generalization rule refers to a more specific concept." ENDPATTERN PATTERN Concepts SPEC PlainConcept ISA A_Concept SPEC ConceptOne ISA A_Concept IDENT PlainConcept: PlainConcept(cptnm) cptnm :: PlainConcept->Conid [INJ] MEANING IN ENGLISH "The name of a concept." context :: PlainConcept*Context --@Stef: Willen we dit opnemen? of is dit dezelfde relatie als ctxcs? (maar daar hebben we het alleen over de definities, dus dit is wellicht een andere relatie. MEANING IN ENGLISH "The context where the concept is known." cpttp :: PlainConcept -> Blob MEANING IN ENGLISH "The type of this Concept" cptdf :: PlainConcept*Blob MEANING IN ENGLISH "The definitions of a concept." cptpurpose :: PlainConcept*Blob MEANING IN ENGLISH "The purposes of a concept." {- obsolete -- CONCEPT Order "The order of the is-a-relation between concepts." -- IDENT Order: Order(ordername) -- SPEC PlainConcept ISA Concept -- SPEC "ONE" ISA Concept -- ordername :: Order -> String [INJ] -- MEANING IN ENGLISH "The name of a class of is-a-related concepts." -- order :: PlainConcept -> Order -- MEANING IN ENGLISH "A concept belongs to a class of is-a-related concepts." -- RULE "order": order~;genspc~;gengen;order |- I -- MEANING IN ENGLISH "Is-a-related concepts belong to the same class of is-a-related concepts." --RULE "different order": ???, a closure would be nice... --MEANING IN ENGLISH "Concepts, that are not is-a-related, are in different orders of the is-a-relation." --NOTE: MESSAGEs depend on the edit possibilities of the interface they are used in. --if you have written messages for interfaces at a certain moment and you add an interface which can violate a message differently, then you should revise those messages, but probably you will forget to do so -> risk for awkward messages in new interface -} --RULE "referential integrity": src~;decsgn~;decpopu;left \/ trg~;decsgn~;decpopu;right |- order;order~;cptos --MEANING IN ENGLISH "An atom in the domain or codomain of a relation is an instance of a concept from the same class as the source respectively the target of that relation." --MESSAGE "If an atom is in some tuple of a relation, then that atom must exist in the concept that is the source respectively target of that relation. Deletion of an atom from a concept is not permitted if that atom is still present in some tuple of some relation. Nor is addition of a tuple permitted if the source or target atom is not present in the related concept. It is a violation of Referential integrity rule for a relation." --VIOLATION (TXT "The tuple ", SRC I, TXT " refers to a source or target atom that does not exist." ) ENDPATTERN PATTERN Populations SPEC RelPopu ISA Population SPEC CptPopu ISA Population popdcl::RelPopu->Declaration popps::RelPopu*Pair popcpt::CptPopu->A_Concept popas::CptPopu*Atom IDENT Pair: Pair( left;atomvalue, right;atomvalue ) VIEW Pair: Pair( left;atomvalue , TXT " * " , right;atomvalue ) left::Pair->Atom MEANING IN ENGLISH "The source of a relationship." right::Pair->Atom MEANING IN ENGLISH "The target of a relationship." IDENT Atom: Atom( atomvalue,root) VIEW Atom: Atom( atomvalue , TXT " :: ", root) atomvalue::Atom->AtomValue MEANING IN ENGLISH "The value of an atom." --RULE "entity integrity concept": atomvalue;atomvalue~ /\ popas~;order;order~;popas |- I --MEANING IN ENGLISH "An atom of a concept has a unique value within the class of that concept." --MESSAGE "Every atom of a concept is unique, or, no two atoms in the population of a concept have the same name. Addition of a duplicate atom is not permitted. It is a violation of the Entity integrity rule for this concept. Please refer to book Rule Based Design, page 43 and 52, entity integrity. " --VIOLATION (TXT "An atom with name ", SRC I, TXT " already exists." ) root::Atom->A_Concept MEANING IN ENGLISH "The root concept of an atom." -- an atom representing `Piet` as an instance of the concept `Student`, could have `Person` as root concept of that atom. (assuming Student ISA Person) ENDPATTERN PATTERN Signs IDENT Sign: Sign( src, trg ) -- VIEW Sign: Sign( src;name[Concept*Conid] , TXT " * " , trg;name[Concept*Conid] ) src::Sign->A_Concept MEANING IN ENGLISH "The source of a sign." trg::Sign->A_Concept MEANING IN ENGLISH "The target of a sign." ENDPATTERN PATTERN Declarations IDENT Declaration: Declaration( decnm , decsgn;src, decsgn;trg ) VIEW Declaration: Declaration( decnm , TXT " :: ", decsgn;src;cptnm ,TXT " * ", decsgn;trg;cptnm ) RULE "eq declaration": decnm;decnm~ /\ decsgn;src;(decsgn;src)~ /\ decsgn;trg;(decsgn;trg)~ |- I MEANING IN ENGLISH "The unique signature of a relation consists of a relation name, a source concept, and a target concept." -- HJO20130509: There should be a rule that ONE must not be source and/or target of a Declaration decnm ::Declaration->Varid MEANING IN ENGLISH "The name of a relation." decsgn ::Declaration->Sign MEANING IN ENGLISH "The sign of a declaration." decprps::Declaration*PropertyRule [INJ] MEANING IN ENGLISH "The properties of a relation." SPEC PropertyRule ISA Rule RULE "property enum": I[Property] |- '->' \/ 'UNI' \/ 'TOT' \/ 'INJ' \/ 'SUR' \/ 'RFX' \/ 'IRF' \/ 'SYM' \/ 'ASY' \/ 'TRN' \/ 'PROP' MEANING IN ENGLISH "There are eleven tokens, that can be used to define properties on a relation. -> means univalent and total; UNI means univalent; TOT means total; INJ means injective; SUR means surjective; RFX means reflexive; IRF means irreflexive; SYM means symmetric; ASY means antisymmetric; TRN means transitive; and PROP means symmetric and antisymmetric." declaredthrough::PropertyRule*Property [TOT] MEANING IN ENGLISH "A property is defined as part of the declaration of relation." decprL ::Declaration*String[UNI] MEANING IN ENGLISH "The prefix of the pragma of a relation." decprM ::Declaration*String[UNI] MEANING IN ENGLISH "The infix of the pragma of a relation." decprR ::Declaration*String[UNI] MEANING IN ENGLISH "The suffix of the pragma of a relation." decmean ::Declaration * Blob MEANING IN ENGLISH "The meanings of a relation." decpurpose::Declaration * Blob MEANING IN ENGLISH "The purposes of a relation." decpopu ::Declaration->RelPopu MEANING IN ENGLISH "The population of a relation." RULE "entity integrity of relation": left;left~ /\ right;right~ /\ popps~;popps |- I[Pair] MEANING IN ENGLISH "There cannot be two pairs in the population of a relation with the same source and same target." MESSAGE "Every tuple in a relation is unique, or, no two tuples in the population of a relation may have the same source and target atoms. Addition of a duplicate tuple is not permitted. It is a violation of the Entity integrity rule for this relation." VIOLATION (TXT "A tuple with the same source and target atoms ", SRC I[Pair], TXT " already exists." ) -- Onderstaande regel is afleidbaar, en hoeft derhalve niet gechecked te worden. We laten de regel echter hier wel staan RULE "typed domain": decpopu;popps;left;popas~ |- decsgn;src;popcpt~ MEANING IN ENGLISH "The atoms in the domain of a relation belong to the same class as the source of that relation." MESSAGE "You try to add a tuple with a source atom, that is not in the population of the source of the relation. This is a violation of the type of the tuple. TIP: enter text in the left input field to get a shorter pick list. Note on ISA-relations: You can make an atom more specific by moving it to the population of a more specific concept." VIOLATION (TXT "Source atom ", TGT I[CptPopu], TXT " is not in the population of ", SRC decsgn;src) RULE "typed codomain": decpopu;popps;right;popas~ |- decsgn;trg;popcpt~ MEANING IN ENGLISH "The atoms in the codomain of a relation belong to the same class as the target of that relation." MESSAGE "You try to add a tuple with a target atom, that is not in the population of the target of the relation. This is a violation of the type of the tuple. TIP: enter text in the right input field to get a shorter pick list. Note on ISA-relations: You can make an atom more specific by moving it to the population of a more specific concept." VIOLATION (TXT "Target atom ", TGT I[CptPopu], TXT " is not in the population of ", SRC decsgn;trg) ENDPATTERN PATTERN Expressions IDENT ExpressionID : ExpressionID(exprvalue) exprvalue :: ExpressionID->Expression MEANING IN ENGLISH "The value of an expression." rels :: ExpressionID*Declaration MEANING IN ENGLISH "The user-declared relations in an expression." --CONCEPT Relation "A relation is a relation term in an expression linked to a user-declared relation" --IDENT Relation: Relation( relnm , relsgn;src, relsgn;trg) --VIEW Relation: Relation( relnm , TXT "[" , relsgn;src;name[Concept*Conid] , TXT "*" , relsgn;trg;name[Concept*Conid] , TXT "]") --relnm :: Relation -> Varid --MEANING IN ENGLISH "The name of a relation used as a relation token." --relsgn:: Relation -> Sign --MEANING IN ENGLISH "The sign of a relation." --reldcl:: Relation -> Declaration --MEANING IN ENGLISH "A relation token refers to a relation." --RULE "rel name is decl name": relnm = reldcl;decnm --MEANING IN ENGLISH "The name of a relation is used as a relation token to refer to that relation." ENDPATTERN PATTERN Rules IDENT Rule: Rule(rrnm) rrnm :: Rule -> ADLid [INJ] MEANING IN ENGLISH "The name of a rule." rrexp :: Rule -> ExpressionID MEANING IN ENGLISH "The rule expressed in relation algebra." rrmean:: Rule * Blob MEANING IN ENGLISH "The meanings of a rule." rrpurpose:: Rule * Blob MEANING IN ENGLISH "The purposes of a rule." ENDPATTERN ENDCONTEXT