## Trusted source translation of a total function language (2008)

Venue: | In 14th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS |

Citations: | 11 - 8 self |

### BibTeX

@INPROCEEDINGS{Li08trustedsource,

author = {Guodong Li and Konrad Slind},

title = {Trusted source translation of a total function language},

booktitle = {In 14th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS},

year = {2008}

}

### OpenURL

### Abstract

Abstract. We present a trusted source translator that transforms total functions defined in the specification language of the HOL theorem prover to simple intermediate code. This translator eliminates polymorphism by code specification, removes higher-order functions through closure conversion, interprets pattern matching as conditional expressions, etc. The target intermediate language can be further translated by proof to a simple imperative language. Each transformation is proven to be correct automatically. The formalization, implementation and mechanical verification of all transformations are done in HOL-4. 1

### Citations

833 |
M.: Isabelle/HOL — A Proof Assistant for Higher-Order Logic, vol
- Nipkow, Paulson, et al.
- 2002
(Show Context)
Citation Context ...ation language we use is the Total Functional Language (TFL) [20], which is a pure, total functional programming layer on top of higher order logic and implemented in both the HOL-4 [17] and Isabelle =-=[16]-=- systems. TFL enables abstract algorithms to be specified in a mixture of mathematics and programming idioms and then reasoned about using a theorem prover. Roughly speaking, this language comprises M... |

248 | Formal certification of a compiler back-end, or: Programming a compiler with a proof assistant
- Leroy
- 2006
(Show Context)
Citation Context ...on [2] interprets types as binary relations. They proved a semantic type soundness for a compiler from a simple imperative language with heap-allocated data into an idealized assembly language. Leroy =-=[3, 10]-=- verified a compiler from a subset of C, i.e. Clight, to PowerPC assembly code in the Coq system. The semantics of Clight is completely deterministic and specified as big-step operational semantics. S... |

159 | Translation Validation, in
- Pnueli, Siegel, et al.
- 1998
(Show Context)
Citation Context ...expressions. All intermediate forms of a program are still mathematical functions defined in HOL. The correctness proof of a transformation of a source program p proceeds, in a translation validation =-=[18]-=- style, by showing the generated program q computes the same mathematical function as p. Note that the built-in type checker in HOL will type check both p and q to ensure their type safety. Two techni... |

109 | T.: A machine-checked model for a Java-like language, virtual machine and compiler
- Klein, Nipkow
- 2006
(Show Context)
Citation Context ...tion and case analysis on the last evaluation rule used; in contrast, our proofs proceed by verifying the rewriting steps. A purely operational semantics based development is that of Klein and Nipkow =-=[8]-=- which gives a thorough formalization of a Java-like language. A compiler from this language to a subset of Java Virtual Machine is verified using Isabelle/HOL. The Isabelle/HOL theorem prover is also... |

85 |
Compiling pattern matching
- Augustsson
- 1985
(Show Context)
Citation Context ...′ = k ⊩thm (∀x. dispatchτ1 (s ′ , x) = s x) ⇒ ∀x∀y. dispatchτ2 (g ′ (s ′ , x), y) = (g (s, x)) y 3.4 Pattern Matching This conversion to nested case expressions is based on Augustsson’s original work =-=[1]-=-, which was adapted by Slind [20] for function description in HOL. A pre-processing pass is first performed to deal with incomplete and overlapping patterns: incomplete patterns are made complete by a... |

66 | From ML to Ada: Strongly-typed language interoperability via source translation
- Tolmach, Oliva
- 1998
(Show Context)
Citation Context ...our setting to verify the translation from HOL- to IL. 5 Related Work There has been much work on translating functional languages; one of the most influential has been the paper of Tolmach and Oliva =-=[22]-=- which developed a translation from SML-like functional language to Ada. Our monomorphisation and closure conversion methods are similar, i.e., removing polymorphism by code specialization and higher-... |

46 | Towards the formal verification of a C0 compiler: Code generation and implementation correctness
- Leinenbach, Paul, et al.
- 2005
(Show Context)
Citation Context ...s language to a subset of Java Virtual Machine is verified using Isabelle/HOL. The Isabelle/HOL theorem prover is also used to verify the compilation from a type-safe subset of C to DLX assembly code =-=[9]-=-, where a big step semantics and a small step semantics for this language are defined. In addition, Meyer and Wolff [13] derive in Isabelle/HOL a verified compilation of a lazy language (called MiniHa... |

41 |
A certified type-preserving compiler from lambda calculus to assembly language
- Chlipala
- 2007
(Show Context)
Citation Context ...nd differs greatly from real machines. In their work, programs are associated with operational semantics; and both compiler transformation and verifications are modeled as deductive systems. Chlipala =-=[4]-=- further considered compiling a simply-typed 13λ-calculus to assembly language. He proved semantics preservation based on denotational semantics assigned to the intermediate languages. Type preservat... |

41 |
Compiler verification: a bibliography
- Dave
(Show Context)
Citation Context ...(called MiniML) based on the denotational semantics of these languages. Of course, compiler verification itself is a venerable topic, with far too many publications to survey (see Dave’s bibliography =-=[5]-=-). 6 Conclusions and Future Work We have presented an approach to construct and mechanically verify a translator from TFL to HOL-. The outputs of this translator can be compiled to assembly code and h... |

34 |
Reasoning about Terminating Functional Programs
- Slind
- 1999
(Show Context)
Citation Context ... higher order logic, and then compile the verified algorithms to low level platforms which are also modeled in the same logic. The specification language we use is the Total Functional Language (TFL) =-=[20]-=-, which is a pure, total functional programming layer on top of higher order logic and implemented in both the HOL-4 [17] and Isabelle [16] systems. TFL enables abstract algorithms to be specified in ... |

26 |
The Definition of Standard ML (Revised Edition
- Milner, Tofte, et al.
- 1997
(Show Context)
Citation Context ...trivial programs in a formal setting. Some widely used functional languages have been given a formal semantics, e.g. Scheme has a denotational semantics [19] and ML has a formal operational semantics =-=[14]-=-. However, these semantics do not as yet provide a practical basis for formal reasoning about programs in the languages, although they are extremely valuable as reference documents and for proving met... |

19 | Hoare logic for realistically modelled machine code
- Myreen, Gordon
- 2007
(Show Context)
Citation Context ...tion, the synthesized function is equal to f. The derivation is syntax-directed and automatic. This reasoning mechanism can be improved by adopting Myreen and Gordon’s idea that uses separation logic =-=[15]-=- to reason about assembly language. We are considering porting their method into our setting to verify the translation from HOL- to IL. 5 Related Work There has been much work on translating functiona... |

12 | Formalizing and verifying semantic type soundness of a simple compiler
- Benton, Zarfaty
- 2007
(Show Context)
Citation Context ...r than TFL, thus their compilers only begin to deal with the high level issues we discuss in this paper. Compared with Chlipala [4] who gives intermediate languages dependent types, Benton and Benton =-=[2]-=- interprets types as binary relations. They proved a semantic type soundness for a compiler from a simple imperative language with heap-allocated data into an idealized assembly language. Leroy [3, 10... |

10 | Structure of a proof-producing compiler for a subset of higher order logic
- Li, Owens, et al.
- 2007
(Show Context)
Citation Context ...nguage can express a very wide range ofalgorithms. The trade-off is that the compilation of logic specifications written in this language is fairly complicated. We have developed a software compiler =-=[11, 12]-=-, which produces assembly code, and a hardware compiler [21], which synthesizes Verilog netlists, for a small subset of TFL. This subset, named HOL-, is a simple monomorphicallytyped functional langua... |

9 |
Formal compiler construction in a logical framework. Higher-Order and Symbolic Computation
- Hickey, Nogin
(Show Context)
Citation Context ...ication languages and perform correctness proofs on the transformations. Our work can be regarded as an extension of theirs by now verifying the correctness of these two conversions. Hickey and Nogin =-=[7]-=- worked in MetaPRL to construct a compiler from a full higher order, untyped, functional language to Intel x86 code, based entirely on higher-order rewrite rules. A set of unverified rewriting rules a... |

9 | Compilation as rewriting in higher order logic
- Li, Slind
- 2007
(Show Context)
Citation Context ...nguage can express a very wide range ofalgorithms. The trade-off is that the compilation of logic specifications written in this language is fairly complicated. We have developed a software compiler =-=[11, 12]-=-, which produces assembly code, and a hardware compiler [21], which synthesizes Verilog netlists, for a small subset of TFL. This subset, named HOL-, is a simple monomorphicallytyped functional langua... |

9 |
Proof producing synthesis of arithmetic and cryptographic hardware
- Slind, Owens, et al.
(Show Context)
Citation Context ...f is that the compilation of logic specifications written in this language is fairly complicated. We have developed a software compiler [11, 12], which produces assembly code, and a hardware compiler =-=[21]-=-, which synthesizes Verilog netlists, for a small subset of TFL. This subset, named HOL-, is a simple monomorphicallytyped functional language handling first order equations where variables range over... |

4 |
Compiler Verification
- Pfenning, Hannan
- 1992
(Show Context)
Citation Context ...program. They use higher-order abstract syntax to represent programs and do not define the semantics of these programs. Thus no formal verification of the rewriting rules is done. Hannan and Pfenning =-=[6]-=- constructed a verified compiler in LF for the untyped λ-calculus. The target machine is a variant of the CAM runtime and differs greatly from real machines. In their work, programs are associated wit... |

4 | Tactic-based optimized compilation of functional programs - Meyer, Wolff - 2004 |