- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
首先介绍一些术语(取自here,第14页):
正程序是有错误的程序。
否定程序是没有错误的程序。
因此,程序有四种类型:
积极计划,分析为积极->真正积极(TP)。
积极计划,分析为否定->假否定(FN)。
否定程序,分析为肯定->假肯定(FP)。
否定程序,分析为否定->真否定(TN)。
如果系统从不接受肯定的程序,则它为声音。
如果系统从不拒绝否定程序,则它是完整。
因此,从我上面写的内容来看:
A complete system accepts FN and TN programs.
A sound system also accepts FN and TN programs.
一位同事告诉我,声音系统也接受FP程序。有人可以确认这一点并解释为什么这样做吗?
最佳答案
这本书是这样解释的:
Soundness prevents false negatives and completeness prevents false positives.
In modern languages, type systems are sound (they prevent what they claim to) but not complete (they reject programs they need not reject). Soundness is important because it lets language users and language implementers rely on X never happening. Completeness would be nice, but hopefully it is rare in practice that a program is rejected unnecessarily and in those cases, hopefully it is easy for the programmer to modify the program such that it type-checks.
Type systems are not complete because for almost anything you might like to check statically, it is impossible to implement a static checker that given any program in your language (a) always terminates, (b) is sound, and (c) is complete. Since we have to give up one, (c) seems like the best option (programmers do not like compilers that may not terminate).
关于logic - 系统的健全性和完整性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21437015/
我正在尝试用 Rust 中的父指针制作一棵树。节点结构上的一种方法给我带来了终身问题。这是一个最小的例子,明确地写了生命周期,以便我可以理解它们: use core::mem::transmute;
我是一名优秀的程序员,十分优秀!