等效,但不是一致性
。
我正在研究SF/PLF章节 有练习
我们已经表明,[cequiv]关系既是等价的,又是命令的一致性。您能想到与等效性的命令的关系,但不是一致?
我不太了解等效与一致性之间的区别。 似乎两个程序的行为等效性。 有人可以对此解释更多吗?
谢谢
All
I'm working on sf/plf chapter Equiv. There is an exercise
We've shown that the [cequiv] relation is both an equivalence and a congruence on commands. Can you think of a relation on commands that is an equivalence but not a congruence?
I do not quite understand the difference between equivalence and congruence.
It seems both behavioral equivalence of a program.
Can any one explain more about this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
除了“行为等价”以外,还有其他等价。等价是反身性,对称和及时性的任何关系。一致性是一个具有结构的等效性。
等效性的一个常见示例是算术模量。平等说modulo 10是一种等价关系,可以保留添加和乘法,因此这是整数环算术的一致性。但这并不是“圆形到0整数部门”的一致性。例如
23/11 = 2
但3/1 = 3
,即23 mod 10 = 3 mod 10
和11 mod 10 = 1 mod 10
,但是23/11 mod 10<> 3/1 mod 10
。There are other equivalences than "behavioral equivalence". An equivalence is any relation which is reflexive, symmetric and transitive. A congruence is a structure-preserving equivalence.
A common example for an equivalence which is a congruence is arithmetic modulo n. Equality say modulo 10 is an equivalence relation which preserves addition and multiplication, so it is a congruence for the integer ring arithmetic. But it is not a congruence e.g. for "round to 0 integer division". E.g.
23/11=2
but3/1=3
, that is23 mod 10 = 3 mod 10
and11 mod 10 = 1 mod 10
, but23/11 mod 10 <> 3/1 mod 10
.