unf和list的连接是unf - 证明Haskell

时间:2015-05-03 20:04:38

标签: haskell undefined proof

如何证明每个列表xs都符合以下条件:

undefined ++ xs = undefined

1 个答案:

答案 0 :(得分:7)

没有太多要证明的。只有一条规则(无法解释或分解为更小的规则)case语句尝试将undefined与构造函数匹配,导致undefined。一旦接受此规则,我们就可以观察

undefined ++ ys
= { by definition of ++ }
case undefined of
    [] -> ys
    x:xs -> x : (xs ++ ys)
= { case that matches undefined against a constructor }
undefined