home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!bcc.ac.uk!link-1.ts.bcc.ac.uk!ucjtrjf
- From: ucjtrjf@ucl.ac.uk (Jonny Farringdon)
- Newsgroups: comp.lang.prolog
- Subject: Re: fuzzy unification of floating point numbers
- Message-ID: <1992Aug13.133930.25900@bas-a.bcc.ac.uk>
- Date: 13 Aug 92 13:39:30 GMT
- References: <1992Aug12.210954.15241@cs.ucla.edu>
- Organization: Bloomsbury Computing Consortium
- Lines: 31
-
- >Does anybody know the prolog for UNIX which supports
- >the fuzzy unification of floating point numbers,
- >that is two floating point numbers are considered
- >equal if | X - Y | =< FUZZVALUE and this FUZZVALUE
- >can be changed by user? I know that VM/Prolog has
- >this feature, but it works on mainframe.
- >Any information is appreciated.
-
- Mike,
-
- each time you want to do
-
- thing(A,B) :-
- a = b,
- important_thing.
-
- do:
-
- thing(A,B) :-
- fuzzy_equality_test(A,B),
- important_thing.
-
- fuzzy_equality_test(A,B) :-
- fuzzy_unify_value(V), !,
- Diff is A - B,
- absolute_value(Diff,Abs_Diff),
- Abs_Diff < V.
-
- fuzzy_equality_test(A,A) :- !.
-
- J. ucjtrjf@ucl.ac.uk
-