I want to have logical connectives like
not(X), conj(X, Y), some(Y, K).
, and I want to be able to iterate over them.
So, for example, I want to be able to convert not (some (Y, K)) to all (Y, not (K)).
I do not want them to have any special meaning, I just want to work with logical formulas in this way.
What is the best way to do this?
Here is the actual line in my code:
nnf(not(all(X, Y)) ,some(Z, W)) :- nnf(X, Z), nnf(not(Y), W).
So, if I give it not(all(a,b))
, I want to return some (a, not (b)), but atm. I don't know how to get Prolog to handle not/1
and all/2
in this way.