三个值变量,最大值、最小值、实际值
很久以前,我使用 Egeria(一种专家系统语言)开发了系统。 它有一个非常有用的功能,其中变量具有三个值:最小值、最大值和当前值。 通过这种方式,可以计算部分已知值的概率,结果最终作为一个范围。 我不记得语法了,但它是这样的:-
A.Min = 1;
A.Max = 5;
A.Current= 4;
B.Min = 2;
B.Max = 4;
B.Current= 4;
A * B = {2, 20, 16}
我的问题是,这种方法叫什么,当前有任何语言实现它吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
像您所描述的那样的多值变量可以在基于约束的编程中使用。 有关最近的论文,请参阅 Radul 和 Sussman,“传播者的艺术”传播者”。
Radul 先生上周在 ILC 2009 上发表了演讲。 他给出了一个(人们可能会想到的)多值变量的例子,这些变量代表了“真相”的概率近似值。 (对于任何失实陈述,我提前表示歉意,我没有注释。)
考虑一个必须协调两个热传感器读数的系统。 进一步假设每个传感器的读数都具有一定程度的不确定性:传感器 A 表示温度在 A1 和 A2 之间,传感器 B 表示温度在 B1 和 B2 之间。 系统在尝试计算温度时是否会失败? 也许“真相”可以用读数重叠的范围来表达。
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.
听起来,作为一种“方法”,它可能是一种模糊逻辑。 特别是当你描述它被概率地使用时。
It sounds like, as an "approach", it may be a species of fuzzy logic. Especially when you describe it being used probabilistically.
Yacc 原始论文(发表于 UNIX 程序员手册第 7 版第 2 卷;论文日期为 1978 年 7 月 31 日)的附录 C 描述了“一种进行浮点区间运算的桌面计算器”。 它使用带有符号“( min, max )”的间隔并实现基于范围的算术。 您所描述的也是“当前”值的扩展。
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.
大多数面向对象的语言可以使用类相当容易地做到这一点。
例如,特别是在 C++ 中,创建一个模板类来为您处理任何基类型的问题是非常容易的。
不过,我不知道有任何语言支持将此作为核心语言的一部分。
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.