TY - GEN
T1 - From operational semantics to abstract machines. Preliminary results
AU - Hannan, John
AU - Miller, Dale
PY - 1990
Y1 - 1990
N2 - The operational semantics of functional programming languages is frequently presented using inference rules within simple metalogics. Such presentations of semantics can be high-level and perspicuous since meta-logics often handle numerous syntactic details in a declarative fashion. This is particularly true of the meta-logic we consider here, which includes simply typed λ-terms, quantification at higher types, and β-conversion. Evaluation of functional programming languages is also often presented using low-level descriptions based on abstract machines: simple term rewriting systems in which few high-level features are present. In this paper, we illustrate how a high-level description of evaluation using inference rules can be systematically transformed into a low-level abstract machine by removing dependencies on high-level features of the metalogic until the resulting inference rules are so simple that they can be immediately identified as specifying an abstract machine. In particular, we present in detail the transformation of two inference rules specifying call-by-name evaluation of the untyped λ-calculus into the Krivine machine, a stack-based abstract machine that implements such evaluation. The initial specification uses the meta-logic's β-conversion to perform substitutions. The resulting machine uses de Bruijn numerals and closures instead of formal substitution. We also comment on a similar construction of a simplified SECD machine implementing call-by-value evaluation. This approach to abstract machine construction provides a semantics-directed method for motivating, proving correct, and extending such abstract machines.
AB - The operational semantics of functional programming languages is frequently presented using inference rules within simple metalogics. Such presentations of semantics can be high-level and perspicuous since meta-logics often handle numerous syntactic details in a declarative fashion. This is particularly true of the meta-logic we consider here, which includes simply typed λ-terms, quantification at higher types, and β-conversion. Evaluation of functional programming languages is also often presented using low-level descriptions based on abstract machines: simple term rewriting systems in which few high-level features are present. In this paper, we illustrate how a high-level description of evaluation using inference rules can be systematically transformed into a low-level abstract machine by removing dependencies on high-level features of the metalogic until the resulting inference rules are so simple that they can be immediately identified as specifying an abstract machine. In particular, we present in detail the transformation of two inference rules specifying call-by-name evaluation of the untyped λ-calculus into the Krivine machine, a stack-based abstract machine that implements such evaluation. The initial specification uses the meta-logic's β-conversion to perform substitutions. The resulting machine uses de Bruijn numerals and closures instead of formal substitution. We also comment on a similar construction of a simplified SECD machine implementing call-by-value evaluation. This approach to abstract machine construction provides a semantics-directed method for motivating, proving correct, and extending such abstract machines.
UR - http://www.scopus.com/inward/record.url?scp=0025555086&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=0025555086&partnerID=8YFLogxK
U2 - 10.1145/91556.91680
DO - 10.1145/91556.91680
M3 - Conference contribution
AN - SCOPUS:0025555086
SN - 089791368X
SN - 9780897913683
T3 - Proc 1990 ACM Conf LISP Funct Program
SP - 323
EP - 332
BT - Proc 1990 ACM Conf LISP Funct Program
PB - Publ by ACM
T2 - Proceedings of the 1990 ACM Conference on LISP and Functional Programming
Y2 - 27 June 1990 through 29 June 1990
ER -