Subject: Re: [SWIPL] That must be because of a Standard

From: "??????? ???????" <[email-masked]>
Date: Thu, 10 May 2001 00:26:54 +0400

Answer is No may be because of
0 is not the same as 0.0
0 <=> int.
0.0 <=> float.

just type
?- 0 = 0.0.

No
?-

Clone your rule with 0(int).
?- assert(my_predicate_with_zero('Yes sure', 0.0)).
?- assert(my_predicate_with_zero('Yes sure', 0)).
or
add term type check    % see "Verify Type of a Term" in Manual.
/Nick/

> Hello Swi-Prolog users,
>
> I am a newbie in SWI-PROLOG, However I have done some work, with another
> Prolog interpreter, which I am now trying to translate.
>
> In the above code, For instance, I previously assert
>
> ?- assert(my_predicate_with_zero('Yes sure', 0.0)).
>
> and then I query the following:
>
> ?- my_predicate_with_zero(X,  0).
>
> I would like to get X='Yes sure',
> However the answer is No.
>
> Can anyone give me some help, or explain me this?
> thanks in advance for any help you can provide,
>
> João