AMN 和数学逻辑符号
我不确定这是否适合 stackoverflow,但我不知道还能去哪里问。我正在研究 B 方法来证明需求规范的一致性,并且在指定操作的先决条件时,我对逻辑数学符号有疑问。
简化原始问题,我有一个变量,它是 FLIGHT_NO x TIME x TIME 之间笛卡尔积的子集 flights,其中对于每个成员 (no,td,ta),no 表示航班的数量航班,td 为出发时间,ta 为到达时间。如何使用数学逻辑符号获得 flights 中 td 值最大的元素?
I'm not sure this is appropriate for stackoverflow, but I don't know where else to ask. I'm studying the B-Method for proving consistence in requirement specifications, and I have an issue with the logic math notation when specifying the pre conditions of the operations.
Simplifying the original problem, I have a variable which is a subset flights of the cartesian product between FLIGHT_NO x TIME x TIME, where for each member (no,td,ta), no means the number of the flight, td the time of departure and ta the tme of arrival. How can I get, using math logic notation, the element of flights that has the biggest value of td?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您想要获取这样的元素,还是测试您拥有的元素是否满足此属性?我这么问是因为第二个似乎是手术的合理先决条件。我不太了解B法的具体情况;我查看了一些文档,但找不到快速参考,因此这在某些细节上可能是错误的。
第二个应该如下所示(
prj2
用于第二个投影):那么第一个是:
Do you want to get such an element, or to test that an element you have satisfies this property? I am asking because the second seems a sensible precondition to an operation. I don't know the B-Method specifically; I've looked at some documents, but can't find a quick reference, so this may be wrong in some details.
The second should look like this (
prj2
is used for the second projection):Then the first is:
原谅我的无知,我对B法不熟悉。但是你不能使用唯一性量词吗?它看起来像这样:
存在一个时间 td ,使得对于所有时间 td' , td > 。 td'
以及
对于所有 td、td'、td'',如果 td > td''和td'> td'' then td == td'
当然,这假设集合中只有一个元素。我无法真正判断 B 方法是否允许一阶逻辑的全部功能,但我假设您可以接近这一点。
Forgive my ignorance, I'm not familiar with the B-Method. But couldn't you use the uniqueness quantifier? It'd look something like:
there exists a time td such that for all times td', td > td'
and
for all td, td', td'', if td > td'' and td' > td'' then td == td'
This, of course, assumes that there is exactly one element in the set. I can't really tell if the B-Method allows for the full power of first order logic but I assume you could come close to this.
可以在 B 中定义函数。函数具有常量值,将在 ABSTRACT_CONSTANTS 子句中列出,并在 PROPERTIES 子句中定义。我尝试解释如何使用此结构来解决您的问题。
接下来是一小段摘录,其中
It is possible to define functions in B. Functions have constant values and are to be listed in the ABSTRACT_CONSTANTS clause, and defined in the PROPERTIES clause. I try to explain how you can use this construct to solve your problem.
Follows a small excerpt where