






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







D -> Da ’within’ D => ’within’
-> Da ;
Da -> Dr ( ’and’ Dr )+ => ’and’
-> Dr ;
Dr -> ’rec’ Db => ’rec’
-> Db ;
Db -> Vl ’=’ E => ’=’
-> ’’ Vb+ ’=’ E => ’function_form’ -> ’(’ D ’)’ ;
Vb -> ’’
-> ’(’ Vl ’)’ -> ’(’ ’)’ => ’()’;
Vl -> ’’ list ’,’ => ’,’?;
RPAL Phrase Structure:
Rpal -> E; E -> ’let’ D ’in’ E => ’let’ -> ’fn’ Vb+ ’.’ E => ’lambda’ -> Ew; Ew -> T ’where’ Dr => ’where’ -> T;
T -> Ta ( ’,’ Ta )+ => ’tau’ -> Ta ; Ta -> Ta ’aug’ Tc => ’aug’ -> Tc ; Tc -> B ’->’ Tc ’|’ Tc => ’->’ -> B ;
B -> B ’or’ Bt => ’or’ -> Bt ; Bt -> Bt ’&’ Bs => ’&’ -> Bs ; Bs -> ’not’ Bp => ’not’ -> Bp ; Bp -> A Rl A => ’rl’ -> A ; Rl -> ’gr’ | ’>’ => ’gr’ -> ’ge’ | ’>=’ => ’ge’ -> ’ls’ | ’<’ => ’ls’ -> ’le’ | ’<=’ => ’le’ -> ’eq’ => ’eq’ -> ’ne’ => ’ne’;
A -> A ’+’ At => ’+’ -> A ’-’ At => ’-’ -> ’+’ At -> ’-’ At => ’neg’ -> At ; At -> At ’’ Af => ’’ -> At ’/’ Af => ’/’ -> Af ; Af -> Ap ’’ Af => ’’ -> Ap ; Ap -> Ap ’@’ ’’ R => ’@’ -> R ;
R -> R Rn => ’gamma’ -> Rn ; Rn -> ’’ -> ’’ -> ’’ -> ’true’ => ’true’ -> ’false’ => ’false’ -> ’nil’ => ’nil’ -> ’(’ E ’)’ -> ’dummy’ => ’dummy’ ;
D -> Da ’within’ D => ’within’ -> Da ; Da -> Dr ( ’and’ Dr )+ => ’and’ -> Dr ; Dr -> ’rec’ Db => ’rec’ -> Db ; Db -> Vl ’=’ E => ’=’ -> ’’ Vb+ ’=’ E => ’function_form’ -> ’(’ D ’)’ ;
Vb -> ’’ -> ’(’ Vl ’)’ -> ’(’ ’)’ => ’()’; Vl -> ’’ list ’,’ => ’,’?;
x k .... .... c
x
.... Result .... where Result=Apply[Rator,Rand]
c
x
.... value ....
CSE Rule 6 (binop) .... binop Rand Rand .... .... Result .... where Result=Apply[binop,Rand,Rand]
CSE Rule 7 (unop) .... unop Rand .... .... Result .... where Result=Apply[unop,Rand]
c
V 1 ,..., Vn