Entity: NamedElement 103 30 null * abstract name String 3 false false false Entity: Relationship 549 34 NamedElement * abstract Entity: Feature 6 125 NamedElement * abstract isStatic boolean 3 false false false Entity: Type 261 133 NamedElement * abstract typeId String 3 false true false Entity: Classifier 275 201 Type * abstract Entity: StructuralFeature 26 208 Feature * abstract isReadOnly boolean 3 false false false Entity: DataType 343 143 Classifier * abstract Entity: PrimitiveType 405 196 DataType * Entity: Enumeration 469 160 DataType * Entity: Entity 295 292 Classifier * isAbstract boolean 3 false false false isInterface boolean 3 false false false Entity: Property 27 325 StructuralFeature * lower int 3 false false false upper int 3 false false false isOrdered boolean 3 false false false isUnique boolean 3 false false false isDerived boolean 3 false false false Entity: Association 603 345 Relationship * addOnly boolean 3 false false false aggregation boolean 3 false false false Entity: Generalization 509 248 Relationship * Entity: EnumerationLiteral 374 54 NamedElement * Entity: BehaviouralFeature 8 471 Feature * abstract Entity: Operation 8 527 BehaviouralFeature * isQuery boolean 3 false false false isCached boolean 3 false false false text String 3 false false false Entity: Constraint 506 567 null * constraintKind int 3 false false false ordered boolean 3 false false false Entity: Expression 338 591 null * abstract needsBracket boolean 3 false false false umlKind UMLKind 3 false false false expId String 3 false true false Entity: UseCase 661 449 Classifier * isGeneric boolean 3 false false false isDerived boolean 3 false false false Entity: CollectionType 398 92 DataType * Association: Feature Type 0 210 130 262 140 1 type null Association: Entity Property 1 300 292 63 326 0 ownedAttribute owner ordered Association: Association Property -1 604 394 248 392 0 memberEnd null ordered Association: Enumeration EnumerationLiteral -1 568 161 535 79 0 ownedLiteral null ordered Association: Entity Generalization 1 362 293 511 251 0 generalization specific Association: Generalization Entity 0 579 273 523 325 1 general specialization Association: Entity Operation 1 326 346 208 530 0 ownedOperation owner ordered Association: Operation Expression -1 225 540 395 588 1 precondition null Association: Operation Expression -1 218 581 338 615 1 postcondition null Association: Constraint Expression -1 510 571 406 591 1 condition null Association: Constraint Expression -1 508 620 429 611 1 succedent null Association: Entity Constraint 1 447 348 578 566 0 constraint owner Association: UseCase Constraint -1 668 505 619 565 0 orderedPostconditions null ordered Association: UseCase Constraint -1 788 505 708 593 0 assumptions null 789 593 Association: BehaviouralFeature Property -1 166 474 186 423 0 parameters null ordered Association: UseCase Property -1 664 450 246 421 0 parameters null ordered Association: Association Entity -1 605 356 521 348 -1 linkedClass null Association: UseCase UseCase -1 800 451 845 450 0 extensions null 800 423 904 422 Association: UseCase UseCase 0 863 502 877 473 0 inclusions null 862 525 940 526 940 492 Association: CollectionType Type 0 394 98 307 133 1 elementType null Generalisation: NamedElement Feature 53 127 105 67 Generalisation: NamedElement Relationship 552 40 261 35 Generalisation: NamedElement Type 278 135 243 68 Generalisation: Feature StructuralFeature 168 210 167 162 Generalisation: Type Classifier 287 203 287 156 Generalisation: DataType Enumeration 471 165 425 163 Generalisation: DataType PrimitiveType 414 198 414 165 Generalisation: Classifier Entity 336 296 335 224 Generalisation: Classifier DataType 372 164 334 203 Generalisation: StructuralFeature Property 51 329 52 247 Generalisation: Relationship Association 731 348 650 58 Generalisation: Relationship Generalization 588 247 583 56 Generalisation: NamedElement EnumerationLiteral 375 62 260 58 Generalisation: Feature BehaviouralFeature 12 472 14 165 Generalisation: BehaviouralFeature Operation 35 528 35 493 Generalisation: Classifier UseCase 777 452 356 220 775 245 Generalisation: DataType CollectionType 420 119 422 145 Entity: CStruct 729 609 CType * name String 3 false true false Operation: toString CStruct String query true result = "struct " + name Entity: CMember 1138 619 null * name String 3 false false false isKey boolean 3 false false false Operation: toString CMember String query true result = " " + type + " " + name + ";\n" Entity: CType 899 845 null * abstract ctypeId String 3 false true false Operation: toString CType String query abstract true true Entity: COperation 556 917 null * name String 3 false false false text String 3 false false false scope String 3 false false false isQuery boolean 3 false false false Operation: parameterDeclaration COperation String s Sequence(CVariable) query true ( s.size = 0 => result = "" ) & ( s.size = 1 => result = s[1].type + " " + s[1].name ) & ( s.size > 1 => result = s[1].type + " " + s[1].name + ", " + parameterDeclaration(s.tail) ) Operation: toString COperation String query true result = returnType + " " + name + "(" + parameterDeclaration(parameters) + ")\n" + "{ " + text + " }\n" Entity: CVariable 917 991 null * name String 3 false false false kind String 3 false false false initialisation String 3 false false false Entity: CProgram 558 1049 null * Operation: printMainOperation CProgram void true "int main() { return 0; }"->display() Operation: printDeclarations CProgram void true true Operation: printOperations CProgram void true operations->forAll( op | op->display() ) Operation: printProgramHeader CProgram void true "#include "->display() & "#include "->display() & "#include "->display() & "#include "->display() & "#include "->display() & "#include "->display() & "#define ALLOCATIONSIZE 10\n"->display() & "#define TRUE 1"->display() & "#define FALSE 0\n"->display() & ("#include \"ocl.h\"\n")->display() Entity: CPrimitiveType 710 701 CType * name String 3 false false false Operation: toString CPrimitiveType String query true result = name Entity: CArrayType 616 764 CType * duplicates boolean 3 false false false Operation: toString CArrayType String query true result = componentType + "*" Entity: CPointerType 1151 764 CType * Operation: toString CPointerType String query true result = pointsTo + "*" Association: CStruct CMember 1 975 646 1137 632 0 members null ordered Association: COperation CVariable -1 816 954 920 1008 0 parameters null ordered Association: CVariable CType 0 1047 993 937 900 1 type null Association: COperation CType 0 816 917 901 899 1 returnType null Association: CArrayType CType 0 740 820 901 851 1 componentType null 741 847 Association: CPointerType CType 0 1251 802 1164 858 1 pointsTo null 1181 857 Association: CMember CType 0 1140 672 1055 845 1 type null Association: CProgram COperation 1 643 1051 653 1005 0 operations null Association: CProgram CVariable 1 739 1098 1019 1057 0 variables null Association: CProgram CStruct -1 560 1058 731 635 0 structs null 520 955 521 637 Generalisation: CType CStruct 962 663 962 847 Generalisation: CType CPrimitiveType 865 753 939 845 Generalisation: CType CPointerType 1160 801 1153 846 Generalisation: CType CArrayType 840 802 903 845 GeneralUseCase: printcode false Constraint: null true printProgramHeader() CProgram printcode false Constraint: null true ( "struct " + name + " {" )->display() & members->forAll( m | ( " " + m.type + " " + m.name + ";" )->display() ) & "};\n"->display() CStruct printcode false Constraint: null true ( "struct " + name + "** " + name.toLowerCase + "_instances = NULL;")->display() & ( "int " + name.toLowerCase + "_size = 0;\n" )->display() CStruct printcode false Constraint: null true ("struct " + name + "** append" + name + "(struct " + name + "* col[], struct " + name + "* ex)")->display() & (" { struct " + name + "** result;")->display() & (" int len = length((void**) col);")->display() & (" if (len % ALLOCATIONSIZE == 0)")->display() & (" { result = (struct " + name + "**) calloc(len + ALLOCATIONSIZE + 1, sizeof(struct " + name + "*));")->display() & (" int i = 0;")->display() & (" for ( ; i < len; i++) { result[i] = col[i]; }")->display() & (" }")->display() & (" else { result = col; }")->display() & (" result[len] = ex;")->display() & (" result[len+1] = NULL;")->display() & (" return result;")->display() & (" }\n")->display() CStruct printcode false Constraint: null true ("struct " + name + "* create" + name + "()")->display() & ("{ struct " + name + "* result = NULL;")->display() & (" result = (struct " + name + "*) malloc(sizeof(struct " + name + "));")->display() & (" " + name.toLowerCase + "_instances = append" + name + "(" + name.toLowerCase + "_instances, result);")->display() & (" " + name.toLowerCase + "_size++;")->display() & (" return result;")->display() & ("}\n")->display() CStruct printcode false Constraint: null true ("struct " + name + "** new" + name + "List()")->display() & ("{ return (struct " + name + "**) calloc(ALLOCATIONSIZE, sizeof(struct " + name + "*)); }\n")->display() CStruct printcode false Constraint: null true ("struct " + name + "** remove" + name + "(struct " + name + "* col[], struct " + name + "* self)")->display & (" { int len = length((void**) col);")->display() & (" struct " + name + "** result = (struct " + name + "**) calloc(len+1, sizeof(struct " + name + "*));")->display() & (" int j = 0;")->display() & (" int i = 0;")->display() & (" for ( ; i < len; i++)")->display() & (" { struct " + name + "* eobj = col[i];")->display() & (" if (eobj == NULL)")->display() & (" { result[j] = NULL;")->display() & (" return result;")->display() & (" }")->display() & (" if (eobj == self) { }")->display() & (" else { result[j] = eobj; j++; }")->display() & (" }")->display() & (" result[j] = NULL;")->display() & (" return result;")->display() & (" }\n")->display() CStruct printcode false Constraint: null true ("struct " + name + "** insert" + name + "(struct " + name + "* col[], struct " + name + "* self)")->display() & (" { if (isIn((void*) self, (void**) col))")->display() & (" { return col; }")->display() & (" return append" + name + "(col,self);")->display() & (" }\n")->display() CStruct printcode false Constraint: null true ("struct " + name + "** select" + name + "(struct " + name + "* col[], int (*test)(struct " + name + "* self))")->display() & ("{ struct " + name + "** result;")->display() & (" int len = length((void**) col);")->display() & (" result = (struct " + name + "**) calloc(len + 1, sizeof(struct " + name + "*));")->display() & (" int j = 0;")->display() & (" int i = 0;")->display() & (" for ( ; i < len; i++)")->display() & (" { struct " + name + "* self = col[i];")->display() & (" if (self == NULL)")->display() & (" { result[j] = NULL;")->display() & (" return result;")->display() & (" }")->display() & (" if ((*test)(self))")->display() & (" { result[j] = self;")->display() & (" j++;")->display() & (" }")->display() & (" }")->display() & (" result[j] = NULL;")->display() & (" return result;")->display() & ("}\n")->display() CStruct printcode false Constraint: null true ("struct " + name + "** reject" + name + "(struct " + name + "* col[], int (*test)(struct " + name + "* self))")->display() & ("{ struct " + name + "** result;")->display() & (" int len = length((void**) col);")->display() & (" result = (struct " + name + "**) calloc(len + 1, sizeof(struct " + name + "*));")->display() & (" int j = 0;")->display() & (" int i = 0;")->display() & (" for ( ; i < len; i++)")->display() & (" { struct " + name + "* self = col[i];")->display() & (" if (self == NULL)")->display() & (" { result[j] = NULL;")->display() & (" return result;")->display() & (" }")->display() & (" if ((*test)(self)) {}")->display() & (" else { result[j] = self;")->display() & (" j++;")->display() & (" }")->display() & (" }")->display() & (" result[j] = NULL;")->display() & (" return result;")->display() & ("}\n")->display() CStruct printcode false Constraint: null true (" void** collect" + name + "(struct " + name + "* col[], void* (*fe)(struct " + name + "*))")->display() & (" { int n = length((void**) col);")->display() & (" void** result = (void**) calloc(n+1, sizeof(void*));")->display() & (" int i = 0;")->display() & (" for ( ; i < n; i++)")->display() & (" { struct " + name + "* self = col[i];")->display() & (" result[i] = (*fe)(self);")->display() & (" }")->display() & (" result[n] = NULL;")->display() & (" return result;")->display() & (" }\n")->display() CStruct printcode false Constraint: null true (" unsigned char exists" + name + "(struct " + name + "* col[], int (*test)(struct " + name + "* ex))")->display() & (" { int n = length((void**) col);")->display() & (" unsigned char result = FALSE;")->display() & (" int i = 0;")->display() & (" for ( ; i < n; i++)")->display() & (" { struct " + name + "* ex = col[i];")->display() & (" if (ex == NULL) { return result; }")->display() & (" if ((*test)(ex))")->display() & (" { return TRUE; }")->display() & (" }")->display() & (" return result;")->display() & (" }\n")->display() COperation printcode false Constraint: null true (" unsigned char forAll" + name + "(struct " + name + "* col[], int (*test)(struct " + name + "* ex))")->display() & (" { int n = length((void**) col);")->display() & (" unsigned char result = TRUE;")->display() & (" int i = 0;")->display() & (" for ( ; i < n; i++)")->display() & (" { struct " + name + "* ex = col[i];")->display() & (" if (ex == NULL) { return result; }")->display() & (" if ((*test)(ex)) {}")->display() & (" else { return FALSE; }")->display() & (" }")->display() & (" return result;")->display() & (" }\n")->display() COperation printcode false Constraint: null true self->display() COperation printcode false Constraint: null true "main() { }"->display() CProgram printcode false GeneralUseCase: types2C false Constraint: name = "int" null CPrimitiveType->exists( p | p.ctypeId = typeId & p.name = "int" ) PrimitiveType types2C false Constraint: name = "long" null CPrimitiveType->exists( p | p.ctypeId = typeId & p.name = "long" ) PrimitiveType types2C false Constraint: name = "double" null CPrimitiveType->exists( p | p.ctypeId = typeId & p.name = "double" ) PrimitiveType types2C false Constraint: name = "boolean" null CPrimitiveType->exists( p | p.ctypeId = typeId & p.name = "unsigned char" ) PrimitiveType types2C false Constraint: name = "String" null CPointerType->exists( t | t.ctypeId = typeId & CPrimitiveType->exists( p | p.name = "char" & t.pointsTo = p ) ) PrimitiveType types2C false Constraint: name = "void" null CPrimitiveType->exists( p | p.ctypeId = typeId & p.name = "void" ) PrimitiveType types2C false Constraint: null true CPointerType->exists( p | p.ctypeId = typeId & CStruct->exists( c | c.name = name & c.ctypeId = name & p.pointsTo = c ) ) Entity types2C false Constraint: name = "Sequence" null CArrayType->exists( a | a.ctypeId = typeId & a.duplicates = true & a.componentType = CType@pre[elementType.typeId] ) CollectionType types2C false Constraint: name = "Set" null CArrayType->exists( c | c.ctypeId = typeId & c.duplicates = false & c.componentType = CType@pre[elementType.typeId] ) CollectionType types2C false GeneralUseCase: program2C false Constraint: p : ownedAttribute & p.name.size > 0 null CStruct->exists( c | c.name = name & CMember->exists( m | m.name = p.name & m.isKey = p.isUnique & m.type = CType@pre[p.type.typeId] & m : c.members ) ) Entity program2C false Constraint: null true COperation->exists( op | op.name = name & op.scope = "entity" & op.isQuery = isQuery & op.text = text & op.returnType = CType[type.typeId] & CVariable->exists( s | s.name = "self" & s.type = CType[owner.typeId] & s : op.parameters ) & parameters->forAll( p | CVariable->exists( v | v.name = p.name & v.type = CType[p.type.typeId] & v : op.parameters ) ) ) Operation program2C false Constraint: null true CMember->exists( m | m.name = "super" & CStruct->exists( sub | sub.name = specific.name & m : sub.members & m.type = CPointerType[general.typeId] ) ) Generalization program2C false Constraint: null true CProgram->exists( p | p.structs = CStruct.allInstances & p.operations = COperation.allInstances ) null program2C false Entity: BinaryExpression 57 560 Expression * operator String 3 false false false Entity: UnaryExpression 654 512 Expression * operator String 3 false false false Entity: CollectionExpression 646 438 Expression * isOrdered boolean 3 false false false Type: UMLKind 789 596 value variable constant role attribute operation classid function Entity: BasicExpression 284 628 Expression * data String 3 false false false prestate boolean 3 false false false Association: Expression Type 0 340 591 27 255 1 type null Association: Expression Type 0 345 591 108 257 1 elementType null Association: CollectionExpression Expression 0 647 457 338 598 0 elements null Association: BinaryExpression Expression 0 124 560 338 599 1 left null 125 578 Association: BinaryExpression Expression 0 208 572 338 605 1 right null 221 581 Association: BasicExpression Expression 0 427 633 350 570 0 parameters null ordered Association: UnaryExpression Expression -1 657 515 413 592 1 argument null Association: BasicExpression Property 0 588 637 627 679 -1 referredProperty null Association: BasicExpression BasicExpression -1 287 734 339 758 -1 arrayIndex null 227 733 227 796 307 797 Association: Property Expression -1 664 678 335 616 1 initialValue null 665 626 514 622 Association: BasicExpression BasicExpression -1 490 753 408 762 -1 objectRef null 552 753 551 802 443 803 Generalisation: Expression UnaryExpression 655 539 341 610 Generalisation: Expression BasicExpression 357 626 347 613 Generalisation: Expression BinaryExpression 57 618 348 618 23 619 24 618 288 616 Generalisation: Expression CollectionExpression 722 439 375 637 722 623 474 622