--------------------------------------------------------------
(1) {x,y,u,v,w | customer(x,y,u,v,w) }

Relation CUSTOMER is not present in the database
--------------------------------------------------------------
(2) {x,y,u,v | customers(x,y,u,v,10) }

TYPE ERROR: Constant 10 does not match Database Type of VARCHAR
--------------------------------------------------------------
(3) {x | (exists y,y)(zipcodes(x,y)) }

REPEATED VARIABLE in VarList of EXISTS
--------------------------------------------------------------
(4) {x,y,x | zipcodes(x,y) }

REPEATED VARIABLE in VarList of QUERY
--------------------------------------------------------------
(5) {x,y | (exists x)(zipcodes(x,y)) }

ERROR: Query variable X does not appear as free variable in DRC expression
--------------------------------------------------------------
(6) {x | zipcodes(x,y)}

ERROR: Free variable Y in DRC expression does not appear in query variables
--------------------------------------------------------------
(7) {x,y,u | customers(x,y,u,x,'aaa') }

NO ERROR
--------------------------------------------------------------
(8) {x,y,u | customers(x,y,x,u,'a') }

TYPE ERROR: Variable X has conflicting types VARCHAR and INTEGER
--------------------------------------------------------------
(9) {x,y,u | customers(x,y,u) and zipcodes(u,'aa') }

ERROR: Arity of predicate CUSTOMERS does not match number of columns in Database 
--------------------------------------------------------------
(10) {x,y,u | customers(x,y,u,x,'aa') and zipcodes(x,'bb') }

NO ERROR
--------------------------------------------------------------
(11) {x,y,u | customers(x,y,u,x,'aa') and zipcodes(y,'bb') }

TYPE ERROR: Variable Y has conflicting types VARCHAR and INTEGER
--------------------------------------------------------------
(12) {name | (exists cno,a,b,c)(
          customers(cno,name,a,b,c) and
          (exists d,e,f,g,h,i,j,k)(
              orders(d,cno,e,f,g) and
              orders(h,cno,i,j,k) and
              d<>h) and
           not ((exists d1,e1,f1,g1,d2,e2,f2,g2,d3,e3,f3,g3)(
                    orders(d1,cno,e1,f1,g1) and
                    orders(d2,cno,e2,f2,g2) and
                    orders(d3,cno,e3,f3,g3) and
                    d1<>d2 and d2<>d3 and d1<>d3
                ))
         ) }

NO ERROR
--------------------------------------------------------------
(13) {name | (exists cno,a,b,c)(
          customers(cno,name,a,b,c) and
          (exists d,e,f,g,h,i,j,k)(
              orders(d,cno,e,f,g) and
              orders(h,cno,i,j,k) and
              d<>h) and
           not ((exists d1,e1,f1,g1,d2,e2,f2,g2,d3,e3,f3)(
                    orders(d1,cno,e1,f1,g1) and
                    orders(d2,cno,e2,f2,g2) and
                    orders(d3,cno,e3,f3,g3) and
                    d1<>d2 and d2<>d3 and d1<>d3
                ))
         ) }

SAFETY ERROR: G3 UNLIMITED
--------------------------------------------------------------
(140 {name | (exists cno,a,b,c)(
          customers(cno,name,a,b,c) and
          (exists d,e,f,g,h,i,j,k)(
              orders(d,cno,e,f,g) and
              orders(h,cno,i,j,k) and
              d<>h) and
           not ((exists d1,e1,f1,g1,d2,e2,f2,g2,d3,e3,f3,g3)(
                    orders(d1,f1,e1,cno,g1) and
                    orders(d2,cno,e2,f2,g2) and
                    orders(d3,cno,e3,f3,g3) and
                    d1<>d2 and d2<>d3 and d1<>d3
                ))
         ) }

TYPE ERROR: Variable CNO has conflicting types VARCHAR and INTEGER
--------------------------------------------------------------
(15) {x,y | zipcodes(x,y) or not(x>60000) }

UNSAFE Query: Variable Y appears free in one of the disjuncts and not in one of the other disjuncts
--------------------------------------------------------------
(16) {x | (exists y)(zipcodes(x,y)) or (x>60000) }

SAFETY ERROR: comparison-sub-expression has a non-and parent
--------------------------------------------------------------
(17) {x | (exists y)(zipcodes(x,y)) or not((exists y)(zipcodes(x,y))) }

SAFETY ERROR: not-sub-expression has a non-and parent
--------------------------------------------------------------
(18) {a,b,c | (exists x,y,z)(customers(a,b,x,y,z)) or zipcodes(b,c) }

TYPE ERROR: Variable B has conflicting types VARCHAR and INTEGER
--------------------------------------------------------------
(19) {a,b,c | (exists x,y,z)(customers(a,b,x,y,z)) or zipcodes(a,c) }

UNSAFE Query: Variable C appears free in one of the disjuncts and not in one of the other disjuncts
--------------------------------------------------------------
(20) { A | (exists T)(actors(T,A) and
              not((exists M)(actors(M,A) and not(movies(M,'Kurosawa'))))) }

NO ERROR
--------------------------------------------------------------
(21) { D | (exists T)(movies(T,D) and
         not((exists M,A,S)(actors(M,A) and movies(S,D) and 
                             not((exists V)(movies(V,D) and actors(V,A)))))) }
NO ERROR
--------------------------------------------------------------