🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #2872

Re: Comparing numbers

#2872
From: Leon Sterling
Date: Tue, 17 Nov 1987 19:15
24 lines
1625 bytes
Bruce Holmes questions' are good examples of `kosher pigs',
i.e. strictly legalistic curiosities that can't (more realistically
shouldn't) arise.

In his example of type conversion, only one of the queries makes
sense, namely 1.0 =:= 1?  (The testing procedure is irrelevant.)
This is the ONLY Prolog predicate which does evaluation as part of its
comparison.
It is probably sensible for this goal to succeed, thouigh it would
not be unreasonable for =:= only to compare values of the same type.

The meta-logical test 1.0 == 1? should only be applied to non-ground
terms. If its behaviour must be defined, I feel strongly that the
query should fail. The real number 1.0 is not the same object as the 
integer 1.

The unification test 1.0 = 1? should also fail, it seems to me.
Do we want a list with one element, a say, to unify with a binary
tree with a single leaf node a?                                           

Roundoff behaviour is a question for implementing arithmetic,
and is irrelevant in language design.

            Leon Sterling
Technical Details
Message-ID: <2307@mandrill.CWRU.Edu>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!ucbcad!ucbvax!cbosgd!mandrill!leon

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!ucbcad!ucbvax!cbosgd!mandrill!leon
From: leon@mandrill.CWRU.Edu (Leon Sterling)
Newsgroups: comp.lang.prolog
Subject: Re: Comparing numbers
Message-ID: <2307@mandrill.CWRU.Edu>
Date: Tue, 17-Nov-87 14:15:59 EST
Article-I.D.: mandrill.2307
Posted: Tue Nov 17 14:15:59 1987
Date-Received: Sat, 21-Nov-87 03:42:17 EST
Reply-To: leon@mandrill.UUCP (Leon Sterling)
Organization: CWRU Dept. of Computer Engineering, Cleveland OH
Lines: 24