规格如下:
(truth-table formula) --> truth-table
一个公式是:
- 一个真值,即要么
#t或#f - 一个变量,即
p, q, r, ... (not formula)(and formula1 formula2)(or formula1 formula2)
真值表是一组行。一行包含一个绑定(I t),其中I真值赋值,即绑定集(p t)。I一定是:
- 持续的
- 完全的
t是由估值函数产生的V(formula, I)。V定义为:
V(t,I) = tV(p,I) = t用于(p t)绑定IV((not formula), I) = (not (V (formula I)))V((and formula1 formula2), I) = (and V(formula1 I) V(formula2 I))V(( or formula1 formula2), I) = (or V(formula1 I) V( formula2 I))
为了在 Scheme 中实现真值表,可以遵循什么程序?请注意,公式中可能有子公式。