CPL - Chalmers Publication Library
| Utbildning | Forskning | Styrkeområden | Om Chalmers | In English In English Ej inloggad.

Pattern matches in HOL: A new representation and improved code generation

Thomas Tuerk ; Magnus O. Myreen (Institutionen för data- och informationsteknik, Programvaruteknik (Chalmers)) ; Ramana Kumar
Lecture Notes in Computer Science - Proceedings of the 6th International Conference on Interactive Theorem Proving, ITP 2015, Nanjing, China, 24-27 August 2015 (0302-9743). Vol. 9236 (2015), p. 453-468.
[Konferensbidrag, refereegranskat]

Pattern matching is ubiquitous in functional programming and also very useful for definitions in higher-order logic. However, it is not directly supported by higher-order logic. Therefore, the parsers of theorem provers like HOL4 and Isabelle/HOL contain a pattern-compilation algorithm. Internally, decision trees based on case constants are used. For non-trivial case expressions, there is a big discrepancy between the user’s view and the internal representation. This paper presents a new general-purpose representation for case expressions that mirrors the input syntax in the internal representation closely. Because of this close connection, the new representation is more intuitive and often much more compact. Complicated parsers and pretty printers are no longer required. Proofs can more closely follow the user’s intentions, and code generators can produce better code. Moreover, the new representation is more general than the currently used representation, supporting guards, patterns with multiple occurrences of the same bound variable, unbound variables, arithmetic expressions in patterns, and more. This work has been implemented in the HOL4 theorem prover and integrated into CakeML’s proof-producing code generator.

Den här publikationen ingår i följande styrkeområden:

Läs mer om Chalmers styrkeområden  

Denna post skapades 2016-01-05. Senast ändrad 2016-05-24.
CPL Pubid: 229817


Läs direkt!

Länk till annan sajt (kan kräva inloggning)