 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ELEMENT2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


element2(ownedMember,0,Id):-class2(_,Id).

element2(ownedMember,0,Id):-stereotype2(_,Id).

element2('xmi:Extension',IdC,[IdC,1]):- 
				element2(ownedMember,_,IdC),
				associationEnds2(extension,IdC,IdE),
				associationEnds2(stereotype,IdE,_).

element2(appliedStereotype,[IdC,1],[IdS,1]):-
				element2(ownedMember,_,IdC),
				associationEnds2(extension,IdC,IdE),
				associationEnds2(stereotype,IdE,IdS).
element2(ownedAttribute,Id1,Id2):-			 
			property2_name(type,Id1,Id2),
			property2_composite(false,Id1,Id2),
			property2_unique(false,Id1,Id2),
			property2_lower('1',Id1,Id2),
			property2_upper('1',Id1,Id2).


element2(ownedEnd,[Id1,Id2],[Id1,Id2,Name]):-
				association2(_,[Id1,Id2]),
				property2_name(Name,Id1,Id2).

element2(lowerValue,[Id1,Id2,Name],[Id1,Id2,Name,1]):-
				association2(_,[Id1,Id2]),
				property2_name(Name,Id1,Id2).

element2(upperValue,[Id1,Id2,Name],[Id1,Id2,Name,2]):-
				association2(_,[Id1,Id2]), 
				property2_name(Name,Id1,Id2).

element2(memberEnd,[Id1,Id2],[Id1,Id2,Name,memberEnd]):-
				association2(_,[Id1,Id2]), 
				property2_name(Name,Id1,Id2).



element2(ownedEnd,[Id1,Id2],[Id1,Id2,7]):-
			property2_name('',Id2,Id1).

element2(lowerValue,[Id1,Id2,7],[Id1,Id2,7,1]):-
			 
			property2_name('',Id2,Id1).

element2(upperValue,[Id1,Id2,7],[Id1,Id2,7,2]):-
			 
			property2_name('',Id2,Id1).

element2(memberEnd,[Id1,Id2],[Id1,Id2,8]):-
			 
			property2_name('',Id2,Id1).

element2(ownedMember,0,[Id1,Id2]):-association2(_,[Id1,Id2]).


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ATT2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


att2(name,Name,Id,Id):-class2(Name,Id).

att2('xmi:type','uml:Class',Id,Id):-class2(_,Id).

att2('xmi:id',Id2,Id,Id):-class2(_,Id),gen(Id,Id2).

att2(name,Name,Id,Id):-stereotype2(Name,Id).

att2('xmi:type','uml:Stereotype',Id,Id):-stereotype2(_,Id).

att2('xmi:id',Id2,Id,Id):-stereotype2(_,Id),gen(Id,Id2).

att2('xmi:Extender','Visual Paradigm for UML',[IdC,1],[IdS,1]):-
				element2(ownedMember,_,IdC),
				associationEnds2(extension,IdC,IdE),
				associationEnds2(stereotype,IdE,IdS).

att2('xmi:value',IdS,[IdS,1],[IdS,1]):-stereotype2(_,IdS).

att2(name,type,Id2,Id2):-
			 
			property2_name(type,_,Id2),
			property2_composite(false,_,Id2),
			property2_unique(false,_,Id2),
			property2_lower('1',_,Id2),
			property2_upper('1',_,Id2).

att2(type,Type,Id2,Id2):-
			 
			property2_name(type,_,Id2),
			property2_type(Type,_,Id2),
			property2_composite(false,_,Id2),
			property2_unique(false,_,Id2),
			property2_lower('1',_,Id2),
			property2_upper('1',_,Id2).

att2('xmi:id',Id3,Id2,Id2):-
			 
			property2_name(type,_,Id2),
			property2_composite(false,_,Id2),
			property2_unique(false,_,Id2),
			property2_lower('1',_,Id2),
			property2_upper('1',_,Id2),
			gen(Id2,Id3).

att2('xmi:type','uml:Property',Id2,Id2):-
			 
			property2_name(type,_,Id2),
			property2_composite(false,_,Id2),
			property2_unique(false,_,Id2),
			property2_lower('1',_,Id2),
			property2_upper('1',_,Id2).

att2(name,Name,[Id1,Id2,Name],[Id1,Id2,Name]):-
				 
				property2_name(Name,Id1,Id2).

att2(isNavigable,true,[Id1,Id2,Name],[Id1,Id2,Name]):-
				 
				property2_name(Name,Id1,Id2).

att2(type,IdA,[Id1,Id2,Name],[Id1,Id2,Name]):-
				  
				property2_name(Name,Id1,Id2),
				gen(Id2,IdA).

att2(association,IdA,[Id1,Id2,Name],[Id1,Id2,Name]):-
				 
				property2_name(Name,Id1,Id2),
				gen([Id1,Id2],IdA).

att2(aggregation,composite,[Id1,Id2,Name],[Id1,Id2,Name]):-
				 
				property2_name(Name,Id1,Id2),
				property2_composite(true,Id1,Id2).

att2(aggregation,none,[Id1,Id2,Name],[Id1,Id2,Name]):-
				  
				property2_name(Name,Id1,Id2),
				property2_composite(false,Id1,Id2).

att2('xmi:id',Id3,[Id1,Id2,Name],[Id1,Id2,Name]):-
				 
				property2_name(Name,Id1,Id2),
				gen([Name,Id1,Id2],Id3).

att2('xmi:type','uml:Property',[Id1,Id2,Name],[Id1,Id2,Name]):-
				 
				property2_name(Name,Id1,Id2).

att2(value,Lower,[Id1,Id2,Name,1],[Id1,Id2,Name,1]):-
				 
				property2_name(Name,Id1,Id2),
				property2_lower(Lower,Id1,Id2).

att2(value,Upper,[Id1,Id2,Name,2],[Id1,Id2,Name,2]):-
				 
				property2_name(Name,Id1,Id2),
				property2_upper(Upper,Id1,Id2).

att2('xmi:idref',Id3,[Id1,Id2,Name,memberEnd],[Id1,Id2,Name,memberEnd]):-	
				  
				property2_name(Name,Id1,Id2),
				gen([Id1,Id2],Id3).


att2(name,'',[Id1,Id2,7],[Id1,Id2,7]):-
			 
			property2_name('',Id2,Id1).

att2(isNavigable,true,[Id1,Id2,7],[Id1,Id2,7]):-
			 
			property2_name('',Id2,Id1).

att2(type,IdA,[Id1,Id2,7],[Id1,Id2,7]):-
			 	
			property2_name('',Id2,Id1),
			gen(Id1,IdA).

att2(association,IdA,[Id1,Id2,7],[Id1,Id2,7]):-
			 
			property2_name('',Id2,Id1),
			gen([Id1,Id2],IdA).

att2(aggregation,composite,[Id1,Id2,7],[Id1,Id2,7]):-						
			 
			property2_name('',Id2,Id1),
			property2_composite(true,Id2,Id1).

att2(aggregation,none,[Id1,Id2,7],[Id1,Id2,7]):-
			 
			property2_name('',Id2,Id1),
			property2_composite(false,Id2,Id1).

att2('xmi:id',Id3,[Id1,Id2,7],[Id1,Id2,7]):-
			 
			property2_name('',Id2,Id1),
			gen([3,Id2],Id3).

att2('xmi:type','uml:Property',[Id1,Id2,7],[Id1,Id2,7]):-
			 
			property2_name('',Id2,Id1).

att2(value,Lower,[Id1,Id2,7,1],[Id1,Id2,7,1]):-
			 
			property2_name('',Id2,Id1),
			property2_lower(Lower,Id2,Id1).

att2(value,Upper,[Id1,Id2,7,2],[Id1,Id2,7,2]):-
			 
			property2_name('',Id2,Id1),
			property2_upper(Upper,Id2,Id1).

att2('xmi:idref',Id3,[Id1,Id2,8],[Id1,Id2,8]):-
			 
			property2_name('',Id2,Id1),
			gen([3,Id2],Id3).


att2('xmi:id',IdA,[Id1,Id2],[Id1,Id2]):-association2(_,[Id1,Id2]),
					gen([Id1,Id2],IdA).

att2('xmi:type','uml:Association',Id,Id):-association2(_,Id).




