How to OR and AND operator in CLIPS?

102 views
Skip to first unread message

Amol salunke

unread,
May 9, 2020, 2:14:27 PM5/9/20
to CLIPSESG

I need to OR and AND operator while expression evaluation, but when I use it o CLIPSDOS it give wrong result.


CLIPS (6.31 6/12/19) 

CLIPS> ( and 0 1 )

 TRUE

 CLIPS>


“I expect the output FALSE but it give TRUE, What could be wrong in it?'

CLIPS Support

unread,
May 9, 2020, 2:16:23 PM5/9/20
to CLIPSESG

In C, the integer 0 is false and any other integer is true.

In CLIPS, the symbol FALSE is false and any other value is true.

         CLIPS (6.31 6/12/19)
CLIPS> (and 0 1)
TRUE
CLIPS> (and 1 2)
TRUE
CLIPS> (and FALSE TRUE)
FALSE
CLIPS> 
Reply all
Reply to author
Forward
0 new messages