等效,但不是一致性

发布于 2025-01-28 21:10:12 字数 201 浏览 3 评论 0原文

我正在研究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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柏林苍穹下 2025-02-04 21:10:12

除了“行为等价”以外,还有其他等价。等价是反身性,对称和及时性的任何关系。一致性是一个具有结构的等效性。

等效性的一个常见示例是算术模量。平等说modulo 10是一种等价关系,可以保留添加和乘法,因此这是整数环算术的一致性。但这并不是“圆形到0整数部门”的一致性。例如23/11 = 23/1 = 3,即23 mod 10 = 3 mod 1011 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 but 3/1=3, that is 23 mod 10 = 3 mod 10 and 11 mod 10 = 1 mod 10, but 23/11 mod 10 <> 3/1 mod 10.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文