• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/13

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

13 Cards in this Set

  • Front
  • Back

static environment

the types of the preceding bindings in a file

dynamic environment

the values of the preceding bindings in a file.

syntax

the specific way in which you write the operation or command you wish to perform

semantics

how an expression or variable binding type checks and evaluates

type-check variable binding

To type check a variable binding, we use the "current static environment" ( the types of preceding bindings) to type check e (which will depend on what kind of expression it is) and produce a "new static environment" that is the current static environment except with x having type t where t is the type of e.

evaluate a variable binding


To evaluate a variable binding, we use the "current dynamic environment" (the values of preceding bindings to evaluate e (which will depend on what kind of expression it is) and produce a "new dynamic environment" that is the current environment except with x having the value v where v is the result of evaluating e.

value

An expression that can not be further simplified, or has no more computation to do.



Example 2 + 3 = 5


5 is the value of 2 + 3

integer constant (syntax, type checking, evaluation)

Syntax: a sequence of digits


Type Checking: type int in any static environment


Evaluation: to itself in any dynamic environment (it is a value)

addition (syntax, type checking, evalutation)

Syntax: e1 + e2 where e1 and e2 are expressions


Type Checking: type int but only if e1 and e2 have type int in the same static environment, else does not type check


Evaluation: Evaluate e1 to v1 and e2 to v2 in the same dynamic environment and then produce the sum of v1 and v 2

variables

Syntax: a sequence of letters, underscores, etc.


Type-checking: look up the variable in the current static environment and use that type


Evaluation: look up the variable in the current dynamic environment and use that value

conditionals

Syntax: if e1 then e2 else e3 where e1, e2, e3 are expressions


Type-Checking: using the current static environment, a conditional type-checks only if (a) e1 has type bool and (b) e2 and e3 have the same type. The type of the whole expression is the type of e2 and e3


Evaluation: Under the current dynamic environment, evaluate e1. If the result is true, the result of evaluating e2 under the current dynamic environment is the overall result. If the result is false, the result of evaluating e3 under the current dynamic environment is the overall result.

boolean constants

Syntax: either true or false


Type-checking: type bool in any static environment


Evaluation: to itself in any dynamic environment (it is a value)

less than comparison syntax

Syntax: e1 < e2 where e1 and e2 are expressions


Type-checking: type bool but only if e1 and e2 have type int in the same static environment, else does not type-check


Evaluation: evalute e1 to v1 and e2 to v2 in the same dynamic environment and then produce true if v1 is less than v2 and false otherwise.