%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  ENTITY-RELATIONSHIP-RELATIONAL TRANSFORMATION EXAMPLE
%  Author: Jesus Almendros and Luis Iribarne. March 2012.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%(30)
val: bad_key_name(Key):- mmB:key(Key)  and mmB:name(Key,Name) and mmA:key_name(_,NameKey) and makeSet(NameKey,Names) and notElement(Name,Names).

 
val: bad_key_type(Key):- mmB:key(Key) and mmB:type(Key,Type) and
mmA:key_type(_,TypeKey) and makeSet(TypeKey,Types) and notElement(Type,Types).
 

val: bad_col_name(Col):- mmB:col(Col) and mmB:name(Col,Name) and mmA:col_name(_,NameCol) and makeSet(NameCol,Names) and notElement(Name,Names).

 
val: bad_col_type(Col):- mmB:col(Col) and mmB:type(Col,Type) and mmA:col_type(_,TypeCol) and
makeSet(TypeCol,Types) and notElement(Type,Types).

%(31)
val:bad_table_name(Table):-mmB:table(Table) and mmB:name(Table,Name) and mmA:table_name(_,NameTable) and makeSet(NameTable,Names) and notElement(Name,Names).

%(32)
val:bad_row_name(Row):-mmB:row(Row) and mmB:name(Row,Name) and mmA:row_name(_,NameRow) and makeSet(NameRow,Names) and notElement(Name,Names).

%(33)
val:bad_foreign_name(Foreign):-mmB:foreign(Foreign) and mmB:name(Foreign,Name) and mmA:foreign_name(_,NameForeign) and makeSet(NameForeign,Names) and notElement(Name,Names).