or(TRUE,y) -> TRUE
or(FALSE,y) -> y

and(TRUE,y) -> y
and(FALSE,y) -> FALSE

eq(Z,Z) -> TRUE
eq(S(x),S(y)) -> eq(x,y)
eq(Z,y) -> FALSE
eq(x,Z) -> FALSE

mem(a,NIL) -> FALSE
mem(a,CONS(b,l)) -> or(eq(a,b), mem(a,l))

qbf(VAR(n),l) -> mem(n,l)
qbf(OR(f1,f2),l) -> or(qbf(f1,l), qbf(f2,l))
qbf(AND(f1,f2),l) -> and(qbf(f1,l), qbf(f2,l))
qbf(EXISTS(n,f),l) -> or(qbf(f,l), qbf(f,CONS(n,l)))
qbf(FORALL(n,f),l) -> and(qbf(f,l), qbf(f,CONS(n,l)))


[or](x,y) = max(x,y)
[and](x,y) = max(x,y)
[eq](x,y) = max(x,y)
[mem](a,l) = max(a,l)
[VAR](x) = x+1
[OR](x,y) = x+y+1
[AND](x,y) = x+y+1
[EXISTS](x,y) = x+y+1
[FORALL](x,y) = x+y+1
[qbf](f,l) = f+l
[TRUE] = 1
[FALSE] = 1
[Z] = 1
[S](x) = x+1
[NIL] = 1
[CONS](a,l) = a+l+1
