8.10
3.1.4 v3 Languages
(require cpsc411/langs/v3) | package: cpsc411-lib |
values-lang-v3 : grammar?
p | ::= | (module tail) | ||
tail | ::= | value | ||
| | (let ([x value] ...) tail) | |||
value | ::= | triv | ||
| | (binop triv triv) | |||
| | (let ([x value] ...) value) | |||
triv | ::= | x | ||
| | int64 | |||
x | ::= | name? | ||
binop | ::= | * | ||
| | + | |||
int64 | ::= | int64? |
procedure
(values-lang-v3? a) → boolean?
a : any/c
Decides whether a is a valid program in the values-lang-v3 grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
(interp-values-lang-v3 a) → any/c
a : values-lang-v3?
Evaluates a values-lang-v3 program to a value.
values-unique-lang-v3 : grammar?
p | ::= | (module tail) | ||
tail | ::= | value | ||
| | (let ([aloc value] ...) tail) | |||
value | ::= | triv | ||
| | (binop triv triv) | |||
| | (let ([aloc value] ...) value) | |||
triv | ::= | aloc | ||
| | int64 | |||
binop | ::= | * | ||
| | + | |||
aloc | ::= | aloc? | ||
int64 | ::= | int64? |
procedure
a : any/c
Decides whether a is a valid program in the values-unique-lang-v3 grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
a : values-unique-lang-v3?
Evaluates a values-unique-lang-v3 program to a value.
imp-mf-lang-v3 : grammar?
p | ::= | (module tail) | ||
tail | ::= | value | ||
| | (begin effect ... tail) | |||
value | ::= | triv | ||
| | (binop triv triv) | |||
| | (begin effect ... value) | |||
effect | ::= | (set! aloc value) | ||
| | (begin effect ... effect) | |||
triv | ::= | aloc | ||
| | int64 | |||
binop | ::= | * | ||
| | + | |||
aloc | ::= | aloc? | ||
int64 | ::= | int64? |
procedure
(imp-mf-lang-v3? a) → boolean?
a : any/c
Decides whether a is a valid program in the imp-mf-lang-v3 grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
(interp-imp-mf-lang-v3 a) → any/c
a : imp-mf-lang-v3?
Evaluates a imp-mf-lang-v3 program to a value.
imp-cmf-lang-v3 : grammar?
p | ::= | (module tail) | ||
tail | ::= | value | ||
| | (begin effect ... tail) | |||
value | ::= | triv | ||
| | (binop triv triv) | |||
effect | ::= | (set! aloc value) | ||
| | (begin effect ... effect) | |||
triv | ::= | aloc | ||
| | int64 | |||
binop | ::= | * | ||
| | + | |||
aloc | ::= | aloc? | ||
int64 | ::= | int64? |
procedure
(imp-cmf-lang-v3? a) → boolean?
a : any/c
Decides whether a is a valid program in the imp-cmf-lang-v3 grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
(interp-imp-cmf-lang-v3 a) → any/c
a : imp-cmf-lang-v3?
Evaluates a imp-cmf-lang-v3 program to a value.