Adding comments for types
This commit is contained in:
@ -50,7 +50,7 @@ let rec evaluate (mem: memory) (command: t_exp) =
|
|||||||
funcClosure.assignments
|
funcClosure.assignments
|
||||||
funcClosure.inputList
|
funcClosure.inputList
|
||||||
parmList
|
parmList
|
||||||
in (* helper funcClosure or helper mem ??? *)
|
in
|
||||||
let mem2 = (
|
let mem2 = (
|
||||||
match funcClosure.recursiveness with
|
match funcClosure.recursiveness with
|
||||||
None -> {assignments = mem2assignments}
|
None -> {assignments = mem2assignments}
|
||||||
|
|||||||
@ -8,30 +8,30 @@ type ftype =
|
|||||||
| FunctionType of ftype list * ftype
|
| FunctionType of ftype list * ftype
|
||||||
|
|
||||||
type t_exp =
|
type t_exp =
|
||||||
Integer of int
|
Integer of int (* x := a *)
|
||||||
| Boolean of bool
|
| Boolean of bool (* v *)
|
||||||
| Variable of variable
|
| Variable of variable (* x *)
|
||||||
| Function of variable list * ftype * t_exp
|
| Function of variable list * ftype * t_exp (* lambda x: t. x *)
|
||||||
| Application of t_exp * t_exp list
|
| Application of t_exp * t_exp list (* x x *)
|
||||||
| Plus of t_exp * t_exp
|
| Plus of t_exp * t_exp (* x + x *)
|
||||||
| Minus of t_exp * t_exp
|
| Minus of t_exp * t_exp (* x - x *)
|
||||||
| Times of t_exp * t_exp
|
| Times of t_exp * t_exp (* x * x *)
|
||||||
| Division of t_exp * t_exp
|
| Division of t_exp * t_exp (* x / x *)
|
||||||
| Modulo of t_exp * t_exp
|
| Modulo of t_exp * t_exp (* x % x *)
|
||||||
| Power of t_exp * t_exp
|
| Power of t_exp * t_exp (* x ^ x *)
|
||||||
| PowerMod of t_exp * t_exp * t_exp
|
| PowerMod of t_exp * t_exp * t_exp (* (x ^ x) % x *)
|
||||||
| Rand of t_exp
|
| Rand of t_exp (* rand(0, x) *)
|
||||||
| BAnd of t_exp * t_exp
|
| BAnd of t_exp * t_exp (* x and x *)
|
||||||
| BOr of t_exp * t_exp
|
| BOr of t_exp * t_exp (* x or x *)
|
||||||
| BNot of t_exp
|
| BNot of t_exp (* not x *)
|
||||||
| Cmp of t_exp * t_exp
|
| Cmp of t_exp * t_exp (* x == x *)
|
||||||
| CmpLess of t_exp * t_exp
|
| CmpLess of t_exp * t_exp (* x < x *)
|
||||||
| CmpLessEq of t_exp * t_exp
|
| CmpLessEq of t_exp * t_exp (* x <= x *)
|
||||||
| CmpGreater of t_exp * t_exp
|
| CmpGreater of t_exp * t_exp (* x > x *)
|
||||||
| CmpGreaterEq of t_exp * t_exp
|
| CmpGreaterEq of t_exp * t_exp (* x >= x *)
|
||||||
| IfThenElse of t_exp * t_exp * t_exp
|
| IfThenElse of t_exp * t_exp * t_exp (* if b then c else c *)
|
||||||
| LetIn of variable * t_exp * t_exp
|
| LetIn of variable * t_exp * t_exp (* let x = x in x *)
|
||||||
| LetFun of variable * variable list * ftype * t_exp * t_exp
|
| LetFun of variable * variable list * ftype * t_exp * t_exp (* let rec x: t. x in x*)
|
||||||
|
|
||||||
type permittedValues =
|
type permittedValues =
|
||||||
IntegerPermitted of int
|
IntegerPermitted of int
|
||||||
|
|||||||
Reference in New Issue
Block a user