Using the programming language Haskell, we introduce an implementation for a simple imperative language that can evaluate arithmetic and boolean expressions; step by step, we will expand the implementation starting from arithmetic expressions, to boolean expressions and then to imperative programs. As we expand the language, we will show several evaluation strategies, considering the normalization property and how it affects an implementation. Finally, we will provide a bottom-up implementation of Hoare's logic which will allow us to deduce facts about programs without the need for a full evaluation.
翻译:使用编程语言Haskell, 我们引入了一种简单的必备语言的实施, 该语言可以评估算术和布尔语表达方式; 一步一步地, 我们将从算术表达方式、 布尔语表达方式, 然后再扩展到必备方案。 随着语言的扩展, 我们将展示一些评价战略, 考虑正常化的属性以及它如何影响执行。 最后, 我们将提供自下而上地实施Hoare逻辑的方法, 从而使我们能够在不需要全面评估的情况下推断出有关方案的事实 。