[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to use not in gprolog?
From: |
Jean Michel LECONTE |
Subject: |
Re: How to use not in gprolog? |
Date: |
Tue, 30 Oct 2001 14:21:24 +0000 |
u can use the predicate \+(Goal) wich means not provable
not/1 isnt a builtin in GNU Prolog
a possible definition of not/1 is :
not(Goal):-Goal,!, fail.
not(Goal):-true.
Regards,
Jean Michel LECONTE
Carfield Yim wrote :
> Hi, I need to find the negation of a clause, e.g.:
>
> e.g: if Z is a member of list T and Y is not a member of T, member(Z,T)
> should return true and member(Y,T) should return false. I would like to get
> the negation of this clause, i.e.: not(member(Z,T)) return false and
> not(member(Y,T)) return true. But it doesn't work. So I try
> member(X,T)\=true. and once(member(X,T))\=true. But both don't work.
>
> So I would like to ask how to get the negation of a clause?