final Flashcards

(157 cards)

1
Q

functional languages vs imperative languages

A

imperative:
- based directly on the von Neumann
architecture:
- Efficiency is the primary concern, rather than the suitability of the language for software development

functional:
- based on mathematical functions:
- A solid theoretical basis that is also closer to the user, but relatively unconcerned with the architecture of the machines on which programs will run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

mathematical function

A

a mapping of members of one set, called the domain set, to another set, called the range set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Lambda expressions

A

*Lambda expressions describe nameless functions
*Lambda expressions are applied to parameter(s) by placing the parameter(s)
after the expression,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Function Composition

A

A functional form that takes two functions as parameters and yields a function
whose value is the first actual parameter function applied to the application of
the second:
Form: h =f∘g
which means: h(x) =f(g(x)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

objective of the design of an FPL

A

mimic mathematical functions to the
greatest extent possible

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

basic process of computation in FPL vs imperative languages

A

§ imperative language: operations are done and the results are stored in variables for later use
§Management of variables is a constant concern and source of complexity for
imperative programming
* FPL: variables are not necessary, as is the case in mathematics, the evaluation of a function always produces the same result given the same parameters (referential transparency)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Tail recursive function in Scheme

A
  • A function is tail recursive if its recursive call is the last operation in
    the function
  • A tail recursive function can be automatically converted by a compiler to use iteration, making it faster
  • Scheme language definition requires that Scheme language systems convert all tail recursive functions to use iteration
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

common lisp features

A

§records
§arrays
§complex numbers
§character strings
§powerful I/O capabilities
§packages with access control
§iterative control statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Symbol Data Type

A

*Similar to that of Ruby
*The reserved words are symbols that evaluate to themselves
*Symbols are either bound or unbound:
§Parameter symbols are bound while the function is being evaluated
§Symbols that are the names of imperative style variables that have been assigned
values are bound
§All other symbols are unbound

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

ML

A
  • static-scoped
  • syntax that is closer to Pascal than to
    Lisp
  • type declarations + type inferencing
  • strongly typed and has no type coercions
  • Does not have imperative-style variables
  • identifiers are untyped
  • exception handling and a module facility for implementing abstract data types
  • lists and list operations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

how is Haskell similar and different from ML?

A

*Similar to ML (syntax, static scoped, strongly typed, type inferencing, pattern
matching)
*Different from ML (and most other functional languages) in that it is purely
functional (e.g., no variables, no assignment statements, and no side effects of
any kind)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

F#

A
  • imperative features and supports
    OOP
  • tuples, lists, discriminated unions, records, and both mutable and immutable arrays
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Trends in imperative languages

A

Support for functional programming is increasingly creeping into imperative languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Comparing Functional and Imperative Languages

A

*Imperative Languages:
§Efficient execution
§Complex semantics
§Complex syntax
§Concurrency is programmer designed
*Functional Languages:
§Simple semantics
§Simple syntax
§Less efficient execution
§Programs can automatically be made concurrent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

abstraction

A

view or representation of an entity that includes only the most significant attributes
* fundamental in programming (and computer science)
*Nearly all programming languages support process abstraction with subprograms
*Nearly all programming languages designed since 1980 support data
abstraction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

abstract data type (ADT)

A

a user-defined data type that satisfies the
following two conditions
1. the only operations possible are those provided in the type’s definition
2. declarations and the protocols of the operations on objects of the type are contained in a single syntactic unit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Advantages of Data Abstraction

A

*Advantages the first condition:
§Reliability: by hiding the data representations, user code cannot directly access objects of the type or depend on the representation, allowing the representation to
be changed without affecting user code
§Reduces the range of code and variables of which the programmer must be aware
§Name conflicts are less likely
*Advantages of the second condition:
§Provides a method of program organization
§Aids modifiability (everything associated with a data structure is together)
§Separate compilation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Language Requirements for ADTs

A

*A syntactic unit in which to encapsulate the type definition
*A method of making type names and subprogram headers visible to clients,
while hiding actual definitions
*Some primitive operations must be built into the language processor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Parameterized ADTs

A

Parameterized ADTs allow designing an ADT that can store any type elements:
only an issue for static typed languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Encapsulation Constructs

A

a grouping of subprograms that are logically related into a unit that can be separately compiled (compilation units)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Nested Subprograms

A

*Organizing programs by nesting subprogram definitions inside the logically
larger subprograms that use them
*Nested subprograms are supported in Python, JavaScript, and Ruby

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Object-Oriented Programming (OOP) Languages

A

*Some support procedural and data-oriented programming (e.g., C++)
*Some support functional program (e.g., CLOS)
*Newer languages do not support other paradigms but use their imperative
structures (e.g., Java and C#)
*Some are pure OOP language (e.g., Smalltalk & Ruby)
*Some functional languages support OOP, but they are not discussed in this chapter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Three major OOP language features:

A

§Abstract data types (Chapter 11)
§(Class) Inheritance:
o Inheritance is the central theme in OOP and languages that support it
§Polymorphism

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Design Issues for OOP Languages

A

*The Exclusivity of Objects
*Are Subclasses Subtypes?
*Single and Multiple Inheritance
*Object Allocation and Deallocation
*Dynamic and Static Binding
*Nested Classes
*Initialization of Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Single and Multiple Inheritance
*Multiple inheritance allows a new class to inherit from two or more classes *Disadvantages of multiple inheritance: §Language and implementation complexity (in part due to name collisions) §Potential inefficiency: dynamic binding costs more with multiple inheritance (but not much) *Advantage: §Sometimes it is quite convenient and valuable
26
Allocation and DeAllocation of Objects
§If they behave line the ADTs, they can be allocated from anywhere: o Allocated from the run-time stack o Explicitly create on the heap (via new) §If they are all heap-dynamic, references can be uniform thru a pointer or reference variable: o Simplifies assignment: dereferencing can be implicit §If objects are stack dynamic, there is a problem with regard to subtypes: object slicing
27
Two interesting and challenging parts of implementing OO constructs:
§Storage structures for instance variables §Dynamic binding of messages to methods
28
Instance Data Storage
*Class instance records (CIRs) store the state of an object: §Static (built at compile time) *If a class has a parent, the subclass instance variables are added to the parent CIR *Because CIR is static, access to all instance variables is done as it is in records: §Efficient
29
Dynamic Binding of Methods Calls
Methods in a class that are statically bound need not be involved in the CIR; methods that will be dynamically bound must have entries in the CIR: §Calls to dynamically bound methods can be connected to the corresponding code thru a pointer in the CIR §The storage structure is sometimes called virtual method tables (vtable) §Method calls can be represented as offsets from the beginning of the vtable
30
Reflection
A programming language that supports reflection allows its programs to have runtime access to their types and structure and to be able to dynamically modify their behavior
31
metadata
The types and structure of a program
32
introspection
The process of a program examining its metadata
33
intercession
Interceding in the execution of a program
34
Uses of reflection for software tools:
§Class browsers need to enumerate the classes of a program §Visual IDEs use type information to assist the developer in building type correct code §Debuggers need to examine private fields and methods of classes §Test systems need to know all of the methods of a class
35
Concurrency can occur at four levels:
§Machine instruction level §High-level language statement level §Unit level §Program level
36
Categories of Concurrency:
§Physical concurrency: Multiple independent processors ( multiple threads of control) §Logical concurrency: The appearance of physical concurrency is presented by time- sharing one processor (software can be designed as if there were multiple threads of control)
37
Coroutines
have a single thread of control
38
thread of control in a program
the sequence of program points reached as control flows through the program
39
task or process or thread
a program unit that can be in concurrent execution with other program units
40
Tasks differ from ordinary subprograms in that:
§A task may be implicitly started §When a program unit starts the execution of a task, it is not necessarily suspended §When a task’s execution is completed, control may not return to the caller
41
Tasks dont usually work together
FALSE
42
Two General Categories of Tasks
*Heavyweight tasks execute in their own address space *Lightweight tasks all run in the same address space, more efficient *A task is disjoint if it does not communicate with or affect the execution of any other task in the program in any way
43
Task Synchronization
A mechanism that controls the order in which tasks execute
44
Two kinds of synchronization:
§Cooperation synchronization §Competition synchronization
45
Task communication is necessary for synchronization, provided by:
§Shared nonlocal variables §Parameters §Message passing
46
Task Execution States
*New: created but not yet started *Ready: ready to run but not currently running (no available processor) *Running *Blocked: has been running, but cannot now continue (usually waiting for some event to occur) *Dead: no longer active in any sense
47
Design Issues for Concurrency
*Competition and cooperation synchronization: the most important issue *Controlling task scheduling *How can an application influence task scheduling *How and when tasks start and end execution *How and when are tasks created
48
Semaphores
*A semaphore is a data structure consisting of a counter and a queue for storing task descriptors: §A task descriptor is a data structure that stores all of the relevant information about the execution state of the task *Semaphores can be used to implement guards on the code that accesses shared data structures *Semaphores have only two operations, wait and release (originally called Pand Vby Dijkstra) *Semaphores can be used to provide both competition and cooperation synchronization
49
Monitors
*The idea: encapsulate the shared data and its operations to restrict access *A monitor is an abstract data type for shared data
50
Message Passing
*Message passing is a general model for concurrency: §It can model both semaphores and monitors §It is not just for competition synchronization *Central idea: task communication is like seeing a doctor, most of the time the doctor waits for you or you wait for the doctor, but when you are both ready, you get together, or rendezvous
51
Ada Evaluation
*Message passing model of concurrency is powerful and general *Protected objects are a better way to provide synchronized shared data *In the absence of distributed processors, the choice between monitors and tasks with message passing is somewhat a matter of taste *For distributed systems, message passing is a better model for concurrency
52
Java’s Thread Evaluation
*Java’s support for concurrency is relatively simple but effective *Not as powerful as Ada’s tasks
53
C#’s Concurrency Evaluation
*An advance over Java threads, e.g., any method can run its own thread *Thread termination is cleaner than in Java *Synchronization is more sophisticated
54
Statement-Level Concurrency
*Objective: Provide a mechanism that the programmer can use to inform compiler of ways it can map the program onto multiprocessor architecture *Minimize communication among processors and the memories of the other processors
55
High-Performance Fortran (HPF)
*A collection of extensions that allow the programmer to provide information to the compiler to help it optimize code for multiprocessor computers *Specify the number of processors, the distribution of data over the memories of those processors, and the alignment of data
56
exception
any unusual event, either erroneous or not, detectable by either hardware or software, that may require special processing
57
exception handling
The special processing that may be required after detection of an exception
58
exception handler
exception handling code unit
59
exceptions: Design Issues
*How and where are exception handlers specified and what is their scope? *How is an exception occurrence bound to an exception handler? *Can information about the exception be passed to the handler? *Where does execution continue, if at all, after an exception handler completes its execution? (continuation vs. resumption) *Is some form of finalization provided? *How are user-defined exceptions specified? *Should there be default exception handlers for programs that do not provide their own? *Can predefined exceptions be explicitly raised? *Are hardware-detectable errors treated as exceptions that can be handled? *Are there any predefined exceptions? *How can exceptions be disabled, if at all?
60
Exceptions: C++ Evaluation
*There are no predefined exceptions *It is odd that exceptions are not named and that hardware- and system software-detectable exceptions cannot be handled *Binding exceptions to handlers through the type of the parameter certainly does not promote readability
61
Exceptions: Java Evaluation
*The types of exceptions makes more sense than in the case of C++ *The throws clause is better than that of C++ (The throw clause in C++ says little to the programmer) *The finally clause is often useful *The Java interpreter throws a variety of exceptions that can be handled by user programs
62
Python Exception Handling
*Exceptions are objects: the base class is BaseException *All predefined and user-defined exceptions are derived from Exception *Predefined subclasses of Exception are: §ArithmeticError: subclasses are OverflowError, ZeroDivisionError, and FloatingPointError §LookupError: subclasses are IndexError and KeyError
63
Ruby Exception Handling
*Exceptions are objects *There are many predefined exceptions *All exceptions that are user handled are either StandardError class or a subclass of it *StandardError is derived from Exception, which has two methods, message and backtrace *Exceptions can be raised with raise, which often has the form
64
Event Handling
*An event is a notification that something specific has occurred, such as a mouse click on a graphical button *The event handler is a segment of code that is executed in response to an event
65
The Java Event Model
*User interactions with GUI components create events that can be caught by event handlers, called event listeners *An event generator tells a listener of an event by sending a message *An interface is used to make event-handling methods conform to a standard protocol *A class that implements a listener must implement an interface for the listener
66
C# Event Handling
*Event handling in C# (and the other .NET languages) is similar to that in Java *.NET has two approaches, Windows Forms and Windows Presentation Foundation: we cover only the former (which is the original approach) *An application subclasses the Form predefined class (defined in System.Windows.Forms) *There is no need to create a frame or panel in which to place the GUI components *Label objects are used to place text in the window *Radio buttons are objects of the RadioButton class
67
Symbolic Logic
Logic which can be used for the basic needs of formal logic: §Express propositions §Express relationships between propositions §Describe how new propositions can be inferred from other propositions
68
predicate calculus
Particular form of symbolic logic used for logic programming
69
Propositions can be stated in two forms:
§Fact: proposition is assumed to be true §Query: truth of proposition is to be determined
70
Compound proposition:
§Have two or more atomic propositions §Propositions are connected by operators
71
Clausal Form
*Too many ways to state the same thing *Use a standard form for propositions *Clausal form B1 ÈB2 È... ÈBn ÌA1 ÇA2 Ç... ÇAm
72
Unification
finding values for variables in propositions that allows matching process to succeed
73
Instantiation
assigning temporary values to variables to allow unification to succeed After instantiating a variable with a value, if matching fails, may need to backtrack and instantiate with a different value
74
Hypotheses
a set of pertinent propositions
75
Goal
negation of theorem stated as a proposition
76
Theorem
proved by finding an inconsistency
77
Declarative semantics
§There is a simple way to determine the meaning of each statement §Simpler than the semantics of imperative languages
78
Programming is nonprocedural:
Programs do not state now a result is to be computed, but rather the form of the result
79
When goal has more than one subgoal, can use either:
§Depth-first search: find a complete proof for the first subgoal before working on others §Breadth-first search: work on all subgoals in parallel
80
Trace
Built-in structure that displays instantiations at each step
81
Tracing model of execution, four events:
§Call: beginning of attempt to satisfy goal §Exit: when a goal has been satisfied §Redo: when backtrack occurs §Fail: when goal fails
82
Language Evaluation Criteria
*Readability: the ease with which programs can be read and understood *Writability: the ease with which a language can be used to create programs *Reliability: conformance to specifications (i.e., performs to its specifications) *Cost: the ultimate total cost
83
The von Neumann Architecture
Fetch-execute-cycle (on a von Neumann architecture computer) initialize the program counter repeat forever fetch the instruction pointed by the counter increment the counter decode the instruction execute the instruction end repeat
84
Language Categories
*Imperative §Central features are variables, assignment statements, and iteration §Include languages that support object-oriented programming §Include scripting languages §Include the visual languages §Examples: C, Java, Perl, JavaScript, Visual BASIC .NET, C++ *Functional §Main means of making computations is by applying functions to given parameters §Examples: LISP, Scheme, ML, F# *Logic §Rule-based (rules are specified in no particular order) §Example: Prolog *Markup/programming hybrid §Markup languages extended to support some programming §Examples: JSTL, XSLT
85
Implementation Methods
*Compilation §Programs are translated into machine language; includes JIT systems §Use: Large commercial applications *Pure Interpretation §Programs are interpreted by another program known as an interpreter §Use: Small programs or when efficiency is not an issue *Hybrid Implementation Systems §A compromise between compilers and pure interpreters §Use: Small and medium systems when efficiency is not the first concern
86
Language Groups
*Imperative: §von Neumann (Fortran, Pascal, Basic, C) §Object-oriented (Smalltalk, Eiffel, C++?) §Scripting languages (Perl, Python, JavaScript, PHP) *Declarative: §Functional (Scheme, ML, pure LISP, FP) §Logic, constraint-based (Prolog, VisiCalc, RPG) *Imperative languages, particularly the von Neumann languages, predominate: §They will occupy the bulk of our attention
87
Syntax
the form or structure of the expressions, statements, and program units
88
Semantics
the meaning of the expressions, statements, and program units
89
Users of a language definition
§Other language designers §Implementers §Programmers (the users of the language)
90
Context-Free Grammars
§Developed by Noam Chomsky in the mid-1950s §Language generators, meant to describe the syntax of natural languages §Define a class of languages called context-free languages
91
Backus-Naur Form
§Invented by John Backus to describe the syntax of Algol 58 §BNF is equivalent to context-free grammars
92
sentential form
Every string of symbols in a derivation
93
sentence
a sentential form that has only terminal symbols
94
leftmost derivation
leftmost nonterminal in each sentential form is the one that is expanded
95
Parse Tree
A hierarchical representation of a derivation
96
Attribute Grammars
have additions to CFGs to carry some semantic info on parse tree nodes
97
Primary value of AGs:
§Static semantics specification §Compiler design (static semantics checking)
98
Dynamic Semantics
There is no single widely acceptable notation or formalism for describing semantics
99
Several needs for a methodology and notation for semantics:
§Programmers need to know what statements mean §Compiler writers must know exactly what language constructs do §Correctness proofs would be possible §Compiler generators would be possible §Designers could detect ambiguities and inconsistencies
100
Syntax Analysis
The syntax analysis portion of a language processor nearly always consists of two parts: §A low-level part called a lexical analyzer(mathematically, a finite automaton based on a regular grammar) §A high-level part called a syntax analyzer, or parser (mathematically, a push-down automaton based on a context-free grammar, or BNF)
101
Regular Expressions
A regular expression is one of the following: §A character §The empty string, denoted by ε §Two regular expressions concatenated §Two regular expressions separated by | (i.e., or) §A regular expression followed by the Kleene star * (concatenation of zero or more strings).
102
Goals of the parser, given an input program:
§Find all syntax errors; for each, produce an appropriate diagnostic message and recover quickly §Produce the parse tree, or at least a trace of the parse tree, for the program
103
Two categories of parsers:
§Top down: o Produce the parse tree, beginning at the root o Order is that of a leftmost derivation o Traces or builds the parse tree in preorder §Bottom up: o Produce the parse tree, beginning at the leaves o Order is that of the reverse of a rightmost derivation
104
Imperative languages are abstractions of von Neumann architecture:
§Memory §Processor
105
Variables are characterized by attributes:
To design a type, must consider scope, lifetime, type checking, initialization, and type compatibility
106
variable
an abstraction of a memory cell
107
Variables can be characterized as a sextuple of attributes:
§Name §Address §Value §Type §Lifetime §Scope
108
Type
determines the range of values of variables and the set of operations that are defined for values of that type; in the case of floating point, type also determines the precision
109
Value
the contents of the location with which the variable is associated:
110
l-value
l-value of a variable is its address
111
r-value
r-value of a variable is its value
112
Abstract memory cell
the physical cell or collection of cells associated with a variable
113
static binding
A binding is static if it first occurs before run time and remains unchanged throughout program execution
114
dynamic binding
A binding is dynamic if it first occurs during execution or can change during execution of the program
115
scope of a variable
scope of a variable is the range of statements over which it is visible
116
local variables of a program unit
local variables of a program unit are those that are declared in that unit
117
nonlocal variables of a program unit
nonlocal variables of a program unit are those that are visible in the unit but not declared there
118
Global variables
a special category of nonlocal variables
119
scope rules of a language determine...
how references to names are associated with variables
120
static scope search process
search declarations, first locally, then in increasingly larger enclosing scopes, until one is found for the given name
121
static ancestors
Enclosing static scopes (to a specific scope) are called its static ancestors
122
static parent
the nearest static ancestor is called a static parent
123
static scope bindings depend on
bindings are defined by the physical (lexical) structure of the program
124
dynamic scope bindings depend on
depend on the current state of program execution:
125
data type
defines a collection of data objects and a set of predefined operations on those objects
126
descriptor
the collection of the attributes of a variable
127
object
represents an instance of a user-defined (abstract data) type
128
One design issue for all data types
What operations are defined and how are they specified?
129
Almost all programming languages provide
provide a set of primitive data types
130
Primitive data types
Those not defined in terms of other data types
131
examples of primitive data types
§Integer §Floating Point §Complex §Decimal §Boolean §Character
132
Access function
maps subscript expressions to an address in the array
133
Access function for single-dimensioned arrays:
address(list[k]) = address (list[lower_bound]) + ((k-lower_bound) * element_size)
134
pointers
*A pointer type variable has a range of values that consists of memory addresses and a special value, nil *Provide the power of indirect addressing *Provide a way to manage dynamic memory *A pointer can be used to access a location in the area where storage is dynamically created (usually called a heap)
135
Expressions
are the fundamental means of specifying computations in a programming language
136
Essence of imperative languages is dominant role of
assignment statements
137
operator precedence rules for expression evaluation
define the order in which “adjacent” operators of different precedence levels are evaluated
138
Typical precedence levels:
§parentheses §unary operators §** (if the language supports it) §*, / §+, -
139
Typical associativity rules
§Left to right, except **, which is right to left §Sometimes unary operators associate right to left (e.g., in FORTRAN)
140
operator associativity rules for expression evaluation
define the order in which adjacent operators with the same precedence level are evaluated
141
Precedence and associativity rules can be overridden with
parentheses
142
Operand evaluation order:
§Variables: fetch the value from memory §Constants: sometimes a fetch from memory; sometimes the constant is in the machine language instruction §Parenthesized expressions: evaluate all operands and operators first §The most interesting case is when an operand is a function call
143
Subtle but important differences in the semantics of assignment in different imperative languages
Context based: a variable may refer to the value of the variable (r-value) or its location (l-value) – a named container for a value
144
Value model of variables
an expression is either an l-value or an r-value, based on the context in which it appears:
145
Reference model of variables
a variable is a named reference for a value – every variable is an l-value:
146
control structure
a control statement and the statements whose execution it controls Design question: §Should a control structure have multiple entries?
147
selection statement
provides the means of choosing between two or more paths of execution
148
2 categories of selection statements
§Two-way selectors §Multiple-way selectors
149
General design issues for iteration control statements:
§How is iteration controlled? §Where is the control mechanism in the loop?
150
Iterative Statements
The repeated execution of a statement or compound statement is accomplished either by iteration or recursion
151
purpose of guarded commands
to support a new programming methodology that supported verification (correctness) during development Basic Idea: if the order of evaluation is not important, the program should not specify one
152
subprogram linkage
The subprogram call and return operations of a language
153
General semantics of calls to a subprogram:
§Parameter passing methods §Stack-dynamic allocation of local variables §Save the execution status of calling program §Transfer of control and arrange for the return §If subprogram nesting is supported, access to nonlocal variables must be arranged
154
Activation Record
*The activation record format is static, but its size may be dynamic *The dynamic link points to the top of an instance of the activation record of the caller *An activation record instance is dynamically created when a subprogram is called *Activation record instances reside on the run-time stack *The Environment Pointer (EP) must be maintained by the run-time system. It always points at the base of the activation record instance of the currently executing program unit
155
static chain
a chain of static links that connects certain activation record instances
156
dynamic scoping deep access
non-local references are found by searching the activation record instances on the dynamic chain: §Length of the chain cannot be statically determined §Every activation record instance must have variable names
157
static scoping shallow access
put locals in a central place: §One stack for each variable name §Central table with an entry for each variable name