100% found this document useful (1 vote)
70 views

PDF Practical Foundations For Programming Languages 2nd Edition Robert Harper Download

Foundations

Uploaded by

melonatiga
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
70 views

PDF Practical Foundations For Programming Languages 2nd Edition Robert Harper Download

Foundations

Uploaded by

melonatiga
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

Download the full version of the textbook now at textbookfull.

com

Practical Foundations For Programming


Languages 2nd Edition Robert Harper

https://textbookfull.com/product/practical-
foundations-for-programming-languages-2nd-edition-
robert-harper/

Explore and download more textbook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Foundations of Programming Languages Second Edition Lee

https://textbookfull.com/product/foundations-of-programming-languages-
second-edition-lee/

textbookfull.com

Foundations of Programming Languages Kent D. Lee

https://textbookfull.com/product/foundations-of-programming-languages-
kent-d-lee/

textbookfull.com

Concepts of Programming Languages Global Edition Robert W.


Sebesta [Sebesta R.W.]

https://textbookfull.com/product/concepts-of-programming-languages-
global-edition-robert-w-sebesta-sebesta-r-w/

textbookfull.com

PTSD and the Politics of Trauma in Israel: A Nation on the


Couch Keren Friedman-Peleg

https://textbookfull.com/product/ptsd-and-the-politics-of-trauma-in-
israel-a-nation-on-the-couch-keren-friedman-peleg/

textbookfull.com
Computational seismology : a practical introduction 1st
Edition Igel

https://textbookfull.com/product/computational-seismology-a-practical-
introduction-1st-edition-igel/

textbookfull.com

Anthology of World Scriptures Robert E. Van Voorst

https://textbookfull.com/product/anthology-of-world-scriptures-robert-
e-van-voorst/

textbookfull.com

The Electronics Companion Devices and Circuits for


Physicists and Engineers 2nd Edition Fischer-Cripps

https://textbookfull.com/product/the-electronics-companion-devices-
and-circuits-for-physicists-and-engineers-2nd-edition-fischer-cripps/

textbookfull.com

The Best People Trump s Cabinet and the Siege on


Washington Alexander Nazaryan

https://textbookfull.com/product/the-best-people-trump-s-cabinet-and-
the-siege-on-washington-alexander-nazaryan/

textbookfull.com

Integration of Nature and Technology for Smart Cities 3rd


Edition Anil Ahuja

https://textbookfull.com/product/integration-of-nature-and-technology-
for-smart-cities-3rd-edition-anil-ahuja/

textbookfull.com
Christianity and Social Work Readings on the Integration
of Christian Faith and Social Work Practice Fifth Edition
T. Laine Scales
https://textbookfull.com/product/christianity-and-social-work-
readings-on-the-integration-of-christian-faith-and-social-work-
practice-fifth-edition-t-laine-scales/
textbookfull.com
Practical Foundations for Programming Languages

This text develops a comprehensive theory of programming languages based on type sys-
tems and structural operational semantics. Language concepts are precisely defined by their
static and dynamic semantics, presenting the essential tools both intuitively and rigorously
while relying on only elementary mathematics. These tools are used to analyze and prove
properties of languages and provide the framework for combining and comparing language
features. The broad range of concepts includes fundamental data types such as sums and
products, polymorphic and abstract types, dynamic typing, dynamic dispatch, subtyping
and refinement types, symbols and dynamic classification, parallelism and cost semantics,
and concurrency and distribution. The methods are directly applicable to language imple-
mentation, to the development of logics for reasoning about programs, and to the formal
verification language properties such as type safety.
This thoroughly revised second edition includes exercises at the end of nearly every
chapter and a new chapter on type refinements.

Robert Harper is a professor in the Computer Science Department at Carnegie Mellon


University. His main research interest is in the application of type theory to the design
and implementation of programming languages and to the mechanization of their meta-
theory. Harper is a recipient of the Allen Newell Medal for Research Excellence and the
Herbert A. Simon Award for Teaching Excellence, and is an Association for Computing
Machinery Fellow.
Practical Foundations for
Programming Languages
Second Edition

Robert Harper
Carnegie Mellon University
32 Avenue of the Americas, New York, NY 10013

Cambridge University Press is part of the University of Cambridge.

It furthers the University’s mission by disseminating knowledge in the pursuit of


education, learning, and research at the highest international levels of excellence.

www.cambridge.org
Information on this title: www.cambridge.org/9781107150300
© Robert Harper 2016

This publication is in copyright. Subject to statutory exception


and to the provisions of relevant collective licensing agreements,
no reproduction of any part may take place without the written
permission of Cambridge University Press.
First published 2016

Printed in the United States of America

A catalog record for this publication is available from the British Library.

Library of Congress Cataloging in Publication Data


Names: Harper, Robert, 1957–
Title: Practical foundations for programming languages / Robert Harper,
Carnegie Mellon University.
Description: Second edition. | New York NY : Cambridge University Press,
2016. | Includes bibliographical references and index.
Identifiers: LCCN 2015045380 | ISBN 9781107150300 (alk. paper)
Subjects: LCSH: Programming languages (Electronic computers)
Classification: LCC QA76.7 .H377 2016 | DDC 005.13–dc23
LC record available at http://lccn.loc.gov/2015045380

ISBN 978-1-107-15030-0 Hardback


Cambridge University Press has no responsibility for the persistence or accuracy of
URLs for external or third-party Internet Web sites referred to in this publication
and does not guarantee that any content on such Web sites is, or will remain,
accurate or appropriate.
Contents

Preface to the Second Edition page xv


Preface to the First Edition xvii

Part I Judgments and Rules

1 Abstract Syntax 3
1.1 Abstract Syntax Trees 3
1.2 Abstract Binding Trees 6
1.3 Notes 10

2 Inductive Definitions 12
2.1 Judgments 12
2.2 Inference Rules 12
2.3 Derivations 14
2.4 Rule Induction 15
2.5 Iterated and Simultaneous Inductive Definitions 17
2.6 Defining Functions by Rules 18
2.7 Notes 19

3 Hypothetical and General Judgments 21


3.1 Hypothetical Judgments 21
3.2 Hypothetical Inductive Definitions 24
3.3 General Judgments 26
3.4 Generic Inductive Definitions 27
3.5 Notes 28

Part II Statics and Dynamics

4 Statics 33
4.1 Syntax 33
4.2 Type System 34
4.3 Structural Properties 35
4.4 Notes 37
vi Contents

5 Dynamics 39
5.1 Transition Systems 39
5.2 Structural Dynamics 40
5.3 Contextual Dynamics 42
5.4 Equational Dynamics 44
5.5 Notes 46

6 Type Safety 48
6.1 Preservation 48
6.2 Progress 49
6.3 Run-Time Errors 50
6.4 Notes 52

7 Evaluation Dynamics 53
7.1 Evaluation Dynamics 53
7.2 Relating Structural and Evaluation Dynamics 54
7.3 Type Safety, Revisited 55
7.4 Cost Dynamics 56
7.5 Notes 57

Part III Total Functions

8 Function Definitions and Values 61


8.1 First-Order Functions 61
8.2 Higher-Order Functions 62
8.3 Evaluation Dynamics and Definitional Equality 65
8.4 Dynamic Scope 66
8.5 Notes 67

9 System T of Higher-Order Recursion 69


9.1 Statics 69
9.2 Dynamics 70
9.3 Definability 71
9.4 Undefinability 73
9.5 Notes 75

Part IV Finite Data Types

10 Product Types 79
10.1 Nullary and Binary Products 79
10.2 Finite Products 81
10.3 Primitive Mutual Recursion 82
10.4 Notes 83
vii Contents

11 Sum Types 85
11.1 Nullary and Binary Sums 85
11.2 Finite Sums 86
11.3 Applications of Sum Types 88
11.4 Notes 91

Part V Types and Propositions

12 Constructive Logic 95
12.1 Constructive Semantics 95
12.2 Constructive Logic 96
12.3 Proof Dynamics 100
12.4 Propositions as Types 101
12.5 Notes 101

13 Classical Logic 104


13.1 Classical Logic 105
13.2 Deriving Elimination Forms 109
13.3 Proof Dynamics 110
13.4 Law of the Excluded Middle 111
13.5 The Double-Negation Translation 113
13.6 Notes 114

Part VI Infinite Data Types

14 Generic Programming 119


14.1 Introduction 119
14.2 Polynomial Type Operators 119
14.3 Positive Type Operators 122
14.4 Notes 123

15 Inductive and Coinductive Types 125


15.1 Motivating Examples 125
15.2 Statics 128
15.3 Dynamics 130
15.4 Solving Type Equations 131
15.5 Notes 132

Part VII Variable Types

16 System F of Polymorphic Types 137


16.1 Polymorphic Abstraction 137
16.2 Polymorphic Definability 140
16.3 Parametricity Overview 142
16.4 Notes 144
viii Contents

17 Abstract Types 146


17.1 Existential Types 146
17.2 Data Abstraction 149
17.3 Definability of Existential Types 150
17.4 Representation Independence 151
17.5 Notes 153

18 Higher Kinds 154


18.1 Constructors and Kinds 155
18.2 Constructor Equality 156
18.3 Expressions and Types 157
18.4 Notes 158

Part VIII Partiality and Recursive Types

19 System PCF of Recursive Functions 161


19.1 Statics 162
19.2 Dynamics 163
19.3 Definability 165
19.4 Finite and Infinite Data Structures 167
19.5 Totality and Partiality 167
19.6 Notes 169

20 System FPC of Recursive Types 171


20.1 Solving Type Equations 171
20.2 Inductive and Coinductive Types 172
20.3 Self-Reference 174
20.4 The Origin of State 176
20.5 Notes 177

Part IX Dynamic Types

21 The Untyped λ-Calculus 181


21.1 The λ-Calculus 181
21.2 Definability 182
21.3 Scott’s Theorem 184
21.4 Untyped Means Uni-Typed 186
21.5 Notes 187

22 Dynamic Typing 189


22.1 Dynamically Typed PCF 189
22.2 Variations and Extensions 192
22.3 Critique of Dynamic Typing 194
22.4 Notes 195
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
ix Contents

23 Hybrid Typing 198


23.1 A Hybrid Language 198
23.2 Dynamic as Static Typing 200
23.3 Optimization of Dynamic Typing 201
23.4 Static versus Dynamic Typing 203
23.5 Notes 204

Part X Subtyping

24 Structural Subtyping 207


24.1 Subsumption 207
24.2 Varieties of Subtyping 208
24.3 Variance 211
24.4 Dynamics and Safety 215
24.5 Notes 216

25 Behavioral Typing 219


25.1 Statics 220
25.2 Boolean Blindness 226
25.3 Refinement Safety 228
25.4 Notes 229

Part XI Dynamic Dispatch

26 Classes and Methods 235


26.1 The Dispatch Matrix 235
26.2 Class-Based Organization 238
26.3 Method-Based Organization 239
26.4 Self-Reference 240
26.5 Notes 242

27 Inheritance 245
27.1 Class and Method Extension 245
27.2 Class-Based Inheritance 246
27.3 Method-Based Inheritance 248
27.4 Notes 249

Part XII Control Flow

28 Control Stacks 253


28.1 Machine Definition 253
28.2 Safety 255
28.3 Correctness of the K Machine 256
28.4 Notes 259
x Contents

29 Exceptions 260
29.1 Failures 260
29.2 Exceptions 262
29.3 Exception Values 263
29.4 Notes 264

30 Continuations 266
30.1 Overview 266
30.2 Continuation Dynamics 268
30.3 Coroutines from Continuations 269
30.4 Notes 272

Part XIII Symbolic Data

31 Symbols 277
31.1 Symbol Declaration 277
31.2 Symbol References 280
31.3 Notes 282

32 Fluid Binding 284


32.1 Statics 284
32.2 Dynamics 285
32.3 Type Safety 286
32.4 Some Subtleties 287
32.5 Fluid References 288
32.6 Notes 289

33 Dynamic Classification 291


33.1 Dynamic Classes 291
33.2 Class References 293
33.3 Definability of Dynamic Classes 294
33.4 Applications of Dynamic Classification 295
33.5 Notes 296

Part XIV Mutable State

34 Modernized Algol 301


34.1 Basic Commands 301
34.2 Some Programming Idioms 306
34.3 Typed Commands and Typed Assignables 307
34.4 Notes 310

35 Assignable References 313


35.1 Capabilities 313
35.2 Scoped Assignables 314
xi Contents

35.3 Free Assignables 316


35.4 Safety 318
35.5 Benign Effects 320
35.6 Notes 321

36 Lazy Evaluation 323


36.1 PCF By-Need 323
36.2 Safety of PCF By-Need 326
36.3 FPC By-Need 328
36.4 Suspension Types 329
36.5 Notes 331

Part XV Parallelism

37 Nested Parallelism 335


37.1 Binary Fork-Join 335
37.2 Cost Dynamics 338
37.3 Multiple Fork-Join 341
37.4 Bounded Implementations 342
37.5 Scheduling 346
37.6 Notes 348

38 Futures and Speculations 350


38.1 Futures 350
38.2 Speculations 351
38.3 Parallel Dynamics 352
38.4 Pipelining with Futures 354
38.5 Notes 356

Part XVI Concurrency and Distribution

39 Process Calculus 359


39.1 Actions and Events 359
39.2 Interaction 361
39.3 Replication 363
39.4 Allocating Channels 364
39.5 Communication 366
39.6 Channel Passing 369
39.7 Universality 371
39.8 Notes 372

40 Concurrent Algol 375


40.1 Concurrent Algol 375
40.2 Broadcast Communication 378
40.3 Selective Communication 380
xii Contents

40.4 Free Assignables as Processes 382


40.5 Notes 383

41 Distributed Algol 385


41.1 Statics 385
41.2 Dynamics 388
41.3 Safety 390
41.4 Notes 391

Part XVII Modularity

42 Modularity and Linking 395


42.1 Simple Units and Linking 395
42.2 Initialization and Effects 396
42.3 Notes 398

43 Singleton Kinds and Subkinding 399


43.1 Overview 399
43.2 Singletons 400
43.3 Dependent Kinds 402
43.4 Higher Singletons 405
43.5 Notes 407

44 Type Abstractions and Type Classes 409


44.1 Type Abstraction 410
44.2 Type Classes 412
44.3 A Module Language 414
44.4 First- and Second-Class 418
44.5 Notes 419

45 Hierarchy and Parameterization 422


45.1 Hierarchy 422
45.2 Abstraction 425
45.3 Hierarchy and Abstraction 427
45.4 Applicative Functors 429
45.5 Notes 431

Part XVIII Equational Reasoning

46 Equality for System T 435


46.1 Observational Equivalence 435
46.2 Logical Equivalence 439
46.3 Logical and Observational Equivalence Coincide 440
46.4 Some Laws of Equality 443
46.5 Notes 444
xiii Contents

47 Equality for System PCF 445


47.1 Observational Equivalence 445
47.2 Logical Equivalence 446
47.3 Logical and Observational Equivalence Coincide 446
47.4 Compactness 449
47.5 Lazy Natural Numbers 452
47.6 Notes 453

48 Parametricity 454
48.1 Overview 454
48.2 Observational Equivalence 455
48.3 Logical Equivalence 456
48.4 Parametricity Properties 461
48.5 Representation Independence, Revisited 464
48.6 Notes 465

49 Process Equivalence 467


49.1 Process Calculus 467
49.2 Strong Equivalence 469
49.3 Weak Equivalence 472
49.4 Notes 473

Part XIX Appendices

A Background on Finite Sets 477

Bibliography 479
Index 487
Preface to the Second Edition

Writing the second edition to a textbook incurs the same risk as building the second version
of a software system. It is difficult to make substantive improvements, while avoiding the
temptation to overburden and undermine the foundation on which one is building. With the
hope of avoiding the second system effect, I have sought to make corrections, revisions,
expansions, and deletions that improve the coherence of the development, remove some
topics that distract from the main themes, add new topics that were omitted from the first
edition, and include exercises for almost every chapter.
The revision removes a number of typographical errors, corrects a few material errors
(especially the formulation of the parallel abstract machine and of concurrency in Algol),
and improves the writing throughout. Some chapters have been deleted (general pattern
matching and polarization, restricted forms of polymorphism), some have been completely
rewritten (the chapter on higher kinds), some have been substantially revised (general
and parametric inductive definitions, concurrent and distributed Algol), several have been
reorganized (to better distinguish partial from total type theories), and a new chapter
has been added (on type refinements). Titular attributions on several chapters have been
removed, not to diminish credit, but to avoid confusion between the present and the original
formulations of several topics. A new system of (pronounceable!) language names has been
introduced throughout. The exercises generally seek to expand on the ideas in the main
text, and their solutions often involve significant technical ideas that merit study. Routine
exercises of the kind one might include in a homework assignment are deliberately few.
My purpose in writing this book is to establish a comprehensive framework for formu-
lating and analyzing a broad range of ideas in programming languages. If language design
and programming methodology are to advance from a trade-craft to a rigorous discipline,
it is essential that we first get the definitions right. Then, and only then, can there be mean-
ingful analysis and consolidation of ideas. My hope is that I have helped to build such a
foundation.
I am grateful to Stephen Brookes, Evan Cavallo, Karl Crary, Jon Sterling, James R.
Wilcox and Todd Wilson for their help in critiquing drafts of this edition and for their
suggestions for modification and revision. I thank my department head, Frank Pfenning,
for his support of my work on the completion of this edition. Thanks also to my editors, Ada
Brunstein and Lauren Cowles, for their guidance and assistance. And thanks to Andrew
Shulaev for corrections to the draft.
Neither the author nor the publisher make any warranty, express or implied, that the
definitions, theorems, and proofs contained in this volume are free of error, or are consistent
with any particular standard of merchantability, or that they will meet requirements for any
particular application. They should not be relied on for solving a problem whose incorrect
xvi Preface to the Second Edition

solution could result in injury to a person or loss of property. If you do use this material
in such a manner, it is at your own risk. The author and publisher disclaim all liability for
direct or consequential damage resulting from its use.

Pittsburgh
July 2015
Preface to the First Edition

Types are the central organizing principle of the theory of programming languages. Lan-
guage features are manifestations of type structure. The syntax of a language is governed
by the constructs that define its types, and its semantics is determined by the interactions
among those constructs. The soundness of a language design—the absence of ill-defined
programs—follows naturally.
The purpose of this book is to explain this remark. A variety of programming language
features are analyzed in the unifying framework of type theory. A language feature is defined
by its statics, the rules governing the use of the feature in a program, and its dynamics, the
rules defining how programs using this feature are to be executed. The concept of safety
emerges as the coherence of the statics and the dynamics of a language.
In this way, we establish a foundation for the study of programming languages. But
why these particular methods? The main justification is provided by the book itself. The
methods we use are both precise and intuitive, providing a uniform framework for explaining
programming language concepts. Importantly, these methods scale to a wide range of
programming language concepts, supporting rigorous analysis of their properties. Although
it would require another book in itself to justify this assertion, these methods are also
practical in that they are directly applicable to implementation and uniquely effective as a
basis for mechanized reasoning. No other framework offers as much.
Being a consolidation and distillation of decades of research, this book does not provide
an exhaustive account of the history of the ideas that inform it. Suffice it to say that much
of the development is not original but rather is largely a reformulation of what has gone
before. The notes at the end of each chapter signpost the major developments but are
not intended as a complete guide to the literature. For further information and alternative
perspectives, the reader is referred to such excellent sources as Constable (1986, 1998),
Girard (1989), Martin-Löf (1984), Mitchell (1996), Pierce (2002, 2004), and Reynolds
(1998).
The book is divided into parts that are, in the main, independent of one another. Parts
I and II, however, provide the foundation for the rest of the book and must therefore be
considered prior to all other parts. On first reading, it may be best to skim Part I, and begin
in earnest with Part II, returning to Part I for clarification of the logical framework in which
the rest of the book is cast.
Numerous people have read and commented on earlier editions of this book and have
suggested corrections and improvements to it. I am particularly grateful to Umut Acar,
Jesper Louis Andersen, Carlo Angiuli, Andrew Appel, Stephanie Balzer, Eric Bergstrom,
Guy E. Blelloch, Iliano Cervesato, Lin Chase, Karl Crary, Rowan Davies, Derek Dreyer,
Dan Licata, Zhong Shao, Rob Simmons, and Todd Wilson for their extensive efforts in
xviii Preface to the First Edition

reading and criticizing the book. I also thank the following people for their suggestions:
Joseph Abrahamson, Arbob Ahmad, Zena Ariola, Eric Bergstrome, William Byrd, Alejan-
dro Cabrera, Luis Caires, Luca Cardelli, Manuel Chakravarty, Richard C. Cobbe, James
Cooper, Yi Dai, Daniel Dantas, Anupam Datta, Jake Donham, Bill Duff, Matthias Felleisen,
Kathleen Fisher, Dan Friedman, Peter Gammie, Maia Ginsburg, Byron Hawkins, Kevin
Hely, Kuen-Bang Hou (Favonia), Justin Hsu, Wojciech Jedynak, Cao Jing, Salil Joshi,
Gabriele Keller, Scott Kilpatrick, Danielle Kramer, Dan Kreysa, Akiva Leffert, Ruy Ley-
Wild, Karen Liu, Dave MacQueen, Chris Martens, Greg Morrisett, Stefan Muller, Tom
Murphy, Aleksandar Nanevski, Georg Neis, David Neville, Adrian Trejo Nuñez, Cyrus
Omar, Doug Perkins, Frank Pfenning, Jean Pichon, Benjamin Pierce, Andrew M. Pitts,
Gordon Plotkin, David Renshaw, John Reynolds, Andreas Rossberg, Carter Schonwald,
Dale Schumacher, Dana Scott, Shayak Sen, Pawel Sobocinski, Kristina Sojakova, Daniel
Spoonhower, Paulo Tanimoto, Joe Tassarotti, Peter Thiemann, Bernardo Toninho, Michael
Tschantz, Kami Vaniea, Carsten Varming, David Walker, Dan Wang, Jack Wileden, Sergei
Winitzki, Roger Wolff, Omer Zach, Luke Zarko, and Yu Zhang. I am very grateful to the
students of 15-312 and 15-814 at Carnegie Mellon who have provided the impetus for the
preparation of this book and who have endured the many revisions to it over the last ten
years.
I thank the Max Planck Institute for Software Systems for its hospitality and support.
I also thank Espresso a Mano in Pittsburgh, CB2 Cafe in Cambridge, and Thonet Cafe
in Saarbrücken for providing a steady supply of coffee and a conducive atmosphere for
writing.
This material is, in part, based on work supported by the National Science Foundation
under Grant Nos. 0702381 and 0716469. Any opinions, findings, and conclusions or rec-
ommendations expressed in this material are those of the author(s) and do not necessarily
reflect the views of the National Science Foundation.

Robert Harper
Pittsburgh
March 2012
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
PART I

Judgments and Rules


1 Abstract Syntax

Programming languages express computations in a form comprehensible to both people


and machines. The syntax of a language specifies how various sorts of phrases (expressions,
commands, declarations, and so forth) may be combined to form programs. But what are
these phrases? What is a program made of?
The informal concept of syntax involves several distinct concepts. The surface, or con-
crete, syntax is concerned with how phrases are entered and displayed on a computer. The
surface syntax is usually thought of as given by strings of characters from some alphabet
(say, ASCII or Unicode). The structural, or abstract, syntax is concerned with the structure
of phrases, specifically how they are composed from other phrases. At this level, a phrase
is a tree, called an abstract syntax tree, whose nodes are operators that combine several
phrases to form another phrase. The binding structure of syntax is concerned with the
introduction and use of identifiers: how they are declared, and how declared identifiers can
be used. At this level, phrases are abstract binding trees, which enrich abstract syntax trees
with the concepts of binding and scope.
We will not concern ourselves in this book with concrete syntax but will instead consider
pieces of syntax to be finite trees augmented with a means of expressing the binding and
scope of identifiers within a syntax tree. To prepare the ground for the rest of the book, we
define in this chapter what is a “piece of syntax” in two stages. First, we define abstract
syntax trees, or ast’s, which capture the hierarchical structure of a piece of syntax, while
avoiding commitment to their concrete representation as a string. Second, we augment
abstract syntax trees with the means of specifying the binding (declaration) and scope
(range of significance) of an identifier. Such enriched forms of abstract syntax are called
abstract binding trees, or abt’s for short.
Several functions and relations on abt’s are defined that give precise meaning to the
informal ideas of binding and scope of identifiers. The concepts are infamously difficult to
define properly and are the mother lode of bugs for language implementors. Consequently,
precise definitions are essential, but they are also fairly technical and take some getting
used to. It is probably best to skim this chapter on first reading to get the main ideas, and
return to it for clarification as necessary.

1.1 Abstract Syntax Trees

An abstract syntax tree, or ast for short, is an ordered tree whose leaves are variables, and
whose interior nodes are operators whose arguments are its children. Ast’s are classified
4 Abstract Syntax

into a variety of sorts corresponding to different forms of syntax. A variable stands for an
unspecified, or generic, piece of syntax of a specified sort. Ast’s can be combined by an
operator, which has an arity specifying the sort of the operator and the number and sorts
of its arguments. An operator of sort s and arity s1 , . . . , sn combines n ≥ 0 ast’s of sort
s1 , . . . , sn , respectively, into a compound ast of sort s.
The concept of a variable is central and therefore deserves special emphasis. A variable
is an unknown object drawn from some domain. The unknown can become known by
substitution of a particular object for all occurrences of a variable in a formula, thereby
specializing a general formula to a particular instance. For example, in school algebra
variables range over real numbers, and we may form polynomials, such as x 2 + 2 x + 1,
that can be specialized by substitution of, say, 7 for x to obtain 72 + (2 × 7) + 1, which can
be simplified according to the laws of arithmetic to obtain 64, which is (7 + 1)2 .
Abstract syntax trees are classified by sorts that divide ast’s into syntactic categories.
For example, familiar programming languages often have a syntactic distinction between
expressions and commands; these are two sorts of abstract syntax trees. Variables in abstract
syntax trees range over sorts in the sense that only ast’s of the specified sort of the variable
can be plugged in for that variable. Thus, it would make no sense to replace an expression
variable by a command, nor a command variable by an expression, the two being different
sorts of things. But the core idea carries over from school mathematics, namely that a
variable is an unknown, or a place-holder, whose meaning is given by substitution.
As an example, consider a language of arithmetic expressions built from numbers,
addition, and multiplication. The abstract syntax of such a language consists of a single
sort Exp generated by these operators:

1. An operator num[n] of sort Exp for each n ∈ N.


2. Two operators, plus and times, of sort Exp, each with two arguments of sort Exp.

The expression 2 + (3 × x), which involves a variable, x, would be represented by the ast

plus(num[2]; times(num[3]; x))

of sort Exp, under the assumption that x is also of this sort. Because, say, num[4], is an ast
of sort Exp, we may plug it in for x in the above ast to obtain the ast

plus(num[2]; times(num[3]; num[4])),

which is written informally as 2 + (3 × 4). We may, of course, plug in more complex ast’s
of sort Exp for x to obtain other ast’s as result.
The tree structure of ast’s provides a very useful principle of reasoning, called structural
induction. Suppose that we wish to prove that some property P(a) holds for all ast’s a of a
given sort. To show this, it is enough to consider all the ways in which a can be generated
and show that the property holds in each case under the assumption that it holds for its
constituent ast’s (if any). So, in the case of the sort Exp just described, we must show

1. The property holds for any variable x of sort Exp: prove that P(x).
2. The property holds for any number, num[n]: for every n ∈ N, prove that P(num[n]).
5 1.1 Abstract Syntax Trees

3. Assuming that the property holds for a1 and a2 , prove that it holds for plus(a1 ; a2 ) and
times(a1 ; a2 ): if P(a1 ) and P(a2 ), then P(plus(a1 ; a2 )) and P(times(a1 ; a2 )).

Because these cases exhaust all possibilities for the formation of a, we are assured that
P(a) holds for any ast a of sort Exp.
It is common to apply the principle of structural induction in a form that takes account of
the interpretation of variables as place-holders for ast’s of the appropriate sort. Informally, it
is often useful to prove a property of an ast involving variables in a form that is conditional
on the property holding for the variables. Doing so anticipates that the variables will be
replaced with ast’s that ought to have the property assumed for them, so that the result of
the replacement will have the property as well. This amounts to applying the principle of
structural induction to properties P(a) of the form “if a involves variables x1 , . . . , xk , and
Q holds of each xi , then Q holds of a,” so that a proof of P(a) for all ast’s a by structural
induction is just a proof that Q(a) holds for all ast’s a under the assumption that Q holds
for its variables. When there are no variables, there are no assumptions, and the proof of P
is a proof that Q holds for all closed ast’s. On the other hand, if x is a variable in a, and we
replace it by an ast b for which Q holds, then Q will hold for the result of replacing x by b
in a.
For the sake of precision, we now give precise definitions of these concepts. Let S be
a finite set of sorts. For a given set S of sorts, an arity has the form (s1 , . . . , sn )s, which
specifies the sort s ∈ S of an operator taking n ≥ 0 arguments, each of sort si ∈ S. Let
O = { Oα } be an arity-indexed family of disjoint sets of operators Oα of arity α. If o is
an operator of arity (s1 , . . . , sn )s, we say that o has sort s and has n arguments of sorts
s 1 , . . . , sn .
Fix a set S of sorts and an arity-indexed family O of sets of operators of each arity. Let
X = { Xs }s∈S be a sort-indexed family of disjoint finite sets Xs of variables x of sort s.
When X is clear from context, we say that a variable x is of sort s if x ∈ Xs , and we say
that x is fresh for X , or just fresh when X is understood, if x ∈ / Xs for any sort s. If x is
fresh for X and s is a sort, then X , x is the family of sets of variables obtained by adding
x to Xs . The notation is ambiguous in that the sort s is not explicitly stated but determined
from context.
The family A[X ] = { A[X ]s }s∈S of abstract syntax trees, or ast’s, of sort s is the smallest
family satisfying the following conditions:

1. A variable of sort s is an ast of sort s: if x ∈ Xs , then x ∈ A[X ]s .


2. Operators combine ast’s: if o is an operator of arity (s1 , . . . , sn )s, and if a1 ∈ A[X ]s1 ,
. . . , an ∈ A[X ]sn , then o(a1 ; . . . ;an ) ∈ A[X ]s .

It follows from this definition that the principle of structural induction can be used to prove
that some property P holds of every ast. To show P(a) holds for every a ∈ A[X ], it is
enough to show:

1. If x ∈ Xs , then Ps (x).
2. If o has arity (s1 , . . . , sn )s and Ps1 (a1 ) and . . . and Psn (an ), then Ps (o(a1 ; . . . ;an )).
Random documents with unrelated
content Scribd suggests to you:
CHAPTER III.
John Brown’s Body and the Bones of
John Paul Jones.

T HAT Paul Jones was not alone soon became evident. With his
coming, other ghostly forms had taken shape in the semi-
gloom and the admiral became the centre of a throng which
included the greatest men of all time—the only great men, in fact,
for one must die before he can be accorded any measure of
greatness. Only in the perspective of the past does a man loom large
in the vision of the present.
“It were better to be a live politician than a dead hero,” observed
Paul Jones, reading my thoughts. Then he sighed.
“But you are honored on earth and even here,” I said, with a
glance around the circle at the illustrious members of the Asbestos
Society of Sinners.
“Earthly honor is but hysteria,” Jones replied wearily. “Yet, ‘twas
ever thus. One is usually crushed by the honors showered upon him,
as were the Romans in attending the banquet of Emperor
Elagabalus, who rained roses upon his guests until all were buried
and smothered by the flowers. Like them ‘bouquets’ are thrown at
me when I am dead, of which I would have been more appreciative
while living. Yet ‘bouquets’ are preferable to ‘brickbats,’ even though
they do not make so lasting an impression. Hades, as you will soon
learn, is more of a news centre than London, and so I have heard
that in recent years the city hall of New York was draped in
mourning for Hiram Cronk, last survivor of the War of 1812, whose
only claim to fame was that he did not die sooner. If earthly honors
died on earth I wouldn’t complain, but they are all reproduced in
Hades, which is a burlesque of the upper world. Ever since
Ambassador Porter found a body which he thought might have
looked like me had I looked like that body, I have been given
homage by every man in Hades. The joke of the matter—if a
Scotchman may take an Irish bull by the horns and joke at his own
funeral—is that there is no certainty about the body being mine.”
“Do you doubt it in the face of—”
“When face to face with a dead doubt, don’t look a gift corpse in
the mouth,” interrupted the admiral dryly. “Had Porter done so, he
would have discovered two gold teeth, and I really must insist that if
that body is mine, those teeth were filled after I died. In the old
days, before the doctors invented appendicitis, I did not mind
swallowing all the grape sent with the enemy’s compliments, but I
always did draw the line at the dentist’s chair, and any manipulator
of the forceps would have struck a snag had he investigated my
corpse too closely. Perhaps I ought not to complain, for it may be
that if I keep my mouth shut I shall get a decent funeral, and
unfortunately this is supposed to be my funeral.”
“But the proofs,” I remonstrated.
“My dear fellow, it is easy to pile up proofs on a dead man, for he
cannot rise up to refute them. Here is a dead body; Paul Jones is
dead: therefore, this must be Paul Jones. That may be logic but it is
not common-sense. Yet this text-book reasoning is no more absurd
than the ‘proofs.’ First of all, there was the absence of a coffin plate;
had the body been missing instead of the name it would have been
more worthy of notice. An autopsy has revealed traces of the
disease of which I died, and this after a hundred years! If they were
as expert in diagnosing the living as they are in cutting up the dead,
fewer of the mistakes of the doctors would have to be buried from
sight and mind. Then these learned savants triumphantly point to
the height as a sure proof that this is the body of Jones and not of
Smith, though both families are so numerous that the bones of one
more or less doesn’t matter save as a museum exhibit—from which
fate may the Stars and Stripes protect me! It seems from this
deduction that I was the only person ever born into the world who
ever attained to a stature of five feet and seven inches. That’s what
a man gets for measuring up to the standard! The most remarkable
coincidence of all is that neither uniform nor sword was found.
Evidently Paris makes it a custom to bury its dead, civilian and
officer alike, in a shroud of mystery, epaulets and gold stripes.
“Really, the only proof distilled is that the body was found floating
in alcohol. I was so fond of that preservative in life, according to the
historical novelists, that if a dead body can move of its own volition,
I know mine would have sought out the alcohol. It may be the body
of John Jones or John Smith, or it may be the remains of some
Johnny Craupaud of a century ago; who knows? A slip of genealogy
has lost thrones and made more than one man get off the earth.”
“At least you must concede it is not often that many cities
squabble over the honor of giving sepulture to a man’s remains.”
“After a century of neglect,” retorted Jones, “‘history repeats itself,’
as my friend Tom Heyward will tell you.”

“‘Seven cities warred for Homer being dead


Who living had no roof to shroud his head!’”

“It’s a wonder some of those cities did not foresee the coming
events of which Homer was the shadow and make a play for Jones.
Now, Seward, it’s your turn. Come, Tom, speak your little piece.”

“‘Great Homer’s birthplace seven rival cities claim;


Too mighty such monopoly of fame.’”

Paul Jones was about to speak when he was interrupted by a


newcomer who chanted:

“‘Seven wealthy towns contend for Homer dead


Through which the living Homer begged his bread.’”
“That is Mr. Anon,” whispered Lord Bacon. “Shakespeare is quite
jealous of him, for Anon claims to be the most voluminous author in
the world and, like Byron’s reviewer, has ‘just enough learning to
misquote.’ He seldom quotes anyone correctly, not even excepting
himself, but in this he is not unlike those other authors whom excess
of egotism persuades into signing their names to that which would
be their own had not some one said it before.”

“‘Heed him not, gentle sirs,


’Tis but the fool,’”

observed Shakespeare.
“I ought to give you a pension for making my sayings so well
known; I notice you never quote your own sentiments because mine
answer all purposes so much better.”
It was Lord Bacon who spoke.
“I was talking of you, I grant that,” retorted Shakespeare. “Shall I
repeat it? My wife says that it’s only by a hair—”
“You two men are always quarreling,” interrupted Anon. “Please
keep the age of Anne from his lordship’s notice, for she hath a way
to fry his Bacon. My lord, you should never judge a poet by his hair.”
“Nor yet by his feet,” interrupted Longfellow; “although if a poet
looks well to his feet there are no heights to which he cannot climb.”
“I accept the measure of your judgment,” went on Anon calmly.
“As for the lady, Delilah’s barber stunt convinced Samson it isn’t wise
to tell the truth to a woman.”
“Yet I must insist,” continued Lord Bacon, “that Shakespeare is
rather shy of hair to be a real poet. Of course, I have heard the
story that Anne Hathaway, after a conference with Delilah, sought to
reduce the strength of the Samson of letters by cutting his name
from Shakespeare to Shakspeare and trimming his hair to make
assurance doubly sure, but Lot’s wife, in looking backward, has
recommended that the pig-tale be swallowed with a grain of salt. My
dear Willie, your poetry has pains in its feet, your rhyme has
received the absent treatment, and your rythm, like your hair, is
lacking.”
“Oh, well, hair doesn’t grow on brains,” retorted the claimant to
“Hamlet.”
But Anon was not to be out-argued, and continued:
“A hirsute chrysanthemum growing on a man’s head is more likely
to indicate a quarterback Freshman on the gridiron than a
hunchback poet on the Mount of Parnassus. As for the poet’s other
extreme, metrical feet are not always symmetrical.”

“You’ve told it all—so for a spell


For more rhymes where’s the reason?
Besides, just now we are in h—”

“That’s blank verse,” interrupted Shakespeare.


“You mean damn!” interjected Lord Bacon, profanely. “Let me lend
you the metres, Bill, so that you may measure up to my standard, or
else cork the rythmic bottle and spill no more mimic blood of red
ink.”
“The gas man is the only person who controls my metre,” said the
Bard of Avon, chuckling at his own wit. “You quite sweep me off my
metaphorical feet. That may not be original, but I have no
aspirations in the direction of originality.”
“The last broker who arrived from Wall Street says that you are
too full of quotations to be original,” sneered Lord Bacon.
“Have you forgotten that you once said ‘a man that hath no virtue
in himself ever envieth virtue in others?’ Bartlett allows you seven
pages, while he gives me more than a hundred. Familiarity breeds
imitators. Even in quotations, you follow after me.”
“If you wear so long a face, you’ll stub your toe on your chin,”
observed Anon, noting that Lord Bacon was getting the worst of his
controversy with Shakespeare. “Never mind Bill’s raving. Burton tells
him he larded his lean books with the fat of others’ works. Maybe
that’s the reason why he gives his readers mental dyspepsia; to
inwardly digest ‘Hamlet’ would disagree with the stomach of an
ostrich. After all, the world knows that Shakespeare was not a man
but a syndicate, to which I was the largest contributor. I’ll call the
man a plagiarist who says I’m a liar.”
No one cared to knock off the verbal chip which Anon had put
upon his shoulders, so Paul Jones resumed:
“Have I equalled Homer’s record?”
“Of course,” I answered; “you, as an American, couldn’t stand
being beaten by a foreigner like Homer, even though you are both
dead ones. You are claimed by New York, Philadelphia, Washington,
Arlington, Richmond, Fredericksburg, Annapolis, and Ocean Grove. I
believe there are a few other cities whose names have escaped my
memory. Have you any preference in the matter?”
“It’s odd no one has thought about consulting me before. I could
have settled the controversy at once. France did not treat me or my
bones very well, yet I can’t say I am glad to leave there. It isn’t very
pleasant to be dead, but it’s worse to have people squabble over
your body. I wonder if Porter ever heard the adage ‘Let the dead
rest in peace,’ and that other one ‘Cursed be he who moves my
bones!’ You’ve seen two dogs fight over a bone, but you never saw
the bone fight. I am nothing but bones.”
“New York’s claim—”
“I hope they won’t bury me in New York. I’ve heard it said that the
metropolis is noisy enough to wake the dead and it is certain that
my presence would make Captain Landais turn over in his grave. I
always did bore Landais and so if I invaded the territory of the tired,
St. Patrick’s cemetery would yawn and give up its dead.”
“Had you been a politician,” observed Matt Quay, “some faction of
our party would long since have unearthed one of your letters in
which you had selected your burial place.”
“You have not yet told me your choice,” I reiterated, remembering
the city editor’s parting words.
“I would rather be embalmed in the throbbing heart of the sea,
with which my own heart beat so long in unison. My grave has been
unmarked for a century, so why not forever? I would prefer to be
commander of that greatest army of all, the unknown dead, whose
resting place is marked only by monuments of billows and flowers of
feathery spray. A bridal veil of silver surge is as elaborate a shroud
as I desire.”
“How about cremation?”
“We’ll get enough of that down here some day, so it is useless to
undergo the ‘roasting’ process twice. Yet it has its advantages.
Soldiers and sailors don’t get much time for godliness, you know,
and as cleanliness is next to it, cremation might—”
“John Brown’s body lies a smouldering in—”
That was as far as Mr. Anon could proceed, for he had fired John
Brown’s anger. That worthy said he was hanged if he were going to
allow anybody to “roast” him by any such incendiary remark.
“Choke him off,” came the chorus from all sides. “Here’s a rope.
String him up.”
This brought up such unpleasant recollections of the past that
John Brown subsided. I hastened to pacify him by observing:
“You have no cause for disquiet, for your bones lie peacefully in
the Adirondacks at North Elba.”
“Hush!” warned Holmes. “That word always invokes Napoleon.”
The Corsican had indeed materialized. He glared at me as he said:
“Peace at Elba? If you found peace there, you accomplished more
than did the great Napoleon, and that were impossible.”
“Ah, but you see I hadn’t met my Waterloo,” I retorted. Wellington
laughed tauntingly.
“Neither had I when I went to Elba,” supplemented Bonaparte,
and then and there I met my Waterloo at the hands of Napoleon. It
is poor policy for a writer of history to dispute the maker of it,
though I am aware the historical novelists hold other views. For a
moment it seemed as if Wellington’s tantalizing mirth would
precipitate another battle between the illustrious warriors. Then the
two men shook hands, looking like two prize fighters about to enter
the ring. Nothing happened, however, and with a trace of
disappointment in his tone,—for immortals are very like mortals and
he dearly loved a fight,—Paul Jones went on:
“It is a good thing I’m dead, for living heroes always get restless
and tumble from the clay pedestal on which an admiring public
places them. Heroes should be handled with care, for they are
perishable goods. Both Dewey and Dowie have had their day. Dewey
turned his house over to his wife so the sheriff couldn’t get it, as
many another man has done before and since. Evidently the dear
public didn’t believe the two were one, for the hero-worshippers
swept him to obscurity on a tidal wave of regretful tears. I wonder if
he said it was all Mrs. Dewey’s fault. You know it is more difficult to
manage a wife in America nowadays than it was in the days of
Solomon, when the wives were so frequent that a man couldn’t
remember which one was to blame.”
“The English still claim that you were a pirate,” I observed.
“I feel quite honored at so illustrious an accession to our ranks,”
said Captain Kidd.
The admiral smiled.
“Stop your Kidding,” he said to the pirate. “I believe my conduct
was unsatisfactory to them on several occasions when I bearded the
lion in his channel. The English are queer. They made Captain
Pierson a baronet for getting defeated.”
“If we had had Paul Jones,” said Lord Nelson, “we would have
made him prime minister and buried him in Westminster Abbey.
England is the most grateful of all nations.”
“You need not remind me of the ungratefulness of republics,”
rejoined Jones. “I have experienced it, though I am not a living
example. But, my lord, I wish I had had you pitted against me in the
days of ’77; I would dearly have loved to have exchanged shots with
you.”
“You are too kind,” drawled Nelson, lifting his monocle to his blind
eye. “I really can’t see you in that light.”
“You have an eye single to your own interest,” I said to Nelson;
then turning to Jones:
“We have swung around the circle and you haven’t yet told me—”
“We will leave it to Roosevelt,” replied the admiral. “Whether it is
John Brown, John Jones or Johnny Craupaud, he will see that the
body gets a square deal—box!”
“How about your epitaph? I would suggest: First in war, last in
peace, and at present in the hearts of his countrymen, to mark the
tomb of the father of the American navy. That epitomizes your whole
career.”
“I do not want to usurp Washington’s paternal honors. Of course
all epitaphs are written by Mephisto, ‘the father of liars,’ as you
know, but if mine were to be truthful, my tomb would bear the
simple inscription:

“Pause, stranger, yet weep not,


For here lies the body of
John Paul Jones—perhaps!”
HENRY VIII. AND HIS HAREM IN
HADES.
CHAPTER IV.
Henry VIII. and His Harem in
Hades.

“Q UAKER worship may be as appropriate as any other kind


on Sunday,” observed William Penn, “but this silence is
getting on my nerves. Why don’t you say something
funny, you humorists? What’s the use of having famous funny men
in this society if they cannot enliven Hades on a dull Sabbath?”
“I’m not in the humor to be humorous to-night,” said Bret Harte,
who was busily engaged in making “Condensed Novels” by tearing
to shreds without reading, their contents from the title page to the
finis; book reviewing they designate it up on earth.
“Do you call that wit?” sneered Eugene Field.
“If you can define the difference between wit and humor, I’ll
promise to laugh the next time you see things at night,” retorted
Harte.
“Eternity is too short for definitions, except to a philologist,”
evaded Field. “Ask Dick Whately; the archbishop of Dublin is the only
man who discriminates English synonyms.”
“I know when you don’t ask me,” replied the doctor. “Consult
Webster.”
“Mortal cannot live by wit alone,” commented that philologist.
“Being immortal, I can,” said Johnson.
“Mark that down, Boswell, even if Shakespeare does object to the
doctor’s company on the Mount of Parnassus. A man of perpetual
inspiration ought to use a fountain pen, but in the absence of a point
to Johnson’s wit, Demosthenes will lend you a pebble.”
“As I live in a glass hot-house, I never throw stones,” gurgled the
orator, after a vain effort to clear his throat of a pill from the
laboratory of Nature.
“On earth I always kept a box of bon mots on my chimney piece,”
put in Sydney Smith.
“If they had been chocolate bon bons, you would have been a
sustaining favorite among the ladies,” chuckled King Henry the
Eighth.
“Where knowledge of women is concerned, I bow to your marital
Majesty,” acquiesced Smith. “Mere man never becomes a post-
graduate on femininology, but he can manage to get up a bowing
acquaintance with women after he is married to six of them. It
seems to me that Utah would be a good place to study her ‘of
infinite variety.’ I have often thought that much of Solomon’s wisdom
came from his three hundred wives.”
“With such a match-making father,” I put in, my newspaper
instinct scenting “copy,” “I have often wondered why good Queen
Bess never married.”
“I’m sorry Elizabeth didn’t keep up the family reputation,”
answered the king, “but I guess she thought I did marrying enough
for the whole family. Besides, Bess had her hands full ruling the
kingdom and her temper without attempting to rule a husband.
However, I never could understand why she turned a deaf ear to Sir
Walter’s pleading. He wooed her so long with his eyes that she
asked him one day why he was such a mute, inglorious Raleigh. He
replied that a beggar who is dumb should challenge double pity. As
many another man has done since then, the silent lover lost his head
over a woman.”
“That’s the King James version,” retorted Sir Walter. “It seems to
me that your Majesty should confine yourself to rattling the
skeletons in your own Bluebeard’s closet.”
“I see you have a sharp tongue to match the edge of the axe
which brought you to your knees. You had a reason for what you did
on earth, but you lost your reason along with your head when you
left the upper world. By the shade of Anne Boleyn,” went on the
king, becoming more and more enraged as he proceeded, “were we
on earth, your insolence should cause you to swing from Tyburn’s
tree.”
“You can’t string me up,” sneered Raleigh. “No man ever made a
monkey of me.”
“No, but a woman did. You can’t cloak what you did for Elizabeth.
Now Anne—”
“You forget yourself,” angrily interrupted Anne Boleyn, who had
just come upon the scene.
“But you won’t allow me to forget you!” ruefully retorted the king.
“It’s time you came home, Henry. You’ve been keeping altogether
too late hours at the club recently and I’ve come to take you home.”
“But I had promised to take tea with Catharine Parr,” rebelled
Henry. “You know she is rightfully my wife.”
“Really? You forget that decrees of divorce are not binding in
Hades, whether they have been executed by the hangsman or by
the justice.”
“I appeal to Judge Blackstone.”
“This is altogether without precedent, but I must support the
lady,” responded the jurist, gallantly.
“Then take her. Bless you, my children. I’ve no hard feelings,
Anne. May no decrees of court or fate terminate your second union.
I’ve sampled the wine of her womanhood, Judge, and as wine
improves with age, it ought to be even better now than it was some
hundreds of years ago.”
“It isn’t every man who would give his wife a recommendation,”
diplomatically remarked Blackstone, alarmed at the construction
Henry had placed on his gallantry, and noting that Anne Boleyn
seemed pleased thereby. “I fear, however, that Satan would object to
any but Lucifer matches in Hades, so until you strike brimstone,
Anne here is still your wife.”
“How about the others?” groaned Henry.
“You must settle that with them,” evaded the jurist. “I think one
wife would be enough for me, but as you have made your harem,
you can’t lie out of it.”
“Henry!” The tone was threatening. The king meekly arose and
cast an appealing glance at me.
“I would be delighted to have your company,” he said. “In the
olden days I should have commanded, but Anne has taken the
command from me. You know I want you to denounce those
hysterical novelists who have taken liberties with my wives.”
“I’d like to see them take liberties with me,” aggressively brindled
madam.
“They couldn’t do that,” soothingly replied his Majesty. “No, they
painted you in your true colors: a study in black and white.”
“Where do you live?” I inquired.
“On Eighth Avenue, of course,” returned the king, as if that were a
foregone conclusion. “Lucifer named and numbered the streets after
a recent visit to New York. Ward McAllister wanted me to live in
apartments at Twenty-third Street and Fifth Avenue, but the ‘skidoo
set’ was not exclusive enough for me and I said I would live on
Eighth Avenue or go back to England. Charon wouldn’t listen to that,
as he said I had given him only a single trip ticket. So I am domiciled
on Eighth Avenue, which we have now reached. Here I live with my
six wives.”
“Six?” I exclaimed, as we entered the royal palace. “I thought it
was eight wives. Why did they call you Henry the Eighth if it were
not because of the number of your consorts? The only thing we
Americans know about you is that you had more wives than the law
allows, and instituted a church to enable you to get another.”
“America?” muttered the king. “I don’t remember where that is.
Down here, however, we refer all questions of geography to Atlas.
My dear, won’t you ask him to come here if he isn’t too weary from
carrying on his shoulder the chip of a world which no one will knock
off.”
But Her Grace did not move.
“Your church was instituted too late to be binding on me,” she
said, her nose becoming an acute retrousse. “The word obey didn’t
cut any figure in our matrimonial contract.”
“If I once chopped off your head, as the historians say, you’ve
snapped mine off since,” grumbled his hen-pecked Majesty.
“My head was divorced from my shoulders. I should have
preferred the courts of law to courting the axe.”
“There! don’t cry or you will cause the carpet to mildew. My dear,
never try to salt down a man’s affections with briny tears.”
A queenly woman entered the room. I arose to greet her. The
king’s fat interfered with his gallantry; besides, the woman was his
wife, which explains while it does not justify.
“My sister and my wife,” said Henry, presenting me to Catharine of
Arragon. “It’s the only case on record where a woman, after
promising to be a man’s sister, became his wife. Do you wonder that
I began to feel quite rich in family relations? Although I murdered
my sister-in-law, I left it to the punsters to murder the mothers-in-
law who came after me.”
“The historians say that my fall from kingly favor was a matter of
conscience,” mused Her Grace. “Didn’t the still small voice make
itself heard when you severed the bonds of matrimony with your
little hatchet?”
“Not at all, Catharine. I left my conscience on the executioner’s
block to flirt with yours!”
“And married again!”
“Of course. Matrimony always had much attraction for me,
although I realize that a man had better fall into the sea than fall in
love and marry. A corpse devoured by crabs is no less harrowing
than the spectacle of a man devoured by love, and it is better to
multiply crabs than to multiply sinners and fools. Matrimony is a
foretaste of purgatory to which no man should be called upon to
submit before death.”
“No wonder you got dyspepsia and gout from indulging your
taste.”
“There you are again, Anne, throwing ancient history in my teeth.
Did you ever hear how I got rid of the gout?”
I shook my head.
“Ah, thank goodness, one incident of my life has escaped the
novelists. Lucifer is compiling a mammoth work ‘Every Man His Own
Historian’ to which we are all contributing. It promises to to be one
of the ‘six best sellers.’ Permit me to read a chapter from my
autobiography:
“I must have fallen asleep upon my throne. I dreamed that a great
iron safe had fallen upon my feet and awoke to find a hideous-
looking creature seated complacently upon my bandaged foot. I
groaned and tried to shake him off, but he still clung there and the
weight of his body seemed to be pushing red-hot needles into the
swollen flesh.
“He took off his cap with a courtly bow.
“‘Allow me to introduce myself as Mr. Gout, M. D.,’ he said.
“‘What! you are Mr. Gout, who is responsible for my sufferings and
you actually have the impudence to come here! Why, oh my foot!’
“‘Do you know why I am so attentive to you?’
“‘From pure cussedness, confound you! Ow-oh, I wish you would
keep your attentions to yourself.’
“‘That’s the way of the world. A man is indiscreet, and when he
has to pay the penalty, lays the blame on some one else. My duty is
to remind you that you cannot abuse this body with impunity.’
“The hideous creature began to jump up and down on my foot.
Maddened by the pain, I picked up a heavy dictionary lying near and
hurled seventy thousand words bound in calf at him. The aim was
too low and Webster fell over my foot. Then I fainted. The Gout had
gone!”
“Now that you have disposed of Dr. Gout, let us go back to our
original subject—women,” I said, smiling. “A man who has had six
wives ought to have some knowledge of the feminine character.”
Just then John Heyward entered. The king turned to him.
“Just in time, fool,” he said. “Answer our American friend: What is
a woman?”
“‘A rag and a bone and a hank of hair.’ That sounds like a before-
treatment advertisement, but is really original with Kipling. As for
myself, although a fool, I don’t attempt to designate a woman by a
descriptive tag, as if she were a special brand of chocolates. To man,
woman is a sphinx endowed with a voice. He never gets more than
a telephonic acquaintance with her, and the woman always hangs up
the receiver and monopolizes the transmitter.”
“Listen to the words of a wise fool who wears a dunce cap for a
crown,” approved Henry. “Right you are, Heyward, and one woman
is very much like another.”
“I beg to differ,” said the poet. “Women are different, not only in
their baptismal labels, but in that some women have a husband and
others have a cat. Women have often been compared to cats, but
did you ever contrast cats and men? Thomas never throws his
mother in the face of his wife. He keeps his own whiskers trimmed
and stays home nights. He does not come back to the partner of his
bosom at three a. m. with a diagonal gait and an asinine gayety,
chewing the butt of a cigar and talking in a tongue that is as
unsteady as his legs. Nor does Tommy slam the door in fourteen
languages when Kitty asks how that blonde hair came on his coat.
But we’re all human. If you’re hunting for a perfect woman, stop—
she’s dead; if for a perfect man, you’re a fool. Elijahs are no longer
translated without being prepared for the undertaker. Yet methinks
that if one could forget other folks’ mistakes as easily as one’s own,
there would be less scandal.”
He turned to Catharine Parr.
“One thing has always puzzled me. Why is it that women prefer to
be old men’s darlings, that you enjoy being clouds in the sunset’s
glow rather than in the noontide glory?”
“The setting sun always gives a golden lining to the clouds it
embraces, but to drop the figurative—we are soaring rather high—
and come down to earth, women marry old men so that they may
soon become widows.”
Henry nervously tried to adjust an imaginary crown that weighed
heavily on his head.
“Seymour plucked the weeds from the garden of your widowed life
before the first blade of grass had pushed up from a newly-made
grave. O Inconstancy! O Woman! Of two things, one. Orpheus went
to Hell to find his wife. He failed to win her from her refuge in the
shades because he looked back to discern her features. Had Euridice
retraced the path from Hell without bringing with her surcease from
domestic woe, Orpheus would have wished her back down that
familiar track. I wish he would pay us another visit. I’d loan him five
of mine.”
“Which wife would you retain?” asked Catharine Howard.
“Catharine,” answered Henry, diplomatically.
All three who bore that name beamed with gratification.
“Catharine is always at Parr,” continued the king. His fondness for
punning nearly proved his undoing.
“I’m not below Parr,” angrily exclaimed Catharine of Arragon. “I
come before her.”
“No, you came,” corrected the king. “It’s merely a question of
tense. Many a woman promises to be a sister to the devil who has
never received a proposal.”
“That’s a good one on you!” laughed the fool. “Her Grace of
Arragon promised to be a sister to you! What do you say to that?”
“My answer is written in history. ‘The Lord gave and the Lord hath
taken away,’ for which ‘blessed be the name of the Lord.’ I replaced
my wives, so that the supply would always equal the demand. I
believed that as long as the Lord took, it was my duty to take.”
The king paused long enough to drink a cup of pink tea and to eat
some breaded calves’ brains for inspiration.
“When trouble comes,” continued Henry, “some people fly to
matrimony, thinking drink too vulgar.”
“Your troubles have been many, judging by your marital
intemperance.”
“They were, but my troubles always came singly,” chuckled the
king. “As fast as I executed one, another came, but I made sure I
was off with the old head before I coveted the new.”
“The only bright thing an American can remember to have heard
Punch say is ‘don’t’ when matrimony is on the horizon, but then
Punch is English and England has no Ali Ben Theodore—peace to his
Strenuosity—to turn the throne into a pulpit for dissertations on vital
statistics in the hope that he may make census taking an
unnecessary burden of government. Modern philologists were
seriously considering the advisability of eliminating the word ‘papa’
from the dictionary, when the leading exponent of the life effective
raised the question as to why mamma’s lap wasn’t filled. When the
president becomes advance agent for the stork hope is born, but if
the stork continues to be derelict in its duties, we might give the
eagle a trial in an endeavor to have this statistical indictment set
aside.”
“What does Mr. Roosevelt know about the rights of unattached
bachelors?” asked Catharine the Third. “He isn’t a bachelor and
never was one; he was born domestic and to the domestic man
nothing ever happens—except the buying of more cradles.”
“A woman’s tongue is as full of sharp points as a porcupine,”
observed Henry, who was inordinately fond of epigrammes. “But
never mind, Kittens, I am the last man in the world who would
deprive you of woman’s inalienable rights—love, license, and the
pursuit of man.”
“Their Majesties are looking well and youthful,” I said, with a
gesture that included all the wives of the much-married king.
“One never grows any older in Hades,” answered Henry. “That
explains its attraction for women, and why the devil has so many
votaries among the fair sex!”
“An exclamation point often hides a pointless period. When a man
talks epigrammatically about woman, it is a sign that he doesn’t
understand her.”
And being a woman, Catharine Parr had the last word.
WHAT METHUSELAH THINKS OF
DR. OSLER.
CHAPTER V.
What Methuselah Thinks of Dr.
Osler.

“O THAT mine adversary had written a book!”


“The most miserable man in Hades is no longer Job but
Methuselah,” whispered Anon. “Ever since Dr. Osler celebrated his
departure for England by proposing a wholesale slaughter of the
innocent aged, Methuselah has had to take a seat on the sinners’
bench. It was formerly considered an honor to be an old man, even
in Hades, but now it is a disgrace not to have died young. The other
day, Cain, who is the bad boy of the underworld, gave Methuselah
as a birthday present a collection of thirty-six bottles of chloroform,
one for each sixty years of his earthly age. Then the lad, who is
Satan’s chief imp, put a placard on Methuselah’s back reading
‘Oslerized.’”
“There comes a time in every man’s life when he wishes for
Herod’s power, that he might order all children killed—except his
own!” muttered the old man. “But I had my revenge: I was Abel to
raise Cain over a foot.”

“Under a spreading chestnut tree,


The ancient jokesmith lies,”

hummed Longfellow.
“That is a prehistoric relic which leaked from the Ark when we
grounded on Mt. Ararat,” volunteered Noah. “I sprung that ‘raising
Cain’ joke on Mrs. Noah, but you know a woman has no sense of
humor and she said she had her hands full without working the
adoption degree.”
“‘O, that mine adversary had written a book!’” reiterated
Methuselah.
“He has; your wish is fulfilled.”
It was a newcomer who spoke. All eyes were turned upon him as
Methuselah asked:
“Who are you?”
“A. Hasbeen, M.D., late secretary of the Os-slurs Chloroforming
Institute of Baltimore. To-day I became a back number—60—which
entitled me to a painless passing, the anæsthetic being administered
by Dr. Senile. But there was no need of the old men getting angry at
what Dr. Osler said about them. He intended it only for advertising
purposes. Having got himself talked into notoriety, his publishers
have announced that a book by the doctor is in press.”
“Then am I revenged indeed! Æsthetic as he is, Dr. Osler will wish
that he had taken an anæsthetic before the book reviewers get
through with him. Oh, for the fatally facile pen of the bright and
bitter Corelli!”
“Anthony Trollope says he said it first.”
“Oh, the idea is itself old enough to be chloroformed,” explained
Dr. Hasbeen. “Osler has been trying to explain that it was all a jest,
but the public refuses to take him in earnest: a comedian never can
become a tragedian. It only goes to show that, although Barnum
may be right in his opinion that the American people like to be
fooled, they won’t swallow a joke that is thrust down their throats
and smile over it, and they do not want their sense of the ludicrous
drugged by an overdose of chloroform.”
“I may be a member of the silent majority,” went on Methuselah,
“but this insult to age would put speech in the most chapfallen
mummy, however it might be pressed for time. Notified to quit
thinking at forty and to stop living at sixty! Why, in my day, a man
hadn’t cut his wisdom tooth then! I’m inclined to think that Dr. Osler
still has some teeth to cut. Man, like wine, improves with age. Before
making that speech the doctor should have put on his old slippers;
then nobody would have known where the shoe pinched him.”
“I wonder how long it took Osler to sober up after that
intemperate speech? Nobody ever heard of him until he approached
the danger line of encroaching years. What has he been doing in the
past? Doubtless he is no different from the ordinary man, who
remains a dormant factor until he comes to years of discretion,
which is more likely to be sixty than sixteen. Before that time, he
courts women and wine more assiduously than wisdom and common
sense.”
“A man’s early life is too much taken up with breach-of-promise
cases, divorces and the stock exchange to care whether or not the
world owes him a living or to take the trouble to collect it. Though
the financial acumen of Humpty Dumpty does not make Wall Street
tremble, it tumbles to a good thing long before he takes a fall to
himself. The bears come out of their pits and the bulls leave their
greenbacks to seek other and greener goods to devour.”
“You know ‘there is no fool like an old fool,’” I ventured to quote.
“‘Young men think old men are fools; but old men know young
men are fools’; they’ve been there themselves,” retorted Methuselah.
“It is easy to mould even stubborn facts by applying the sparks
from the thought anvils of dead men’s minds, which the world
accepts because the men are dead and not because the sparks burn
with living truth.
“Proverbs, not men, should be sacrificed on the altar of antiquity.

“‘At thirty man suspects himself a fool;


Knows it at forty and reforms his plan.’”

“Thank you, Young,” said Methuselah, gratefully. “Your ‘Night


Thoughts’ have shed light on a dark subject. Young is older in
wisdom than his name implies, for a man does not get his mental
equilibrium until the pendulum is swinging to the west, and he
becomes too old to wallow in champagne or to eat lobster suppers
with a peroxide blonde. A man’s legs may be in a forced retreat to
the grave, but his brain remains more active in the world’s service
than that of the youngster under forty, who develops the muscle in
his arms at the expense of the gray matter in his brain. It is only the
callow youth who suffers from softening of the brain. The man at
sixty has more dollars in his cellar and more sense in his garret than
the fool of thirty has cents in his pocket. Yet youth and age are not
antagonistic; they are like the two parts of a pair of scissors in the
work of the world: ‘useless each without the other.’”
“Don’t you think that Dr. Osler promulgated his theory of earthly
eradication at the suggestion of a feminine relative?”
“That would not be surprising. Women are apt to see the defects
of an aged man of talent and the merits of a young fool. It is
possible that some woman in the Osler family is weary of being an
old man’s darling and wants to squeeze him out, unless he can
produce the elixir of Faust.”
“That’s the solution. The women are determined to have
something to squeeze, even if they have to stifle their embraces in
chloroform and let their affections go to ‘weeds.’ Woman is a poppy
that exhales her perfume only in the shade. It may be that
somebody else has said that after me, for Osler implies that the
oldest inhabitant is only a reminiscence of what isn’t so. Who was
the author, Bartlett?”
“That is not a ‘Familiar Quotation,’” answered Bartlett, after a
hurried consultation with Dr. Johnson and Roget. “Therefore, it must
belong to Anon; he claims everything to which other people cannot
prove their title. It seems to me that you are getting so independent
that you even rebel against your metaphors. You call woman a
fragrant poppy in the shade, in apparent ignorance of the fact that in
Hades, where all women have shady characters, there is no
perfume. You poets can scent everything but the bloom of truth.”
“Oh, well, you’re not so fragrant,” said Anon, slangily. “You only
gathered a posie of other men’s flowers, while I furnished the thread
which bound them. But we have lost the thread of this discourse. It
seems to me that if the lethal chamber were to become popular, a
man would have to begin putting his affairs in order almost as soon
as he had ceased to ask his mother-in-law if he might kiss his wife.”
“That’s one thing which has struck me as odd,” I said. “What
particular place of torment has been reserved for the mothers-in-
law? I haven’t seen one since I came to Hades.”
“Nor are you likely to do so,” chuckled Anon. “Mothers-in-law go to
Paradise without any preliminary probation. Adam had no mother-in-
law, you know, so he insisted that he wasn’t going to put up with
any one’s else. Lucifer was glad to accede to Adam’s request for
banishing these marital appendages, for he feared that if he allowed
the mothers-in-law to enter Hades, he would be out of a job within
twenty-four hours. No man ever doubted that his wife’s mother
could outpoint the devil.”
I glanced in alarm at Dr. Roget, who appeared to be choking, but
soon I discovered that he was merely swallowing half a dozen pages
of his “Thesaurus” preparatory to communicating his ideas to us. He
spoke slowly, biting off a word, chewing it until it was thoroughly
digested, and then spitting it forth with the retort of a verbal bomb.
His speech lasted as long as the paper held out, which he later
explained by saying that he never could speak without notes.
“If the world knew that the mother-in-law is a rarer bird in Hades
than a political blackbird hanging over both sides of the fence under
the plum tree, the earth would be depopulated faster by that news
than by the Oslerized process. Charon would have to charter all the
world’s warships for transports and each man in Hades would have
to make a jack o’ lantern of his skull to prevent being run down by
the crowd of onrushing shades. Hades would no longer be a country
of suburban cottages but a Hell of Harlem flats.”
“We are wandering farther away from the subject under discussion
than any convention of preachers I ever knew,” said David. “Isn’t it
about time we had a text? I would suggest: ‘And Saul took the
sword and fell upon it.’”
“You see I didn’t have Dr. Osler for a medical adviser,” explained
Saul. “In my day, when we wanted to shorten the duration of our
stay on that planet called the earth, we cut it. Methinks an opiate
would have deadened the edge of the sword when I walked the
plank.”
“Dr. Osler has gone me one better,” said David. “He has revised
the Psalms to read: The days of a man are two score years, and if,
by reason of any extraordinary fund of vitality, he shall linger around
until he is three score without the ten, he had better get a hustle on
and remove himself, for he is in the way of some one else.”
“Like an emetic, one thing brings up another,” put in Methuselah,
anxious to throw up his grievance. “Having told us it is one’s duty to
dismiss himself from the world, this authority very kindly suggested
that a particular anæsthetic would be the best means for one’s
transfer out of time. The edict has gone forth: All out at sixty. When
the census-taker makes his rounds, he will say: ‘Age, if you please?
Sixty? Kindly step into the asphyxiation chamber or into the
ambulance where you will find a bottle awaiting you. Good-night’.
Night, when deep sleep falleth upon man, has come too early. When
a babe, he smelleth the bottle afar off and lo! children cry for the
soothing syrup which the man would fain put away. Before his eye is
dimmed by the sunset glow, the light of his life is quenched in four
ounces of chloroform.
“According to this medical expert,” continued Methuselah, “when a
man proposes to celebrate his sixtieth birthday by emigrating
beyond the Styx, he is to buy a ticket and pay for it with poison or
pistol. He is then fit only for the doctor and the refuse heap. Has it
come to this? No twentieth century painless surgery for me, thank
you. Long life is no longer a thing to long for. I would prefer to be
kissed not by the dews of night but by the salutation of the glorious
morning.”
“‘Rejoice, O young man, in thy youth,’” exclaimed Solomon, who
still the wisest of men, had hitherto kept silent. He was addressing
Methuselah. “One may no longer tarry until his beard is grown and
his hair is dyed. No longer may he come to his grave in a full age
like as a shock of corn cometh in his season, and though it may go
against the grain, the Grim Reaper stalks through the field, stopping
up the ears with Osler’s Death Drugs.”
“The doctor is an homeopathist,” observed Sherlock Holmes, in a
tone so decided that it left no question for argument.
“I’m not Watson,” I responded, “but of course I know you want
some one to ask you how you know. Just to be accommodating,
allow me to inquire how you can tell that Dr. Osler is an
homeopathist when you haven’t even the ashes of his cigar to
analyze? Do you mean because of small doses?”
“No; like cures like. Old men being a drug on the market, it takes
a drug to remove them. Had he consulted me I would have
recommended cocaine instead of chloroform.”
“Do you think that Dr. Osler will take his own medicine when the
frost is on the temples and the anæsthetic’s handy?”
“Doctors never do. That may be because of professional etiquette,
but it is more likely that the physicians recognize the truth of the
saying about self-preservation being the first law of nature. Some
doctors are so conscientious that they would rather be murdered by
another physician than commit suicide themselves. You may depend
upon it that there is no chloroform in Dr. Osler’s family medicine
chest; he keeps it only for his patients!”

You might also like