8.10
3.1.2 v2 Languages
(require cpsc411/langs/v2) | package: cpsc411-lib |
asm-lang-v2 : grammar?
p | ::= | (module info tail) | ||
info | ::= | info? | ||
tail | ::= | (halt triv) | ||
| | (begin effect ... tail) | |||
effect | ::= | (set! aloc triv) | ||
| | (set! aloc_1 (binop aloc_1 triv)) | |||
| | (begin effect ... effect) | |||
triv | ::= | aloc | ||
| | int64 | |||
binop | ::= | * | ||
| | + | |||
aloc | ::= | aloc? | ||
int64 | ::= | int64? |
procedure
(asm-lang-v2? a) → boolean?
a : any/c
Decides whether a is a valid program in the asm-lang-v2 grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
(interp-asm-lang-v2 a) → any/c
a : asm-lang-v2?
Evaluates a asm-lang-v2 program to a value.
asm-lang-v2/locals : grammar?
p | ::= | (module info tail) | ||
info | ::= | (#:from-contract (info/c (locals (aloc ...)))) | ||
tail | ::= | (halt triv) | ||
| | (begin effect ... tail) | |||
effect | ::= | (set! aloc triv) | ||
| | (set! aloc_1 (binop aloc_1 triv)) | |||
| | (begin effect ... effect) | |||
triv | ::= | aloc | ||
| | int64 | |||
binop | ::= | * | ||
| | + | |||
aloc | ::= | aloc? | ||
int64 | ::= | int64? |
procedure
(asm-lang-v2/locals? a) → boolean?
a : any/c
Decides whether a is a valid program in the asm-lang-v2/locals grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
a : asm-lang-v2/locals?
Evaluates a asm-lang-v2/locals program to a value.
asm-lang-v2/assignments : grammar?
p | ::= | (module info tail) | ||
info | ::= | (#:from-contract (info/c (locals (aloc ...)) (assignment ((aloc loc) ...)))) | ||
tail | ::= | (halt triv) | ||
| | (begin effect ... tail) | |||
effect | ::= | (set! aloc triv) | ||
| | (set! aloc_1 (binop aloc_1 triv)) | |||
| | (begin effect ... effect) | |||
triv | ::= | aloc | ||
| | int64 | |||
loc | ::= | reg | ||
| | fvar | |||
reg | ::= | rsp | ||
| | rbp | |||
| | rax | |||
| | rbx | |||
| | rcx | |||
| | rdx | |||
| | rsi | |||
| | rdi | |||
| | r8 | |||
| | r9 | |||
| | r12 | |||
| | r13 | |||
| | r14 | |||
| | r15 | |||
binop | ::= | * | ||
| | + | |||
aloc | ::= | aloc? | ||
int64 | ::= | int64? | ||
fvar | ::= | fvar? |
procedure
a : any/c
Decides whether a is a valid program in the asm-lang-v2/assignments grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
a : asm-lang-v2/assignments?
Evaluates a asm-lang-v2/assignments program to a value.
nested-asm-lang-v2 : grammar?
p | ::= | tail | ||
tail | ::= | (halt triv) | ||
| | (begin effect ... tail) | |||
effect | ::= | (set! loc triv) | ||
| | (set! loc_1 (binop loc_1 triv)) | |||
| | (begin effect ... effect) | |||
triv | ::= | loc | ||
| | int64 | |||
loc | ::= | reg | ||
| | fvar | |||
reg | ::= | rsp | ||
| | rbp | |||
| | rax | |||
| | rbx | |||
| | rcx | |||
| | rdx | |||
| | rsi | |||
| | rdi | |||
| | r8 | |||
| | r9 | |||
| | r12 | |||
| | r13 | |||
| | r14 | |||
| | r15 | |||
binop | ::= | * | ||
| | + | |||
int64 | ::= | int64? | ||
fvar | ::= | fvar? |
procedure
(nested-asm-lang-v2? a) → boolean?
a : any/c
Decides whether a is a valid program in the nested-asm-lang-v2 grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
a : nested-asm-lang-v2?
Evaluates a nested-asm-lang-v2 program to a value.
para-asm-lang-v2 : grammar?
p | ::= | (begin effect ... (halt triv)) | ||
effect | ::= | (set! loc triv) | ||
| | (set! loc_1 (binop loc_1 triv)) | |||
triv | ::= | loc | ||
| | int64 | |||
loc | ::= | reg | ||
| | fvar | |||
reg | ::= | rsp | ||
| | rbp | |||
| | rax | |||
| | rbx | |||
| | rcx | |||
| | rdx | |||
| | rsi | |||
| | rdi | |||
| | r8 | |||
| | r9 | |||
| | r12 | |||
| | r13 | |||
| | r14 | |||
| | r15 | |||
binop | ::= | * | ||
| | + | |||
int64 | ::= | int64? | ||
fvar | ::= | fvar? |
procedure
(para-asm-lang-v2? a) → boolean?
a : any/c
Decides whether a is a valid program in the para-asm-lang-v2 grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
(interp-para-asm-lang-v2 a) → any/c
a : para-asm-lang-v2?
Evaluates a para-asm-lang-v2 program to a value.
paren-x64-fvars-v2 : grammar?
p | ::= | (begin s ...) | ||
s | ::= | (set! fvar int32) | ||
| | (set! fvar reg) | |||
| | (set! reg loc) | |||
| | (set! reg triv) | |||
| | (set! reg_1 (binop reg_1 int32)) | |||
| | (set! reg_1 (binop reg_1 loc)) | |||
triv | ::= | reg | ||
| | int64 | |||
loc | ::= | reg | ||
| | fvar | |||
reg | ::= | rsp | ||
| | rbp | |||
| | rax | |||
| | rbx | |||
| | rcx | |||
| | rdx | |||
| | rsi | |||
| | rdi | |||
| | r8 | |||
| | r9 | |||
| | r10 | |||
| | r11 | |||
| | r12 | |||
| | r13 | |||
| | r14 | |||
| | r15 | |||
binop | ::= | * | ||
| | + | |||
int64 | ::= | int64? | ||
int32 | ::= | int32? | ||
fvar | ::= | fvar? |
procedure
(paren-x64-fvars-v2? a) → boolean?
a : any/c
Decides whether a is a valid program in the paren-x64-fvars-v2 grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
a : paren-x64-fvars-v2?
Evaluates a paren-x64-fvars-v2 program to a value.
paren-x64-v2 : grammar?
p | ::= | (begin s ...) | ||
s | ::= | (set! addr int32) | ||
| | (set! addr reg) | |||
| | (set! reg loc) | |||
| | (set! reg triv) | |||
| | (set! reg_1 (binop reg_1 int32)) | |||
| | (set! reg_1 (binop reg_1 loc)) | |||
triv | ::= | reg | ||
| | int64 | |||
loc | ::= | reg | ||
| | addr | |||
reg | ::= | rsp | ||
| | rbp | |||
| | rax | |||
| | rbx | |||
| | rcx | |||
| | rdx | |||
| | rsi | |||
| | rdi | |||
| | r8 | |||
| | r9 | |||
| | r10 | |||
| | r11 | |||
| | r12 | |||
| | r13 | |||
| | r14 | |||
| | r15 | |||
addr | ::= | (fbp - dispoffset) | ||
fbp | ::= | frame-base-pointer-register? | ||
binop | ::= | * | ||
| | + | |||
int64 | ::= | int64? | ||
int32 | ::= | int32? | ||
dispoffset | ::= | dispoffset? |
procedure
(paren-x64-v2? a) → boolean?
a : any/c
Decides whether a is a valid program in the paren-x64-v2 grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
(interp-paren-x64-v2 a) → any/c
a : paren-x64-v2?
Evaluates a paren-x64-v2 program to a value.