index 625 index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/book/index.pdf ·...

13

Click here to load reader

Upload: vothu

Post on 11-Jun-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: INDEX 625 Index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/Book/Index.pdf · abstract syntax trees 22, 92, 161, ... Declarative 531 Imperative 522 ... grammars 3,

INDEX 625

Index

625

Symbols

--> 47:: 107::= 3E[v→E1] 145[ ][ ] See emphatic brackets⊥ 346→ 356ε 18λ 140| 18• 18⊆ 345⇔ 149⇔* 149⇒ 5, 148⇒* 148⇒α 148⇒β 148⇒δ 150⇒η 149➨ 262➞ 246➞ ∞ 260

A

abstract data types 443, 471abstract productions 24–26abstract syntax 23–29, 240–242,

273, 481–485lambda calculus 162

abstract syntax trees22, 92, 161, 275, 279

Prolog structure 26–27action semantics 507–564

abstractions 546–547actions 508basic facet 515Bindable 534, 541, 543

calculator 522–530cells 518current information 514Data 513data 508data and sorts 511–514,

534, 543Datum 513declarative facet 515, 531–534empty bindings 531functional facet 515hybrid actions 515imperative facet 515, 518join 513lower level 511meet 513merge bindings 532modules

Declarative 531Imperative 522Integers 512TruthValues 512

nothing 513overlay bindings 532Pelican 541–559

semantic equations 552–554Procedure 546procedures 547–549reflective facet 515, 545stable data 519Storable 518, 534, 543subsort 513translating to actions 551–557,

559–563upper level 511Value 534, 543Wren

semantic equations 535–536,537–540semantic functions 534–535

Page 2: INDEX 625 Index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/Book/Index.pdf · abstract syntax trees 22, 92, 161, ... Declarative 531 Imperative 522 ... grammars 3,

626 INDEX

yielders 508abstraction of _ 546application of _ to _ 548closure of _ 546the _ bound to _ 510, 515, 532the _ stored in _ 509, 515, 519the given _ 510, 514the given _ # _ 514

actions 508, 515combinators

_ and _ 516, 532_ and then _ 516, 533_ before _ 542_ hence _ 533_ moreover _ 541_ or _ 510, 536_ then _ 510, 517, 533_ thence _ 548–549

composite actionsunfold 538unfolding _ 537–538

hybrid actionsrecursively bind _ to _ 550

primitive actionsallocate a cell 509, 519bind _ to _ 509, 531check _ 537complete 509enact _ 547fail 509give _ 509rebind 541regive 526store _ in _ 509, 519

admissible predicates 383ADT See abstract data typesaffix 253, 295, 354algebraic semantics 443–506

abstract syntax 481–485canonical form 479carrier sets 462completeness 468–470conditional equations 448,

451–452confusion 451, 467, 485

congruence 463–464consistency 469constructors 450–451, 481equations 444error values 450evaluation function 463function syntax 448ground terms 461implementation 499–506implementing queues 474–486initial algebras 451, 467junk 451, 467mathematical foundations

460–470models 464module syntax 447–448modules 445–459

AbstractExpressions 484Arrays 474Booleans 446, 470, 500–501Bools 460Characters 452–453Expressions 482Files 455Lists 453–454Mappings 456–458, 459Mixtures 459NatLists 486–487Nats 460Naturals 449–450, 501–502Predecessor

1 468

Predecessor2 468

Queues 472–473Stores 458Strings 456

normal form 479parameterized modules 453–456quotient algebras 465–466representation function 475Σ-algebras 461–463, 477–481Σ-homomorphisms 466selectors 481signatures 444sorts 444sufficiently complete 481, 488

Page 3: INDEX 625 Index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/Book/Index.pdf · abstract syntax trees 22, 92, 161, ... Declarative 531 Imperative 522 ... grammars 3,

INDEX 627

term algebras 462type of interest 478Wren 487–499Wren interpreter 494–498Wren modules

WrenASTs 489–490WrenEvaluator 495–498WrenSystem 498WrenTypeChecker 490–494WrenTypes 488WrenValues 489

Allison, Lloyd 339ambiguous grammars 6, 12

expressions 16, 18anbncn 8, 19, 60–66, 138anonymous function 140antisymmetric 345ascending chains 346Astesiano, Egidio 242, 270attribute grammars 59–104

binary numerals 67–71binary trees 73code generation 191–222definition 66–67expression language 73inherited attributes 63semantic rules 66semantics 67–73synthesized attributes 61Wren

auxiliary functions 89commands 80–82context checking 74–91declarations 75–80expressions 82–84procedures 91semantic rules 84–89translation semantics 191–215

auxiliary functions 313–315axiomatic semantics 395–442

assertion 396factorial 405–407limitations 396loop invariants 405, 408–410nested while loops 410–414

partial correctness 397Pelican 418–432

axiomatic definition 428–429blocks 420–421constant declarations 420nonrecursive procedures422–424procedure declarations420–421recursive procedures 425–429

postcondition 397precondition 397prime numbers 414program derivation 438–442proof tree 404restrictions 423–424, 431–432table of values 409, 414termination 432–436

indefinite iteration 432recursion 435

total correctness 397Wren 398–418

assignment 398–400axiomatic definition 408input/output 400–401while command 405–407

B

Backus, John 30Backus-Naur Form See BNFbig-step semantics 261binary search 441BNF 2, 3bottom 345

C

'C' 45calculator language 310

abstract syntax 279, 523action semantics 522–530concrete syntax 277–278example 281, 528–530semantic equations 282,

Page 4: INDEX 625 Index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/Book/Index.pdf · abstract syntax trees 22, 92, 161, ... Declarative 531 Imperative 522 ... grammars 3,

628 INDEX

524–528semantic functions 282,

523–524semantics 280

call by name 155call by value 155canonical form 479Cantor, Georg 343cardinality 343carrier sets 451, 462Chomsky, Noam 2, 30, 59Church, Alonzo 139, 153–155closure 229Colmerauer, Alain 57, 566command continuations 334compilers 187, 224–225complete partial order 346completeness 250–252, 468–469composition 282compositional 272, 276, 293concrete operational semantics

224concrete syntax 21, 50, 481–482conditional and

252, 386, 541, 603conditional equations 448,

451–452conditional expressions 237, 390confusion 451, 467congruence 463–464connect (Prolog predicate) 45consistency 251–252, 469constants, declarations of

318, 509–510, 543constructors 450–451, 481context checking

attribute grammars 74–91denotational semantics 323–327two-level grammars 116–132

context conditions 13, 15, 324context-free

grammars 3, 4, 388syntax 14

context-sensitiveerrors 78–80, 95

grammars 3, 8, 60–66syntax 14

continuation semantics 328–331Gull

semantic domains 335semantic equations 336–338semantic functions 335

continuations 331–338Continuity Theorem 377, 387continuous functionals 374–378

composition 376conditional expression 375constant function 375identity function 375

continuous functions 356,361–362

cpo See complete partial ordercurrent information 514curried functions 143–144,

283, 288, 608–609Curry, Haskell 144cut 56

D

dangling else 12data 508data abstraction 471–472Datum 513deallocate storage 321declaration continuations 334declarative languages 565definite clause grammars 57

See also logic grammarsdenotable values 311, 313denotation 271denotational semantics 271–340

auxiliary functions 274calculator language 277–285context checking

semantic equations 326–327errors 329numerals 274Pelican 311–323

abstract syntax 311

Page 5: INDEX 625 Index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/Book/Index.pdf · abstract syntax trees 22, 92, 161, ... Declarative 531 Imperative 522 ... grammars 3,

INDEX 629

environments 313procedures 318–321semantic domains 315semantic equations 316–318semantic functions 316stores 314–315

propositional logic 304semantic domains 273semantic equations 274semantic functions 273–274Wren 285–304

auxiliary functions 290context checking 323–328errors 293–294example 296–302input and output 294–304prototype interpreter 304–310semantic domains 286–287semantic equations 290–293semantic functions 289

dependency graph 7derivation trees 5, 19–20,

44, 113–115, 483diagonalization 343difference lists 44–45, 57Dijkstra, Edsger 442direct denotational semantics

293, 328direct implementation 480disjoint union 287, 311divides relation 347domain theory 345–365

A+B 351AxB 349A→B 356approximates 346ascending chain 346, 356bottom 345complete partial order 346continuous functions 356,

361–362elementary domains 348–349Fun(A,B) 355function domains 355–361improper value 348

injection 352inspection 352less defined than or equal to 346monotonic 355product domain 349–351projection 350, 352sum domain 351–354

dynamic errors 16dynamic scoping 177–178,

234, 319, 603

E

E* 18E+ 19E? 19elementary domains 348–349emphatic brackets 272, 528En 19encapsulation 472English grammar 4–8, 40–41

generating sentences 46parsing 43–45, 47–48

environments 170–174, 228–231,235–236, 288, 311–312,314, 324–325, 388

error continuation 336–338evaluation function 463expressible values 288, 313expression continuations 334expression language

abstract syntax 483–485concrete syntax 482

extensionality 150

F

facets 514, 515finite functions 246, 456–458, 522first-class values 288, 606fix 373, 392–393fixed point 368–369Fixed-Point Identity 373, 393fixed-point induction 383–384fixed-point semantics 365–388

Page 6: INDEX 625 Index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/Book/Index.pdf · abstract syntax trees 22, 92, 161, ... Declarative 531 Imperative 522 ... grammars 3,

630 INDEX

admissible predicate 383approximates 366approximations 373constructing a fixed point

370–373, 378continuous functionals 374–388fixed-point induction 383–384less defined than or equal to 366natural extension 366, 367nonrecursive functions 379while command 380–382

Fixed-Point Theorem 370flat domains

See elementary domainsFloyd, Robert 395, 442formal specifications 507free word algebra 478front end 31–33funarg problem 177–178function domains 355–361function subprograms 323functional facet 515–518functional programming

139, 158, 588functionals 368functions 355

G

generic types 472Gordon, Michael 339goto commands 329, 396grammars 2Gries, David 438ground terms 461Gull 333–338

abstract syntax 333semantic equations 336–337semantic functions 335

Gull programsfact 338labels 334

Guttag, John 480, 506

H

halting problem 155, 355Hasse diagrams 345, 363–364heterogeneous algebras 462Hoare, C. A. R. 395, 442Hollerith literals 71, 111–115,

133–136homogeneous algebras 462homomorphisms

276, 466, 475, 485

I

imperative languages 285–286,565, 587

in parameter 321in-out parameter 321induction 435inessential ambiguity 19, 241inference rules 238, 401infinite sum domain 353information hiding 471, 472inherited attributes 67initial algebras 451, 467injection 352input/output 253inspection 352interpreters 225isomorphism 466

J

join 513junk 451, 467

K

Kahn, Gilles 261, 269keywords 10Kleene closure 18Knuth, Donald 59, 103Kowalski, Robert 57

Page 7: INDEX 625 Index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/Book/Index.pdf · abstract syntax trees 22, 92, 161, ... Declarative 531 Imperative 522 ... grammars 3,

INDEX 631

L

λ 140label expressions 237labels 331laboratory activities 31–58

algebraic semantics 499–506attribute grammars 215–222context checking 92–103denotational semantics 304–310Hollerith literals 133–136lambda calculus evaluator

160–166recursion in lambda calculus

389–394SECD machine 235–238self-definition

Prolog 179–185Scheme 169–179

structural operational semantics264–269

translating to actions 559–563translational semantics 215–222two-level grammars 132–133

lambda calculus 139, 341abstraction 141applicative order reduction 152applied lambda calculus 141β-abstraction 149β-conversion 149β-redex 148bound variables 145Church-Rosser Theorems

153–155closed expression 145combination 141confluence property 154equal expressions 149equivalent expressions 149extensionality theorem 150free variables 145, 163innermost expressions 152lambda notation 140lists 156–157name clash 145

normal form 151normal order reduction 152, 164notational conventions 142numerals 157outermost expressions 152paradoxical combinator 391–392parser 161–162parsing expressions 143pure lambda calculus 156–157recursion 389–394reduction 145reduction rules 147–150

α-reduction 148β-reduction 148δ-reduction 150η-reduction 149

reduction strategies 151–155scanner 160–161semantics 145–146, 151–155substitution 146, 163

safe substitution 145valid substitution 145

syntax 140–141, 160variable capture 145variables 141Y 391

lambda expressionsAdd 157Cube 388Curry 144, 159Double 166Fac 390, 392Factorial 392FourthPower 144Head 156in Scheme 599Nil 157numerals 157Pair 156Sqr 388Succ 157Tail 156Thrice 166, 238, 388Twice 142, 160, 166, 238Uncurry 144, 159

Page 8: INDEX 625 Index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/Book/Index.pdf · abstract syntax trees 22, 92, 161, ... Declarative 531 Imperative 522 ... grammars 3,

632 INDEX

Y 391Landin, Peter 223, 270lattices 347least upper bound 345left factoring 55–56left recursion 52–54, 101, 575let expressions 158, 172–173,

233, 237, 604lexical analyzer 12, 21lexical syntax 10lexicon 12Limit Lemma 357Lisp See Scheme

history 588lists 17, 27, 156–157, 165,

244–245, 295, 343, 354,444–445, 453–454, 575–579,591–592

logic grammars 40–50counting words 49English 47, 48lambda calculus 162motivating 41–44parameters 47–48preprocessor 46–47Prolog code 49Wren 50–57

logic programming 565–586See also Prolog

and two-level grammars 136–137logical variable 400, 582–583loop 382loop invariants 405, 433lower bound 345lub See least upper boundLub Lemma 357

M

macrosemantics 511many-sorted algebras 462mathematical semantics 271McCarthy, John

30, 167, 186, 225, 588meet 513

merging bindings 532metacircular interpreters

167, 169–174, 225metalanguage 2, 3, 341microsemantics 511ML 140, 244, 564models 464, 484–485modules 445–459monotonic 355Mosses, Peter 394, 507, 563–564multiple declarations 97, 120

N

natural deduction 238natural extension 366, 367natural semantics 261–262Naur, Peter 30nonprocedural languages 565nonrecursive functions 379nonterminal symbols 2nontermination 255–256, 344normal form 479normal order reduction 234nothing 513

O

one-level grammar 105operational semantics 223–270overlaying bindings 325, 532

P

Pagan, Frank 138, 185, 222, 339paradoxes 365paradoxical combinator

391–392, 394parameter passing 232parameterized modules

453–456, 472parametric polymorphism

See polymorphic operationsparse trees 5parsers 21, 31, 92, 161–162

Page 9: INDEX 625 Index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/Book/Index.pdf · abstract syntax trees 22, 92, 161, ... Declarative 531 Imperative 522 ... grammars 3,

INDEX 633

partial correctness 397partial functions 366partial order 345pass by value 232Pelican

abstract syntax 311, 419action semantics 541–559axiomatic semantics 418–432axioms and rules 428–429context checking 326–327context constraints 324denotable values 541, 543denotational semantics 311–312expressible values 543procedures 545–551storable values 543

Pelican programsaction 555facproc 559facwhile 559recurrence 431scope 316–318small 560squaring 419sum 430summation 320–321trace1 322trace2 322

period 567phrase-structure syntax 10Plotkin, Gordon 238, 269polymorphic operations 141, 144postcondition 397power set 343pragmatics 1–2precondition 397procedures 318–321product domain 349–351productions 2program derivation 437–442projection 352Prolog 565–586

anonymous variables 577arithmetic expressions 584atoms 566

BNF syntax 568body of a clause 567clause order 574clauses 567closed world assumption 570comment 33constants 566control 574–575cut 56example 569–571fact 567failure 181family tree 573function symbols 566functors 566goal 567goal order 574, 582head goal 567input/output 585–586instantiation 582lists 575–580logical variable 582–583not 571numbers 566numerical comparisons 583period 567predicates 566procedures 572query 567recursion 572–574rule order 574rules 568, 570scope 570search trees 579–580sorting 581–582structured objects 567structures 566term construction 585unification 571, 583unit clause 567variables 566

Prolog predicatesabort 586buildSymbolTable 99'C' 45

Page 10: INDEX 625 Index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/Book/Index.pdf · abstract syntax trees 22, 92, 161, ... Declarative 531 Imperative 522 ... grammars 3,

634 INDEX

call 586clause 180compute 164, 237, 246, 268,

307–308, 390concat 578delete 577get0 34, 585getfilename 39go 39, 56, 269, 311, 390is 584lookupType 97member 577name 586nl 586pretty-print 165prove 180–181read 586tab 586tableIntersection 97union 578write 586

prototyping 31

Q

quotient algebra 465–466

R

rand 141rator 141recursion 319, 341–343,

368, 550–551referential transparency 588reflexive 345regular expressions 18regular grammars 4, 33–34relational languages 565remainder of the program 331representation function 475reserved words 10–11, 15Robinson, Alan 566Roman numerals 50, 72, 277Ross, Peter 186Roussel, Philippe 566

rule schemes 248rules of inference 238–239,

401, 420

S

Σ-algebras 461–463scanners 12, 21, 31, 33– 40,

92, 160–162Prolog predicates 35–39

Scheme 140, 167–169, 587–610atoms 589Cambridge Polish Form 592composition 607conditional expressions 597correctness 605curried functions 608–609defining functions 596dotted pairs 589empty list 591evaluation 593higher-order functions 606–608lambda expressions 169, 599let expressions 168, 604list processing 599–603lists 591–592metacircular interpreter 169–174

micro-apply 174micro-eval 172micro-evalcond 172micro-evallet 173micro-let-bind 173micro-rep 170

numeric functions 592, 593predicates 593recursive definitons 598S-expressions 589–590scope rules 603–605special forms 596syntax 590–591tail recursion 609–610

Scheme functionsatom? 168car 168, 590, 592cdr 168, 590, 592

Page 11: INDEX 625 Index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/Book/Index.pdf · abstract syntax trees 22, 92, 161, ... Declarative 531 Imperative 522 ... grammars 3,

INDEX 635

concat 168, 601cond 168, 597cons 168, 591, 592define 594, 596display 168eq? 595equal? 168, 601filter 608if 598map 607member 602newline 168null? 168, 595pair? 595quote 168, 594reduce 607

Schmidt, David 339, 394Schönfinkel, Moses 144scope 288, 311scoped data 514Scott, Dana 271, 344, 394SECD machine 223, 228–234

configuration 228control 228dump 228, 229, 236environment 228stack 228transition function 229–230, 236

selectors 481self-definition 167–186, 225

function application 174–175Lisp 167–169Prolog 179–185

proof tree 180tracing 181

semantic equivalence 260–261,294, 395, 551

semantic errors 16semantic prototyping 339semantics 1–2, 273–274sequencers 330side effects 525, 588signatures 444, 478small-step semantics 261

specifications of algorithms397–398

stable data 514standard semantics 331start symbol 3static scoping 177–178, 229,

233–234, 319, 603static semantics 14, 30stationary chains 365Stepney, Susan 339Storable 518storable values 287, 313stores 245–246, 265–266, 306–

307, 314–315, 330, 458, 520Stoy, Joseph 339Strachey, Christopher 271strict functions 517, 367structural induction 242–245,

276, 476, 479structural operational semantics

238–270abstract syntax 239–242axiom 238commands 253–264examples 248–250, 256–260expressions 245–253inference system 247outcomes 250, 255transition function

247, 254, 265–267stuck 246subsorts 513Substitution Property 464sufficiently complete 481sum domain 351–354symbol table 74–80symbolic tokens 36–37syntactic analyzer 21syntactic categories

See syntactic domainssyntactic domains 26, 239–240,

272–273syntax 1–2, 272–273syntax trees

See abstract syntax trees

Page 12: INDEX 625 Index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/Book/Index.pdf · abstract syntax trees 22, 92, 161, ... Declarative 531 Imperative 522 ... grammars 3,

636 INDEX

synthesized attributes 66–67Synthesizer-Generator 222

T

table of values 440tags 351, 352tail recursion 384, 609–610Tennent, R. D. 339term algebra 462terminal symbols 2termination 432–436termination expression 433tokens 10–12

recognizing 37–38total correctness 397transient data 514transitive 248, 255, 345translational semantics 187–222,

224–226, 551–557attribute grammar 207–213attributes 192commands 201–207comparisons 199–201expressions 193–201labels 202–207, 218machine language 188–189optimization 196–199program translation 189–191Prolog implementation 215–222temporary variables

190, 193, 199, 220TΣ 462Turing, Alan 155Turner, S. J. 136two-level grammars 105–116

and logic programming 136–137derivation trees 113–115EMPTY 110Hollerith literals 111–112,

133–136hyper-rule 106, 110lists 110–111metanotion 106, 110metarule 106, 110

notational conventions 106–107protonotion 105, 110representation tables 109, 112TALLY 110–111terminal symbols 105where clause 114Wren comands and expressions

124–126Wren declarations 117–124Wren grammar 106–108Wren specification 129–131

type of interest 478

U

unbound 311unbounded arrays 474–476unbounded queues 472–473undefined 289, 312unparse 29unrestricted grammars 3upper bound 345

V

van Wijngaarden, Aad 105, 138VDL

See Vienna Definition Languagevending machine 303, 541Vienna Definition Language

226–227

W

Warren, David 58Watt, David 103, 339,

506, 507, 564well-founded partial order 432while command 380–388,

405, 537–539white space 36Wren 10–16

abstract syntax 26, 28,239–242, 286, 489–490

action semantics 531–541

Page 13: INDEX 625 Index - homepage.cs.uiowa.eduhomepage.cs.uiowa.edu/~slonnegr/plf/Book/Index.pdf · abstract syntax trees 22, 92, 161, ... Declarative 531 Imperative 522 ... grammars 3,

INDEX 637

algebraic semantics 487–499attribute grammar 74–91axiomatic semantics 398–418axioms and rules 408BNF 11, 106code generation 191–215context checking 84–89,

116–132, 323–328, 490–494context constraints 14, 74, 494denotable values 534denotational semantics 285–304expressible values 534interpreter 494–498logic grammar 50–57parsing 50–57reserved words 10–11, 37semantic errors 16storable values 534tokens 38translational semantics 207–213two-level grammar 116–132

Wren programsbool 303frombinary 500gcd 189, 215illegal 13mod 213multiply 191, 214prime 305prog1 93prog2 94switch 32tobinary 264

Y

Y 391yielders 508, 514–515