We report on the automation of a technique to prove the correctness of program transformations in higher-order program calculi which may permit recursive let-bindings as they occur in functional programming languages. A program transformation is correct if it preserves the observational semantics of programs. In our LRSX Tool the so-called diagram method is automated by combining unification, matching, and reasoning on alpha-renamings on the higher-order meta-language, and automating induction proofs via an encoding into termination problems of term rewrite systems. We explain the techniques, we illustrate the usage of the tool, and we report on experiments. * This research is supported by the Deutsche Forschungsgemeinschaft (DFG) under grant SA2908/3-1 1 available from http://goethe.link/LRSXTOOL61
Illustration of the Diagram Method -ExamplesWe illustrate the concept of observational semantics, correctness of program transformations, and the diagram method (and its automation) using a quite simple example. In Fig. 2 we define a program calculus Simple. The syntax of Simple-expressions consists of two constants, ⊥ to represent a failing computation, and ⊤ to represent success, a unary operator ¬ for negation, and a binary operator ∧ which computes the conjunction of ⊤ and ⊥, i.e. evaluation of e 1 ∧ e 2 results in ⊤ iff e 1 and e 2 both evaluate to ⊤ and otherwise the evaluation ends with ⊥. The reduction strategy which evaluates the ∧-operator from left to right is defined by using evaluation contexts A (defined in Fig. 2 where [·] denotes the context hole). The standard reduction sr − → is the union of the rules (sr, bot), (sr,top), (sr, neg1), and (sr, neg2).