In this paper we introduce a system for the detection and elimination of dead code in typed functional programs. The main application of this method is the optimization of programs extracted from proofs in logical frameworks but it could be used as well in the elimination of dead code determined by program specialization. Our algorithm is based on a type inference system suitable for reasoning about dead code information. This system relays on refinement types which allow to exploit the type structure of the language for the investigation of program properties. The detection of dead code is obtained via type inference, which can be performed in an efficient and complete way, by reducing it to the solution of a system of inequalities between type variables. A key feature of our method is that program analysis can be performed in a strictly incremental way. Even though the language considered in the paper is a simply typed λ-calculus we can generalize our approach to polymorphic languages like ML. Although focused on dead code elimination our type inference method can also be applied to the investigation of other program properties like binding time and strictness. Some hints on these applications are given.

Refinement Types for Program Analysis

COPPO, Mario;DAMIANI, Ferruccio;
1996-01-01

Abstract

In this paper we introduce a system for the detection and elimination of dead code in typed functional programs. The main application of this method is the optimization of programs extracted from proofs in logical frameworks but it could be used as well in the elimination of dead code determined by program specialization. Our algorithm is based on a type inference system suitable for reasoning about dead code information. This system relays on refinement types which allow to exploit the type structure of the language for the investigation of program properties. The detection of dead code is obtained via type inference, which can be performed in an efficient and complete way, by reducing it to the solution of a system of inequalities between type variables. A key feature of our method is that program analysis can be performed in a strictly incremental way. Even though the language considered in the paper is a simply typed λ-calculus we can generalize our approach to polymorphic languages like ML. Although focused on dead code elimination our type inference method can also be applied to the investigation of other program properties like binding time and strictness. Some hints on these applications are given.
1996
3rd International Static Analysis Symposium, SAS 1996
Aachen; Germany
24 September 1996 through 26 September 1996
Static Analysis
Springer
1145
143
158
978-3-540-61739-6
978-3-540-70674-8
http://link.springer.com/chapter/10.1007%2F3-540-61739-6_39
Application programs, Functional programs, Logical frameworks, Program analysis, Program properties, Program specialization, Simply typed lambda calculus, Type inferences, Type structures
M. COPPO; DAMIANI F.; GIANNINI P.
File in questo prodotto:
File Dimensione Formato  
LNCS-sas-1996.pdf

Accesso riservato

Descrizione: Articolo principale (conferenza)
Tipo di file: PDF EDITORIALE
Dimensione 209.72 kB
Formato Adobe PDF
209.72 kB Adobe PDF   Visualizza/Apri   Richiedi una copia

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/2318/4121
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 11
  • ???jsp.display-item.citation.isi??? ND
social impact