views:

193

answers:

4

A long while ago I developed systems using Egeria an expert system language. It had a really useful feature where variables had three values, a min, max and current. In this way the probability of a partly known value could calculated, with the results ending up as a range. I can't remember the syntax, but it was something like this :-

A.Min = 1;
A.Max = 5;
A.Current= 4;
B.Min = 2;
B.Max = 4;
B.Current= 4;


A * B = {2, 20, 16}

My question is this, what is this approach called, and do any current languages implement it?

A: 

Most object oriented languages could do this fairly easily using classes.

In C++, in particular, it would be very easy to make a templated class that handled this for you for any base type, for example.

I don't know of any languages that support this as part of the core language, though.

Reed Copsey
I realise I could code it, but I' like this built in as core if possible, it's a really useful foundation for lots of other features. Without that already in the language I'd have to re-implement all those extra features too.
MrTelly
+2  A: 

It sounds like, as an "approach", it may be a species of fuzzy logic. Especially when you describe it being used probabilistically.

chaos
+2  A: 

Multi-valued variables like the ones you describe may be used in constraint-based programming. For a recent paper see Radul and Sussman, "The Art of the Propagator".

Mr. Radul presented at ILC 2009 last week. He gave an example of (what one might consider) multi-valued variables that represent a probabilistic approximation to "truth". (I apologize in advance for any misrepresentation, I don't have notes.)

Consider a system that must reconcile readings from two thermal sensors. Suppose further that each sensor's readings come with some degree of uncertainty: sensor A says the temp is between A1 and A2, sensor B says temp is between B1 and B2. Should the system fail in the attempt to compute the temperature? Perhaps the "truth" can be expressed in terms of the range where the readings overlap.

kmcorbett
+1  A: 

Appendix C of the original paper on Yacc (published in Volume 2 of the UNIX Programmer's Manual for Version 7; the paper is dated 1978-07-31) described a 'a desk calculator that does floating point interval arithmetic'. It used intervals with the notation '( min, max )' and implemented range-based arithmetic. What you describe is an extension of that with the 'current' value too.

Jonathan Leffler