“NOT EXISTS” in swi-prolog?

The following works for me and provides the expected result: no_car(W):- worker(W), \+ owner(W, _) Now this is close to what you have. For one thing, you can of course use in predicates; it is not restricted to queries. I usually use for negation, and not gives me a syntax error here!?

EDIT: Ah! In my, albeit dated, version of Prolog you have to use not(hascar(X)) to make it work, so not/1 needs to be used as a term, not an operator. But the manual also says not is deprecated in favor of.

The following works for me and provides the expected result: no_car(W):- worker(W), \+ owner(W, _). Now this is close to what you have. For one thing, you can of course use _ in predicates; it is not restricted to queries.

I usually use \* for negation, and not gives me a syntax error here!? EDIT: Ah! In my, albeit dated, version of Prolog you have to use not(hascar(X)) to make it work, so not/1 needs to be used as a term, not an operator.

But the manual also says not is deprecated in favor of \+.

Thank you! Not(hascar(X)) works fine. Looks strange after working with some other versions of prolog, I didn't guess to check it.

– iensen Sep 24 at 19:49.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions