-dp- wrote: > Is there a way to configure a particular call to unification to require that > any floats or doubles within the compounds should be considered equal if, > say, they are the same up to some configured number of decimal places? > > For example, I would like to provide some argument to operator = here, > > p(X) = p(Y) or =(p(X), p(Y)) > > so that if X and Y happen to be the same for their integer part and the > first, say, three significant digits of their fractional part, then the > unification should succeed. > > I'm pretty sure there is no such feature, but it seemed worth asking since > unifying is fairly pointless if the args are compounds and there's a chance > there's a float somewhere in either of them. > > The best alternative I can think of is to write my own unifier predicate and > add this feature. Maybe one solution could be to use the IC library or the RIA library (I am not sure if RIA still exists), see, eg., the comparison in the manual: http://87.230.22.228/doc/libman/libman017.html#toc13 and then use the equality constraint instead of unification. Best, Marco -- Marco Gavanelli, Ph.D. in Computer Science Dept of Engineering University of Ferrara http://www.ing.unife.it/docenti/MarcoGavanelli/Received on Tue Feb 09 2010 - 11:06:29 CET
This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET