diff --git a/W1/assign1.fo b/W1/assign1.fo new file mode 100644 index 0000000..f6c4aee --- /dev/null +++ b/W1/assign1.fo @@ -0,0 +1,17 @@ +fun int mul(int x, int y) = + if y == 0 then 0 + else if y < 0 then mul(x, y+1) - x + else mul(x, y-1) + x + +fun int readInt(int i) = read(int) + +fun int squareSum(int x, int y) = x + mul(y, y) + +fun int main() = + let n = read(int) in + if n == 0 then let a = write("Incorrect Input!") in 0 + else if n < 0 then let a = write("Incorrect Input!") in 0 + else + let arr = map(readInt, iota(n)) in + let dif = map(fn int (int x) => if x == 0 then arr[x] else arr[x] - arr[x-1], iota(n)) in + write(reduce(squareSum, 0, dif)) diff --git a/W1/fasto/Fasto/AbSyn.fs b/W1/fasto/Fasto/AbSyn.fs new file mode 100644 index 0000000..c0bf3bd --- /dev/null +++ b/W1/fasto/Fasto/AbSyn.fs @@ -0,0 +1,303 @@ +module AbSyn + +(* + Types and utilities for the abstract syntax tree (AbSyn) of Fasto. + Fasto er et funktionelt array-sprog til oversættelse, F-A-S-T-O. + Fasto er også et spansk ord, der betyder "pomp" eller "pragt". + Derfor skal vi programmere en "pragtfuld" oversætter for Fasto. + + The abstract syntax of a (Fasto) program is a representation of the (Fasto) + program in terms of a data type in another programming language (F#). + + Some expressions in Fasto (e.g. array constants, indexing operations, map, + reduce) are implicitly typed, their types are not explicitly stated in the + program text. Their types are infered at run-time by an interpreter, or at + compile-time by a type-checker. + + In support of this, this module defines type-parameterized datatypes for + expressions "Exp<'T>", let declarations "Dec<'T>", function arguments + "FunArg<'T>", function declaration "FunDec<'T>", and program "Prog<'T>". + These datatypes are instantiated over the "unit" and "Type" types to provide + an abstract syntax tree without type information, e.g., "UntypedProg = Prog", + and another abstract syntax tree in which the inferred type information + is made explicit in the representation "TypedProg = Prog". + + For example: + - interpretation uses the untyped version "TypedProg", + - the type checking phase receives as input an untype program ("UntypedProg") + and produces a typed program ("TypedProg") + - the other compiler phases work on the typed program. + + Note that semantically we use two different AbSyns, but we avoid code duplication + by means of the afore-mentioned type parameterization. + + Also our AbSyn stores not just the program structure, but also the positions of + the program substructures in the original program text. This is useful for + reporting errors at later passes of the compiler, e.g. type errors. + + This module also provides pretty printing functionality, printing a valid Fasto + program given its abstract syntax. "pp" is used in this module as a shorthand + for "prettyPrint". +*) + +(*** Helper Functions ***) +let toCString (s : string) : string = + let escape c = + match c with + | '\\' -> "\\\\" + | '"' -> "\\\"" + | '\n' -> "\\n" + | '\t' -> "\\t" + | _ -> System.String.Concat [c] + String.collect escape s + +// Doesn't actually support all escapes. Too badefacilliteter. +let fromCString (s : string) : string = + let rec unescape l: char list = + match l with + | [] -> [] + | '\\' :: 'n' :: l' -> '\n' :: unescape l' + | '\\' :: 't' :: l' -> '\t' :: unescape l' + | '\\' :: c :: l' -> c :: unescape l' + | c :: l' -> c :: unescape l' + Seq.toList s |> unescape |> System.String.Concat + +(* position: (line, column) *) +type Position = int * int + +type Type = + Int + | Bool + | Char + | Array of Type + +type Value = + IntVal of int + | BoolVal of bool + | CharVal of char + | ArrayVal of Value list * Type + (* Type corresponds to the element-type of the array *) + +(* Indentifies value types (for type checking) *) +let valueType = function + | (IntVal _) -> Int + | (BoolVal _) -> Bool + | (CharVal _) -> Char + | (ArrayVal (_,tp)) -> Array tp + +(* pretty printing types *) +let rec ppType = function + | Int -> "int" + | Char -> "char" + | Bool -> "bool" + | Array tp -> "[" + ppType tp + "]" + +(* Parameter declaration *) +type Param = + Param of string * Type + +type Exp<'T> = + Constant of Value * Position + | StringLit of string * Position + | ArrayLit of Exp<'T> list * 'T * Position + | Var of string * Position + | Plus of Exp<'T> * Exp<'T> * Position + | Minus of Exp<'T> * Exp<'T> * Position + | Equal of Exp<'T> * Exp<'T> * Position + | Less of Exp<'T> * Exp<'T> * Position + | If of Exp<'T> * Exp<'T> * Exp<'T> * Position + | Apply of string * Exp<'T> list * Position + | Let of Dec<'T> * Exp<'T> * Position + | Index of string * Exp<'T> * 'T * Position + + (* dirty I/O *) + | Read of Type * Position + | Write of Exp<'T> * 'T * Position + + (* Project implementations *) + | Times of Exp<'T> * Exp<'T> * Position + | Divide of Exp<'T> * Exp<'T> * Position + | Negate of Exp<'T> * Position + | And of Exp<'T> * Exp<'T> * Position + | Or of Exp<'T> * Exp<'T> * Position + | Not of Exp<'T> * Position + + (* Array constructors/combinators implementations *) + | Iota of Exp<'T> * Position + + (* map (f, array) + the first 'T corresponds to the mapped array element type, + which is the same as the f's input type; + the second 'T corresponds to the result-array element type, + which is the same as the f's result type. + *) + | Map of FunArg<'T> * Exp<'T> * 'T * 'T * Position + + (* reduce (f, acc, array) + the 'T argument corresponds to the array element type, + which is the same as the f's result type. + *) + | Reduce of FunArg<'T> * Exp<'T> * Exp<'T> * 'T * Position + + (* replicate(n, a); the 'T argument is the type of the + the second expression (i.e., a's type) + *) + | Replicate of Exp<'T> * Exp<'T> * 'T * Position + + (* filter (p, array) + p is a predicate, i.e., a function of type alpha -> bool + the 'T argument corresponds to the array element type, + which is the same as the f's input type (alpha); + *) + | Filter of FunArg<'T> * Exp<'T> * 'T * Position + + (* scan (f, acc, array); the 'T argument is as in reduce's case *) + | Scan of FunArg<'T> * Exp<'T> * Exp<'T> * 'T * Position + +and Dec<'T> = + Dec of string * Exp<'T> * Position + +and FunArg<'T> = + FunName of string + | Lambda of Type * Param list * Exp<'T> * Position + +(* A function declaration is a tuple of: +(i) function name, +(ii) return type, +(iii) formal arguments names & types, +(iv) function's body, +(v) Position. *) +type FunDec<'T> = + FunDec of string * Type * Param list * Exp<'T> * Position + + +(* Functions for extracting function properties *) +let getFunName (FunDec(fid, _, _, _, _)) = fid +let getFunRTP (FunDec(_, rtp, _, _, _)) = rtp +let getFunArgs (FunDec(_, _, arg, _, _)) = arg +let getFunBody (FunDec(_, _, _, bdy, _)) = bdy +let getFunPos (FunDec(_, _, _, _, pos)) = pos + +type Prog<'T> = FunDec<'T> list + +(****************************************************) +(********** Pretty-Printing Functionality ***********) +(****************************************************) + +let rec indent = function + | 0 -> "" + | n -> " " + indent (n-1) + +let ppParam = function + | Param(id, tp) -> ppType tp + " " + id + +let rec ppParams = function + | [] -> "" + | [bd] -> ppParam bd + | bd::l -> ppParam bd + ", " + ppParams l + +let rec ppVal d = function + | IntVal n -> sprintf "%i" n + | BoolVal b -> sprintf "%b" b + | CharVal c -> "'" + toCString (string c) + "'" + | ArrayVal (vals, t) -> "{ " + (String.concat ", " (List.map (ppVal d) vals)) + " }" + +let newLine exp = match exp with + | Let _ -> "" + | _ -> "\n" + +let rec ppExp d = function + | Constant(v, _) -> ppVal d v + | StringLit(s,_) -> "\"" + toCString s + "\"" + | ArrayLit(es, t, _) -> "{ " + (String.concat ", " (List.map (ppExp d) es)) + " }" + | Var (id, _) -> id + | Plus (e1, e2, _) -> "(" + ppExp d e1 + " + " + ppExp d e2 + ")" + | Minus (e1, e2, _) -> "(" + ppExp d e1 + " - " + ppExp d e2 + ")" + | Times (e1, e2, _) -> "(" + ppExp d e1 + " * " + ppExp d e2 + ")" + | Divide (e1, e2, _) -> "(" + ppExp d e1 + " / " + ppExp d e2 + ")" + | And (e1, e2, _) -> "(" + ppExp d e1 + " && " + ppExp d e2 + ")" + | Or (e1, e2, _) -> "(" + ppExp d e1 + " || " + ppExp d e2 + ")" + | Not (e, _) -> "not("+ppExp d e + ")" + | Negate (e, _) -> "~(" + ppExp d e + ")" + | Equal (e1, e2, _) -> "(" + ppExp d e1 + " == " + ppExp d e2 + ")" + | Less (e1, e2, _) -> "(" + ppExp d e1 + " < " + ppExp d e2 + ")" + | If (e1, e2, e3, _) -> ("if (" + ppExp d e1 + ")\n" + + indent (d+2) + "then " + ppExp (d+2) e2 + "\n" + + indent (d+2) + "else " + ppExp (d+2) e3 + "\n" + + indent d) + | Apply (id, args, _) -> (id + "(" + + (String.concat ", " (List.map (ppExp d) args)) + ")") + | Let (Dec(id, e1, _), e2, _) -> ("\n" + indent (d+1) + "let " + id + " = " + + ppExp (d+2) e1 + " in" + newLine e2 + + indent (d+1) + ppExp d e2) + | Index (id, e, t, _) -> id + "[" + ppExp d e + "]" + | Iota (e, _) -> "iota(" + ppExp d e + ")" + | Replicate (e, el, t, pos) -> "replicate(" + ppExp d e + ", " + ppExp d el + ")" + | Map (f, e, _, _, _) -> "map(" + ppFunArg d f + ", " + ppExp d e + ")" + | Filter (f, arr, _, _) -> ("filter(" + ppFunArg d f + ", " + ppExp d arr + ")") + | Reduce (f, el, lst, _, _) -> + "reduce(" + ppFunArg d f + ", " + ppExp d el + ", " + ppExp d lst + ")" + | Scan (f, acc, arr, _, pos) -> ("scan(" + ppFunArg d f + + ", " + ppExp d acc + + ", " + ppExp d arr + ")") + | Read (t, _) -> "read(" + ppType t + ")" + | Write (e, t, _) -> "write(" + ppExp d e + ")" + +and ppFunArg d = function + | FunName s -> s + | Lambda (rtp, args, body, _) -> ("fn " + ppType rtp + " (" + + ppParams args + ") => " + ppExp (d+2) body) + +(* pretty prints a function declaration *) +let ppFun d = function + | FunDec(id, rtp, args, body, _) -> ( "fun " + ppType rtp + " " + id + + "(" + ppParams args + ") =" + + indent (d+1) + ppExp(d+1) body ) + +(* Pretty pringint a program *) +let ppProg (p : Prog<'T>) = (String.concat "\n\n" (List.map (ppFun 0) p)) + "\n" + +let expPos = function + | Constant (_, p) -> p + | StringLit (_, p) -> p + | ArrayLit (_, _, p) -> p + | Var (_, p) -> p + | Plus (_, _, p) -> p + | Minus (_, _, p) -> p + | Equal (_, _, p) -> p + | Less (_, _, p) -> p + | If (_, _, _, p) -> p + | Apply (_, _, p) -> p + | Let (_, _, p) -> p + | Index (_, _, _, p) -> p + | Iota (_, p) -> p + | Replicate (_, _, _, p) -> p + | Map (_, _, _, _, p) -> p + | Filter (_, _, _, p) -> p + | Reduce (_, _, _, _, p) -> p + | Scan (_, _, _, _, p) -> p + | Read (_, p) -> p + | Write (_, _, p) -> p + | Times (_, _, p) -> p + | Divide (_, _, p) -> p + | And (_, _, p) -> p + | Or (_, _, p) -> p + | Not (_, p) -> p + | Negate (_, p) -> p + + + +type UntypedExp = Exp +type TypedExp = Exp + +type UntypedDec = Dec +type TypedDec = Dec + +type UntypedFunDec = FunDec +type TypedFunDec = FunDec + +type UntypedFunArg = FunArg +type TypedFunArg = FunArg + +type UntypedProg = Prog +type TypedProg = Prog diff --git a/W1/fasto/Fasto/CallGraph.fs b/W1/fasto/Fasto/CallGraph.fs new file mode 100644 index 0000000..0178adb --- /dev/null +++ b/W1/fasto/Fasto/CallGraph.fs @@ -0,0 +1,87 @@ +module CallGraph + +type CallGraph = (string * string list) list + + +let callsOf (caller : string) + (graph : CallGraph) = + match List.tryFind (fun (x,_) -> x = caller) graph with + | None -> [] + | Some (_, calls) -> calls + +let calls (caller : string) + (callee : string) + (graph : CallGraph) = + List.exists (fun x -> x=callee) (callsOf caller graph) + +open AbSyn + + +(* Remove duplicate elements in a list. Quite slow - O(n^2) - + but our lists here will be small. *) +let rec nub = function + | [] -> [] + | x::xs -> if List.exists (fun y -> y = x) xs + then nub xs + else x :: nub xs + +let rec expCalls = function + | Constant _ -> [] + | StringLit _ -> [] + | ArrayLit (es, _, _) -> List.concat (List.map expCalls es) + | Var _ -> [] + | Plus (e1, e2, _) -> expCalls e1 @ expCalls e2 + | Minus (e1, e2, _) -> expCalls e1 @ expCalls e2 + | Equal (e1, e2, _) -> expCalls e1 @ expCalls e2 + | Less (e1, e2, _) -> expCalls e1 @ expCalls e2 + | If (e1, e2, e3, _) -> expCalls e1 @ expCalls e2 @ expCalls e3 + | Apply (fname, es, _) -> fname :: List.concat (List.map expCalls es) + | Let ( Dec(_, e, _), body, _) -> expCalls e @ expCalls body + | Index (_, e, _, _) -> expCalls e + | Iota (e, _) -> expCalls e + | Map (farg, e, _, _, _) -> fargCalls farg @ expCalls e + | Filter (farg, e, _, _) -> fargCalls farg @ expCalls e + | Reduce (farg, e1, e2, _, _) -> fargCalls farg @ expCalls e1 @ expCalls e2 + | Replicate (n, e, _, _) -> expCalls n @ expCalls e + | Scan (farg, e1, e2, _, _) -> fargCalls farg @ expCalls e1 @ expCalls e2 + | Times (e1, e2, _) -> expCalls e1 @ expCalls e2 + | Divide (e1, e2, _) -> expCalls e1 @ expCalls e2 + | And (e1, e2, _) -> expCalls e1 @ expCalls e2 + | Or (e1, e2, _) -> expCalls e1 @ expCalls e2 + | Not (e, _) -> expCalls e + | Negate (e, _) -> expCalls e + | Read _ -> [] + | Write (e, _, _) -> expCalls e + +and fargCalls = function + | Lambda (_, _, body, _) -> expCalls body + | FunName s -> [s] + +(* Get the direct function calls of a single function *) + +let functionCalls = function + | FunDec (fname, _, _, body, _) -> (fname, nub (expCalls body)) + +(* Expand the direct function call graph to its transitive closure. *) +let rec transitiveClosure (graph : CallGraph) = + let grow ((caller : string), + (callees : string list)) = + let calleecalls = + List.concat (List.map (fun callee -> + callsOf callee graph) callees) + let newCalls = (List.filter (fun call -> + not (List.exists (fun x -> x = call) callees) + ) calleecalls) + if List.isEmpty newCalls + then ((caller, callees), + false) + else ((caller, callees @ nub newCalls), + true) + let (graph', changes) = List.unzip (List.map grow graph) + let changed = List.exists (fun x -> x) changes + if changed + then transitiveClosure graph' + else graph' + +let callGraph (prog : TypedProg) = + transitiveClosure (List.map functionCalls prog) diff --git a/W1/fasto/Fasto/CodeGen.fs b/W1/fasto/Fasto/CodeGen.fs new file mode 100644 index 0000000..d4dc31d --- /dev/null +++ b/W1/fasto/Fasto/CodeGen.fs @@ -0,0 +1,877 @@ +(* Code generator for Fasto *) + +module CodeGen + +(* + compile : TypedProg -> Mips.Instruction list + + (* for debugging *) + compileExp : TypedExp + -> SymTab + -> Mips.reg + -> Mips.Instruction list +*) + +open AbSyn + +exception MyError of string * Position + +type VarTable = SymTab.SymTab + +(* Name generator for labels and temporary symbolic registers *) +(* Example usage: val tmp = newName "tmp" (* might produce _tmp_5_ *) *) + +let mutable counter = 0 + +let newName base_name = + counter <- counter + 1 + "_" + base_name + "_" + string counter + "_" + +let newReg reg_name = Mips.RS (newName reg_name) + +let newLab lab_name = newName lab_name + +(* Table storing all string literals, with labels given to them *) +let stringTable : ((Mips.addr*string) list) ref = ref [] +(* could also contain "\n", ",", "Index out of bounds in line ", but the + format is a bit different (length and dummy pointer come first) *) + +(* Building a string in the heap, including initialisation code *) +let buildString ( label : Mips.addr + , str : string + ) : (Mips.Instruction list * Mips.Instruction list) = + let data = [ Mips.ALIGN 2 (* means: word-align *) + ; Mips.LABEL label (* pointer *) + ; Mips.SPACE 4 (* sizeof(Int) *) + ; Mips.ASCIIZ str] + let initR = Mips.RS (label + "_init") + let addrR = Mips.RS (label + "_addr") + let initcode = [ Mips.LA(addrR, label) + ; Mips.LI(initR, String.length str) + ; Mips.SW(initR, addrR, 0) ] + (initcode, data) + +(* Link register *) +let RA = Mips.RN 31 +(* Register for stack pointer *) +let SP = Mips.RN 29 +(* Register for heap pointer *) +let HP = Mips.RN 28 +(* Constant-zero register *) +let RZ = Mips.RN 0 + +(* General scratch-pad registers *) +let RN2 = Mips.RN 2 +let RN4 = Mips.RN 4 +let RN5 = Mips.RN 5 +let RN6 = Mips.RN 6 + +(* Suggested register division *) +let minReg = 2 (* lowest usable register *) +let maxCaller = 15 (* highest caller-saves register *) +let maxReg = 25 (* highest allocatable register *) + +(* Syscall numbers for MARS, to be put in $2 *) +let sysPrintInt = 1 (* print integer in $4 *) +let sysPrintString = 4 (* print NUL-terminated string starting at $4 *) +let sysReadInt = 5 (* read integer into $2 *) +let sysExit = 10 (* terminate execution *) +let sysPrintChar = 11 (* print character in $4 *) +let sysReadChar = 12 (* read character into $2 *) + +(* Determine the size of an element in an array based on its type *) +type ElemSize = ESByte | ESWord + +let getElemSize (tp : Type) : ElemSize = + match tp with + | Char -> ESByte + | Bool -> ESByte + | _ -> ESWord + +let elemSizeToInt (elmsz : ElemSize) : int = + match elmsz with + | ESByte -> 1 + | ESWord -> 4 + +(* Pick the correct instruction from the element size. *) +let mipsLoad elem_size = match elem_size with + | ESByte -> Mips.LB + | ESWord -> Mips.LW + +let mipsStore elem_size = match elem_size with + | ESByte -> Mips.SB + | ESWord -> Mips.SW + +(* generates the code to check that the array index is within bounds *) +let checkBounds ( arr_beg : Mips.reg + , ind_reg : Mips.reg + , (line : int, c : int) + ) : Mips.Instruction list = + let size_reg = newReg "size_reg" + let tmp_reg = newReg "tmp_reg" + let err_lab = newLab "error_lab" + let safe_lab = newLab "safe_lab" + [ Mips.LW(size_reg, arr_beg, 0) + ; Mips.BGEZ(ind_reg, safe_lab) (* check that ind_reg >= 0 *) + ; Mips.LABEL(err_lab) + ; Mips.LI(RN5, line) + ; Mips.LA(RN6, "_Msg_IllegalIndex_") + ; Mips.J "_RuntimeError_" + ; Mips.LABEL(safe_lab) + ; Mips.SUB(tmp_reg, ind_reg, size_reg) + ; Mips.BGEZ(tmp_reg, err_lab) (* check that ind_reg < -size_reg *) + ] + +(* dynalloc(size_reg, place, ty) generates code for allocating arrays of heap + memory by incrementing the HP register (heap pointer) by a number of words. + The arguments for this function are as follows: + + size_reg: contains the logical array size (number of array elements) + place: will contain the address of new allocation (old HP) + ty: char/bool elements take 1 byte, int elements take 4 bytes + *) +let dynalloc (size_reg : Mips.reg, + place : Mips.reg, + ty : Type ) + : Mips.Instruction list = + let tmp_reg = newReg "tmp" + + (* Use old HP as allocation address. *) + let code1 = [ Mips.MOVE (place, HP) ] + + (* For char/bool: Align address to 4-byte boundary by rounding up. *) + (* (By adding 3 and rounding down using SRA/SLL.) *) + (* For int and arrays: Multiply logical size by 4, no alignment. *) + let code2 = + match getElemSize ty with + | ESByte -> [ Mips.ADDI(tmp_reg, size_reg, 3) + ; Mips.SRA (tmp_reg, tmp_reg, 2) + ; Mips.SLL (tmp_reg, tmp_reg, 2) ] + | ESWord -> [ Mips.SLL (tmp_reg, size_reg, 2) ] + + (* Make space for array size (+4). Increase HP. *) + (* Save size of allocation in header. *) + let code3 = + [ Mips.ADDI (tmp_reg, tmp_reg, 4) + ; Mips.ADD (HP, HP, tmp_reg) + ; Mips.SW (size_reg, place, 0) ] + + code1 @ code2 @ code3 + +(* Pushing arguments on the stack: *) +(* For each register 'r' in 'rs', copy them to registers from +'firstReg' and counting up. Return the full code and the next unused +register (firstReg + num_args). *) +let applyRegs ( fid : Mips.addr + , args : Mips.reg list + , place: Mips.reg + , pos : Position ) + : Mips.Instruction list = + let regs_num = List.length args + let caller_regs = List.map (fun n -> Mips.RN (n + minReg)) [0..regs_num-1] + // List.tabulate (regs_num, fun n -> n + minReg) + (* zipWith Mips.MOVE = + zipWith (fun (regDest, regSrc) -> Mips.MOVE (regDest, regSrc)) *) + let move_code = List.map Mips.MOVE (List.zip caller_regs args) + if regs_num > maxCaller - minReg + then raise (MyError("Number of arguments passed to " + fid + + " exceeds number of caller registers", pos)) + else move_code @ [ Mips.JAL(fid,caller_regs); Mips.MOVE(place, RN2) ] + + +(* Compile 'e' under bindings 'vtable', putting the result in register 'place'. *) +let rec compileExp (e : TypedExp) + (vtable : VarTable) + (place : Mips.reg) + : Mips.Instruction list = + match e with + | Constant (IntVal n, pos) -> + if n < 0 then + compileExp (Negate (Constant (IntVal (-n), pos), pos)) vtable place + else if n < 32768 then + [ Mips.LI (place, n) ] + else + [ Mips.LUI (place, n / 65536) + ; Mips.ORI (place, place, n % 65536) ] + | Constant (BoolVal p, _) -> + (* TODO project task 1: represent `true`/`false` values as `1`/`0` *) + failwith "Unimplemented code generation of boolean constants" + | Constant (CharVal c, pos) -> [ Mips.LI (place, int c) ] + + (* Create/return a label here, collect all string literals of the program + (in stringTable), and create them in the data section before the heap + (Mips.ASCIIZ) *) + | StringLit (strLit, pos) -> + (* Convert string literal into label; only use valid characters. *) + let normalChars0 = //String.filter System.Char.IsLetterOrDigit strLit + String.map (fun c -> if System.Char.IsLetterOrDigit c then c else 'a') strLit + let normalChars = normalChars0 + "__str__" + let label = newLab (normalChars.Substring (0, 7)) + let () = stringTable := (label, strLit)::(!stringTable) + [ Mips.LA (place, label) + ; Mips.COMMENT (label + ": string \"" + toCString strLit + "\"") ] + + | Constant (ArrayVal (vs, tp), pos) -> + (* Create corresponding ArrayLit expression to re-use code. *) + let arraylit = ArrayLit (List.map (fun v -> Constant (v, pos)) vs, tp, pos) + compileExp arraylit vtable place + + | ArrayLit (elems, tp, pos) -> + let elem_size = getElemSize tp + let size_reg = newReg "size_reg" + let addr_reg = newReg "addr_reg" + let tmp_reg = newReg "tmp_reg" + + (* Store size of literal in size_reg, dynamically allocate that. *) + (* Let addr_reg contain the address for the first array element. *) + let header = [ Mips.LI (size_reg, List.length elems) ] @ + dynalloc (size_reg, place, tp) @ + [ Mips.ADDI (addr_reg, place, 4) ] + + let compileElem elem_exp = + let elem_code = compileExp elem_exp vtable tmp_reg + elem_code @ + [ mipsStore elem_size (tmp_reg, addr_reg, 0) + ; Mips.ADDI (addr_reg, addr_reg, elemSizeToInt elem_size) ] + + let elems_code = List.concat (List.map compileElem elems) + header @ elems_code + + | Var (vname, pos) -> + match SymTab.lookup vname vtable with + | None -> raise (MyError ("Name " + vname + " not found", pos)) + | Some reg_name -> [Mips.MOVE (place, reg_name)] + + | Plus (e1, e2, pos) -> + let t1 = newReg "plus_L" + let t2 = newReg "plus_R" + let code1 = compileExp e1 vtable t1 + let code2 = compileExp e2 vtable t2 + code1 @ code2 @ [Mips.ADD (place,t1,t2)] + + | Minus (e1, e2, pos) -> + let t1 = newReg "minus_L" + let t2 = newReg "minus_R" + let code1 = compileExp e1 vtable t1 + let code2 = compileExp e2 vtable t2 + code1 @ code2 @ [Mips.SUB (place,t1,t2)] + + (* TODO project task 1: + Look in `AbSyn.fs` for the expression constructors `Times`, ... + `Times` is very similar to `Plus`/`Minus`. + For `Divide`, you may ignore division by zero for a quick first + version, but remember to come back and clean it up later. + `Not` and `Negate` are simpler; you can use `Mips.XORI` for `Not` + *) + | Times (_, _, _) -> + failwith "Unimplemented code generation of multiplication" + + | Divide (_, _, _) -> + failwith "Unimplemented code generation of division" + + | Not (_, _) -> + failwith "Unimplemented code generation of not" + + | Negate (_, _) -> + failwith "Unimplemented code generation of negate" + + | Let (dec, e1, pos) -> + let (code1, vtable1) = compileDec dec vtable + let code2 = compileExp e1 vtable1 place + code1 @ code2 + + | If (e1, e2, e3, pos) -> + let thenLabel = newLab "then" + let elseLabel = newLab "else" + let endLabel = newLab "endif" + let code1 = compileCond e1 vtable thenLabel elseLabel + let code2 = compileExp e2 vtable place + let code3 = compileExp e3 vtable place + code1 @ [Mips.LABEL thenLabel] @ code2 @ + [ Mips.J endLabel; Mips.LABEL elseLabel ] @ + code3 @ [Mips.LABEL endLabel] + + (* special case for length *) + | Apply ("length", [arr], pos) -> + let arr_addr = newReg "len_arr" + let code1 = compileExp arr vtable arr_addr + code1 @ [ Mips.LW(place,arr_addr, 0) ] + | Apply (f, args, pos) -> + (* Convention: args in regs (2..15), result in reg 2 *) + let compileArg arg = + let arg_reg = newReg "arg" + (arg_reg, compileExp arg vtable arg_reg) + let (arg_regs, argcode) = List.unzip (List.map compileArg args) + let applyCode = applyRegs(f, arg_regs, place, pos) + List.concat argcode @ (* Evaluate args *) + applyCode (* Jump to function and store result in place *) + + (* dirty I/O. Read and Write: supported for basic types: Int, Char, + Bool via system calls. Write of an Array(Chars) is also + supported. The others are the user's responsibility. + *) + | Read(tp, pos) -> + match tp with + | Int -> [ Mips.JAL ("getint", [RN2]) + ; Mips.MOVE(place, RN2) + ] + | Char -> [ Mips.JAL ("getchar", [RN2]) + ; Mips.MOVE(place, RN2) + ] + | Bool -> + (* Note: the following inputs booleans as integers, with 0 + interpreted as false and everything else as true. This + differs from the interpreter! *) + let tl = newLab "true_lab" + let fl = newLab "false_lab" + let ml = newLab "merge_lab" + let v = newReg "bool_var" + [ Mips.JAL ("getint", [RN2]) + ; Mips.MOVE(v, RN2) + ; Mips.BEQ (v, RZ,fl) + ; Mips.J tl + ; Mips.LABEL fl + ; Mips.MOVE(place, RZ) + ; Mips.J ml + ; Mips.LABEL tl + ; Mips.LI (place, 1) + ; Mips.J ml + ; Mips.LABEL ml + ] + | _ -> raise (MyError("Read on an incompatible type: " + ppType tp, pos)) + + | Write(e, tp, pos) -> + let tmp = newReg "tmp" + let codeexp = compileExp e vtable tmp @ [ Mips.MOVE (place, tmp) ] + match tp with + | Int -> codeexp @ [ Mips.MOVE(RN2,place); Mips.JAL("putint", [RN2]) ] + | Char -> codeexp @ [ Mips.MOVE(RN2,place); Mips.JAL("putchar",[RN2]) ] + | Bool -> + let tlab = newLab "wBoolF" + codeexp @ + [ Mips.LA (RN2, "_true") + ; Mips.BNE (place, RZ, tlab) + ; Mips.LA (RN2, "_false") + ; Mips.LABEL tlab + ; Mips.JAL ("putstring", [RN2]) + ] + + | Array Char -> + codeexp @ [ Mips.MOVE (RN2, tmp) + ; Mips.JAL("putstring", [RN2]) ] + | _ -> raise (MyError("Write on an incompatible type: " + ppType tp, pos)) + + (* Comparison checking, later similar code for And and Or. *) + | Equal (e1, e2, pos) -> + let t1 = newReg "eq_L" + let t2 = newReg "eq_R" + let code1 = compileExp e1 vtable t1 + let code2 = compileExp e2 vtable t2 + let falseLabel = newLab "false" + code1 @ code2 @ + [ Mips.LI (place, 0) + ; Mips.BNE (t1,t2,falseLabel) + ; Mips.LI (place, 1) + ; Mips.LABEL falseLabel + ] + + | Less (e1, e2, pos) -> + let t1 = newReg "lt_L" + let t2 = newReg "lt_R" + let code1 = compileExp e1 vtable t1 + let code2 = compileExp e2 vtable t2 + code1 @ code2 @ [Mips.SLT (place,t1,t2)] + + (* TODO project task 1: + Look in `AbSyn.fs` for the expression constructors of `And` and `Or`. + The implementation of `And` and `Or` is more complicated than `Plus` + because you need to ensure the short-circuit semantics, e.g., + in `e1 || e2` if the execution of `e1` will evaluate to `true` then + the code of `e2` must not be executed. Similarly for `And` (&&). + *) + | And (_, _, _) -> + failwith "Unimplemented code generation of &&" + + | Or (_, _, _) -> + failwith "Unimplemented code generation of ||" + + (* Indexing: + 1. generate code to compute the index + 2. check index within bounds + 3. add the start address with the index + 4. get the element at that address + *) + | Index (arr_name, i_exp, ty, pos) -> + let ind_reg = newReg "arr_ind" + let ind_code = compileExp i_exp vtable ind_reg + let arr_reg = newReg "arr_reg" + + (* Let arr_reg be the start of the data segment *) + let arr_beg = + match SymTab.lookup arr_name vtable with + | None -> raise (MyError ("Name " + arr_name + " not found", pos)) + | Some reg_name -> reg_name + let init_code = [ Mips.ADDI(arr_reg, arr_beg, 4) ] + + (* code to check bounds *) + let check_code = checkBounds(arr_beg, ind_reg, pos) + + (* for INT/ARRAY: ind *= 4 else ind is unchanged *) + (* array_var += index; place = *array_var *) + let load_code = + match getElemSize ty with + | ESByte -> [ Mips.ADD(arr_reg, arr_reg, ind_reg) + ; Mips.LB(place, arr_reg, 0) ] + | ESWord -> [ Mips.SLL(ind_reg, ind_reg, 2) + ; Mips.ADD(arr_reg, arr_reg, ind_reg) + ; Mips.LW(place, arr_reg, 0) ] + ind_code @ init_code @ check_code @ load_code + + (* Second-Order Array Combinators (SOACs): + iota, map, reduce + *) + | Iota (n_exp, (line, _)) -> + let size_reg = newReg "size_reg" + let n_code = compileExp n_exp vtable size_reg + (* size_reg is now the integer n. *) + + (* Check that array size N >= 0: + if N >= 0 then jumpto safe_lab + jumpto "_IllegalArrSizeError_" + safe_lab: ... + *) + let safe_lab = newLab "safe_lab" + let checksize = [ Mips.BGEZ (size_reg, safe_lab) + ; Mips.LI (RN5, line) + ; Mips.LA (RN6, "_Msg_IllegalArraySize_") + ; Mips.J "_RuntimeError_" + ; Mips.LABEL (safe_lab) + ] + + let addr_reg = newReg "addr_reg" + let i_reg = newReg "i_reg" + let init_regs = [ Mips.ADDI (addr_reg, place, 4) + ; Mips.MOVE (i_reg, RZ) ] + (* addr_reg is now the position of the first array element. *) + + (* Run a loop. Keep jumping back to loop_beg until it is not the + case that i_reg < size_reg, and then jump to loop_end. *) + let loop_beg = newLab "loop_beg" + let loop_end = newLab "loop_end" + let tmp_reg = newReg "tmp_reg" + let loop_header = [ Mips.LABEL (loop_beg) + ; Mips.SUB (tmp_reg, i_reg, size_reg) + ; Mips.BGEZ (tmp_reg, loop_end) + ] + (* iota is just 'arr[i] = i'. arr[i] is addr_reg. *) + let loop_iota = [ Mips.SW (i_reg, addr_reg, 0) ] + let loop_footer = [ Mips.ADDI (addr_reg, addr_reg, 4) + ; Mips.ADDI (i_reg, i_reg, 1) + ; Mips.J loop_beg + ; Mips.LABEL loop_end + ] + n_code + @ checksize + @ dynalloc (size_reg, place, Int) + @ init_regs + @ loop_header + @ loop_iota + @ loop_footer + + | Map (farg, arr_exp, elem_type, ret_type, pos) -> + let size_reg = newReg "size_reg" (* size of input/output array *) + let arr_reg = newReg "arr_reg" (* address of array *) + let elem_reg = newReg "elem_reg" (* address of single element *) + let res_reg = newReg "res_reg" + let arr_code = compileExp arr_exp vtable arr_reg + + let get_size = [ Mips.LW (size_reg, arr_reg, 0) ] + + let addr_reg = newReg "addr_reg" (* address of element in new array *) + let i_reg = newReg "i_reg" + let init_regs = [ Mips.ADDI (addr_reg, place, 4) + ; Mips.MOVE (i_reg, RZ) + ; Mips.ADDI (elem_reg, arr_reg, 4) + ] + let loop_beg = newLab "loop_beg" + let loop_end = newLab "loop_end" + let tmp_reg = newReg "tmp_reg" + let loop_header = [ Mips.LABEL (loop_beg) + ; Mips.SUB (tmp_reg, i_reg, size_reg) + ; Mips.BGEZ (tmp_reg, loop_end) ] + (* map is 'arr[i] = f(old_arr[i])'. *) + let src_size = getElemSize elem_type + let dst_size = getElemSize ret_type + let loop_map = + [ mipsLoad src_size (res_reg, elem_reg, 0) + ; Mips.ADDI(elem_reg, elem_reg, elemSizeToInt src_size) + ] + @ applyFunArg(farg, [res_reg], vtable, res_reg, pos) + @ + [ mipsStore dst_size (res_reg, addr_reg, 0) + ; Mips.ADDI (addr_reg, addr_reg, elemSizeToInt dst_size) + ] + + let loop_footer = + [ Mips.ADDI (i_reg, i_reg, 1) + ; Mips.J loop_beg + ; Mips.LABEL loop_end + ] + arr_code + @ get_size + @ dynalloc (size_reg, place, ret_type) + @ init_regs + @ loop_header + @ loop_map + @ loop_footer + + (* reduce(f, acc, {x1, x2, ...xn}) = f(f(f(acc,x1),x2),...xn) *) + | Reduce (binop, acc_exp, arr_exp, tp, pos) -> + let arr_reg = newReg "arr_reg" (* address of array *) + let size_reg = newReg "size_reg" (* size of input array *) + let i_reg = newReg "ind_var" (* loop counter *) + let tmp_reg = newReg "tmp_reg" (* several purposes *) + let loop_beg = newLab "loop_beg" + let loop_end = newLab "loop_end" + + let arr_code = compileExp arr_exp vtable arr_reg + let header1 = [ Mips.LW(size_reg, arr_reg, 0) ] + + (* Compile initial value into place (will be updated below) *) + let acc_code = compileExp acc_exp vtable place + + (* Set arr_reg to address of first element instead. *) + (* Set i_reg to 0. While i < size_reg, loop. *) + let loop_code = + [ Mips.ADDI(arr_reg, arr_reg, 4) + ; Mips.MOVE(i_reg, RZ) + ; Mips.LABEL(loop_beg) + ; Mips.SUB(tmp_reg, i_reg, size_reg) + ; Mips.BGEZ(tmp_reg, loop_end) + ] + (* Load arr[i] into tmp_reg *) + let elem_size = getElemSize tp + let load_code = + [ mipsLoad elem_size (tmp_reg, arr_reg, 0) + ; Mips.ADDI (arr_reg, arr_reg, elemSizeToInt elem_size) + ] + (* place := binop(place, tmp_reg) *) + let apply_code = + applyFunArg(binop, [place; tmp_reg], vtable, place, pos) + + arr_code @ header1 @ acc_code @ loop_code @ load_code @ apply_code @ + [ Mips.ADDI(i_reg, i_reg, 1) + ; Mips.J loop_beg + ; Mips.LABEL loop_end + ] + + (* TODO project task 2: + `replicate (n, a)` + `filter (f, arr)` + `scan (f, ne, arr)` + Look in `AbSyn.fs` for the shape of expression constructors + `Replicate`, `Filter`, `Scan`. + General Hint: write down on a piece of paper the C-like pseudocode + for implementing them, then translate that to Mips pseudocode. + To allocate heap space for an array you may use `dynalloc` defined + above. For example, if `sz_reg` is a register containing an integer `n`, + and `ret_type` is the element-type of the to-be-allocated array, then + `dynalloc (sz_reg, arr_reg, ret_type)` will alocate enough space for + an n-element array of element-type `ret_type` (including the first + word that holds the length, and the necessary allignment padding), and + will place in register `arr_reg` the start address of the new array. + Since you need to allocate space for the result arrays of `Replicate`, + `Map` and `Scan`, then `arr_reg` should probably be `place` ... + + `replicate(n,a)`: You should allocate a new (result) array, and execute a + loop of count `n`, in which you store the value hold into the register + corresponding to `a` into each memory location corresponding to an + element of the result array. + If `n` is less than `0` then remember to terminate the program with + an error -- see implementation of `iota`. + *) + | Replicate (_, _, _, _) -> + failwith "Unimplemented code generation of replicate" + + (* TODO project task 2: see also the comment to replicate. + (a) `filter(f, arr)`: has some similarity with the implementation of map. + (b) Use `applyFunArg` to call `f(a)` in a loop, for every element `a` of `arr`. + (c) If `f(a)` succeeds (result in the `true` value) then (and only then): + - set the next element of the result array to `a`, and + - increment a counter (initialized before the loop) + (d) It is useful to maintain two array iterators: one for the input array `arr` + and one for the result array. (The latter increases slower because + some of the elements of the input array are skipped because they fail + under the predicate). + (e) The last step (after the loop writing the elments of the result array) + is to update the logical size of the result array to the value of the + counter computed in step (c). You do this of course with a + `Mips.SW(counter_reg, place, 0)` instruction. + *) + | Filter (_, _, _, _) -> + failwith "Unimplemented code generation of filter" + + (* TODO project task 2: see also the comment to replicate. + `scan(f, ne, arr)`: you can inspire yourself from the implementation of + `reduce`, but in the case of `scan` you will need to also maintain + an iterator through the result array, and write the accumulator in + the current location of the result iterator at every iteration of + the loop. + *) + | Scan (_, _, _, _, _) -> + failwith "Unimplemented code generation of scan" + +and applyFunArg ( ff : TypedFunArg + , args : Mips.reg list + , vtable : VarTable + , place : Mips.reg + , pos : Position + ) : Mips.Instruction list = + match ff with + | FunName s -> + let tmp_reg = newReg "tmp_reg" + applyRegs(s, args, tmp_reg, pos) @ [Mips.MOVE(place, tmp_reg)] + + | Lambda (_, parms, body, lampos) -> + let rec bindParams parms args vtable' = + match (parms, args) with + | (Param (pname,_)::parms', arg::args') -> + bindParams parms' args' (SymTab.bind pname arg vtable') + | _ -> vtable' + let vtable' = bindParams parms args vtable + let t = newReg "fun_arg_res" + compileExp body vtable' t @ [ Mips.MOVE(place, t) ] + +(* compile condition *) +and compileCond (c : TypedExp) + (vtable : VarTable) + (tlab : Mips.addr) + (flab : Mips.addr) + : Mips.Instruction list = + let t1 = newReg "cond" + let code1 = compileExp c vtable t1 + code1 @ [Mips.BNE (t1, RZ, tlab); Mips.J flab] + +(* compile let declaration *) +and compileDec (dec : TypedDec) + (vtable : VarTable) + : (Mips.Instruction list * VarTable) = + let (Dec (s,e,pos)) = dec + let t = newReg "letBind" + let code = compileExp e vtable t + let new_vtable = SymTab.bind s t vtable + (code, new_vtable) + +(* code for saving and restoring callee-saves registers *) +let rec stackSave (currentReg : int) + (maxReg : int) + (savecode : Mips.Instruction list) + (restorecode : Mips.Instruction list) + (offset : int) + : (Mips.Instruction list * Mips.Instruction list * int) = + if currentReg > maxReg + then (savecode, restorecode, offset) (* done *) + else stackSave (currentReg+1) + maxReg + (Mips.SW (Mips.RN currentReg, SP, offset) + :: savecode) (* save register *) + (Mips.LW (Mips.RN currentReg, SP, offset) + :: restorecode) (* restore register *) + (offset-4) (* adjust offset *) + +(* add function arguments to symbol table *) +and getArgs (parms : Param list) + (vtable : VarTable) + (nextReg : int) + : (Mips.Instruction list * VarTable) = + match parms with + | [] -> ([], vtable) + | (Param (v,_)::vs) -> + if nextReg > maxCaller + then raise (MyError ("Passing too many arguments!", (0,0))) + else let vname = newReg ("param_" + v) + let vtable1 = SymTab.bind v vname vtable (* (v,vname)::vtable *) + let (code2,vtable2) = getArgs vs vtable1 (nextReg + 1) + ([Mips.MOVE (vname, Mips.RN nextReg)] @ code2, vtable2) + +(* compile function declaration *) +and compileFun (fundec : TypedFunDec) : Mips.Prog = + let (FunDec (fname, resty, args, exp, (line,col))) = fundec + (* make a vtable from bound formal parameters, + then evaluate expression in this context, return it *) + (* arguments passed in registers, "move" into local vars. *) + let (argcode, vtable_local) = getArgs args (SymTab.empty ()) minReg + (* return value in register 2 *) + let rtmp = newReg (fname + "res") + let returncode = [Mips.MOVE (RN2,rtmp)] (* move return val to R2 *) + let body = compileExp exp vtable_local rtmp (* target expr *) + let (body1, _, maxr, spilled) = + RegAlloc.registerAlloc (* call register allocator *) + (argcode @ body @ returncode) + (Set.singleton (RN2)) 2 maxCaller maxReg 0 + let (savecode, restorecode, offset) = (* save/restore callee-saves *) + stackSave (maxCaller+1) maxr [] [] (-8 + (-4 * spilled)) + [Mips.COMMENT ("Function " + fname); + Mips.LABEL fname; (* function label *) + Mips.SW (RA, SP, -4)] (* save return address *) + @ savecode (* save callee-saves registers *) + @ [Mips.ADDI (SP,SP,offset)] (* SP adjustment *) + @ body1 (* code for function body *) + @ [Mips.ADDI (SP,SP,-offset)] (* move SP up *) + @ restorecode (* restore callee-saves registers *) + @ [Mips.LW (RA, SP, -4); (* restore return addr *) + Mips.JR (RA, [])] (* return *) + + +(* compile program *) +let compile (funs : TypedProg) : Mips.Instruction list = + let () = stringTable := [("_true","true"); ("_false","false")] + let funsCode = List.concat (List.map compileFun funs) + let (stringinit_sym, stringdata) = + List.unzip (List.map buildString (!stringTable)) + let (stringinit,_,_,_) = + match stringinit_sym with + | [] -> ([],Set.empty,0,0) + | _ -> RegAlloc.registerAlloc (* call register allocator *) + (List.concat stringinit_sym) + (Set.singleton (RN2)) 2 maxCaller maxReg 0 + let mips_prog = + [Mips.TEXT "0x00400000"; + Mips.GLOBL "main"] + (* initialisation: heap pointer and string pointers *) + @ (Mips.LA (HP, "_heap_"):: stringinit) + (* jump to main (and stop after returning) *) + @ [Mips.JAL ("main",[])] + @ (* stop code *) + [Mips.LABEL "_stop_"; + Mips.LI (RN2, sysExit); + Mips.SYSCALL] + @ (* code for functions *) + funsCode + (* pre-defined ord: char -> int and chr: int -> char *) + @ [Mips.LABEL "ord"; (* char returned unmodified, interpreted as int *) + Mips.JR (RA,[]); + Mips.LABEL "chr"; (* int values are truncated to 8 bit (ASCII), *) + Mips.ANDI (RN2, RN2, 255); + Mips.JR (RA,[])] + (* built-in read and write functions *) + @ [Mips.LABEL "putint"; (* putint function *) + Mips.ADDI(SP,SP,-8); + Mips.SW (RN2,SP,0); (* save used registers *) + Mips.SW (RN4,SP,4); + Mips.MOVE (RN4, RN2); (* convention: number to be written in r2 *) + Mips.LI (RN2, sysPrintInt); + Mips.SYSCALL; + Mips.LI (RN2, sysPrintString); + Mips.LA(RN4,"_space_"); + Mips.SYSCALL; (* write CR *) + Mips.LW (RN2,SP,0); (* reload used registers *) + Mips.LW (RN4,SP,4); + Mips.ADDI(SP,SP,8); + Mips.JR (RA,[]); + + Mips.LABEL "getint"; (* getint function *) + Mips.LI (RN2,sysReadInt); + Mips.SYSCALL; + Mips.JR (RA,[])] + @ (* putchar *) + [ Mips.LABEL "putchar"; + Mips.ADDI(SP,SP,-8); (* make space for 2 registers on the stack *) + Mips.SW (RN2,SP,0); (* save registers $2 and $4 to stack *) + Mips.SW (RN4,SP,4); + Mips.MOVE (RN4, RN2); (* put char in $4 for syscall to work on *) + Mips.LI(RN2, sysPrintChar); + Mips.SYSCALL; + Mips.LI (RN2, sysPrintString); + Mips.LA(RN4,"_space_"); (* the string we'll write is a space *) + Mips.SYSCALL; + Mips.LW (RN2,SP,0); (* reload registers $2 and $4 from stack *) + Mips.LW (RN4,SP,4); + Mips.ADDI(SP,SP,8); (* free stack space again *) + Mips.JR (RA,[]) + ] + @ (* getchar *) + [ Mips.LABEL "getchar"; + Mips.ADDI(SP,SP,-8); (* make space for 2 registers on the stack *) + Mips.SW (RN4,SP,0); (* save registers $4 and $5 to stack *) + Mips.SW (RN5,SP,4); + Mips.LI(RN2, sysReadChar); + Mips.SYSCALL; + Mips.MOVE(RN5,RN2); (* temporarily move the result in reg $5*) + Mips.LI (RN2, sysPrintString); + Mips.LA(RN4,"_cr_"); + Mips.SYSCALL; (* write CR *) + Mips.MOVE(RN2, RN5); (* put the result back in $2*) + Mips.LW (RN4, SP, 0); (* restore registers *) + Mips.LW (RN5, SP, 4); + Mips.ADDI(SP,SP,8); (* free stack space again *) + Mips.JR (RA,[]) + ] + @ (* putstring *) + [ Mips.LABEL "putstring"; + Mips.ADDI(SP, SP, -16); (* make space on stack for registers *) + Mips.SW (RN2, SP, 0); (* save registers $2,$4,$5,$6 to stack *) + Mips.SW (RN4, SP, 4); + Mips.SW (RN5, SP, 8); + Mips.SW (RN6, SP, 12); + Mips.LW (RN4, RN2, 0); (* $4 := size($2) *) + Mips.ADDI(RN5, RN2, 4); (* $5 := $2 + 4 *) + Mips.ADD (RN6, RN5, RN4); (* $6 := $5 + $4 *) + Mips.LI (RN2, sysPrintChar); + Mips.LABEL "putstring_begin"; + Mips.SUB (RN4, RN5, RN6); (* while ($5 < $6) { *) + Mips.BGEZ(RN4, "putstring_done"); (* *) + Mips.LB(RN4, RN5, 0); (* $4 := M[$5] *) + Mips.SYSCALL; (* putchar($4) *) + Mips.ADDI(RN5, RN5, 1); (* $5 := $5 + 1 *) + Mips.J "putstring_begin"; (* } *) + Mips.LABEL "putstring_done"; + Mips.LW (RN2, SP, 0); (* restore registers $2,$4,$5,$6 *) + Mips.LW (RN4, SP, 4); + Mips.LW (RN5, SP, 8); + Mips.LW (RN6, SP, 12); + Mips.ADDI(SP, SP, 16); (* free stack space again *) + Mips.JR (RA,[]) + ] + @ (* Fixed code for reporting runtime errors. + expects source line number in $5, pointer to error message in $6 *) + [Mips.LABEL "_RuntimeError_"; + Mips.LA (RN4, "_ErrMsg_"); + Mips.LI (RN2, sysPrintString); Mips.SYSCALL; + Mips.MOVE (RN4, RN5); + Mips.LI (RN2, sysPrintInt); Mips.SYSCALL; + Mips.LA (RN4, "_colon_space_"); + Mips.LI (RN2, sysPrintString); Mips.SYSCALL; + Mips.MOVE (RN4, RN6); + Mips.LI (RN2, sysPrintString); Mips.SYSCALL; + Mips.LA (RN4, "_cr_"); + Mips.LI (RN2, sysPrintString); Mips.SYSCALL; + Mips.J "_stop_"] + @ + [Mips.DATA ""; + Mips.COMMENT "Fixed strings for I/O"; + Mips.LABEL "_ErrMsg_"; + Mips.ASCIIZ "Runtime error at line "; + Mips.LABEL "_colon_space_"; + Mips.ASCIIZ ": "; + Mips.LABEL "_cr_"; + Mips.ASCIIZ "\n"; + Mips.LABEL "_space_"; + Mips.ASCIIZ " "] + @ + [Mips.COMMENT "Message strings for specific errors"; + Mips.LABEL "_Msg_IllegalArraySize_"; + Mips.ASCIIZ "negative array size"; + Mips.LABEL "_Msg_IllegalIndex_"; + Mips.ASCIIZ "array index out of bounds" + Mips.LABEL "_Msg_DivZero_"; + Mips.ASCIIZ "division by zero" + ] + @ (* String literals *) + (Mips.COMMENT "String Literals" :: + List.concat stringdata) + (* Heap (to allocate arrays in, word-aligned) *) + @ [Mips.ALIGN 2; + Mips.LABEL "_heap_"; + Mips.SPACE 100000] + mips_prog diff --git a/W1/fasto/Fasto/CopyConstPropFold.fs b/W1/fasto/Fasto/CopyConstPropFold.fs new file mode 100644 index 0000000..0afe02f --- /dev/null +++ b/W1/fasto/Fasto/CopyConstPropFold.fs @@ -0,0 +1,208 @@ +module CopyConstPropFold + + +(* + (* An optimisation takes a program and returns a new program. *) + val optimiseProgram : Fasto.KnownTypes.Prog -> Fasto.KnownTypes.Prog +*) + +open AbSyn + +(* A propagatee is something that we can propagate - either a variable + name or a constant value. *) +type Propagatee = + ConstProp of Value + | VarProp of string + +type VarTable = SymTab.SymTab + +let rec copyConstPropFoldExp (vtable : VarTable) + (e : TypedExp) = + match e with + (* Copy propagation is handled entirely in the following three + cases for variables, array indexing, and let-bindings. *) + | Var (name, pos) -> + (* TODO project task 3: + Should probably look in the symbol table to see if + a binding corresponding to the current variable `name` + exists and if so, it should replace the current expression + with the variable or constant to be propagated. + *) + failwith "Unimplemented copyConstPropFold for Var" + | Index (name, e, t, pos) -> + (* TODO project task 3: + Should probably do the same as the `Var` case, for + the array name, and optimize the index expression `e` as well. + *) + failwith "Unimplemented copyConstPropFold for Index" + | Let (Dec (name, e, decpos), body, pos) -> + let e' = copyConstPropFoldExp vtable e + match e' with + | Var (_, _) -> + (* TODO project task 3: + Hint: I have discovered a variable-copy statement `let x = a`. + I should probably record it in the `vtable` by + associating `x` with a variable-propagatee binding, + and optimize the `body` of the let. + *) + failwith "Unimplemented copyConstPropFold for Let with Var" + | Constant (_, _) -> + (* TODO project task 3: + Hint: I have discovered a constant-copy statement `let x = 5`. + I should probably record it in the `vtable` by + associating `x` with a constant-propagatee binding, + and optimize the `body` of the let. + *) + failwith "Unimplemented copyConstPropFold for Let with Constant" + | Let (_, _, _) -> + (* TODO project task 3: + Hint: this has the structure + `let y = (let x = e1 in e2) in e3` + Problem is, in this form, `e2` may simplify + to a variable or constant, but I will miss + identifying the resulting variable/constant-copy + statement on `y`. + A potential solution is to optimize directly the + restructured, semantically-equivalent expression: + `let x = e1 in let y = e2 in e3` + *) + failwith "Unimplemented copyConstPropFold for Let with Let" + | _ -> (* Fallthrough - for everything else, do nothing *) + let body' = copyConstPropFoldExp vtable body + Let (Dec (name, e', decpos), body', pos) + + | Times (_, _, _) -> + (* TODO project task 3: implement as many safe algebraic + simplifications as you can think of. You may inspire + yourself from the case of `Plus`. For example: + 1 * x = ? + x * 0 = ? + *) + failwith "Unimplemented copyConstPropFold for multiplication" + | And (e1, e2, pos) -> + (* TODO project task 3: see above. You may inspire yourself from + `Or` below, but that only scratches the surface of what's possible *) + failwith "Unimplemented copyConstPropFold for &&" + | Constant (x,pos) -> Constant (x,pos) + | StringLit (x,pos) -> StringLit (x,pos) + | ArrayLit (es, t, pos) -> + ArrayLit (List.map (copyConstPropFoldExp vtable) es, t, pos) + | Plus (e1, e2, pos) -> + let e1' = copyConstPropFoldExp vtable e1 + let e2' = copyConstPropFoldExp vtable e2 + match (e1', e2') with + | (Constant (IntVal x, _), Constant (IntVal y, _)) -> + Constant (IntVal (x + y), pos) + | (Constant (IntVal 0, _), _) -> e2' + | (_, Constant (IntVal 0, _)) -> e1' + | _ -> Plus (e1', e2', pos) + | Minus (e1, e2, pos) -> + let e1' = copyConstPropFoldExp vtable e1 + let e2' = copyConstPropFoldExp vtable e2 + match (e1', e2') with + | (Constant (IntVal x, _), Constant (IntVal y, _)) -> + Constant (IntVal (x - y), pos) + | (_, Constant (IntVal 0, _)) -> e1' + | _ -> Minus (e1', e2', pos) + | Equal (e1, e2, pos) -> + let e1' = copyConstPropFoldExp vtable e1 + let e2' = copyConstPropFoldExp vtable e2 + match (e1', e2') with + | (Constant (IntVal v1, _), Constant (IntVal v2, _)) -> + Constant (BoolVal (v1 = v2), pos) + | _ -> + if false (* e1' = e2' *) (* <- this would be unsafe! (why?) *) + then Constant (BoolVal true, pos) + else Equal (e1', e2', pos) + | Less (e1, e2, pos) -> + let e1' = copyConstPropFoldExp vtable e1 + let e2' = copyConstPropFoldExp vtable e2 + match (e1', e2') with + | (Constant (IntVal v1, _), Constant (IntVal v2, _)) -> + Constant (BoolVal (v1 < v2), pos) + | _ -> + if false (* e1' = e2' *) (* <- as above *) + then Constant (BoolVal false, pos) + else Less (e1', e2', pos) + | If (e1, e2, e3, pos) -> + let e1' = copyConstPropFoldExp vtable e1 + match e1' with + | Constant (BoolVal b, _) -> + if b + then copyConstPropFoldExp vtable e2 + else copyConstPropFoldExp vtable e3 + | _ -> + If (e1', + copyConstPropFoldExp vtable e2, + copyConstPropFoldExp vtable e3, + pos) + | Apply (fname, es, pos) -> + Apply (fname, List.map (copyConstPropFoldExp vtable) es, pos) + | Iota (e, pos) -> + Iota (copyConstPropFoldExp vtable e, pos) + | Replicate (n, e, t, pos) -> + Replicate (copyConstPropFoldExp vtable n, + copyConstPropFoldExp vtable e, + t, pos) + | Map (farg, e, t1, t2, pos) -> + Map (copyConstPropFoldFunArg vtable farg, + copyConstPropFoldExp vtable e, + t1, t2, pos) + | Filter (farg, e, t1, pos) -> + Filter (copyConstPropFoldFunArg vtable farg, + copyConstPropFoldExp vtable e, + t1, pos) + | Reduce (farg, e1, e2, t, pos) -> + Reduce (copyConstPropFoldFunArg vtable farg, + copyConstPropFoldExp vtable e1, + copyConstPropFoldExp vtable e2, + t, pos) + | Scan (farg, e1, e2, t, pos) -> + Scan (copyConstPropFoldFunArg vtable farg, + copyConstPropFoldExp vtable e1, + copyConstPropFoldExp vtable e2, + t, pos) + | Divide (e1, e2, pos) -> + let e1' = copyConstPropFoldExp vtable e1 + let e2' = copyConstPropFoldExp vtable e2 + match (e1', e2') with + | (Constant (IntVal x, _), Constant (IntVal y, _)) when y <> 0 -> + Constant (IntVal (x / y), pos) + | _ -> Divide (e1', e2', pos) + | Or (e1, e2, pos) -> + let e1' = copyConstPropFoldExp vtable e1 + let e2' = copyConstPropFoldExp vtable e2 + match (e1', e2') with + | (Constant (BoolVal a, _), Constant (BoolVal b, _)) -> + Constant (BoolVal (a || b), pos) + | _ -> Or (e1', e2', pos) + | Not (e, pos) -> + let e' = copyConstPropFoldExp vtable e + match e' with + | Constant (BoolVal a, _) -> Constant (BoolVal (not a), pos) + | _ -> Not (e', pos) + | Negate (e, pos) -> + let e' = copyConstPropFoldExp vtable e + match e' with + | Constant (IntVal x, _) -> Constant (IntVal (-x), pos) + | _ -> Negate (e', pos) + | Read (t, pos) -> Read (t, pos) + | Write (e, t, pos) -> Write (copyConstPropFoldExp vtable e, t, pos) + +and copyConstPropFoldFunArg (vtable : VarTable) + (farg : TypedFunArg) = + match farg with + | FunName fname -> FunName fname + | Lambda (rettype, paramls, body, pos) -> + (* Remove any bindings with the same names as the parameters. *) + let paramNames = (List.map (fun (Param (name, _)) -> name) paramls) + let vtable' = SymTab.removeMany paramNames vtable + Lambda (rettype, paramls, copyConstPropFoldExp vtable' body, pos) + +let copyConstPropFoldFunDec = function + | FunDec (fname, rettype, paramls, body, loc) -> + let body' = copyConstPropFoldExp (SymTab.empty ()) body + FunDec (fname, rettype, paramls, body', loc) + +let optimiseProgram (prog : TypedProg) = + List.map copyConstPropFoldFunDec prog diff --git a/W1/fasto/Fasto/DeadBindingRemoval.fs b/W1/fasto/Fasto/DeadBindingRemoval.fs new file mode 100644 index 0000000..4d73ec8 --- /dev/null +++ b/W1/fasto/Fasto/DeadBindingRemoval.fs @@ -0,0 +1,239 @@ +module DeadBindingRemoval + +(* + val removeDeadBindings : Fasto.KnownTypes.Prog -> Fasto.KnownTypes.Prog +*) + +open AbSyn + +type DBRtab = SymTab.SymTab + +let isUsed (name : string) (stab : DBRtab) = + match SymTab.lookup name stab with + | None -> false + | Some _ -> true + +let recordUse (name : string) (stab : DBRtab) = + match SymTab.lookup name stab with + | None -> SymTab.bind name () stab + | Some _ -> stab + +let rec unzip3 = function + | [] -> ([], [], []) + | (x,y,z)::l -> + let (xs, ys, zs) = unzip3 l + (x::xs, y::ys, z::zs) +let anytrue = List.exists (fun x -> x) + +(* Input: the expression to be optimised (by removing inner dead bindings) + The result is a three-tuple: + - bool refers to whether the expression _may_ contain I/O + operations (directly or indirectly). We always err on the safe side; + that is, we only return false if we are certain that + a dead binding to this expression is safe to remove. + - DBRtab is the symbol table that is synthesized from processing the + subexpressions -- its keys are the names that were used in subexpressions. + - the TypedExp is the resulting (optimised) expression + The idea is that you do a bottom-up traversal of AbSyn, and you record + any (variable) names that you find in the symbol table. You find such + names when (1) the expression is a `Var` expression or (2) an `Index` + expression. + Then, whenever you reach a `Let` expression, you check whether the body + of the let has used the variable name currently defined. If not, then + the current binding is unused and can be omitted/removed, _if_ + it contains no I/O operations. For example, assume the original + program is: + `let x = (let y = 4 + 5 in 6) in x * 2` + then one can observe that `y` is unused and the binding `let y = 4 + 5` + can be removed (because `y` is not subsequently used), resulting in the + optimised program: `let x = 6 in x * 2`. + The rest of the expression constructors mainly perform the AbSyn (bottom-up) + traversal by recursively calling `removeDeadBindingsInExp` on subexpressions + and joining the results. +*) +let rec removeDeadBindingsInExp (e : TypedExp) : (bool * DBRtab * TypedExp) = + match e with + | Constant (x, pos) -> (false, SymTab.empty(), Constant (x, pos)) + | StringLit (x, pos) -> (false, SymTab.empty(), StringLit (x, pos)) + | ArrayLit (es, t, pos) -> + let (ios, uses, es') = unzip3 (List.map removeDeadBindingsInExp es) + (anytrue ios, + List.fold SymTab.combine (SymTab.empty()) uses, + ArrayLit (es', t, pos) ) + (* ToDO: Task 3: implement the cases of `Var`, `Index` and `Let` expressions below *) + | Var (name, pos) -> + (* Task 3, Hints for the `Var` case: + - 1st element of result tuple: can a variable name contain IO? + - 2nd element of result tuple: you have discovered a name, hence + you need to record it in a new symbol table. + - 3rd element of the tuple: should be the optimised expression. + *) + failwith "Unimplemented removeDeadBindingsInExp for Var" + | Plus (x, y, pos) -> + let (xios, xuses, x') = removeDeadBindingsInExp x + let (yios, yuses, y') = removeDeadBindingsInExp y + (xios || yios, + SymTab.combine xuses yuses, + Plus (x', y', pos)) + | Minus (x, y, pos) -> + let (xios, xuses, x') = removeDeadBindingsInExp x + let (yios, yuses, y') = removeDeadBindingsInExp y + (xios || yios, + SymTab.combine xuses yuses, + Minus (x', y', pos)) + | Equal (x, y, pos) -> + let (xios, xuses, x') = removeDeadBindingsInExp x + let (yios, yuses, y') = removeDeadBindingsInExp y + (xios || yios, + SymTab.combine xuses yuses, + Equal (x', y', pos)) + | Less (x, y, pos) -> + let (xios, xuses, x') = removeDeadBindingsInExp x + let (yios, yuses, y') = removeDeadBindingsInExp y + (xios || yios, + SymTab.combine xuses yuses, + Less (x', y', pos)) + | If (e1, e2, e3, pos) -> + let (ios1, uses1, e1') = removeDeadBindingsInExp e1 + let (ios2, uses2, e2') = removeDeadBindingsInExp e2 + let (ios3, uses3, e3') = removeDeadBindingsInExp e3 + (ios1 || ios2 || ios3, + SymTab.combine (SymTab.combine uses1 uses2) uses3, + If (e1', e2', e3', pos)) + | Apply (fname, args, pos) -> + let (ios, uses, args') = unzip3 (List.map removeDeadBindingsInExp args) + (* Since we don't currently analyze the body of the called function, + we don't know if it might contain I/O. Thus, we always mark + a function call as non-removable, unless it is to a + known-safe builtin function, such as "length". + (However, if we perform function inlining before removing + dead bindings, being overly cautious here will generally + not cause us to miss many optimization opportunities.) *) + (anytrue ios || fname <> "length", + List.fold SymTab.combine (SymTab.empty()) uses, + Apply (fname, args', pos)) + | Index (name, e, t, pos) -> + (* Task 3, `Index` case: is similar to the `Var` case, except that, + additionally, you also need to recursively optimize the index + expression `e` and to propagate its results (in addition + to recording the use of `name`). + *) + failwith "Unimplemented removeDeadBindingsInExp for Index" + + | Let (Dec (name, e, decpos), body, pos) -> + (* Task 3, Hints for the `Let` case: + - recursively process the `e` and `body` subexpressions + of the Let-binding + - a Let-binding contains IO if at least one of `e` + and `body` does. + - a variable is used in a Let-binding if it is used + in either `e` or `body`, except that any uses in + `body` do not count if they refer to the local + binding of `name`. For example, in + `let x = y+1 in x*z`, + `x` is _not_ considered to be used in the + Let-expression, but `y` and `z` are. Consider how + to express this with the SymTab operations. + - the optimized expression will be either just the + optimized body (if it doesn't use `name` _and_ `e` + does not contain IO), or a new Let-expression + built from the optimized subexpressions + (otherwise). Note that the returned IO-flag and + used-variable table should describe the expression + *resulting* from the optmization, not the original + Let-expression. + + *) + failwith "Unimplemented removeDeadBindingsInExp for Let" + | Iota (e, pos) -> + let (io, uses, e') = removeDeadBindingsInExp e + (io, + uses, + Iota (e', pos)) + | Map (farg, e, t1, t2, pos) -> + let (eio, euses, e') = removeDeadBindingsInExp e + let (fio, fuses, farg') = removeDeadBindingsInFunArg farg + (eio || fio, + SymTab.combine euses fuses, + Map (farg', e', t1, t2, pos)) + | Filter (farg, e, t1, pos) -> + let (eio, euses, e') = removeDeadBindingsInExp e + let (fio, fuses, farg') = removeDeadBindingsInFunArg farg + (eio || fio, + SymTab.combine euses fuses, + Filter (farg', e', t1, pos)) + | Reduce (farg, e1, e2, t, pos) -> + let (io1, uses1, e1') = removeDeadBindingsInExp e1 + let (io2, uses2, e2') = removeDeadBindingsInExp e2 + let (fio, fuses, farg') = removeDeadBindingsInFunArg farg + (io1 || io2 || fio, + SymTab.combine (SymTab.combine uses1 uses2) fuses, + Reduce(farg', e1', e2', t, pos)) + | Replicate (n, e, t, pos) -> + let (nio, nuses, n') = removeDeadBindingsInExp n + let (eio, euses, e') = removeDeadBindingsInExp e + (nio || eio, + SymTab.combine nuses euses, + Replicate (n', e', t, pos)) + | Scan (farg, e1, e2, t, pos) -> + let (io1, uses1, e1') = removeDeadBindingsInExp e1 + let (io2, uses2, e2') = removeDeadBindingsInExp e2 + let (fio, fuses, farg') = removeDeadBindingsInFunArg farg + (io1 || io2 || fio, + SymTab.combine (SymTab.combine uses1 uses2) fuses, + Scan(farg', e1', e2', t, pos)) + | Times (x, y, pos) -> + let (xios, xuses, x') = removeDeadBindingsInExp x + let (yios, yuses, y') = removeDeadBindingsInExp y + (xios || yios, + SymTab.combine xuses yuses, + Times (x', y', pos)) + | Divide (x, y, pos) -> + let (xios, xuses, x') = removeDeadBindingsInExp x + let (yios, yuses, y') = removeDeadBindingsInExp y + (xios || yios, + SymTab.combine xuses yuses, + Divide (x', y', pos)) + | And (x, y, pos) -> + let (xios, xuses, x') = removeDeadBindingsInExp x + let (yios, yuses, y') = removeDeadBindingsInExp y + (xios || yios, + SymTab.combine xuses yuses, + And (x', y', pos)) + | Or (x, y, pos) -> + let (xios, xuses, x') = removeDeadBindingsInExp x + let (yios, yuses, y') = removeDeadBindingsInExp y + (xios || yios, + SymTab.combine xuses yuses, + Or (x', y', pos)) + | Not (e, pos) -> + let (ios, uses, e') = removeDeadBindingsInExp e + (ios, uses, Not (e', pos)) + | Negate (e, pos) -> + let (ios, uses, e') = removeDeadBindingsInExp e + (ios, uses, Negate (e', pos)) + | Read (x, pos) -> + (true, SymTab.empty(), Read (x, pos)) + | Write (e, t, pos) -> + let (_, uses, e') = removeDeadBindingsInExp e + (true, uses, Write (e', t, pos)) + +and removeDeadBindingsInFunArg (farg : TypedFunArg) = + match farg with + | FunName fname -> (false, SymTab.empty(), FunName fname) + | Lambda (rettype, paramls, body, pos) -> + let (io, uses, body') = removeDeadBindingsInExp body + let uses' = List.fold (fun acc (Param (pname,_)) -> + SymTab.remove pname acc + ) uses paramls + (io, + uses', + Lambda (rettype, paramls, body', pos)) + +let removeDeadBindingsInFunDec (FunDec (fname, rettype, paramls, body, pos)) = + let (_, _, body') = removeDeadBindingsInExp body + FunDec (fname, rettype, paramls, body', pos) + +(* Entrypoint: remove dead bindings from the whole program *) +let removeDeadBindings (prog : TypedProg) = + List.map removeDeadBindingsInFunDec prog diff --git a/W1/fasto/Fasto/DeadFunctionRemoval.fs b/W1/fasto/Fasto/DeadFunctionRemoval.fs new file mode 100644 index 0000000..b975748 --- /dev/null +++ b/W1/fasto/Fasto/DeadFunctionRemoval.fs @@ -0,0 +1,10 @@ +module DeadFunctionRemoval + +open AbSyn +open CallGraph + +let removeDeadFunction (prog : TypedProg) = + let graph = callGraph prog + let alive (FunDec (fname, _, _, _, _)) = + fname = "main" || calls "main" fname graph + List.filter alive prog diff --git a/W1/fasto/Fasto/Fasto.fsproj b/W1/fasto/Fasto/Fasto.fsproj new file mode 100644 index 0000000..c4c05c1 --- /dev/null +++ b/W1/fasto/Fasto/Fasto.fsproj @@ -0,0 +1,38 @@ + + + + Exe + net6.0 + + + + + + + + + -v --module Parser + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/W1/fasto/Fasto/Fasto.fsx b/W1/fasto/Fasto/Fasto.fsx new file mode 100644 index 0000000..32a0840 --- /dev/null +++ b/W1/fasto/Fasto/Fasto.fsx @@ -0,0 +1,252 @@ +// The Fasto compiler command-line interface. +// +// This is the main program for when this compiler is turned into an executable. +// It ties together all the compiler modules. You can build the compiler by +// running 'make' or 'dotnet build Fasto' in the top-level directory. + +open System.Text +open FSharp.Text.Lexing +open System.IO + +open AbSyn +open Inlining +open DeadFunctionRemoval +open DeadBindingRemoval +open CopyConstPropFold + + +// YOU DO NOT NEED TO UNDERSTAND THIS; IT IS A HACK: State machine for getting +// line and position numbers from a Parser error string. This is really nasty. +// The problem is that we can only define the needed 'parse_error_rich' function +// in Parser.fsp at the top of the file, which means that we have not defined +// the actual tokens yet, so we cannot pattern match on them for extracting +// their source code positions, although we *can* print them. An alternative +// solution is to inject a proper 'parse_error_rich' function in the bottom of +// the generated Parser.fs. +exception SyntaxError of int * int +let printPos (errString : string) : unit = + let rec state3 (s : string) (p : int) (lin : string) (col : int) = + (* read digits until not *) + let c = s.[p] + if System.Char.IsDigit c + then state3 s (p-1) (System.Char.ToString c + lin) col + else raise (SyntaxError (System.Int32.Parse lin, col)) + + let rec state2 (s : string) (p : int) (col : string) = + (* skip from position until digit *) + let c = s.[p] + if System.Char.IsDigit c + then state3 s (p-1) (System.Char.ToString c) (System.Int32.Parse col) + else state2 s (p-1) col + + let rec state1 (s : string) (p : int) (col : string) = + (* read digits until not *) + let c = s.[p] + if System.Char.IsDigit c + then state1 s (p-1) (System.Char.ToString c + col) + else state2 s (p-1) col + + let rec state0 (s : string) (p : int) = + (* skip from end until digit *) + let c = s.[p] + if System.Char.IsDigit c + then state1 s (p-1) (System.Char.ToString c) + else state0 s (p-1) + + state0 errString (String.length errString - 1) + +// Parse program from string. +let parseString (s : string) : AbSyn.UntypedProg = + Parser.Prog Lexer.Token + <| LexBuffer<_>.FromBytes (Encoding.UTF8.GetBytes s) + +//////////////////// +/// Usage helper /// +//////////////////// +let usage = + [ " fasto -i tests/fib.fo\n" + ; " Run 'fib.fo' in the 'tests' directory in interpreted mode.\n" + ; " and print the result.\n" + ; "\n" + ; " fasto -r tests/fib.fo\n" + ; " Run 'fib.fo' in interpreted mode, but do not print the result.\n" + ; "\n" + ; " fasto -c tests/fib.fo\n" + ; " Compile 'tests/fib.fo' into the MIPS program 'tests/fib.asm'.\n" + ; "\n" + ; " fasto -o [opts] tests/fib.fo\n" + ; " Compile the optimised 'tests/fib.fo' into 'tests/fib.asm'.\n" + ; "\n" + ; " fasto -p [opts] tests/fib.fo\n" + ; " Optimise 'tests/fib.fo' and print the result on standard output.\n" + ; " is a sequence of characters corresponding to optimisation\n" + ; " passes, where: \n" + ; " i - Inline functions.\n" + ; " c - Copy propagation and constant folding.\n" + ; " d - Remove dead bindings.\n" + ; " D - Remove dead functions.\n" + ] + + +// Print error message to the standard error channel. +let errorMessage (message : string) : Unit = + printfn "%s\n" message + +let errorMessage' (errorType : string, message : string, line : int, col : int) = + printfn "%s: %s at line %d, column %d" errorType message line col + +let bad () : Unit = + errorMessage "Unknown command-line arguments. Usage:\n" + errorMessage (usage |> List.fold (+) "") + +exception FileProblem of string + +// Remove trailing .fo from filename. +let sanitiseFilename (argFilename : string) : string = + if argFilename.EndsWith ".fo" + then argFilename.Substring(0, (String.length argFilename)-3) + else argFilename + +// Save the content of a string to file. +let saveFile (filename : string) (content : string) : Unit = + try + let outFile = File.CreateText filename + // Generate code here. + outFile.Write content + outFile.Close() + with + | ex -> + printfn "Problem writing file named: %s, error: %s,\n where content is:\n %s\n" filename ex.Message content + System.Environment.Exit 1 + + +let parseFastoFile (filename : string) : AbSyn.UntypedProg = + let txt = try // read text from file given as parameter with added extension + let inStream = File.OpenText (filename + ".fo") + let txt = inStream.ReadToEnd() + inStream.Close() + txt + with // or return empty string + | ex -> "" + if txt <> "" then // valid file content + let program = + try + parseString txt + with + | Lexer.LexicalError (info,(line,col)) -> + printfn "%s at line %d, position %d\n" info line col + System.Environment.Exit 1 + [] + | ex -> + if ex.Message = "parse error" + then printPos Parser.ErrorContextDescriptor + else printfn "%s" ex.Message + System.Environment.Exit 1 + [] + program + else failwith "Invalid file name or empty file" + +let compile (filename : string) optimiser : Unit = + let pgm = parseFastoFile filename + let pgm_decorated = TypeChecker.checkProg pgm + let pgm_optimised = optimiser pgm_decorated + let mips_code = CodeGen.compile pgm_optimised + let mips_code_text = Mips.ppMipsProg mips_code + saveFile (filename + ".asm") mips_code_text + +let interpret (filename : string) : Unit = + let pgm = parseFastoFile filename + printfn "Program is:\n\n%s" (AbSyn.ppProg pgm) + printfn "\n+-----------------------------------------+" + printfn "\n| You might need to enter some input now. |" + printfn "\n+-----------------------------------------+" + printfn "\n" + let res = Interpreter.evalProg pgm + printfn "\n\nResult of 'main': %s\n" (AbSyn.ppVal 0 res) + +let interpretSimple (filename : string) : AbSyn.Value = + let pgm = parseFastoFile filename + Interpreter.evalProg pgm + +let printOptimised (argFilename : string) optimiser : Unit = + let pgm = parseFastoFile argFilename + let pgm_decorated = TypeChecker.checkProg pgm + let pgm_optimised = optimiser pgm_decorated + printfn "%s\n" (ppProg pgm_optimised) + +let withoutOptimisations (prog : TypedProg) = prog + +let defaultOptimisations (prog : TypedProg) = + (removeDeadFunction << + removeDeadBindings << + optimiseProgram << + inlineOptimiseProgram) prog + +type opt = char + +let rec extractOpts (opts : opt list) = + match opts with + | [] -> Some (fun x -> x) + | opt::opls -> + let extractOpt (op : opt) = + match op with + | 'i' -> Some inlineOptimiseProgram + | 'c' -> Some optimiseProgram + | 'd' -> Some removeDeadBindings + | 'D' -> Some removeDeadFunction + | _ -> None + match (extractOpt opt, extractOpts opls) with + | (Some opt', Some opts') -> Some (fun x -> opts' (opt' x)) + | _ -> None + +let explode (s:string) = + [for c in s -> c] + +[] +let main (paramList: string[]) : int = + try + match paramList with + | [|"-i"; file|] -> interpret (sanitiseFilename file) + | [|"-r"; file|] -> let res = interpretSimple (sanitiseFilename file) + printfn "\n\nResult of 'main': %s\n" (AbSyn.ppVal 0 res) + | [|"-c"; file|] -> compile (sanitiseFilename file) (fun x -> x) + | [|"-o"; file|] -> compile (sanitiseFilename file) defaultOptimisations + | [|"-o"; opts; file|] -> + match extractOpts (explode opts) with + | Some (opts') -> compile (sanitiseFilename file) opts' + | None -> bad () + | [|"-P"; file|] -> + printOptimised (sanitiseFilename file) withoutOptimisations + | [|"-p"; file|] -> + printOptimised (sanitiseFilename file) defaultOptimisations + | [|"-p"; opts; file|] -> + match extractOpts (explode opts) with + | Some (opts') -> printOptimised (sanitiseFilename file) opts' + | None -> bad () + | _ -> bad () + 0 + with + | SyntaxError (line, col) -> + errorMessage' ("Parse error", "Error", line, col) + System.Environment.Exit 1 + 1 + | Lexer.LexicalError (message, (line, col)) -> + errorMessage' ("Lexical error", message, line, col) + System.Environment.Exit 1 + 1 + | Interpreter.MyError (message, (line, col)) -> + errorMessage' ("Interpreter error", message, line, col) + System.Environment.Exit 1 + 1 + | CodeGen.MyError (message, (line, col)) -> + errorMessage' ("Code generator error", message, line, col) + System.Environment.Exit 1 + 1 + | TypeChecker.MyError (message, (line, col)) -> + errorMessage' ("Type error", message, line, col) + System.Environment.Exit 1 + 1 + | FileProblem filename -> + errorMessage ("There was a problem with the file: " + filename) + System.Environment.Exit 1 + 1 diff --git a/W1/fasto/Fasto/Inlining.fs b/W1/fasto/Fasto/Inlining.fs new file mode 100644 index 0000000..63b3d4a --- /dev/null +++ b/W1/fasto/Fasto/Inlining.fs @@ -0,0 +1,140 @@ +(* We will inline any function that does not call itselt. *) +module Inlining + +open AbSyn +open CallGraph + +let mutable inlining_ctr = 0 (* for generating fresh variable names *) + +let newSuffix () = + inlining_ctr <- inlining_ctr + 1 + "_I" + string inlining_ctr + +let rec inlineInExp (graph : CallGraph) + (prog : TypedProg) + (e : TypedExp) = + match e with + | Constant _ -> e + | StringLit _ -> e + | ArrayLit (es, t, pos) -> + ArrayLit (List.map (inlineInExp graph prog) es, t, pos) + | Var _ -> e + | Plus (e1, e2, pos) -> + Plus (inlineInExp graph prog e1, + inlineInExp graph prog e2, pos) + | Minus (e1, e2, pos) -> + Minus (inlineInExp graph prog e1, + inlineInExp graph prog e2, pos) + | Equal (e1, e2, pos) -> + Equal (inlineInExp graph prog e1, + inlineInExp graph prog e2, pos) + | Less (e1, e2, pos) -> + Less (inlineInExp graph prog e1, + inlineInExp graph prog e2, pos) + | If (e1, e2, e3, pos) -> + If (inlineInExp graph prog e1, + inlineInExp graph prog e2, + inlineInExp graph prog e3, + pos) + | Apply (fname, es, pos) -> + if calls fname fname graph then + (* Function is recursive - do not inline. *) + Apply (fname, List.map (inlineInExp graph prog) es, pos) + else (* OK - inline. *) + inlineFuncall fname graph prog es pos + | Let (Dec (name, e, decpos), body, pos) -> + Let (Dec (name, inlineInExp graph prog e, decpos), + inlineInExp graph prog body, + pos) + | Index (name, e, t, pos) -> + Index (name, inlineInExp graph prog e, t, pos) + | Iota (e, pos) -> + Iota (e, pos) + | Map (farg, e, t1, t2, pos) -> + Map (inlineInFunArg graph prog farg, + inlineInExp graph prog e, + t1, t2, pos) + | Filter (farg, e, t1, pos) -> + Filter (inlineInFunArg graph prog farg, + inlineInExp graph prog e, + t1, pos) + | Reduce (farg, e1, e2, t, pos) -> + Reduce (inlineInFunArg graph prog farg, + inlineInExp graph prog e1, + inlineInExp graph prog e2, + t, pos) + | Replicate (n, e, t, pos) -> + Replicate (inlineInExp graph prog n, + inlineInExp graph prog e, + t, pos) + | Scan (farg, e1, e2, t, pos) -> + Scan (inlineInFunArg graph prog farg, + inlineInExp graph prog e1, + inlineInExp graph prog e2, + t, pos) + | Times (e1, e2, pos) -> + Times (inlineInExp graph prog e1, + inlineInExp graph prog e2, + pos) + | Divide (e1, e2, pos) -> + Divide (inlineInExp graph prog e1, + inlineInExp graph prog e2, + pos) + | And (e1, e2, pos) -> + And (inlineInExp graph prog e1, + inlineInExp graph prog e2, + pos) + | Or (e1, e2, pos) -> + Or (inlineInExp graph prog e1, + inlineInExp graph prog e2, + pos) + | Not (e, pos) -> + Not (inlineInExp graph prog e, pos) + | Negate (e, pos) -> + Negate (inlineInExp graph prog e, pos) + | Read (t, pos) -> + Read (t, pos) + | Write (e, t, pos) -> + Write (inlineInExp graph prog e, t, pos) + +and inlineInFunArg (graph : CallGraph) + (prog : TypedProg) = function + | Lambda (rettype, paramls, body, pos) -> + Lambda (rettype, paramls, inlineInExp graph prog body, pos) + | FunName fname -> + match List.tryFind (fun (FunDec (x, _, _, _, _)) -> x = fname) prog with + | None -> FunName fname + | Some (FunDec (_, rettype, paramls, body, pos)) -> + inlineInFunArg graph prog (Lambda (rettype, paramls, body, pos)) + +and inlineFuncall (fname : string) + (graph : CallGraph) + (prog : TypedProg) + (args : TypedExp list) + (pos : Position) = + match List.tryFind (fun (FunDec(x, _, _, _, _)) -> x = fname) prog with + | None -> Apply (fname, List.map ( inlineInExp graph prog) args, pos) + | Some (FunDec (_, _, paramls, body, _)) -> + let parNames = List.map (fun (Param (v,t)) -> v) paramls + // let paramBindings = List.zip parNames args (* too simplistic *) + let uniq = newSuffix () (* can use same suffix for all pars *) + let parNames1 = List.map (fun v -> v + uniq) parNames + let paramBindings = + List.zip parNames1 args @ + List.zip parNames (List.map (fun v -> Var (v,pos)) parNames1) + let rec mkLetsAroundBody = function + | [] -> body + | ((paramname, arg) :: rest) -> + Let ( Dec ( paramname, arg, pos), + mkLetsAroundBody rest, + pos) + inlineInExp graph prog (mkLetsAroundBody paramBindings) + +let inlineInFunction (graph : CallGraph) + (prog : TypedProg) + (FunDec (fname, rettype, paramls, body, pos)) = + FunDec (fname, rettype, paramls, inlineInExp graph prog body, pos) + +let inlineOptimiseProgram (prog : TypedProg) = + let graph = callGraph prog + List.map (inlineInFunction graph prog) prog diff --git a/W1/fasto/Fasto/Interpreter.fs b/W1/fasto/Fasto/Interpreter.fs new file mode 100644 index 0000000..4d4ae4b --- /dev/null +++ b/W1/fasto/Fasto/Interpreter.fs @@ -0,0 +1,376 @@ +(* An interpreter for Fasto. *) + +module Interpreter + +(* + +An interpreter executes a (Fasto) program by inspecting the abstract syntax +tree of the program, and doing what needs to be done in another programming +language (F#). + +As mentioned in AbSyn.fs, some Fasto expressions are implicitly typed. The +interpreter infers the missing types, and checks the types of the operands +before performing any Fasto operation. Some type errors might still occur though. + +Any valid Fasto program must contain a "main" function, which is the entry +point of the program. The return value of this function is the result of the +Fasto program. + +The main function of interest in this module is: + + val evalProg : AbSyn.UntypedProg -> AbSyn.Value + +*) + +open System +open AbSyn + +(* An exception for reporting run-time errors. *) +exception MyError of string * Position + +type FunTable = SymTab.SymTab +type VarTable = SymTab.SymTab + +(* Build a function table, which associates a function names with function + declarations. *) +let rec buildFtab (fdecs : UntypedFunDec list) : FunTable = + match fdecs with + | [] -> let p = (0, 0) + let ch = 'a' + let fdec_chr = FunDec ("chr", Char, [Param ("n", Int) ], Constant (CharVal ch, p), p) + let fdec_ord = FunDec ("ord", Int, [Param ("c", Char)], Constant (IntVal 1, p), p) + SymTab.fromList [("chr", fdec_chr); ("ord", fdec_ord)] + | ( fdcl::fs ) -> + (* Bind the user-defined functions, in reverse order. *) + let fid = getFunName fdcl + let pos = getFunPos fdcl + let ftab = buildFtab fs + match SymTab.lookup fid ftab with + | None -> SymTab.bind fid fdcl ftab + | Some ofdecl -> + (* Report the first occurrence of the name. *) + raise (MyError ("Already defined function: "+fid, getFunPos ofdecl)) + +(* Check whether a value matches a type. *) +let rec typeMatch (tpval : Type * Value) : bool = + match tpval with + | ( Int, IntVal _ ) -> true + | ( Bool, BoolVal _) -> true + | ( Char, CharVal _) -> true + | ( Array t, ArrayVal (vals, tp) ) -> + (t = tp) && (List.map (fun value -> typeMatch (t, value)) vals |> List.fold (&&) true) + | (_, _) -> false + +let reportBadType (str : string) + (want : string) + (v : Value) + (pos : Position) = + let msg = "Bad type for " + str + ": expected " + want + ", but got " + + ppType (valueType v) + " (" + (ppVal 0 v) + ")" + raise (MyError(msg, pos)) + +let reportWrongType str tp v pos = reportBadType str (ppType tp) v pos + +let reportNonArray str v pos = reportBadType str "an array" v pos + +(* Bind the formal parameters of a function declaration to actual parameters in + a new vtab. *) + +let rec bindParams (fargs : Param list) + (aargs : Value list) + (fid : String) + (pdec : Position) + (pcall : Position) : VarTable = + match (fargs, aargs) with + | ([], []) -> SymTab.empty () + | (Param (faid, fatp) :: fargs, v :: aargs) -> + let vtab = bindParams fargs aargs fid pdec pcall + if typeMatch(fatp, v) + then match SymTab.lookup faid vtab with + None -> SymTab.bind faid v vtab + | Some m -> raise (MyError( "Formal argument is already in symbol table!"+ + " In function: "+fid+" formal argument: "+faid + , pdec )) + else reportWrongType ("argument " + faid + " of function " + fid) + fatp v pcall + | (_, _) -> raise (MyError("Number of formal and actual params do not match in call to "+fid, + pcall)) + + +(* Interpreter for Fasto expressions: + 1. vtab holds bindings between variable names and + their interpreted value (Fasto.Value). + 2. ftab holds bindings between function names and + function declarations (Fasto.FunDec). + 3. Returns the interpreted value. *) +let rec evalExp (e : UntypedExp, vtab : VarTable, ftab : FunTable) : Value = + match e with + | Constant (v,_) -> v + | ArrayLit (l, t, pos) -> + let els = (List.map (fun x -> evalExp(x, vtab, ftab)) l) + let elt = match els with + | [] -> Int (* Arbitrary *) + | v::_ -> valueType v + ArrayVal (els, elt) + | StringLit(s, pos) -> + let cvs = List.map (fun c -> CharVal c) (Seq.toList s) + ArrayVal (cvs, Char) + | Var(id, pos) -> + let res = SymTab.lookup id vtab + match res with + | None -> raise (MyError("Unknown variable "+id, pos)) + | Some m -> m + | Plus(e1, e2, pos) -> + let res1 = evalExp(e1, vtab, ftab) + let res2 = evalExp(e2, vtab, ftab) + match (res1, res2) with + | (IntVal n1, IntVal n2) -> IntVal (n1+n2) + | (IntVal _, _) -> reportWrongType "right operand of +" Int res2 (expPos e2) + | (_, _) -> reportWrongType "left operand of +" Int res1 (expPos e1) + | Minus(e1, e2, pos) -> + let res1 = evalExp(e1, vtab, ftab) + let res2 = evalExp(e2, vtab, ftab) + match (res1, res2) with + | (IntVal n1, IntVal n2) -> IntVal (n1-n2) + | (IntVal _, _) -> reportWrongType "right operand of -" Int res2 (expPos e2) + | (_, _) -> reportWrongType "left operand of -" Int res1 (expPos e1) + (* TODO: project task 1: + Look in `AbSyn.fs` for the arguments of the `Times` + (`Divide`,...) expression constructors. + Implementation similar to the cases of Plus/Minus. + Try to pattern match the code above. + For `Divide`, remember to check for attempts to divide by zero. + For `And`/`Or`: make sure to implement the short-circuit semantics, + e.g., `And (e1, e2, pos)` should not evaluate `e2` if `e1` already + evaluates to false. + *) + | Times(_, _, _) -> + failwith "Unimplemented interpretation of multiplication" + | Divide(_, _, _) -> + failwith "Unimplemented interpretation of division" + | And (_, _, _) -> + failwith "Unimplemented interpretation of &&" + | Or (_, _, _) -> + failwith "Unimplemented interpretation of ||" + | Not(_, _) -> + failwith "Unimplemented interpretation of not" + | Negate(_, _) -> + failwith "Unimplemented interpretation of negate" + | Equal(e1, e2, pos) -> + let r1 = evalExp(e1, vtab, ftab) + let r2 = evalExp(e2, vtab, ftab) + match (r1, r2) with + | (IntVal n1, IntVal n2) -> BoolVal (n1 = n2) + | (BoolVal b1, BoolVal b2) -> BoolVal (b1 = b2) + | (CharVal c1, CharVal c2) -> BoolVal (c1 = c2) + | (ArrayVal _, _) -> reportBadType "left operand of =" "a base type" r1 pos + | (_, _) -> reportWrongType "right operand of =" (valueType r1) r2 pos + | Less(e1, e2, pos) -> + let r1 = evalExp(e1, vtab, ftab) + let r2 = evalExp(e2, vtab, ftab) + match (r1, r2) with + | (IntVal n1, IntVal n2 ) -> BoolVal (n1 < n2) + | (BoolVal false, BoolVal true) -> BoolVal true + | (BoolVal _, BoolVal _ ) -> BoolVal false + | (CharVal c1, CharVal c2 ) -> BoolVal ( (int c1) < (int c2) ) + | (ArrayVal _, _) -> reportBadType "left operand of <" "a base type" r1 pos + | (_, _) -> reportWrongType "right operand of <" (valueType r1) r2 pos + | If(e1, e2, e3, pos) -> + let cond = evalExp(e1, vtab, ftab) + match cond with + | BoolVal true -> evalExp(e2, vtab, ftab) + | BoolVal false -> evalExp(e3, vtab, ftab) + | other -> reportWrongType "if condition" Bool cond (expPos e1) + //raise (MyError("If condition is not a boolean", pos)) + (* The case of length receives special treatment below *) + | Apply("length", [arg], pos) -> + let evarg = evalExp(arg, vtab, ftab) + match evarg with + | ArrayVal (lst, _) -> IntVal (List.length lst) + | otherwise -> reportNonArray "argument of length" evarg pos + | Apply("length", args, pos) -> + let msg = sprintf "Call to length function expects exactly one arg, given: %i" (List.length args) + raise (MyError(msg, pos)) + (* general case of function application *) + | Apply(fid, args, pos) -> + let evargs = List.map (fun e -> evalExp(e, vtab, ftab)) args + match (SymTab.lookup fid ftab) with + | Some f -> callFunWithVtable(f, evargs, SymTab.empty(), ftab, pos) + | None -> raise (MyError("Call to unknown function "+fid, pos)) + | Let(Dec(id,e,p), exp, pos) -> + let res = evalExp(e, vtab, ftab) + let nvtab = SymTab.bind id res vtab + evalExp(exp, nvtab, ftab) + | Index(id, e, tp, pos) -> + let indv = evalExp(e, vtab, ftab) + let arr = SymTab.lookup id vtab + match (arr, indv) with + | (None, _) -> raise (MyError("Unknown array variable "+id, pos)) + | (Some (ArrayVal(lst, tp)), IntVal ind) -> + let len = List.length(lst) + if( len > ind && ind >= 0 ) + then lst.Item(ind) + else let msg = sprintf "Array index out of bounds! Array length: %i, index: %i" len ind + raise (MyError( msg, pos )) + | (Some m, IntVal _) -> reportNonArray ("indexing into " + id) m pos + | (_, _) -> reportWrongType "indexing expression" Int indv pos + | Iota (e, pos) -> + let sz = evalExp(e, vtab, ftab) + match sz with + | IntVal size -> + if size >= 0 + then ArrayVal( List.map (fun x -> IntVal x) [0..size-1], Int ) + else let msg = sprintf "Argument of \"iota\" is negative: %i" size + raise (MyError(msg, pos)) + | _ -> reportWrongType "argument of \"iota\"" Int sz pos + | Map (farg, arrexp, _, _, pos) -> + let arr = evalExp(arrexp, vtab, ftab) + let farg_ret_type = rtpFunArg farg ftab pos + match arr with + | ArrayVal (lst,tp1) -> + let mlst = List.map (fun x -> evalFunArg (farg, vtab, ftab, pos, [x])) lst + ArrayVal (mlst, farg_ret_type) + | otherwise -> reportNonArray "2nd argument of \"map\"" arr pos + | Reduce (farg, ne, arrexp, tp, pos) -> + let farg_ret_type = rtpFunArg farg ftab pos + let arr = evalExp(arrexp, vtab, ftab) + let nel = evalExp(ne, vtab, ftab) + match arr with + | ArrayVal (lst,tp1) -> + List.fold (fun acc x -> evalFunArg (farg, vtab, ftab, pos, [acc;x])) nel lst + | otherwise -> reportNonArray "3rd argument of \"reduce\"" arr pos + (* TODO project task 2: `replicate(n, a)` + Look in `AbSyn.fs` for the arguments of the `Replicate` + (`Map`,`Scan`) expression constructors. + - evaluate `n` then evaluate `a`, + - check that `n` evaluates to an integer value >= 0 + - If so then create an array containing `n` replicas of + the value of `a`; otherwise raise an error (containing + a meaningful message). + *) + | Replicate (_, _, _, _) -> + failwith "Unimplemented interpretation of replicate" + + (* TODO project task 2: `filter(p, arr)` + pattern match the implementation of map: + - check that the function `p` result type (use `rtpFunArg`) is bool; + - evaluate `arr` and check that the (value) result corresponds to an array; + - use F# `List.filter` to keep only the elements `a` of `arr` which succeed + under predicate `p`, i.e., `p(a) = true`; + - create an `ArrayVal` from the (list) result of the previous step. + *) + | Filter (_, _, _, _) -> + failwith "Unimplemented interpretation of filter" + + (* TODO project task 2: `scan(f, ne, arr)` + Implementation similar to reduce, except that it produces an array + of the same type and length to the input array `arr`. + *) + | Scan (_, _, _, _, _) -> + failwith "Unimplemented interpretation of scan" + + | Read (t,p) -> + let str = Console.ReadLine() + match t with + | Int -> let v : int = int str + IntVal v + | Bool when str = "true" -> BoolVal true + | Bool when str = "false" -> BoolVal false + | Char -> let v : char = char str + CharVal v + | otherwise -> raise (MyError("Read operation is valid only on basic types ", p)) + + | Write(exp,t,p) -> + let v = evalExp(exp, vtab, ftab) + match v with + | IntVal n -> printfn "%i " n + | BoolVal b -> let res = if(b) then "true " else "false " + printfn "%s" res + | CharVal c -> printfn "%c " c + | ArrayVal (a, Char) -> + let mapfun = function + | CharVal c -> c + | otherwise -> raise (MyError("Write argument " + + ppVal 0 v + + " should have been evaluated to string", p)) + printfn "%s" ( System.String.Concat (List.map mapfun a) ) + | otherwise -> raise (MyError("Write can be called only on basic and array(char) types ", p)) + v + + + +(* finds the return type of a function argument *) +and rtpFunArg (funarg : UntypedFunArg) + (ftab : FunTable) + (callpos : Position) + : Type = + match funarg with + | FunName fid -> + match SymTab.lookup fid ftab with + | None -> raise (MyError("Call to unknown function "+fid, callpos)) + | Some (FunDec (_, rettype, _, _, _)) -> rettype + | Lambda (rettype, _, _, _) -> rettype + +(* evalFunArg takes as argument a FunArg, a vtable, an ftable, the +position where the call is performed, and the list of actual arguments. +It returns the result of calling the (lambda) function. + *) +and evalFunArg ( funarg : UntypedFunArg + , vtab : VarTable + , ftab : FunTable + , callpos : Position + , aargs : Value list + ) : Value = + match funarg with + | (FunName fid) -> + let fexp = SymTab.lookup fid ftab + match fexp with + | None -> raise (MyError("Call to known function "+fid, callpos)) + | Some f -> callFunWithVtable(f, aargs, SymTab.empty(), ftab, callpos) + | Lambda (rettype, parms, body, fpos) -> + callFunWithVtable ( FunDec ("", rettype, parms, body, fpos) + , aargs, vtab, ftab, callpos ) + +(* Interpreter for Fasto function calls: + 1. f is the function declaration. + 2. args is a list of (already interpreted) arguments. + 3. vtab is the variable symbol table + 4. ftab is the function symbol table (containing f itself). + 5. pcall is the position of the function call. *) +and callFunWithVtable (fundec : UntypedFunDec + , aargs : Value list + , vtab : VarTable + , ftab : FunTable + , pcall : Position + ) : Value = + let (FunDec (fid, rtp, fargs, body, pdcl)) = fundec + match fid with + (* treat the special functions *) + | "ord" -> match aargs with + | [CharVal c] -> IntVal (int c) + | [v] -> reportWrongType "argument of \"ord\"" Char v pcall + | _ -> raise (MyError ("Wrong argument count for \"ord\"", pcall)) + | "chr" -> match aargs with + | [IntVal n] -> CharVal (char n) + | [v] -> reportWrongType "argument of \"chr\"" Int v pcall + | _ -> raise (MyError ("Wrong argument count for \"chr\"", pcall)) + | _ -> + let vtab' = SymTab.combine (bindParams fargs aargs fid pdcl pcall) vtab + let res = evalExp (body, vtab', ftab) + if typeMatch (rtp, res) + then res + else reportWrongType ("result of function \"" + fid + "\"") rtp res pcall + +(* Interpreter for Fasto programs: + 1. builds the function symbol table, + 2. interprets the body of "main", and + 3. returns its result. *) +and evalProg (prog : UntypedProg) : Value = + let ftab = buildFtab prog + let mainf = SymTab.lookup "main" ftab + match mainf with + | None -> raise (MyError("Could not find the main function", (0,0))) + | Some m -> + match getFunArgs m with + | [] -> callFunWithVtable(m, [], SymTab.empty(), ftab, (0,0)) + | _ -> raise (MyError("The main function is not allowed to have parameters", getFunPos m)) diff --git a/W1/fasto/Fasto/Lexer.fs b/W1/fasto/Fasto/Lexer.fs new file mode 100644 index 0000000..8c007ee --- /dev/null +++ b/W1/fasto/Fasto/Lexer.fs @@ -0,0 +1,267 @@ +# 18 "Lexer.fsl" + +module Lexer + +open System;; +open FSharp.Text.Lexing;; +open System.Text;; + +(* A lexer definition for Fasto, for use with fslex. *) + +(* boilerplate code for all lexer files... *) +let mutable currentLine = 1 +let mutable lineStartPos = [0] + +let rec getLineCol pos line = function + | (p1::ps) -> + if pos>=p1 + then (line, pos-p1) + else getLineCol pos (line-1) ps + | [] -> (0,0) (* should not happen *) + +let getPos (lexbuf : LexBuffer<'char>) = + getLineCol lexbuf.StartPos.pos_cnum + (currentLine) + (lineStartPos) + +exception LexicalError of string * (int * int) (* (message, (line, column)) *) + +let lexerError lexbuf s = + raise (LexicalError (s, getPos lexbuf)) + +(* This one is language specific, yet very common. Alternative would + be to encode every keyword as a regexp. This one is much easier. + Note that here we recognize specific keywords, and if none matches + then we assume we have found a user-defined identifier (last case). +*) +let keyword (s, pos) = + match s with + | "if" -> Parser.IF pos + | "then" -> Parser.THEN pos + | "else" -> Parser.ELSE pos + | "let" -> Parser.LET pos + | "in" -> Parser.IN pos + | "int" -> Parser.INT pos + | "bool" -> Parser.BOOL pos + | "char" -> Parser.CHAR pos + | "fun" -> Parser.FUN pos + | "fn" -> Parser.FN pos + | "op" -> Parser.OP pos + +(* specials: *) + | "iota" -> Parser.IOTA pos + | "map" -> Parser.MAP pos + | "reduce" -> Parser.REDUCE pos + | "read" -> Parser.READ pos + | "write" -> Parser.WRITE pos + | _ -> Parser.ID (s, pos) + + +# 60 "Lexer.fs" +let trans : uint16[] array = + [| + (* State 0 *) + [|21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 1us; 2us; 21us; 2us; 1us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 1us; 21us; 8us; 21us; 21us; 21us; 21us; 7us; 13us; 14us; 21us; 9us; 19us; 10us; 21us; 3us; 4us; 5us; 5us; 5us; 5us; 5us; 5us; 5us; 5us; 5us; 21us; 21us; 12us; 11us; 21us; 21us; 21us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 15us; 21us; 16us; 21us; 21us; 21us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 6us; 17us; 21us; 18us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 21us; 20us; |]; + (* State 1 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 34us; 65535us; 65535us; 65535us; 34us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 34us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 2 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 3 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 32us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 4 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 5 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 31us; 31us; 31us; 31us; 31us; 31us; 31us; 31us; 31us; 31us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 6 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 65535us; 65535us; 65535us; 65535us; 30us; 65535us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 7 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 27us; 27us; 65535us; 27us; 27us; 27us; 27us; 65535us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 28us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 27us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 8 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 25us; 25us; 24us; 25us; 25us; 25us; 25us; 65535us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 26us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 9 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 10 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 11 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 23us; 22us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 12 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 13 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 14 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 15 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 16 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 17 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 18 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 19 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 20 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 21 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 22 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 23 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 24 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 25 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 25us; 25us; 24us; 25us; 25us; 25us; 25us; 65535us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 26us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 25us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 26 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 25us; 65535us; 65535us; 65535us; 65535us; 25us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 25us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 25us; 65535us; 65535us; 65535us; 65535us; 65535us; 25us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 27 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 29us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 28 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 27us; 65535us; 65535us; 65535us; 65535us; 27us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 27us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 27us; 65535us; 65535us; 65535us; 65535us; 65535us; 27us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 29 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 30 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 65535us; 65535us; 65535us; 65535us; 30us; 65535us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 30us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 31 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 31us; 31us; 31us; 31us; 31us; 31us; 31us; 31us; 31us; 31us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + (* State 32 *) + [|33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 65535us; 33us; 65535us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 65535us; |]; + (* State 33 *) + [|33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 65535us; 33us; 65535us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 33us; 65535us; |]; + (* State 34 *) + [|65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 34us; 65535us; 65535us; 65535us; 34us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 34us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |]; + |] +let actions : uint16[] = [|65535us; 0us; 1us; 21us; 3us; 3us; 4us; 21us; 21us; 7us; 8us; 11us; 12us; 13us; 14us; 15us; 16us; 17us; 18us; 19us; 20us; 21us; 9us; 10us; 6us; 65535us; 65535us; 65535us; 65535us; 5us; 4us; 3us; 2us; 2us; 0us; |] +let _fslex_tables = FSharp.Text.Lexing.AsciiTables.Create(trans,actions) +let rec _fslex_dummy () = _fslex_dummy() +// Rule Token +and Token lexbuf = + match _fslex_tables.Interpret(0,lexbuf) with + | 0 -> ( +# 78 "Lexer.fsl" + Token lexbuf +# 143 "Lexer.fs" + ) + | 1 -> ( +# 79 "Lexer.fsl" + currentLine <- currentLine + 1; + lineStartPos <- lexbuf.StartPos.pos_cnum + :: lineStartPos; + Token lexbuf +# 151 "Lexer.fs" + ) + | 2 -> ( +# 83 "Lexer.fsl" + Token lexbuf +# 156 "Lexer.fs" + ) + | 3 -> ( +# 85 "Lexer.fsl" + Parser.NUM + ( int (Encoding.UTF8.GetString(lexbuf.Lexeme)) + , getPos lexbuf ) + +# 164 "Lexer.fs" + ) + | 4 -> ( +# 90 "Lexer.fsl" + keyword ( Encoding.UTF8.GetString(lexbuf.Lexeme) + , getPos lexbuf ) +# 170 "Lexer.fs" + ) + | 5 -> ( +# 93 "Lexer.fsl" + let str0 = Encoding.UTF8.GetString(lexbuf.Lexeme) + let str1 = str0.Substring (1, (String.length str0) - 2) + let str2 = AbSyn.fromCString str1 + Parser.CHARLIT (str2.Chars(0), getPos lexbuf) + +# 179 "Lexer.fs" + ) + | 6 -> ( +# 99 "Lexer.fsl" + + let str0 = Encoding.UTF8.GetString(lexbuf.Lexeme) + let str1 = str0.Substring (1, (String.length str0) - 2) + Parser.STRINGLIT (AbSyn.fromCString str1, getPos lexbuf) + +# 188 "Lexer.fs" + ) + | 7 -> ( +# 104 "Lexer.fsl" + Parser.PLUS (getPos lexbuf) +# 193 "Lexer.fs" + ) + | 8 -> ( +# 105 "Lexer.fsl" + Parser.MINUS (getPos lexbuf) +# 198 "Lexer.fs" + ) + | 9 -> ( +# 106 "Lexer.fsl" + Parser.ARROW (getPos lexbuf) +# 203 "Lexer.fs" + ) + | 10 -> ( +# 107 "Lexer.fsl" + Parser.DEQ (getPos lexbuf) +# 208 "Lexer.fs" + ) + | 11 -> ( +# 108 "Lexer.fsl" + Parser.EQ (getPos lexbuf) +# 213 "Lexer.fs" + ) + | 12 -> ( +# 109 "Lexer.fsl" + Parser.LTH (getPos lexbuf) +# 218 "Lexer.fs" + ) + | 13 -> ( +# 110 "Lexer.fsl" + Parser.LPAR (getPos lexbuf) +# 223 "Lexer.fs" + ) + | 14 -> ( +# 111 "Lexer.fsl" + Parser.RPAR (getPos lexbuf) +# 228 "Lexer.fs" + ) + | 15 -> ( +# 112 "Lexer.fsl" + Parser.LBRACKET (getPos lexbuf) +# 233 "Lexer.fs" + ) + | 16 -> ( +# 113 "Lexer.fsl" + Parser.RBRACKET (getPos lexbuf) +# 238 "Lexer.fs" + ) + | 17 -> ( +# 114 "Lexer.fsl" + Parser.LCURLY (getPos lexbuf) +# 243 "Lexer.fs" + ) + | 18 -> ( +# 115 "Lexer.fsl" + Parser.RCURLY (getPos lexbuf) +# 248 "Lexer.fs" + ) + | 19 -> ( +# 116 "Lexer.fsl" + Parser.COMMA (getPos lexbuf) +# 253 "Lexer.fs" + ) + | 20 -> ( +# 117 "Lexer.fsl" + Parser.EOF (getPos lexbuf) +# 258 "Lexer.fs" + ) + | 21 -> ( +# 118 "Lexer.fsl" + lexerError lexbuf "Illegal symbol in input" +# 263 "Lexer.fs" + ) + | _ -> failwith "Token" + +# 3000000 "Lexer.fs" diff --git a/W1/fasto/Fasto/Lexer.fsl b/W1/fasto/Fasto/Lexer.fsl new file mode 100644 index 0000000..0d1ff9b --- /dev/null +++ b/W1/fasto/Fasto/Lexer.fsl @@ -0,0 +1,118 @@ +//////////////////////////////////////////////////////////////////// +// TODO: project task 1 +// implement lexer tokens for the new operators: +// multiplication (*), division (/), numerical negation (~), +// logical negation (not), logical and (&&), logical or (||), +// boolean literals (true, false), semicolon (;) +// +// +// TODO: project task 2 +// implement lexer tokens (keywords) for replicate, filter, scan +// +// +// TODO: project task 4 +// implement the lexer tokens (keywords) for array comprehension +//////////////////////////////////////////////////////////////////// + + +{ +module Lexer + +open System;; +open FSharp.Text.Lexing;; +open System.Text;; + +(* A lexer definition for Fasto, for use with fslex. *) + +(* boilerplate code for all lexer files... *) +let mutable currentLine = 1 +let mutable lineStartPos = [0] + +let rec getLineCol pos line = function + | (p1::ps) -> + if pos>=p1 + then (line, pos-p1) + else getLineCol pos (line-1) ps + | [] -> (0,0) (* should not happen *) + +let getPos (lexbuf : LexBuffer<'char>) = + getLineCol lexbuf.StartPos.pos_cnum + (currentLine) + (lineStartPos) + +exception LexicalError of string * (int * int) (* (message, (line, column)) *) + +let lexerError lexbuf s = + raise (LexicalError (s, getPos lexbuf)) + +(* This one is language specific, yet very common. Alternative would + be to encode every keyword as a regexp. This one is much easier. + Note that here we recognize specific keywords, and if none matches + then we assume we have found a user-defined identifier (last case). +*) +let keyword (s, pos) = + match s with + | "if" -> Parser.IF pos + | "then" -> Parser.THEN pos + | "else" -> Parser.ELSE pos + | "let" -> Parser.LET pos + | "in" -> Parser.IN pos + | "int" -> Parser.INT pos + | "bool" -> Parser.BOOL pos + | "char" -> Parser.CHAR pos + | "fun" -> Parser.FUN pos + | "fn" -> Parser.FN pos + | "op" -> Parser.OP pos + +(* specials: *) + | "iota" -> Parser.IOTA pos + | "map" -> Parser.MAP pos + | "reduce" -> Parser.REDUCE pos + | "read" -> Parser.READ pos + | "write" -> Parser.WRITE pos + | _ -> Parser.ID (s, pos) + +} + +rule Token = parse + [' ' '\t' '\r']+ { Token lexbuf } (* whitespace *) + | ['\n' '\012'] { currentLine <- currentLine + 1; + lineStartPos <- lexbuf.StartPos.pos_cnum + :: lineStartPos; + Token lexbuf } (* newlines *) + | "//" [^ '\n' '\012']* { Token lexbuf } (* comment *) + + | '0' | ['1'-'9']['0'-'9']* { Parser.NUM + ( int (Encoding.UTF8.GetString(lexbuf.Lexeme)) + , getPos lexbuf ) + } + | ['a'-'z' 'A'-'Z']['a'-'z' 'A'-'Z' '0'-'9' '_']* + { keyword ( Encoding.UTF8.GetString(lexbuf.Lexeme) + , getPos lexbuf ) } + | '\'' ( [' ' '!' '#'-'&' '('-'[' ']'-'~'] | '\\' ['n' 't' '\'' '"' '\\'] ) '\'' + { let str0 = Encoding.UTF8.GetString(lexbuf.Lexeme) + let str1 = str0.Substring (1, (String.length str0) - 2) + let str2 = AbSyn.fromCString str1 + Parser.CHARLIT (str2.Chars(0), getPos lexbuf) + } + | '"' ( [' ' '!' '#'-'&' '('-'[' ']'-'~'] | '\\' ['n' 't' '\'' '"' '\\'] )* '"' + { + let str0 = Encoding.UTF8.GetString(lexbuf.Lexeme) + let str1 = str0.Substring (1, (String.length str0) - 2) + Parser.STRINGLIT (AbSyn.fromCString str1, getPos lexbuf) + } + | '+' { Parser.PLUS (getPos lexbuf) } + | '-' { Parser.MINUS (getPos lexbuf) } + | "=>" { Parser.ARROW (getPos lexbuf) } + | "==" { Parser.DEQ (getPos lexbuf) } + | '=' { Parser.EQ (getPos lexbuf) } + | '<' { Parser.LTH (getPos lexbuf) } + | '(' { Parser.LPAR (getPos lexbuf) } + | ')' { Parser.RPAR (getPos lexbuf) } + | '[' { Parser.LBRACKET (getPos lexbuf) } + | ']' { Parser.RBRACKET (getPos lexbuf) } + | '{' { Parser.LCURLY (getPos lexbuf) } + | '}' { Parser.RCURLY (getPos lexbuf) } + | ',' { Parser.COMMA (getPos lexbuf) } + | eof { Parser.EOF (getPos lexbuf) } + | _ { lexerError lexbuf "Illegal symbol in input" } diff --git a/W1/fasto/Fasto/Mips.fs b/W1/fasto/Fasto/Mips.fs new file mode 100644 index 0000000..79e2a85 --- /dev/null +++ b/W1/fasto/Fasto/Mips.fs @@ -0,0 +1,127 @@ +(* Types and utilities for the abstract syntax of MIPS. *) + +module Mips + +open AbSyn + +type reg = RN of int | RS of string +type imm = int +type addr = string + +type Instruction = + LABEL of addr (* Angiver en label, man fx kan hoppe til *) + | COMMENT of string (* Placerer en kommentar i assemblerkoden *) + + | LA of reg*addr (* LA($rd,addr): $rd = addr (label) *) + | LUI of reg*imm (* LUI($rd,imm): $rd = (imm << 16) *) + | LW of reg*reg*imm (* LW($rd,$rs,imm): $rd = Mem[$rs + imm] *) + | LB of reg*reg*imm (* LB($rd,$rs,imm): $rd = Mem[$rs + imm] *) + | SW of reg*reg*imm (* SW($rw,$rm,imm): Mem[$rm + imm] = $rw *) + | SB of reg*reg*imm (* SB($rb,$rm,imm): Mem[$rm + imm] = $rb *) + + (* Aritmetiske instruktioner *) + | ADD of reg*reg*reg (* ADD($rd,$rs,$rt): $rd = $rs + $rt. *) + | ADDI of reg*reg*imm (* ADDI($rd,$rs,imm): $rd = $rs + imm *) + | SUB of reg*reg*reg (* SUB($rd,$rs,$rt): $rd = $rs - $rt. *) + | MUL of reg*reg*reg (* MUL($rd,$rs,$rt): $rd = $rs * $rt, no overflow. *) + | DIV of reg*reg*reg (* DIV($rd,$rs,$rt): $rd = quotient($rd / $rs), no overflow. *) + + (* Bitvise operatorer *) + | AND of reg*reg*reg (* AND($rd,$rs,$rt): $rd = $rs & $rt *) + | ANDI of reg*reg*imm (* ANDI($rd,$rs,imm): $rd = $rs & imm *) + | OR of reg*reg*reg (* OR($rd,$rs,$rt): $rd = $rs | $rt *) + | ORI of reg*reg*imm (* ORI($rd,$rs,imm): $rd = $rs | imm *) + | XOR of reg*reg*reg (* XOR($rd,$rs,$rt): $rd = $rs ^ $rt *) + | XORI of reg*reg*imm (* XORI($rd,$rs,imm): $rd = $rs ^ imm *) + + (* Bit-shifting *) + | SLL of reg*reg*imm (* SLL($rd,$rs,imm): $rd = $rs << imm *) + | SRA of reg*reg*imm (* SRA($rd,$rs,imm): $rd = $rs >> imm *) + + (* Instruktioner til sammenligning *) + | SLT of reg*reg*reg (* SLT($rd,$rs,$rt): $rd = $rs < $rt *) + | SLTI of reg*reg*imm (* SLTI($rd,$rs,imm): $rd = $rs < imm *) + | BEQ of reg*reg*addr (* BEQ($rs,$rt,addr): if ($rs == $rd) goto(addr) *) + | BNE of reg*reg*addr (* BNE($rs,$rt,addr): if ($rs != $rd) goto(addr) *) + | BGEZ of reg*addr (* BGEZ($rs,addr): if ($rs >= $0) goto(addr) *) + | J of addr (* J(addr): goto(addr) *) + | JR of reg * reg list (* JR($rd,regs): goto($rd) *) + | JAL of addr* reg list (* JAL(addr,regs): $RA = $PC; goto(addr) *) + | NOP + | SYSCALL (* Udfører det systemkald som er nævnt i $2 *) + + (* Angiver direktiverne .globl, .text, .data, .space, ascii, .asciiz, .align *) + | GLOBL of addr + | TEXT of addr + | DATA of addr + | SPACE of int + | ASCII of string + | ASCIIZ of string + | ALIGN of int + +(* Diverse pseudo-instruktioner *) +let MOVE (rd,rs) = ORI (rd, rs, 0) (* MOVE($rd,$rs): $rd = $rs *) +let LI (rd,imm) = ORI (rd, RN 0, imm) (* LI($rd,imm): $rd = imm *) +let SUBI (rd, rs, imm) = ADDI (rd, rs, -imm) + +type Prog = Instruction list + +(* Pretty-print a list of MIPS instructions in the + format accepted by the MARS MIPS simulator. *) +let rec ppMipsProg instructions = + String.concat "\n" (List.map ppMips instructions) + +(* Pretty-print a single MIPS instruction for .asm output *) +and ppMips inst = + match inst with + | LABEL l -> l + ":" + | COMMENT s -> "# " + s + + | LA (rt,l) -> "\tla\t" + ppReg rt + ", " + l + | LUI (rt,v) -> "\tlui\t" + ppReg rt + ", " + imm2str v + | LW (rd,rs,v) -> "\tlw\t" + ppReg rd + ", " + imm2str v + "(" + ppReg rs + ")" + | LB (rd,rs,v) -> "\tlb\t" + ppReg rd + ", " + imm2str v + "(" + ppReg rs + ")" + | SW (rd,rs,v) -> "\tsw\t" + ppReg rd + ", " + imm2str v + "(" + ppReg rs + ")" + | SB (rd,rs,v) -> "\tsb\t" + ppReg rd + ", " + imm2str v + "(" + ppReg rs + ")" + + | ADD (rd,rs,rt) -> "\tadd\t" + ppReg rd + ", " + ppReg rs + ", " + ppReg rt + | ADDI (rd,rs,v) -> "\taddi\t" + ppReg rd + ", " + ppReg rs + ", " + imm2str v + | SUB (rd,rs,rt) -> "\tsub\t" + ppReg rd + ", " + ppReg rs + ", " + ppReg rt + | MUL (rd,rs,rt) -> "\tmul\t" + ppReg rd + ", " + ppReg rs + ", " + ppReg rt + | DIV (rd,rs,rt) -> "\tdiv\t" + ppReg rd + ", " + ppReg rs + ", " + ppReg rt + + | AND (rd,rs,rt) -> "\tand\t" + ppReg rd + ", " + ppReg rs + ", " + ppReg rt + | ANDI (rd,rs,v) -> "\tandi\t" + ppReg rd + ", " + ppReg rs + ", " + imm2str v + | OR (rd,rs,rt) -> "\tor\t" + ppReg rd + ", " + ppReg rs + ", " + ppReg rt + | ORI (rd,rs,v) -> "\tori\t" + ppReg rd + ", " + ppReg rs + ", " + imm2str v + | XOR (rd,rs,rt) -> "\txor\t" + ppReg rd + ", " + ppReg rs + ", " + ppReg rt + | XORI (rd,rs,v) -> "\txori\t" + ppReg rd + ", " + ppReg rs + ", " + imm2str v + + | SLL (rd,rt,v) -> "\tsll\t" + ppReg rd + ", " + ppReg rt + ", " + imm2str v + | SRA (rd,rt,v) -> "\tsra\t" + ppReg rd + ", " + ppReg rt + ", " + imm2str v + + | SLT (rd,rs,rt) -> "\tslt\t" + ppReg rd + ", " + ppReg rs + ", " + ppReg rt + | SLTI (rd,rs,v) -> "\tslti\t" + ppReg rd + ", " + ppReg rs + ", " + imm2str v + | BEQ (rs,rt,l) -> "\tbeq\t" + ppReg rs + ", " + ppReg rt + ", " + l + | BNE (rs,rt,l) -> "\tbne\t" + ppReg rs + ", " + ppReg rt + ", " + l + | BGEZ (rs,l) -> "\tbgez\t" + ppReg rs + ", " + l + | J l -> "\tj\t" + l + | JAL (l,argRegs) -> "\tjal\t" + l + | JR (r,resRegs) -> "\tjr\t" + ppReg r + | NOP -> "\tnop" + | SYSCALL -> "\tsyscall" + + | GLOBL s -> "\t.globl\t" + s + | TEXT s -> "\t.text\t" + s + | DATA s -> "\t.data\t" + s + | SPACE s -> "\t.space\t" + string s + | ASCII s -> "\t.ascii\t\"" + toCString s + "\"" + | ASCIIZ s -> "\t.asciiz\t\"" + toCString s + "\"" + | ALIGN s -> "\t.align\t" + string s + +and ppReg r = + match r with + | RN n -> "$" + string n + | RS s -> s + +and imm2str (i:imm) = string i (* maybe add some sanity checks here *) diff --git a/W1/fasto/Fasto/Parser.fs b/W1/fasto/Fasto/Parser.fs new file mode 100644 index 0000000..97e4581 --- /dev/null +++ b/W1/fasto/Fasto/Parser.fs @@ -0,0 +1,887 @@ +// Implementation file for parser generated by fsyacc +module Parser +#nowarn "64";; // turn off warnings that type variables used in production annotations are instantiated to concrete type +open FSharp.Text.Lexing +open FSharp.Text.Parsing.ParseHelpers +# 2 "Parser.fsp" + + +let p0 = (0,0) + +open FSharp.Text.Parsing +open AbSyn + +(* parse-error function *) +let mutable ErrorContextDescriptor : string = "" + +let parse_error_rich = + Some (fun (ctxt: ParseErrorContext<_>) -> + ErrorContextDescriptor <- + match ctxt.CurrentToken with + | None -> "At beginning of input\n" + | Some token -> sprintf "at token %A\n" token + ) + + +# 26 "Parser.fs" +// This type is the type of tokens accepted by the parser +type token = + | LPAR of (Position) + | RPAR of (Position) + | LBRACKET of (Position) + | RBRACKET of (Position) + | LCURLY of (Position) + | RCURLY of (Position) + | FUN of (Position) + | FN of (Position) + | COMMA of (Position) + | SEMICOLON of (Position) + | READ of (Position) + | WRITE of (Position) + | DEQ of (Position) + | LTH of (Position) + | EQ of (Position) + | OP of (Position) + | MAP of (Position) + | REDUCE of (Position) + | IOTA of (Position) + | ARROW of (Position) + | PLUS of (Position) + | MINUS of (Position) + | LESS of (Position) + | INT of (Position) + | CHAR of (Position) + | BOOL of (Position) + | IF of (Position) + | THEN of (Position) + | ELSE of (Position) + | LET of (Position) + | IN of (Position) + | EOF of (Position) + | ID of (string * Position) + | STRINGLIT of (string * Position) + | CHARLIT of (char * Position) + | NUM of (int * Position) +// This type is used to give symbolic names to token indexes, useful for error messages +type tokenId = + | TOKEN_LPAR + | TOKEN_RPAR + | TOKEN_LBRACKET + | TOKEN_RBRACKET + | TOKEN_LCURLY + | TOKEN_RCURLY + | TOKEN_FUN + | TOKEN_FN + | TOKEN_COMMA + | TOKEN_SEMICOLON + | TOKEN_READ + | TOKEN_WRITE + | TOKEN_DEQ + | TOKEN_LTH + | TOKEN_EQ + | TOKEN_OP + | TOKEN_MAP + | TOKEN_REDUCE + | TOKEN_IOTA + | TOKEN_ARROW + | TOKEN_PLUS + | TOKEN_MINUS + | TOKEN_LESS + | TOKEN_INT + | TOKEN_CHAR + | TOKEN_BOOL + | TOKEN_IF + | TOKEN_THEN + | TOKEN_ELSE + | TOKEN_LET + | TOKEN_IN + | TOKEN_EOF + | TOKEN_ID + | TOKEN_STRINGLIT + | TOKEN_CHARLIT + | TOKEN_NUM + | TOKEN_end_of_input + | TOKEN_error +// This type is used to give symbolic names to token indexes, useful for error messages +type nonTerminalId = + | NONTERM__startProg + | NONTERM_Prog + | NONTERM_FunDecs + | NONTERM_Fun + | NONTERM_Type + | NONTERM_Params + | NONTERM_BinOp + | NONTERM_Exp + | NONTERM_Exps + | NONTERM_FunArg + +// This function maps tokens to integer indexes +let tagOfToken (t:token) = + match t with + | LPAR _ -> 0 + | RPAR _ -> 1 + | LBRACKET _ -> 2 + | RBRACKET _ -> 3 + | LCURLY _ -> 4 + | RCURLY _ -> 5 + | FUN _ -> 6 + | FN _ -> 7 + | COMMA _ -> 8 + | SEMICOLON _ -> 9 + | READ _ -> 10 + | WRITE _ -> 11 + | DEQ _ -> 12 + | LTH _ -> 13 + | EQ _ -> 14 + | OP _ -> 15 + | MAP _ -> 16 + | REDUCE _ -> 17 + | IOTA _ -> 18 + | ARROW _ -> 19 + | PLUS _ -> 20 + | MINUS _ -> 21 + | LESS _ -> 22 + | INT _ -> 23 + | CHAR _ -> 24 + | BOOL _ -> 25 + | IF _ -> 26 + | THEN _ -> 27 + | ELSE _ -> 28 + | LET _ -> 29 + | IN _ -> 30 + | EOF _ -> 31 + | ID _ -> 32 + | STRINGLIT _ -> 33 + | CHARLIT _ -> 34 + | NUM _ -> 35 + +// This function maps integer indexes to symbolic token ids +let tokenTagToTokenId (tokenIdx:int) = + match tokenIdx with + | 0 -> TOKEN_LPAR + | 1 -> TOKEN_RPAR + | 2 -> TOKEN_LBRACKET + | 3 -> TOKEN_RBRACKET + | 4 -> TOKEN_LCURLY + | 5 -> TOKEN_RCURLY + | 6 -> TOKEN_FUN + | 7 -> TOKEN_FN + | 8 -> TOKEN_COMMA + | 9 -> TOKEN_SEMICOLON + | 10 -> TOKEN_READ + | 11 -> TOKEN_WRITE + | 12 -> TOKEN_DEQ + | 13 -> TOKEN_LTH + | 14 -> TOKEN_EQ + | 15 -> TOKEN_OP + | 16 -> TOKEN_MAP + | 17 -> TOKEN_REDUCE + | 18 -> TOKEN_IOTA + | 19 -> TOKEN_ARROW + | 20 -> TOKEN_PLUS + | 21 -> TOKEN_MINUS + | 22 -> TOKEN_LESS + | 23 -> TOKEN_INT + | 24 -> TOKEN_CHAR + | 25 -> TOKEN_BOOL + | 26 -> TOKEN_IF + | 27 -> TOKEN_THEN + | 28 -> TOKEN_ELSE + | 29 -> TOKEN_LET + | 30 -> TOKEN_IN + | 31 -> TOKEN_EOF + | 32 -> TOKEN_ID + | 33 -> TOKEN_STRINGLIT + | 34 -> TOKEN_CHARLIT + | 35 -> TOKEN_NUM + | 38 -> TOKEN_end_of_input + | 36 -> TOKEN_error + | _ -> failwith "tokenTagToTokenId: bad token" + +/// This function maps production indexes returned in syntax errors to strings representing the non terminal that would be produced by that production +let prodIdxToNonTerminal (prodIdx:int) = + match prodIdx with + | 0 -> NONTERM__startProg + | 1 -> NONTERM_Prog + | 2 -> NONTERM_FunDecs + | 3 -> NONTERM_FunDecs + | 4 -> NONTERM_Fun + | 5 -> NONTERM_Fun + | 6 -> NONTERM_Type + | 7 -> NONTERM_Type + | 8 -> NONTERM_Type + | 9 -> NONTERM_Type + | 10 -> NONTERM_Params + | 11 -> NONTERM_Params + | 12 -> NONTERM_BinOp + | 13 -> NONTERM_Exp + | 14 -> NONTERM_Exp + | 15 -> NONTERM_Exp + | 16 -> NONTERM_Exp + | 17 -> NONTERM_Exp + | 18 -> NONTERM_Exp + | 19 -> NONTERM_Exp + | 20 -> NONTERM_Exp + | 21 -> NONTERM_Exp + | 22 -> NONTERM_Exp + | 23 -> NONTERM_Exp + | 24 -> NONTERM_Exp + | 25 -> NONTERM_Exp + | 26 -> NONTERM_Exp + | 27 -> NONTERM_Exp + | 28 -> NONTERM_Exp + | 29 -> NONTERM_Exp + | 30 -> NONTERM_Exp + | 31 -> NONTERM_Exp + | 32 -> NONTERM_Exp + | 33 -> NONTERM_Exp + | 34 -> NONTERM_Exps + | 35 -> NONTERM_Exps + | 36 -> NONTERM_FunArg + | 37 -> NONTERM_FunArg + | 38 -> NONTERM_FunArg + | _ -> failwith "prodIdxToNonTerminal: bad production index" + +let _fsyacc_endOfInputTag = 38 +let _fsyacc_tagOfErrorTerminal = 36 + +// This function gets the name of a token as a string +let token_to_string (t:token) = + match t with + | LPAR _ -> "LPAR" + | RPAR _ -> "RPAR" + | LBRACKET _ -> "LBRACKET" + | RBRACKET _ -> "RBRACKET" + | LCURLY _ -> "LCURLY" + | RCURLY _ -> "RCURLY" + | FUN _ -> "FUN" + | FN _ -> "FN" + | COMMA _ -> "COMMA" + | SEMICOLON _ -> "SEMICOLON" + | READ _ -> "READ" + | WRITE _ -> "WRITE" + | DEQ _ -> "DEQ" + | LTH _ -> "LTH" + | EQ _ -> "EQ" + | OP _ -> "OP" + | MAP _ -> "MAP" + | REDUCE _ -> "REDUCE" + | IOTA _ -> "IOTA" + | ARROW _ -> "ARROW" + | PLUS _ -> "PLUS" + | MINUS _ -> "MINUS" + | LESS _ -> "LESS" + | INT _ -> "INT" + | CHAR _ -> "CHAR" + | BOOL _ -> "BOOL" + | IF _ -> "IF" + | THEN _ -> "THEN" + | ELSE _ -> "ELSE" + | LET _ -> "LET" + | IN _ -> "IN" + | EOF _ -> "EOF" + | ID _ -> "ID" + | STRINGLIT _ -> "STRINGLIT" + | CHARLIT _ -> "CHARLIT" + | NUM _ -> "NUM" + +// This function gets the data carried by a token as an object +let _fsyacc_dataOfToken (t:token) = + match t with + | LPAR _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | RPAR _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | LBRACKET _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | RBRACKET _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | LCURLY _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | RCURLY _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | FUN _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | FN _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | COMMA _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | SEMICOLON _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | READ _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | WRITE _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | DEQ _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | LTH _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | EQ _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | OP _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | MAP _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | REDUCE _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | IOTA _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | ARROW _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | PLUS _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | MINUS _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | LESS _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | INT _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | CHAR _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | BOOL _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | IF _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | THEN _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | ELSE _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | LET _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | IN _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | EOF _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | ID _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | STRINGLIT _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | CHARLIT _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x + | NUM _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x +let _fsyacc_gotos = [| 0us; 65535us; 1us; 65535us; 0us; 1us; 2us; 65535us; 0us; 2us; 5us; 6us; 1us; 65535us; 4us; 5us; 7us; 65535us; 4us; 7us; 9us; 23us; 20us; 21us; 25us; 23us; 68us; 69us; 104us; 105us; 106us; 23us; 3us; 65535us; 9us; 10us; 25us; 26us; 106us; 109us; 1us; 65535us; 88us; 89us; 25us; 65535us; 12us; 13us; 15us; 16us; 32us; 53us; 56us; 35us; 57us; 36us; 58us; 37us; 59us; 38us; 60us; 39us; 61us; 40us; 62us; 41us; 63us; 53us; 72us; 42us; 75us; 43us; 80us; 44us; 85us; 45us; 86us; 46us; 90us; 47us; 91us; 48us; 93us; 49us; 97us; 50us; 98us; 51us; 99us; 52us; 101us; 53us; 108us; 54us; 111us; 55us; 3us; 65535us; 32us; 33us; 63us; 64us; 101us; 102us; 2us; 65535us; 78us; 79us; 83us; 84us; |] +let _fsyacc_sparseGotoTableRowOffsets = [|0us; 1us; 3us; 6us; 8us; 16us; 20us; 22us; 48us; 52us; |] +let _fsyacc_stateToProdIdxsTableElements = [| 1us; 0us; 1us; 0us; 1us; 1us; 1us; 1us; 2us; 2us; 3us; 2us; 2us; 3us; 1us; 2us; 2us; 4us; 5us; 2us; 4us; 5us; 2us; 4us; 5us; 1us; 4us; 1us; 4us; 1us; 4us; 5us; 4us; 18us; 19us; 20us; 21us; 1us; 5us; 1us; 5us; 5us; 5us; 18us; 19us; 20us; 21us; 1us; 6us; 1us; 7us; 1us; 8us; 1us; 9us; 1us; 9us; 1us; 9us; 2us; 10us; 11us; 2us; 10us; 11us; 1us; 10us; 1us; 10us; 1us; 12us; 1us; 13us; 1us; 14us; 4us; 15us; 23us; 24us; 33us; 1us; 16us; 1us; 17us; 1us; 17us; 1us; 17us; 5us; 18us; 18us; 19us; 20us; 21us; 5us; 18us; 19us; 19us; 20us; 21us; 5us; 18us; 19us; 20us; 20us; 21us; 5us; 18us; 19us; 20us; 21us; 21us; 5us; 18us; 19us; 20us; 21us; 22us; 5us; 18us; 19us; 20us; 21us; 22us; 5us; 18us; 19us; 20us; 21us; 22us; 5us; 18us; 19us; 20us; 21us; 26us; 5us; 18us; 19us; 20us; 21us; 27us; 5us; 18us; 19us; 20us; 21us; 28us; 5us; 18us; 19us; 20us; 21us; 29us; 5us; 18us; 19us; 20us; 21us; 29us; 5us; 18us; 19us; 20us; 21us; 30us; 5us; 18us; 19us; 20us; 21us; 30us; 5us; 18us; 19us; 20us; 21us; 31us; 5us; 18us; 19us; 20us; 21us; 32us; 5us; 18us; 19us; 20us; 21us; 32us; 5us; 18us; 19us; 20us; 21us; 33us; 6us; 18us; 19us; 20us; 21us; 34us; 35us; 5us; 18us; 19us; 20us; 21us; 37us; 5us; 18us; 19us; 20us; 21us; 38us; 1us; 18us; 1us; 19us; 1us; 20us; 1us; 21us; 1us; 22us; 1us; 22us; 1us; 22us; 2us; 23us; 24us; 1us; 23us; 1us; 23us; 1us; 24us; 1us; 25us; 1us; 25us; 1us; 25us; 1us; 25us; 1us; 26us; 1us; 26us; 1us; 26us; 1us; 27us; 1us; 27us; 1us; 27us; 1us; 28us; 1us; 28us; 1us; 28us; 1us; 28us; 1us; 28us; 2us; 29us; 30us; 2us; 29us; 30us; 1us; 29us; 1us; 29us; 1us; 29us; 1us; 29us; 1us; 30us; 1us; 30us; 1us; 30us; 1us; 30us; 1us; 30us; 1us; 31us; 1us; 31us; 1us; 32us; 1us; 32us; 1us; 32us; 1us; 32us; 1us; 33us; 1us; 33us; 1us; 34us; 1us; 34us; 1us; 36us; 2us; 37us; 38us; 2us; 37us; 38us; 2us; 37us; 38us; 1us; 37us; 1us; 37us; 1us; 38us; 1us; 38us; 1us; 38us; |] +let _fsyacc_stateToProdIdxsTableRowOffsets = [|0us; 2us; 4us; 6us; 8us; 11us; 14us; 16us; 19us; 22us; 25us; 27us; 29us; 31us; 37us; 39us; 41us; 47us; 49us; 51us; 53us; 55us; 57us; 59us; 62us; 65us; 67us; 69us; 71us; 73us; 75us; 80us; 82us; 84us; 86us; 88us; 94us; 100us; 106us; 112us; 118us; 124us; 130us; 136us; 142us; 148us; 154us; 160us; 166us; 172us; 178us; 184us; 190us; 196us; 203us; 209us; 215us; 217us; 219us; 221us; 223us; 225us; 227us; 229us; 232us; 234us; 236us; 238us; 240us; 242us; 244us; 246us; 248us; 250us; 252us; 254us; 256us; 258us; 260us; 262us; 264us; 266us; 268us; 271us; 274us; 276us; 278us; 280us; 282us; 284us; 286us; 288us; 290us; 292us; 294us; 296us; 298us; 300us; 302us; 304us; 306us; 308us; 310us; 312us; 314us; 317us; 320us; 323us; 325us; 327us; 329us; 331us; |] +let _fsyacc_action_rows = 112 +let _fsyacc_actionTableElements = [|1us; 32768us; 6us; 4us; 0us; 49152us; 1us; 32768us; 31us; 3us; 0us; 16385us; 4us; 32768us; 2us; 20us; 23us; 17us; 24us; 18us; 25us; 19us; 1us; 16387us; 6us; 4us; 0us; 16386us; 1us; 32768us; 32us; 8us; 1us; 32768us; 0us; 9us; 5us; 32768us; 1us; 14us; 2us; 20us; 23us; 17us; 24us; 18us; 25us; 19us; 1us; 32768us; 1us; 11us; 1us; 32768us; 14us; 12us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 4us; 16388us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 1us; 32768us; 14us; 15us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 4us; 16389us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 0us; 16390us; 0us; 16391us; 0us; 16392us; 4us; 32768us; 2us; 20us; 23us; 17us; 24us; 18us; 25us; 19us; 1us; 32768us; 3us; 22us; 0us; 16393us; 1us; 32768us; 32us; 24us; 1us; 16395us; 8us; 25us; 4us; 32768us; 2us; 20us; 23us; 17us; 24us; 18us; 25us; 19us; 0us; 16394us; 0us; 16396us; 0us; 16397us; 0us; 16398us; 2us; 16399us; 0us; 63us; 2us; 99us; 0us; 16400us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 1us; 32768us; 5us; 34us; 0us; 16401us; 0us; 16402us; 0us; 16403us; 2us; 16404us; 20us; 56us; 21us; 57us; 2us; 16405us; 20us; 56us; 21us; 57us; 5us; 32768us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 27us; 61us; 5us; 32768us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 28us; 62us; 4us; 16406us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 5us; 32768us; 1us; 73us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 5us; 32768us; 1us; 76us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 5us; 32768us; 1us; 81us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 5us; 32768us; 8us; 86us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 5us; 32768us; 1us; 87us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 5us; 32768us; 8us; 91us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 5us; 32768us; 1us; 92us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 5us; 32768us; 1us; 94us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 5us; 32768us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 30us; 98us; 4us; 16416us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 5us; 32768us; 3us; 100us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 5us; 16419us; 8us; 101us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 4us; 16421us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 4us; 16422us; 12us; 58us; 13us; 59us; 20us; 56us; 21us; 57us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 14us; 32768us; 0us; 93us; 1us; 66us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 1us; 32768us; 1us; 65us; 0us; 16407us; 0us; 16408us; 1us; 32768us; 0us; 68us; 4us; 32768us; 2us; 20us; 23us; 17us; 24us; 18us; 25us; 19us; 1us; 32768us; 1us; 70us; 0us; 16409us; 1us; 32768us; 0us; 72us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 0us; 16410us; 1us; 32768us; 0us; 75us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 0us; 16411us; 1us; 32768us; 0us; 78us; 2us; 32768us; 7us; 104us; 32us; 103us; 1us; 32768us; 8us; 80us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 0us; 16412us; 1us; 32768us; 0us; 83us; 3us; 32768us; 7us; 104us; 15us; 88us; 32us; 103us; 1us; 32768us; 8us; 85us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 0us; 16413us; 1us; 32768us; 20us; 27us; 1us; 32768us; 8us; 90us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 0us; 16414us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 0us; 16415us; 1us; 32768us; 32us; 96us; 1us; 32768us; 14us; 97us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 0us; 16417us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 0us; 16418us; 0us; 16420us; 4us; 32768us; 2us; 20us; 23us; 17us; 24us; 18us; 25us; 19us; 1us; 32768us; 0us; 106us; 5us; 32768us; 1us; 107us; 2us; 20us; 23us; 17us; 24us; 18us; 25us; 19us; 1us; 32768us; 19us; 108us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; 1us; 32768us; 1us; 110us; 1us; 32768us; 19us; 111us; 13us; 32768us; 0us; 93us; 4us; 32us; 10us; 67us; 11us; 71us; 16us; 77us; 17us; 82us; 18us; 74us; 26us; 60us; 29us; 95us; 32us; 30us; 33us; 31us; 34us; 29us; 35us; 28us; |] +let _fsyacc_actionTableRowOffsets = [|0us; 2us; 3us; 5us; 6us; 11us; 13us; 14us; 16us; 18us; 24us; 26us; 28us; 42us; 47us; 49us; 63us; 68us; 69us; 70us; 71us; 76us; 78us; 79us; 81us; 83us; 88us; 89us; 90us; 91us; 92us; 95us; 96us; 110us; 112us; 113us; 114us; 115us; 118us; 121us; 127us; 133us; 138us; 144us; 150us; 156us; 162us; 168us; 174us; 180us; 186us; 192us; 197us; 203us; 209us; 214us; 219us; 233us; 247us; 261us; 275us; 289us; 303us; 317us; 332us; 334us; 335us; 336us; 338us; 343us; 345us; 346us; 348us; 362us; 363us; 365us; 379us; 380us; 382us; 385us; 387us; 401us; 402us; 404us; 408us; 410us; 424us; 438us; 439us; 441us; 443us; 457us; 471us; 472us; 486us; 487us; 489us; 491us; 505us; 519us; 533us; 534us; 548us; 549us; 550us; 555us; 557us; 563us; 565us; 579us; 581us; 583us; |] +let _fsyacc_reductionSymbolCounts = [|1us; 2us; 3us; 2us; 7us; 6us; 1us; 1us; 1us; 3us; 4us; 2us; 1us; 1us; 1us; 1us; 1us; 3us; 3us; 3us; 3us; 3us; 6us; 4us; 3us; 4us; 4us; 4us; 6us; 8us; 9us; 3us; 6us; 4us; 3us; 1us; 1us; 6us; 7us; |] +let _fsyacc_productionToNonTerminalTable = [|0us; 1us; 2us; 2us; 3us; 3us; 4us; 4us; 4us; 4us; 5us; 5us; 6us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 7us; 8us; 8us; 9us; 9us; 9us; |] +let _fsyacc_immediateActions = [|65535us; 49152us; 65535us; 16385us; 65535us; 65535us; 16386us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 16390us; 16391us; 16392us; 65535us; 65535us; 16393us; 65535us; 65535us; 65535us; 16394us; 16396us; 16397us; 16398us; 65535us; 16400us; 65535us; 65535us; 16401us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 16407us; 16408us; 65535us; 65535us; 65535us; 16409us; 65535us; 65535us; 16410us; 65535us; 65535us; 16411us; 65535us; 65535us; 65535us; 65535us; 16412us; 65535us; 65535us; 65535us; 65535us; 65535us; 16413us; 65535us; 65535us; 65535us; 65535us; 16414us; 65535us; 16415us; 65535us; 65535us; 65535us; 65535us; 65535us; 16417us; 65535us; 16418us; 16420us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; |] +let _fsyacc_reductions () = [| +# 338 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> AbSyn.UntypedProg in + Microsoft.FSharp.Core.Operators.box + ( + ( + raise (FSharp.Text.Parsing.Accept(Microsoft.FSharp.Core.Operators.box _1)) + ) + : 'gentype__startProg)); +# 347 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> AbSyn.UntypedFunDec list in + let _2 = parseState.GetInput(2) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 65 "Parser.fsp" + _1 + ) +# 65 "Parser.fsp" + : AbSyn.UntypedProg)); +# 359 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> AbSyn.UntypedFunDec in + let _3 = parseState.GetInput(3) :?> AbSyn.UntypedFunDec list in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 68 "Parser.fsp" + _2 :: _3 + ) +# 68 "Parser.fsp" + : AbSyn.UntypedFunDec list)); +# 372 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> AbSyn.UntypedFunDec in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 69 "Parser.fsp" + _2 :: [] + ) +# 69 "Parser.fsp" + : AbSyn.UntypedFunDec list)); +# 384 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> AbSyn.Type in + let _2 = parseState.GetInput(2) :?> string * Position in + let _3 = parseState.GetInput(3) :?> Position in + let _4 = parseState.GetInput(4) :?> 'gentype_Params in + let _5 = parseState.GetInput(5) :?> Position in + let _6 = parseState.GetInput(6) :?> Position in + let _7 = parseState.GetInput(7) :?> AbSyn.UntypedExp in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 73 "Parser.fsp" + FunDec (fst _2, _1, _4, _7, snd _2) + ) +# 73 "Parser.fsp" + : AbSyn.UntypedFunDec)); +# 401 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> AbSyn.Type in + let _2 = parseState.GetInput(2) :?> string * Position in + let _3 = parseState.GetInput(3) :?> Position in + let _4 = parseState.GetInput(4) :?> Position in + let _5 = parseState.GetInput(5) :?> Position in + let _6 = parseState.GetInput(6) :?> AbSyn.UntypedExp in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 75 "Parser.fsp" + FunDec (fst _2, _1, [], _6, snd _2) + ) +# 75 "Parser.fsp" + : AbSyn.UntypedFunDec)); +# 417 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 78 "Parser.fsp" + AbSyn.Int + ) +# 78 "Parser.fsp" + : AbSyn.Type)); +# 428 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 79 "Parser.fsp" + AbSyn.Char + ) +# 79 "Parser.fsp" + : AbSyn.Type)); +# 439 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 80 "Parser.fsp" + AbSyn.Bool + ) +# 80 "Parser.fsp" + : AbSyn.Type)); +# 450 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> AbSyn.Type in + let _3 = parseState.GetInput(3) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 81 "Parser.fsp" + AbSyn.Array _2 + ) +# 81 "Parser.fsp" + : AbSyn.Type)); +# 463 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> AbSyn.Type in + let _2 = parseState.GetInput(2) :?> string * Position in + let _3 = parseState.GetInput(3) :?> Position in + let _4 = parseState.GetInput(4) :?> 'gentype_Params in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 85 "Parser.fsp" + Param (fst _2, _1) :: _4 + ) +# 85 "Parser.fsp" + : 'gentype_Params)); +# 477 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> AbSyn.Type in + let _2 = parseState.GetInput(2) :?> string * Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 86 "Parser.fsp" + Param (fst _2, _1) :: [] + ) +# 86 "Parser.fsp" + : 'gentype_Params)); +# 489 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 90 "Parser.fsp" + (Lambda + (Int, [Param ("x", Int); + Param ("y", Int)], + Plus (Var ("x", _1), + Var ("y", _1), + _1) ,_1)) + ) +# 90 "Parser.fsp" + : 'gentype_BinOp)); +# 505 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> int * Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 103 "Parser.fsp" + Constant (IntVal (fst _1), snd _1) + ) +# 103 "Parser.fsp" + : AbSyn.UntypedExp)); +# 516 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> char * Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 104 "Parser.fsp" + Constant (CharVal (fst _1), snd _1) + ) +# 104 "Parser.fsp" + : AbSyn.UntypedExp)); +# 527 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> string * Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 105 "Parser.fsp" + Var _1 + ) +# 105 "Parser.fsp" + : AbSyn.UntypedExp)); +# 538 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> string * Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 106 "Parser.fsp" + StringLit _1 + ) +# 106 "Parser.fsp" + : AbSyn.UntypedExp)); +# 549 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> AbSyn.UntypedExp list in + let _3 = parseState.GetInput(3) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 108 "Parser.fsp" + ArrayLit (_2, (), _1) + ) +# 108 "Parser.fsp" + : AbSyn.UntypedExp)); +# 562 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> AbSyn.UntypedExp in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> AbSyn.UntypedExp in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 109 "Parser.fsp" + Plus (_1, _3, _2) + ) +# 109 "Parser.fsp" + : AbSyn.UntypedExp)); +# 575 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> AbSyn.UntypedExp in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> AbSyn.UntypedExp in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 110 "Parser.fsp" + Minus(_1, _3, _2) + ) +# 110 "Parser.fsp" + : AbSyn.UntypedExp)); +# 588 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> AbSyn.UntypedExp in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> AbSyn.UntypedExp in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 111 "Parser.fsp" + Equal(_1, _3, _2) + ) +# 111 "Parser.fsp" + : AbSyn.UntypedExp)); +# 601 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> AbSyn.UntypedExp in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> AbSyn.UntypedExp in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 112 "Parser.fsp" + Less (_1, _3, _2) + ) +# 112 "Parser.fsp" + : AbSyn.UntypedExp)); +# 614 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> AbSyn.UntypedExp in + let _3 = parseState.GetInput(3) :?> Position in + let _4 = parseState.GetInput(4) :?> AbSyn.UntypedExp in + let _5 = parseState.GetInput(5) :?> Position in + let _6 = parseState.GetInput(6) :?> AbSyn.UntypedExp in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 114 "Parser.fsp" + If (_2, _4, _6, _1) + ) +# 114 "Parser.fsp" + : AbSyn.UntypedExp)); +# 630 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> string * Position in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> AbSyn.UntypedExp list in + let _4 = parseState.GetInput(4) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 116 "Parser.fsp" + Apply (fst _1, _3, snd _1) + ) +# 116 "Parser.fsp" + : AbSyn.UntypedExp)); +# 644 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> string * Position in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 117 "Parser.fsp" + Apply (fst _1, [], snd _1) + ) +# 117 "Parser.fsp" + : AbSyn.UntypedExp)); +# 657 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> AbSyn.Type in + let _4 = parseState.GetInput(4) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 119 "Parser.fsp" + Read (_3, _1) + ) +# 119 "Parser.fsp" + : AbSyn.UntypedExp)); +# 671 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> AbSyn.UntypedExp in + let _4 = parseState.GetInput(4) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 121 "Parser.fsp" + Write (_3, (), _1) + ) +# 121 "Parser.fsp" + : AbSyn.UntypedExp)); +# 685 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> AbSyn.UntypedExp in + let _4 = parseState.GetInput(4) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 123 "Parser.fsp" + Iota (_3, _1) + ) +# 123 "Parser.fsp" + : AbSyn.UntypedExp)); +# 699 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> AbSyn.UntypedFunArg in + let _4 = parseState.GetInput(4) :?> Position in + let _5 = parseState.GetInput(5) :?> AbSyn.UntypedExp in + let _6 = parseState.GetInput(6) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 125 "Parser.fsp" + Map (_3, _5, (), (), _1) + ) +# 125 "Parser.fsp" + : AbSyn.UntypedExp)); +# 715 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> AbSyn.UntypedFunArg in + let _4 = parseState.GetInput(4) :?> Position in + let _5 = parseState.GetInput(5) :?> AbSyn.UntypedExp in + let _6 = parseState.GetInput(6) :?> Position in + let _7 = parseState.GetInput(7) :?> AbSyn.UntypedExp in + let _8 = parseState.GetInput(8) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 127 "Parser.fsp" + Reduce (_3, _5, _7, (), _1) + ) +# 127 "Parser.fsp" + : AbSyn.UntypedExp)); +# 733 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> Position in + let _4 = parseState.GetInput(4) :?> 'gentype_BinOp in + let _5 = parseState.GetInput(5) :?> Position in + let _6 = parseState.GetInput(6) :?> AbSyn.UntypedExp in + let _7 = parseState.GetInput(7) :?> Position in + let _8 = parseState.GetInput(8) :?> AbSyn.UntypedExp in + let _9 = parseState.GetInput(9) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 129 "Parser.fsp" + Reduce (_4, _6, _8, (), _1) + ) +# 129 "Parser.fsp" + : AbSyn.UntypedExp)); +# 752 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> AbSyn.UntypedExp in + let _3 = parseState.GetInput(3) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 130 "Parser.fsp" + _2 + ) +# 130 "Parser.fsp" + : AbSyn.UntypedExp)); +# 765 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> string * Position in + let _3 = parseState.GetInput(3) :?> Position in + let _4 = parseState.GetInput(4) :?> AbSyn.UntypedExp in + let _5 = parseState.GetInput(5) :?> Position in + let _6 = parseState.GetInput(6) :?> AbSyn.UntypedExp in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 133 "Parser.fsp" + Let (Dec (fst _2, _4, _3), _6, _1) + ) +# 133 "Parser.fsp" + : AbSyn.UntypedExp)); +# 781 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> string * Position in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> AbSyn.UntypedExp in + let _4 = parseState.GetInput(4) :?> Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 135 "Parser.fsp" + Index (fst _1, _3, (), _2) + ) +# 135 "Parser.fsp" + : AbSyn.UntypedExp)); +# 795 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> AbSyn.UntypedExp in + let _2 = parseState.GetInput(2) :?> Position in + let _3 = parseState.GetInput(3) :?> AbSyn.UntypedExp list in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 138 "Parser.fsp" + _1 :: _3 + ) +# 138 "Parser.fsp" + : AbSyn.UntypedExp list)); +# 808 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> AbSyn.UntypedExp in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 139 "Parser.fsp" + _1 :: [] + ) +# 139 "Parser.fsp" + : AbSyn.UntypedExp list)); +# 819 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> string * Position in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 142 "Parser.fsp" + FunName (fst _1 ) + ) +# 142 "Parser.fsp" + : AbSyn.UntypedFunArg)); +# 830 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> AbSyn.Type in + let _3 = parseState.GetInput(3) :?> Position in + let _4 = parseState.GetInput(4) :?> Position in + let _5 = parseState.GetInput(5) :?> Position in + let _6 = parseState.GetInput(6) :?> AbSyn.UntypedExp in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 144 "Parser.fsp" + Lambda (_2, [], _6, _1) + ) +# 144 "Parser.fsp" + : AbSyn.UntypedFunArg)); +# 846 "Parser.fs" + (fun (parseState : FSharp.Text.Parsing.IParseState) -> + let _1 = parseState.GetInput(1) :?> Position in + let _2 = parseState.GetInput(2) :?> AbSyn.Type in + let _3 = parseState.GetInput(3) :?> Position in + let _4 = parseState.GetInput(4) :?> 'gentype_Params in + let _5 = parseState.GetInput(5) :?> Position in + let _6 = parseState.GetInput(6) :?> Position in + let _7 = parseState.GetInput(7) :?> AbSyn.UntypedExp in + Microsoft.FSharp.Core.Operators.box + ( + ( +# 146 "Parser.fsp" + Lambda (_2, _4, _7, _1) + ) +# 146 "Parser.fsp" + : AbSyn.UntypedFunArg)); +|] +# 864 "Parser.fs" +let tables : FSharp.Text.Parsing.Tables<_> = + { reductions= _fsyacc_reductions (); + endOfInputTag = _fsyacc_endOfInputTag; + tagOfToken = tagOfToken; + dataOfToken = _fsyacc_dataOfToken; + actionTableElements = _fsyacc_actionTableElements; + actionTableRowOffsets = _fsyacc_actionTableRowOffsets; + stateToProdIdxsTableElements = _fsyacc_stateToProdIdxsTableElements; + stateToProdIdxsTableRowOffsets = _fsyacc_stateToProdIdxsTableRowOffsets; + reductionSymbolCounts = _fsyacc_reductionSymbolCounts; + immediateActions = _fsyacc_immediateActions; + gotos = _fsyacc_gotos; + sparseGotoTableRowOffsets = _fsyacc_sparseGotoTableRowOffsets; + tagOfErrorTerminal = _fsyacc_tagOfErrorTerminal; + parseError = (fun (ctxt:FSharp.Text.Parsing.ParseErrorContext<_>) -> + match parse_error_rich with + | Some f -> f ctxt + | None -> parse_error ctxt.Message); + numTerminals = 39; + productionToNonTerminalTable = _fsyacc_productionToNonTerminalTable } +let engine lexer lexbuf startState = tables.Interpret(lexer, lexbuf, startState) +let Prog lexer lexbuf : AbSyn.UntypedProg = + engine lexer lexbuf 0 :?> _ diff --git a/W1/fasto/Fasto/Parser.fsi b/W1/fasto/Fasto/Parser.fsi new file mode 100644 index 0000000..c5f62f9 --- /dev/null +++ b/W1/fasto/Fasto/Parser.fsi @@ -0,0 +1,101 @@ +// Signature file for parser generated by fsyacc +module Parser +type token = + | LPAR of (Position) + | RPAR of (Position) + | LBRACKET of (Position) + | RBRACKET of (Position) + | LCURLY of (Position) + | RCURLY of (Position) + | FUN of (Position) + | FN of (Position) + | COMMA of (Position) + | SEMICOLON of (Position) + | READ of (Position) + | WRITE of (Position) + | DEQ of (Position) + | LTH of (Position) + | EQ of (Position) + | OP of (Position) + | MAP of (Position) + | REDUCE of (Position) + | IOTA of (Position) + | ARROW of (Position) + | PLUS of (Position) + | MINUS of (Position) + | LESS of (Position) + | INT of (Position) + | CHAR of (Position) + | BOOL of (Position) + | IF of (Position) + | THEN of (Position) + | ELSE of (Position) + | LET of (Position) + | IN of (Position) + | EOF of (Position) + | ID of (string * Position) + | STRINGLIT of (string * Position) + | CHARLIT of (char * Position) + | NUM of (int * Position) +type tokenId = + | TOKEN_LPAR + | TOKEN_RPAR + | TOKEN_LBRACKET + | TOKEN_RBRACKET + | TOKEN_LCURLY + | TOKEN_RCURLY + | TOKEN_FUN + | TOKEN_FN + | TOKEN_COMMA + | TOKEN_SEMICOLON + | TOKEN_READ + | TOKEN_WRITE + | TOKEN_DEQ + | TOKEN_LTH + | TOKEN_EQ + | TOKEN_OP + | TOKEN_MAP + | TOKEN_REDUCE + | TOKEN_IOTA + | TOKEN_ARROW + | TOKEN_PLUS + | TOKEN_MINUS + | TOKEN_LESS + | TOKEN_INT + | TOKEN_CHAR + | TOKEN_BOOL + | TOKEN_IF + | TOKEN_THEN + | TOKEN_ELSE + | TOKEN_LET + | TOKEN_IN + | TOKEN_EOF + | TOKEN_ID + | TOKEN_STRINGLIT + | TOKEN_CHARLIT + | TOKEN_NUM + | TOKEN_end_of_input + | TOKEN_error +type nonTerminalId = + | NONTERM__startProg + | NONTERM_Prog + | NONTERM_FunDecs + | NONTERM_Fun + | NONTERM_Type + | NONTERM_Params + | NONTERM_BinOp + | NONTERM_Exp + | NONTERM_Exps + | NONTERM_FunArg +/// This function maps tokens to integer indexes +val tagOfToken: token -> int + +/// This function maps integer indexes to symbolic token ids +val tokenTagToTokenId: int -> tokenId + +/// This function maps production indexes returned in syntax errors to strings representing the non terminal that would be produced by that production +val prodIdxToNonTerminal: int -> nonTerminalId + +/// This function gets the name of a token as a string +val token_to_string: token -> string +val Prog : (FSharp.Text.Lexing.LexBuffer<'cty> -> token) -> FSharp.Text.Lexing.LexBuffer<'cty> -> (AbSyn.UntypedProg) diff --git a/W1/fasto/Fasto/Parser.fsp b/W1/fasto/Fasto/Parser.fsp new file mode 100644 index 0000000..a0bad45 --- /dev/null +++ b/W1/fasto/Fasto/Parser.fsp @@ -0,0 +1,149 @@ + +%{ + +let p0 = (0,0) + +open FSharp.Text.Parsing +open AbSyn + +(* parse-error function *) +let mutable ErrorContextDescriptor : string = "" + +let parse_error_rich = + Some (fun (ctxt: ParseErrorContext<_>) -> + ErrorContextDescriptor <- + match ctxt.CurrentToken with + | None -> "At beginning of input\n" + | Some token -> sprintf "at token %A\n" token + ) + +%} + +////////////////////////////////////////////////////////////////////// +// TODO: Add new (lexer) token definitions: +// +// TODO: project task 1 : +// - multiplication (*), division (/), numerical negation (~), +// logical negation (not), logical and (&&), logical or (||), +// boolean literals (true, false) +// - add the required precedence and associativity rules for +// *, /, ~, not, &&, || +// - generalize the syntax of let-expressions to allow +// multiple variable declarations +// +// TODO: project task 2: replicate, filter, scan +// +// TODO: project task 4: array comprehension +////////////////////////////////////////////////////////////////////// + +%token NUM +%token CHARLIT +%token ID STRINGLIT +%token IF THEN ELSE LET IN EOF +%token INT CHAR BOOL +%token PLUS MINUS LESS +%token DEQ LTH EQ OP MAP REDUCE IOTA ARROW +%token FUN FN COMMA SEMICOLON READ WRITE +%token LPAR RPAR LBRACKET RBRACKET LCURLY RCURLY + +%nonassoc ifprec letprec +%left DEQ LTH +%left PLUS MINUS + +%start Prog +%type Prog +%type FunDecs +%type Fun +%type Type +%type Exp +%type Exps +%type FunArg +// TODO: Task 1(b): add any new nonterminals here + +%% + +Prog : FunDecs EOF { $1 } +; + +FunDecs : FUN Fun FunDecs { $2 :: $3 } + | FUN Fun { $2 :: [] } +; + +Fun : Type ID LPAR Params RPAR EQ Exp + { FunDec (fst $2, $1, $4, $7, snd $2) } + | Type ID LPAR RPAR EQ Exp + { FunDec (fst $2, $1, [], $6, snd $2) } +; + +Type : INT { AbSyn.Int } + | CHAR { AbSyn.Char } + | BOOL { AbSyn.Bool } + | LBRACKET Type RBRACKET { AbSyn.Array $2 } +; + +Params : Type ID COMMA Params + { Param (fst $2, $1) :: $4 } + | Type ID { Param (fst $2, $1) :: [] } +; + + +BinOp : PLUS { (Lambda + (Int, [Param ("x", Int); + Param ("y", Int)], + Plus (Var ("x", $1), + Var ("y", $1), + $1) ,$1))} +; + +/////////////////////////////////////////////////////// +// TODO: project tasks 1,2,4: +// add grammer rules for the new expressions +/////////////////////////////////////////////////////// + +Exp : NUM { Constant (IntVal (fst $1), snd $1) } + | CHARLIT { Constant (CharVal (fst $1), snd $1) } + | ID { Var $1 } + | STRINGLIT { StringLit $1 } + | LCURLY Exps RCURLY + { ArrayLit ($2, (), $1) } + | Exp PLUS Exp { Plus ($1, $3, $2) } + | Exp MINUS Exp { Minus($1, $3, $2) } + | Exp DEQ Exp { Equal($1, $3, $2) } + | Exp LTH Exp { Less ($1, $3, $2) } + | IF Exp THEN Exp ELSE Exp %prec ifprec + { If ($2, $4, $6, $1) } + | ID LPAR Exps RPAR + { Apply (fst $1, $3, snd $1) } + | ID LPAR RPAR { Apply (fst $1, [], snd $1) } + | READ LPAR Type RPAR + { Read ($3, $1) } + | WRITE LPAR Exp RPAR + { Write ($3, (), $1) } + | IOTA LPAR Exp RPAR + { Iota ($3, $1) } + | MAP LPAR FunArg COMMA Exp RPAR + { Map ($3, $5, (), (), $1) } + | REDUCE LPAR FunArg COMMA Exp COMMA Exp RPAR + { Reduce ($3, $5, $7, (), $1) } + | REDUCE LPAR OP BinOp COMMA Exp COMMA Exp RPAR + { Reduce ($4, $6, $8, (), $1) } + | LPAR Exp RPAR { $2 } + // TODO: task 1(b): replace this with a more general production + | LET ID EQ Exp IN Exp %prec letprec + { Let (Dec (fst $2, $4, $3), $6, $1) } + | ID LBRACKET Exp RBRACKET + { Index (fst $1, $3, (), $2) } +; + +Exps : Exp COMMA Exps { $1 :: $3 } + | Exp { $1 :: [] } +; + +FunArg : ID { FunName (fst $1 ) } + | FN Type LPAR RPAR ARROW Exp + { Lambda ($2, [], $6, $1) } + | FN Type LPAR Params RPAR ARROW Exp + { Lambda ($2, $4, $7, $1) } +; + +%% diff --git a/W1/fasto/Fasto/Parser.fsyacc.output b/W1/fasto/Fasto/Parser.fsyacc.output new file mode 100644 index 0000000..a94e590 --- /dev/null +++ b/W1/fasto/Fasto/Parser.fsyacc.output @@ -0,0 +1,4640 @@ + Output file describing compiled parser placed in Parser.fs and Parser.fsi +------------------------ +states = +state 0: items: _startProg -> . Prog + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): shift 4 + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Prog: 1 + goto FunDecs: 2 +state 1: items: _startProg -> Prog . + actions: action 'LPAR' (noprec): accept + action 'RPAR' (noprec): accept + action 'LBRACKET' (noprec): accept + action 'RBRACKET' (noprec): accept + action 'LCURLY' (noprec): accept + action 'RCURLY' (noprec): accept + action 'FUN' (noprec): accept + action 'FN' (noprec): accept + action 'COMMA' (noprec): accept + action 'SEMICOLON' (noprec): accept + action 'READ' (noprec): accept + action 'WRITE' (noprec): accept + action 'DEQ' (noprec): accept + action 'LTH' (noprec): accept + action 'EQ' (noprec): accept + action 'OP' (noprec): accept + action 'MAP' (noprec): accept + action 'REDUCE' (noprec): accept + action 'IOTA' (noprec): accept + action 'ARROW' (noprec): accept + action 'PLUS' (noprec): accept + action 'MINUS' (noprec): accept + action 'LESS' (noprec): accept + action 'INT' (noprec): accept + action 'CHAR' (noprec): accept + action 'BOOL' (noprec): accept + action 'IF' (noprec): accept + action 'THEN' (noprec): accept + action 'ELSE' (noprec): accept + action 'LET' (noprec): accept + action 'IN' (noprec): accept + action 'EOF' (noprec): accept + action 'ID' (noprec): accept + action 'STRINGLIT' (noprec): accept + action 'CHARLIT' (noprec): accept + action 'NUM' (noprec): accept + action 'error' (noprec): accept + action '#' (noprec): accept + action '$$' (noprec): accept + immediate action: accept gotos:state 2: items: Prog -> FunDecs . 'EOF' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): shift 3 + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 3: items: Prog -> FunDecs 'EOF' . + actions: action 'LPAR' (noprec): reduce Prog --> FunDecs 'EOF' + action 'RPAR' (noprec): reduce Prog --> FunDecs 'EOF' + action 'LBRACKET' (noprec): reduce Prog --> FunDecs 'EOF' + action 'RBRACKET' (noprec): reduce Prog --> FunDecs 'EOF' + action 'LCURLY' (noprec): reduce Prog --> FunDecs 'EOF' + action 'RCURLY' (noprec): reduce Prog --> FunDecs 'EOF' + action 'FUN' (noprec): reduce Prog --> FunDecs 'EOF' + action 'FN' (noprec): reduce Prog --> FunDecs 'EOF' + action 'COMMA' (noprec): reduce Prog --> FunDecs 'EOF' + action 'SEMICOLON' (noprec): reduce Prog --> FunDecs 'EOF' + action 'READ' (noprec): reduce Prog --> FunDecs 'EOF' + action 'WRITE' (noprec): reduce Prog --> FunDecs 'EOF' + action 'DEQ' (noprec): reduce Prog --> FunDecs 'EOF' + action 'LTH' (noprec): reduce Prog --> FunDecs 'EOF' + action 'EQ' (noprec): reduce Prog --> FunDecs 'EOF' + action 'OP' (noprec): reduce Prog --> FunDecs 'EOF' + action 'MAP' (noprec): reduce Prog --> FunDecs 'EOF' + action 'REDUCE' (noprec): reduce Prog --> FunDecs 'EOF' + action 'IOTA' (noprec): reduce Prog --> FunDecs 'EOF' + action 'ARROW' (noprec): reduce Prog --> FunDecs 'EOF' + action 'PLUS' (noprec): reduce Prog --> FunDecs 'EOF' + action 'MINUS' (noprec): reduce Prog --> FunDecs 'EOF' + action 'LESS' (noprec): reduce Prog --> FunDecs 'EOF' + action 'INT' (noprec): reduce Prog --> FunDecs 'EOF' + action 'CHAR' (noprec): reduce Prog --> FunDecs 'EOF' + action 'BOOL' (noprec): reduce Prog --> FunDecs 'EOF' + action 'IF' (noprec): reduce Prog --> FunDecs 'EOF' + action 'THEN' (noprec): reduce Prog --> FunDecs 'EOF' + action 'ELSE' (noprec): reduce Prog --> FunDecs 'EOF' + action 'LET' (noprec): reduce Prog --> FunDecs 'EOF' + action 'IN' (noprec): reduce Prog --> FunDecs 'EOF' + action 'EOF' (noprec): reduce Prog --> FunDecs 'EOF' + action 'ID' (noprec): reduce Prog --> FunDecs 'EOF' + action 'STRINGLIT' (noprec): reduce Prog --> FunDecs 'EOF' + action 'CHARLIT' (noprec): reduce Prog --> FunDecs 'EOF' + action 'NUM' (noprec): reduce Prog --> FunDecs 'EOF' + action 'error' (noprec): reduce Prog --> FunDecs 'EOF' + action '#' (noprec): reduce Prog --> FunDecs 'EOF' + action '$$' (noprec): reduce Prog --> FunDecs 'EOF' + immediate action: reduce Prog --> FunDecs 'EOF' gotos:state 4: items: FunDecs -> 'FUN' . Fun FunDecs + FunDecs -> 'FUN' . Fun + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): shift 20 + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): shift 17 + action 'CHAR' (noprec): shift 18 + action 'BOOL' (noprec): shift 19 + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Fun: 5 + goto Type: 7 +state 5: items: FunDecs -> 'FUN' Fun . FunDecs + FunDecs -> 'FUN' Fun . + actions: action 'LPAR' (noprec): reduce FunDecs --> 'FUN' Fun + action 'RPAR' (noprec): reduce FunDecs --> 'FUN' Fun + action 'LBRACKET' (noprec): reduce FunDecs --> 'FUN' Fun + action 'RBRACKET' (noprec): reduce FunDecs --> 'FUN' Fun + action 'LCURLY' (noprec): reduce FunDecs --> 'FUN' Fun + action 'RCURLY' (noprec): reduce FunDecs --> 'FUN' Fun + action 'FUN' (noprec): shift 4 + action 'FN' (noprec): reduce FunDecs --> 'FUN' Fun + action 'COMMA' (noprec): reduce FunDecs --> 'FUN' Fun + action 'SEMICOLON' (noprec): reduce FunDecs --> 'FUN' Fun + action 'READ' (noprec): reduce FunDecs --> 'FUN' Fun + action 'WRITE' (noprec): reduce FunDecs --> 'FUN' Fun + action 'DEQ' (noprec): reduce FunDecs --> 'FUN' Fun + action 'LTH' (noprec): reduce FunDecs --> 'FUN' Fun + action 'EQ' (noprec): reduce FunDecs --> 'FUN' Fun + action 'OP' (noprec): reduce FunDecs --> 'FUN' Fun + action 'MAP' (noprec): reduce FunDecs --> 'FUN' Fun + action 'REDUCE' (noprec): reduce FunDecs --> 'FUN' Fun + action 'IOTA' (noprec): reduce FunDecs --> 'FUN' Fun + action 'ARROW' (noprec): reduce FunDecs --> 'FUN' Fun + action 'PLUS' (noprec): reduce FunDecs --> 'FUN' Fun + action 'MINUS' (noprec): reduce FunDecs --> 'FUN' Fun + action 'LESS' (noprec): reduce FunDecs --> 'FUN' Fun + action 'INT' (noprec): reduce FunDecs --> 'FUN' Fun + action 'CHAR' (noprec): reduce FunDecs --> 'FUN' Fun + action 'BOOL' (noprec): reduce FunDecs --> 'FUN' Fun + action 'IF' (noprec): reduce FunDecs --> 'FUN' Fun + action 'THEN' (noprec): reduce FunDecs --> 'FUN' Fun + action 'ELSE' (noprec): reduce FunDecs --> 'FUN' Fun + action 'LET' (noprec): reduce FunDecs --> 'FUN' Fun + action 'IN' (noprec): reduce FunDecs --> 'FUN' Fun + action 'EOF' (noprec): reduce FunDecs --> 'FUN' Fun + action 'ID' (noprec): reduce FunDecs --> 'FUN' Fun + action 'STRINGLIT' (noprec): reduce FunDecs --> 'FUN' Fun + action 'CHARLIT' (noprec): reduce FunDecs --> 'FUN' Fun + action 'NUM' (noprec): reduce FunDecs --> 'FUN' Fun + action 'error' (noprec): reduce FunDecs --> 'FUN' Fun + action '#' (noprec): reduce FunDecs --> 'FUN' Fun + action '$$' (noprec): reduce FunDecs --> 'FUN' Fun + immediate action: gotos: goto FunDecs: 6 +state 6: items: FunDecs -> 'FUN' Fun FunDecs . + actions: action 'LPAR' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'RPAR' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'LBRACKET' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'RBRACKET' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'LCURLY' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'RCURLY' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'FUN' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'FN' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'COMMA' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'SEMICOLON' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'READ' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'WRITE' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'DEQ' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'LTH' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'EQ' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'OP' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'MAP' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'REDUCE' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'IOTA' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'ARROW' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'PLUS' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'MINUS' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'LESS' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'INT' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'CHAR' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'BOOL' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'IF' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'THEN' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'ELSE' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'LET' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'IN' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'EOF' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'ID' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'STRINGLIT' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'CHARLIT' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'NUM' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action 'error' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action '#' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + action '$$' (noprec): reduce FunDecs --> 'FUN' Fun FunDecs + immediate action: reduce FunDecs --> 'FUN' Fun FunDecs gotos:state 7: items: Fun -> Type . 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + Fun -> Type . 'ID' 'LPAR' 'RPAR' 'EQ' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 8 + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 8: items: Fun -> Type 'ID' . 'LPAR' Params 'RPAR' 'EQ' Exp + Fun -> Type 'ID' . 'LPAR' 'RPAR' 'EQ' Exp + actions: action 'LPAR' (noprec): shift 9 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 9: items: Fun -> Type 'ID' 'LPAR' . Params 'RPAR' 'EQ' Exp + Fun -> Type 'ID' 'LPAR' . 'RPAR' 'EQ' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): shift 14 + action 'LBRACKET' (noprec): shift 20 + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): shift 17 + action 'CHAR' (noprec): shift 18 + action 'BOOL' (noprec): shift 19 + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Type: 23 + goto Params: 10 +state 10: items: Fun -> Type 'ID' 'LPAR' Params . 'RPAR' 'EQ' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): shift 11 + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 11: items: Fun -> Type 'ID' 'LPAR' Params 'RPAR' . 'EQ' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): shift 12 + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 12: items: Fun -> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' . Exp + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 13 +state 13: items: Fun -> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp . + Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + actions: action 'LPAR' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'RPAR' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'LBRACKET' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'RBRACKET' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'LCURLY' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'RCURLY' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'FUN' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'FN' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'COMMA' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'SEMICOLON' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'READ' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'WRITE' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'OP' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'MAP' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'REDUCE' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'IOTA' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'ARROW' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'INT' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'CHAR' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'BOOL' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'IF' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'THEN' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'ELSE' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'LET' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'IN' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'EOF' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'ID' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'STRINGLIT' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'CHARLIT' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'NUM' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action 'error' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action '#' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + action '$$' (noprec): reduce Fun --> Type 'ID' 'LPAR' Params 'RPAR' 'EQ' Exp + immediate action: gotos:state 14: items: Fun -> Type 'ID' 'LPAR' 'RPAR' . 'EQ' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): shift 15 + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 15: items: Fun -> Type 'ID' 'LPAR' 'RPAR' 'EQ' . Exp + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 16 +state 16: items: Fun -> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp . + Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + actions: action 'LPAR' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'RPAR' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'LBRACKET' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'RBRACKET' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'LCURLY' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'RCURLY' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'FUN' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'FN' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'COMMA' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'SEMICOLON' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'READ' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'WRITE' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'OP' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'MAP' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'REDUCE' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'IOTA' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'ARROW' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'INT' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'CHAR' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'BOOL' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'IF' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'THEN' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'ELSE' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'LET' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'IN' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'EOF' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'ID' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'STRINGLIT' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'CHARLIT' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'NUM' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action 'error' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action '#' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + action '$$' (noprec): reduce Fun --> Type 'ID' 'LPAR' 'RPAR' 'EQ' Exp + immediate action: gotos:state 17: items: Type -> 'INT' . + actions: action 'LPAR' (noprec): reduce Type --> 'INT' + action 'RPAR' (noprec): reduce Type --> 'INT' + action 'LBRACKET' (noprec): reduce Type --> 'INT' + action 'RBRACKET' (noprec): reduce Type --> 'INT' + action 'LCURLY' (noprec): reduce Type --> 'INT' + action 'RCURLY' (noprec): reduce Type --> 'INT' + action 'FUN' (noprec): reduce Type --> 'INT' + action 'FN' (noprec): reduce Type --> 'INT' + action 'COMMA' (noprec): reduce Type --> 'INT' + action 'SEMICOLON' (noprec): reduce Type --> 'INT' + action 'READ' (noprec): reduce Type --> 'INT' + action 'WRITE' (noprec): reduce Type --> 'INT' + action 'DEQ' (noprec): reduce Type --> 'INT' + action 'LTH' (noprec): reduce Type --> 'INT' + action 'EQ' (noprec): reduce Type --> 'INT' + action 'OP' (noprec): reduce Type --> 'INT' + action 'MAP' (noprec): reduce Type --> 'INT' + action 'REDUCE' (noprec): reduce Type --> 'INT' + action 'IOTA' (noprec): reduce Type --> 'INT' + action 'ARROW' (noprec): reduce Type --> 'INT' + action 'PLUS' (noprec): reduce Type --> 'INT' + action 'MINUS' (noprec): reduce Type --> 'INT' + action 'LESS' (noprec): reduce Type --> 'INT' + action 'INT' (noprec): reduce Type --> 'INT' + action 'CHAR' (noprec): reduce Type --> 'INT' + action 'BOOL' (noprec): reduce Type --> 'INT' + action 'IF' (noprec): reduce Type --> 'INT' + action 'THEN' (noprec): reduce Type --> 'INT' + action 'ELSE' (noprec): reduce Type --> 'INT' + action 'LET' (noprec): reduce Type --> 'INT' + action 'IN' (noprec): reduce Type --> 'INT' + action 'EOF' (noprec): reduce Type --> 'INT' + action 'ID' (noprec): reduce Type --> 'INT' + action 'STRINGLIT' (noprec): reduce Type --> 'INT' + action 'CHARLIT' (noprec): reduce Type --> 'INT' + action 'NUM' (noprec): reduce Type --> 'INT' + action 'error' (noprec): reduce Type --> 'INT' + action '#' (noprec): reduce Type --> 'INT' + action '$$' (noprec): reduce Type --> 'INT' + immediate action: reduce Type --> 'INT' gotos:state 18: items: Type -> 'CHAR' . + actions: action 'LPAR' (noprec): reduce Type --> 'CHAR' + action 'RPAR' (noprec): reduce Type --> 'CHAR' + action 'LBRACKET' (noprec): reduce Type --> 'CHAR' + action 'RBRACKET' (noprec): reduce Type --> 'CHAR' + action 'LCURLY' (noprec): reduce Type --> 'CHAR' + action 'RCURLY' (noprec): reduce Type --> 'CHAR' + action 'FUN' (noprec): reduce Type --> 'CHAR' + action 'FN' (noprec): reduce Type --> 'CHAR' + action 'COMMA' (noprec): reduce Type --> 'CHAR' + action 'SEMICOLON' (noprec): reduce Type --> 'CHAR' + action 'READ' (noprec): reduce Type --> 'CHAR' + action 'WRITE' (noprec): reduce Type --> 'CHAR' + action 'DEQ' (noprec): reduce Type --> 'CHAR' + action 'LTH' (noprec): reduce Type --> 'CHAR' + action 'EQ' (noprec): reduce Type --> 'CHAR' + action 'OP' (noprec): reduce Type --> 'CHAR' + action 'MAP' (noprec): reduce Type --> 'CHAR' + action 'REDUCE' (noprec): reduce Type --> 'CHAR' + action 'IOTA' (noprec): reduce Type --> 'CHAR' + action 'ARROW' (noprec): reduce Type --> 'CHAR' + action 'PLUS' (noprec): reduce Type --> 'CHAR' + action 'MINUS' (noprec): reduce Type --> 'CHAR' + action 'LESS' (noprec): reduce Type --> 'CHAR' + action 'INT' (noprec): reduce Type --> 'CHAR' + action 'CHAR' (noprec): reduce Type --> 'CHAR' + action 'BOOL' (noprec): reduce Type --> 'CHAR' + action 'IF' (noprec): reduce Type --> 'CHAR' + action 'THEN' (noprec): reduce Type --> 'CHAR' + action 'ELSE' (noprec): reduce Type --> 'CHAR' + action 'LET' (noprec): reduce Type --> 'CHAR' + action 'IN' (noprec): reduce Type --> 'CHAR' + action 'EOF' (noprec): reduce Type --> 'CHAR' + action 'ID' (noprec): reduce Type --> 'CHAR' + action 'STRINGLIT' (noprec): reduce Type --> 'CHAR' + action 'CHARLIT' (noprec): reduce Type --> 'CHAR' + action 'NUM' (noprec): reduce Type --> 'CHAR' + action 'error' (noprec): reduce Type --> 'CHAR' + action '#' (noprec): reduce Type --> 'CHAR' + action '$$' (noprec): reduce Type --> 'CHAR' + immediate action: reduce Type --> 'CHAR' gotos:state 19: items: Type -> 'BOOL' . + actions: action 'LPAR' (noprec): reduce Type --> 'BOOL' + action 'RPAR' (noprec): reduce Type --> 'BOOL' + action 'LBRACKET' (noprec): reduce Type --> 'BOOL' + action 'RBRACKET' (noprec): reduce Type --> 'BOOL' + action 'LCURLY' (noprec): reduce Type --> 'BOOL' + action 'RCURLY' (noprec): reduce Type --> 'BOOL' + action 'FUN' (noprec): reduce Type --> 'BOOL' + action 'FN' (noprec): reduce Type --> 'BOOL' + action 'COMMA' (noprec): reduce Type --> 'BOOL' + action 'SEMICOLON' (noprec): reduce Type --> 'BOOL' + action 'READ' (noprec): reduce Type --> 'BOOL' + action 'WRITE' (noprec): reduce Type --> 'BOOL' + action 'DEQ' (noprec): reduce Type --> 'BOOL' + action 'LTH' (noprec): reduce Type --> 'BOOL' + action 'EQ' (noprec): reduce Type --> 'BOOL' + action 'OP' (noprec): reduce Type --> 'BOOL' + action 'MAP' (noprec): reduce Type --> 'BOOL' + action 'REDUCE' (noprec): reduce Type --> 'BOOL' + action 'IOTA' (noprec): reduce Type --> 'BOOL' + action 'ARROW' (noprec): reduce Type --> 'BOOL' + action 'PLUS' (noprec): reduce Type --> 'BOOL' + action 'MINUS' (noprec): reduce Type --> 'BOOL' + action 'LESS' (noprec): reduce Type --> 'BOOL' + action 'INT' (noprec): reduce Type --> 'BOOL' + action 'CHAR' (noprec): reduce Type --> 'BOOL' + action 'BOOL' (noprec): reduce Type --> 'BOOL' + action 'IF' (noprec): reduce Type --> 'BOOL' + action 'THEN' (noprec): reduce Type --> 'BOOL' + action 'ELSE' (noprec): reduce Type --> 'BOOL' + action 'LET' (noprec): reduce Type --> 'BOOL' + action 'IN' (noprec): reduce Type --> 'BOOL' + action 'EOF' (noprec): reduce Type --> 'BOOL' + action 'ID' (noprec): reduce Type --> 'BOOL' + action 'STRINGLIT' (noprec): reduce Type --> 'BOOL' + action 'CHARLIT' (noprec): reduce Type --> 'BOOL' + action 'NUM' (noprec): reduce Type --> 'BOOL' + action 'error' (noprec): reduce Type --> 'BOOL' + action '#' (noprec): reduce Type --> 'BOOL' + action '$$' (noprec): reduce Type --> 'BOOL' + immediate action: reduce Type --> 'BOOL' gotos:state 20: items: Type -> 'LBRACKET' . Type 'RBRACKET' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): shift 20 + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): shift 17 + action 'CHAR' (noprec): shift 18 + action 'BOOL' (noprec): shift 19 + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Type: 21 +state 21: items: Type -> 'LBRACKET' Type . 'RBRACKET' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): shift 22 + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 22: items: Type -> 'LBRACKET' Type 'RBRACKET' . + actions: action 'LPAR' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'RPAR' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'LBRACKET' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'RBRACKET' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'LCURLY' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'RCURLY' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'FUN' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'FN' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'COMMA' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'SEMICOLON' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'READ' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'WRITE' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'DEQ' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'LTH' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'EQ' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'OP' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'MAP' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'REDUCE' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'IOTA' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'ARROW' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'PLUS' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'MINUS' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'LESS' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'INT' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'CHAR' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'BOOL' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'IF' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'THEN' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'ELSE' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'LET' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'IN' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'EOF' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'ID' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'STRINGLIT' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'CHARLIT' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'NUM' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action 'error' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action '#' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + action '$$' (noprec): reduce Type --> 'LBRACKET' Type 'RBRACKET' + immediate action: reduce Type --> 'LBRACKET' Type 'RBRACKET' gotos:state 23: items: Params -> Type . 'ID' 'COMMA' Params + Params -> Type . 'ID' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 24 + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 24: items: Params -> Type 'ID' . 'COMMA' Params + Params -> Type 'ID' . + actions: action 'LPAR' (noprec): reduce Params --> Type 'ID' + action 'RPAR' (noprec): reduce Params --> Type 'ID' + action 'LBRACKET' (noprec): reduce Params --> Type 'ID' + action 'RBRACKET' (noprec): reduce Params --> Type 'ID' + action 'LCURLY' (noprec): reduce Params --> Type 'ID' + action 'RCURLY' (noprec): reduce Params --> Type 'ID' + action 'FUN' (noprec): reduce Params --> Type 'ID' + action 'FN' (noprec): reduce Params --> Type 'ID' + action 'COMMA' (noprec): shift 25 + action 'SEMICOLON' (noprec): reduce Params --> Type 'ID' + action 'READ' (noprec): reduce Params --> Type 'ID' + action 'WRITE' (noprec): reduce Params --> Type 'ID' + action 'DEQ' (noprec): reduce Params --> Type 'ID' + action 'LTH' (noprec): reduce Params --> Type 'ID' + action 'EQ' (noprec): reduce Params --> Type 'ID' + action 'OP' (noprec): reduce Params --> Type 'ID' + action 'MAP' (noprec): reduce Params --> Type 'ID' + action 'REDUCE' (noprec): reduce Params --> Type 'ID' + action 'IOTA' (noprec): reduce Params --> Type 'ID' + action 'ARROW' (noprec): reduce Params --> Type 'ID' + action 'PLUS' (noprec): reduce Params --> Type 'ID' + action 'MINUS' (noprec): reduce Params --> Type 'ID' + action 'LESS' (noprec): reduce Params --> Type 'ID' + action 'INT' (noprec): reduce Params --> Type 'ID' + action 'CHAR' (noprec): reduce Params --> Type 'ID' + action 'BOOL' (noprec): reduce Params --> Type 'ID' + action 'IF' (noprec): reduce Params --> Type 'ID' + action 'THEN' (noprec): reduce Params --> Type 'ID' + action 'ELSE' (noprec): reduce Params --> Type 'ID' + action 'LET' (noprec): reduce Params --> Type 'ID' + action 'IN' (noprec): reduce Params --> Type 'ID' + action 'EOF' (noprec): reduce Params --> Type 'ID' + action 'ID' (noprec): reduce Params --> Type 'ID' + action 'STRINGLIT' (noprec): reduce Params --> Type 'ID' + action 'CHARLIT' (noprec): reduce Params --> Type 'ID' + action 'NUM' (noprec): reduce Params --> Type 'ID' + action 'error' (noprec): reduce Params --> Type 'ID' + action '#' (noprec): reduce Params --> Type 'ID' + action '$$' (noprec): reduce Params --> Type 'ID' + immediate action: gotos:state 25: items: Params -> Type 'ID' 'COMMA' . Params + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): shift 20 + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): shift 17 + action 'CHAR' (noprec): shift 18 + action 'BOOL' (noprec): shift 19 + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Type: 23 + goto Params: 26 +state 26: items: Params -> Type 'ID' 'COMMA' Params . + actions: action 'LPAR' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'RPAR' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'LBRACKET' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'RBRACKET' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'LCURLY' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'RCURLY' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'FUN' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'FN' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'COMMA' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'SEMICOLON' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'READ' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'WRITE' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'DEQ' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'LTH' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'EQ' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'OP' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'MAP' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'REDUCE' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'IOTA' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'ARROW' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'PLUS' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'MINUS' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'LESS' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'INT' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'CHAR' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'BOOL' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'IF' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'THEN' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'ELSE' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'LET' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'IN' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'EOF' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'ID' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'STRINGLIT' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'CHARLIT' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'NUM' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action 'error' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action '#' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + action '$$' (noprec): reduce Params --> Type 'ID' 'COMMA' Params + immediate action: reduce Params --> Type 'ID' 'COMMA' Params gotos:state 27: items: BinOp -> 'PLUS' . + actions: action 'LPAR' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'RPAR' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'LBRACKET' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'RBRACKET' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'LCURLY' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'RCURLY' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'FUN' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'FN' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'COMMA' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'SEMICOLON' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'READ' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'WRITE' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'DEQ' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'LTH' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'EQ' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'OP' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'MAP' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'REDUCE' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'IOTA' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'ARROW' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'PLUS' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'MINUS' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'LESS' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'INT' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'CHAR' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'BOOL' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'IF' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'THEN' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'ELSE' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'LET' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'IN' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'EOF' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'ID' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'STRINGLIT' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'CHARLIT' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'NUM' (explicit left 9999): reduce BinOp --> 'PLUS' + action 'error' (explicit left 9999): reduce BinOp --> 'PLUS' + action '#' (explicit left 9999): reduce BinOp --> 'PLUS' + action '$$' (explicit left 9999): reduce BinOp --> 'PLUS' + immediate action: reduce BinOp --> 'PLUS' gotos:state 28: items: Exp -> 'NUM' . + actions: action 'LPAR' (noprec): reduce Exp --> 'NUM' + action 'RPAR' (noprec): reduce Exp --> 'NUM' + action 'LBRACKET' (noprec): reduce Exp --> 'NUM' + action 'RBRACKET' (noprec): reduce Exp --> 'NUM' + action 'LCURLY' (noprec): reduce Exp --> 'NUM' + action 'RCURLY' (noprec): reduce Exp --> 'NUM' + action 'FUN' (noprec): reduce Exp --> 'NUM' + action 'FN' (noprec): reduce Exp --> 'NUM' + action 'COMMA' (noprec): reduce Exp --> 'NUM' + action 'SEMICOLON' (noprec): reduce Exp --> 'NUM' + action 'READ' (noprec): reduce Exp --> 'NUM' + action 'WRITE' (noprec): reduce Exp --> 'NUM' + action 'DEQ' (noprec): reduce Exp --> 'NUM' + action 'LTH' (noprec): reduce Exp --> 'NUM' + action 'EQ' (noprec): reduce Exp --> 'NUM' + action 'OP' (noprec): reduce Exp --> 'NUM' + action 'MAP' (noprec): reduce Exp --> 'NUM' + action 'REDUCE' (noprec): reduce Exp --> 'NUM' + action 'IOTA' (noprec): reduce Exp --> 'NUM' + action 'ARROW' (noprec): reduce Exp --> 'NUM' + action 'PLUS' (noprec): reduce Exp --> 'NUM' + action 'MINUS' (noprec): reduce Exp --> 'NUM' + action 'LESS' (noprec): reduce Exp --> 'NUM' + action 'INT' (noprec): reduce Exp --> 'NUM' + action 'CHAR' (noprec): reduce Exp --> 'NUM' + action 'BOOL' (noprec): reduce Exp --> 'NUM' + action 'IF' (noprec): reduce Exp --> 'NUM' + action 'THEN' (noprec): reduce Exp --> 'NUM' + action 'ELSE' (noprec): reduce Exp --> 'NUM' + action 'LET' (noprec): reduce Exp --> 'NUM' + action 'IN' (noprec): reduce Exp --> 'NUM' + action 'EOF' (noprec): reduce Exp --> 'NUM' + action 'ID' (noprec): reduce Exp --> 'NUM' + action 'STRINGLIT' (noprec): reduce Exp --> 'NUM' + action 'CHARLIT' (noprec): reduce Exp --> 'NUM' + action 'NUM' (noprec): reduce Exp --> 'NUM' + action 'error' (noprec): reduce Exp --> 'NUM' + action '#' (noprec): reduce Exp --> 'NUM' + action '$$' (noprec): reduce Exp --> 'NUM' + immediate action: reduce Exp --> 'NUM' gotos:state 29: items: Exp -> 'CHARLIT' . + actions: action 'LPAR' (noprec): reduce Exp --> 'CHARLIT' + action 'RPAR' (noprec): reduce Exp --> 'CHARLIT' + action 'LBRACKET' (noprec): reduce Exp --> 'CHARLIT' + action 'RBRACKET' (noprec): reduce Exp --> 'CHARLIT' + action 'LCURLY' (noprec): reduce Exp --> 'CHARLIT' + action 'RCURLY' (noprec): reduce Exp --> 'CHARLIT' + action 'FUN' (noprec): reduce Exp --> 'CHARLIT' + action 'FN' (noprec): reduce Exp --> 'CHARLIT' + action 'COMMA' (noprec): reduce Exp --> 'CHARLIT' + action 'SEMICOLON' (noprec): reduce Exp --> 'CHARLIT' + action 'READ' (noprec): reduce Exp --> 'CHARLIT' + action 'WRITE' (noprec): reduce Exp --> 'CHARLIT' + action 'DEQ' (noprec): reduce Exp --> 'CHARLIT' + action 'LTH' (noprec): reduce Exp --> 'CHARLIT' + action 'EQ' (noprec): reduce Exp --> 'CHARLIT' + action 'OP' (noprec): reduce Exp --> 'CHARLIT' + action 'MAP' (noprec): reduce Exp --> 'CHARLIT' + action 'REDUCE' (noprec): reduce Exp --> 'CHARLIT' + action 'IOTA' (noprec): reduce Exp --> 'CHARLIT' + action 'ARROW' (noprec): reduce Exp --> 'CHARLIT' + action 'PLUS' (noprec): reduce Exp --> 'CHARLIT' + action 'MINUS' (noprec): reduce Exp --> 'CHARLIT' + action 'LESS' (noprec): reduce Exp --> 'CHARLIT' + action 'INT' (noprec): reduce Exp --> 'CHARLIT' + action 'CHAR' (noprec): reduce Exp --> 'CHARLIT' + action 'BOOL' (noprec): reduce Exp --> 'CHARLIT' + action 'IF' (noprec): reduce Exp --> 'CHARLIT' + action 'THEN' (noprec): reduce Exp --> 'CHARLIT' + action 'ELSE' (noprec): reduce Exp --> 'CHARLIT' + action 'LET' (noprec): reduce Exp --> 'CHARLIT' + action 'IN' (noprec): reduce Exp --> 'CHARLIT' + action 'EOF' (noprec): reduce Exp --> 'CHARLIT' + action 'ID' (noprec): reduce Exp --> 'CHARLIT' + action 'STRINGLIT' (noprec): reduce Exp --> 'CHARLIT' + action 'CHARLIT' (noprec): reduce Exp --> 'CHARLIT' + action 'NUM' (noprec): reduce Exp --> 'CHARLIT' + action 'error' (noprec): reduce Exp --> 'CHARLIT' + action '#' (noprec): reduce Exp --> 'CHARLIT' + action '$$' (noprec): reduce Exp --> 'CHARLIT' + immediate action: reduce Exp --> 'CHARLIT' gotos:state 30: items: Exp -> 'ID' . + Exp -> 'ID' . 'LPAR' Exps 'RPAR' + Exp -> 'ID' . 'LPAR' 'RPAR' + Exp -> 'ID' . 'LBRACKET' Exp 'RBRACKET' + actions: action 'LPAR' (noprec): shift 63 + action 'RPAR' (noprec): reduce Exp --> 'ID' + action 'LBRACKET' (noprec): shift 99 + action 'RBRACKET' (noprec): reduce Exp --> 'ID' + action 'LCURLY' (noprec): reduce Exp --> 'ID' + action 'RCURLY' (noprec): reduce Exp --> 'ID' + action 'FUN' (noprec): reduce Exp --> 'ID' + action 'FN' (noprec): reduce Exp --> 'ID' + action 'COMMA' (noprec): reduce Exp --> 'ID' + action 'SEMICOLON' (noprec): reduce Exp --> 'ID' + action 'READ' (noprec): reduce Exp --> 'ID' + action 'WRITE' (noprec): reduce Exp --> 'ID' + action 'DEQ' (noprec): reduce Exp --> 'ID' + action 'LTH' (noprec): reduce Exp --> 'ID' + action 'EQ' (noprec): reduce Exp --> 'ID' + action 'OP' (noprec): reduce Exp --> 'ID' + action 'MAP' (noprec): reduce Exp --> 'ID' + action 'REDUCE' (noprec): reduce Exp --> 'ID' + action 'IOTA' (noprec): reduce Exp --> 'ID' + action 'ARROW' (noprec): reduce Exp --> 'ID' + action 'PLUS' (noprec): reduce Exp --> 'ID' + action 'MINUS' (noprec): reduce Exp --> 'ID' + action 'LESS' (noprec): reduce Exp --> 'ID' + action 'INT' (noprec): reduce Exp --> 'ID' + action 'CHAR' (noprec): reduce Exp --> 'ID' + action 'BOOL' (noprec): reduce Exp --> 'ID' + action 'IF' (noprec): reduce Exp --> 'ID' + action 'THEN' (noprec): reduce Exp --> 'ID' + action 'ELSE' (noprec): reduce Exp --> 'ID' + action 'LET' (noprec): reduce Exp --> 'ID' + action 'IN' (noprec): reduce Exp --> 'ID' + action 'EOF' (noprec): reduce Exp --> 'ID' + action 'ID' (noprec): reduce Exp --> 'ID' + action 'STRINGLIT' (noprec): reduce Exp --> 'ID' + action 'CHARLIT' (noprec): reduce Exp --> 'ID' + action 'NUM' (noprec): reduce Exp --> 'ID' + action 'error' (noprec): reduce Exp --> 'ID' + action '#' (noprec): reduce Exp --> 'ID' + action '$$' (noprec): reduce Exp --> 'ID' + immediate action: gotos:state 31: items: Exp -> 'STRINGLIT' . + actions: action 'LPAR' (noprec): reduce Exp --> 'STRINGLIT' + action 'RPAR' (noprec): reduce Exp --> 'STRINGLIT' + action 'LBRACKET' (noprec): reduce Exp --> 'STRINGLIT' + action 'RBRACKET' (noprec): reduce Exp --> 'STRINGLIT' + action 'LCURLY' (noprec): reduce Exp --> 'STRINGLIT' + action 'RCURLY' (noprec): reduce Exp --> 'STRINGLIT' + action 'FUN' (noprec): reduce Exp --> 'STRINGLIT' + action 'FN' (noprec): reduce Exp --> 'STRINGLIT' + action 'COMMA' (noprec): reduce Exp --> 'STRINGLIT' + action 'SEMICOLON' (noprec): reduce Exp --> 'STRINGLIT' + action 'READ' (noprec): reduce Exp --> 'STRINGLIT' + action 'WRITE' (noprec): reduce Exp --> 'STRINGLIT' + action 'DEQ' (noprec): reduce Exp --> 'STRINGLIT' + action 'LTH' (noprec): reduce Exp --> 'STRINGLIT' + action 'EQ' (noprec): reduce Exp --> 'STRINGLIT' + action 'OP' (noprec): reduce Exp --> 'STRINGLIT' + action 'MAP' (noprec): reduce Exp --> 'STRINGLIT' + action 'REDUCE' (noprec): reduce Exp --> 'STRINGLIT' + action 'IOTA' (noprec): reduce Exp --> 'STRINGLIT' + action 'ARROW' (noprec): reduce Exp --> 'STRINGLIT' + action 'PLUS' (noprec): reduce Exp --> 'STRINGLIT' + action 'MINUS' (noprec): reduce Exp --> 'STRINGLIT' + action 'LESS' (noprec): reduce Exp --> 'STRINGLIT' + action 'INT' (noprec): reduce Exp --> 'STRINGLIT' + action 'CHAR' (noprec): reduce Exp --> 'STRINGLIT' + action 'BOOL' (noprec): reduce Exp --> 'STRINGLIT' + action 'IF' (noprec): reduce Exp --> 'STRINGLIT' + action 'THEN' (noprec): reduce Exp --> 'STRINGLIT' + action 'ELSE' (noprec): reduce Exp --> 'STRINGLIT' + action 'LET' (noprec): reduce Exp --> 'STRINGLIT' + action 'IN' (noprec): reduce Exp --> 'STRINGLIT' + action 'EOF' (noprec): reduce Exp --> 'STRINGLIT' + action 'ID' (noprec): reduce Exp --> 'STRINGLIT' + action 'STRINGLIT' (noprec): reduce Exp --> 'STRINGLIT' + action 'CHARLIT' (noprec): reduce Exp --> 'STRINGLIT' + action 'NUM' (noprec): reduce Exp --> 'STRINGLIT' + action 'error' (noprec): reduce Exp --> 'STRINGLIT' + action '#' (noprec): reduce Exp --> 'STRINGLIT' + action '$$' (noprec): reduce Exp --> 'STRINGLIT' + immediate action: reduce Exp --> 'STRINGLIT' gotos:state 32: items: Exp -> 'LCURLY' . Exps 'RCURLY' + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 53 + goto Exps: 33 +state 33: items: Exp -> 'LCURLY' Exps . 'RCURLY' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): shift 34 + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 34: items: Exp -> 'LCURLY' Exps 'RCURLY' . + actions: action 'LPAR' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'RPAR' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'LBRACKET' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'RBRACKET' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'LCURLY' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'RCURLY' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'FUN' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'FN' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'COMMA' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'SEMICOLON' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'READ' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'WRITE' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'DEQ' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'LTH' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'EQ' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'OP' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'MAP' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'REDUCE' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'IOTA' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'ARROW' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'PLUS' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'MINUS' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'LESS' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'INT' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'CHAR' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'BOOL' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'IF' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'THEN' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'ELSE' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'LET' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'IN' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'EOF' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'ID' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'STRINGLIT' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'CHARLIT' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'NUM' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action 'error' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action '#' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + action '$$' (noprec): reduce Exp --> 'LCURLY' Exps 'RCURLY' + immediate action: reduce Exp --> 'LCURLY' Exps 'RCURLY' gotos:state 35: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp 'PLUS' Exp . + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + actions: action 'LPAR' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'RPAR' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'LBRACKET' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'RBRACKET' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'LCURLY' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'RCURLY' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'FUN' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'FN' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'COMMA' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'SEMICOLON' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'READ' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'WRITE' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'DEQ' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'LTH' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'EQ' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'OP' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'MAP' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'REDUCE' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'IOTA' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'ARROW' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'PLUS' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'MINUS' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'LESS' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'INT' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'CHAR' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'BOOL' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'IF' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'THEN' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'ELSE' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'LET' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'IN' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'EOF' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'ID' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'STRINGLIT' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'CHARLIT' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'NUM' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action 'error' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action '#' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + action '$$' (explicit left 9999): reduce Exp --> Exp 'PLUS' Exp + immediate action: gotos:state 36: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp 'MINUS' Exp . + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + actions: action 'LPAR' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'RPAR' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'LBRACKET' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'RBRACKET' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'LCURLY' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'RCURLY' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'FUN' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'FN' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'COMMA' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'SEMICOLON' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'READ' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'WRITE' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'DEQ' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'LTH' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'EQ' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'OP' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'MAP' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'REDUCE' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'IOTA' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'ARROW' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'PLUS' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'MINUS' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'LESS' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'INT' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'CHAR' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'BOOL' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'IF' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'THEN' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'ELSE' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'LET' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'IN' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'EOF' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'ID' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'STRINGLIT' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'CHARLIT' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'NUM' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action 'error' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action '#' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + action '$$' (explicit left 9999): reduce Exp --> Exp 'MINUS' Exp + immediate action: gotos:state 37: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp 'DEQ' Exp . + Exp -> Exp . 'LTH' Exp + actions: action 'LPAR' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'RPAR' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'LBRACKET' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'RBRACKET' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'LCURLY' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'RCURLY' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'FUN' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'FN' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'COMMA' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'SEMICOLON' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'READ' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'WRITE' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'DEQ' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'LTH' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'EQ' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'OP' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'MAP' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'REDUCE' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'IOTA' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'ARROW' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'INT' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'CHAR' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'BOOL' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'IF' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'THEN' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'ELSE' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'LET' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'IN' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'EOF' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'ID' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'STRINGLIT' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'CHARLIT' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'NUM' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action 'error' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action '#' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + action '$$' (explicit left 9998): reduce Exp --> Exp 'DEQ' Exp + immediate action: gotos:state 38: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> Exp 'LTH' Exp . + actions: action 'LPAR' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'RPAR' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'LBRACKET' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'RBRACKET' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'LCURLY' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'RCURLY' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'FUN' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'FN' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'COMMA' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'SEMICOLON' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'READ' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'WRITE' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'DEQ' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'LTH' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'EQ' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'OP' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'MAP' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'REDUCE' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'IOTA' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'ARROW' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'INT' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'CHAR' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'BOOL' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'IF' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'THEN' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'ELSE' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'LET' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'IN' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'EOF' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'ID' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'STRINGLIT' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'CHARLIT' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'NUM' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action 'error' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action '#' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + action '$$' (explicit left 9998): reduce Exp --> Exp 'LTH' Exp + immediate action: gotos:state 39: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'IF' Exp . 'THEN' Exp 'ELSE' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): shift 61 + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 40: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'IF' Exp 'THEN' Exp . 'ELSE' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): shift 62 + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 41: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'IF' Exp 'THEN' Exp 'ELSE' Exp . + actions: action 'LPAR' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'RPAR' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'LBRACKET' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'RBRACKET' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'LCURLY' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'RCURLY' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'FUN' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'FN' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'COMMA' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'SEMICOLON' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'READ' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'WRITE' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'OP' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'MAP' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'REDUCE' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'IOTA' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'ARROW' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'INT' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'CHAR' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'BOOL' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'IF' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'THEN' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'ELSE' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'LET' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'IN' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'EOF' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'ID' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'STRINGLIT' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'CHARLIT' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'NUM' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action 'error' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action '#' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + action '$$' (explicit nonassoc 9997): reduce Exp --> 'IF' Exp 'THEN' Exp 'ELSE' Exp + immediate action: gotos:state 42: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'WRITE' 'LPAR' Exp . 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): shift 73 + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 43: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'IOTA' 'LPAR' Exp . 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): shift 76 + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 44: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'MAP' 'LPAR' FunArg 'COMMA' Exp . 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): shift 81 + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 45: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp . 'COMMA' Exp 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): shift 86 + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 46: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp . 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): shift 87 + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 47: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp . 'COMMA' Exp 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): shift 91 + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 48: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp . 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): shift 92 + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 49: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'LPAR' Exp . 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): shift 94 + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 50: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'LET' 'ID' 'EQ' Exp . 'IN' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): shift 98 + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 51: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'LET' 'ID' 'EQ' Exp 'IN' Exp . + actions: action 'LPAR' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'RPAR' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'LBRACKET' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'RBRACKET' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'LCURLY' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'RCURLY' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'FUN' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'FN' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'COMMA' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'SEMICOLON' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'READ' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'WRITE' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'OP' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'MAP' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'REDUCE' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'IOTA' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'ARROW' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'INT' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'CHAR' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'BOOL' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'IF' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'THEN' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'ELSE' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'LET' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'IN' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'EOF' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'ID' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'STRINGLIT' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'CHARLIT' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'NUM' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action 'error' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action '#' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + action '$$' (explicit nonassoc 9997): reduce Exp --> 'LET' 'ID' 'EQ' Exp 'IN' Exp + immediate action: gotos:state 52: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exp -> 'ID' 'LBRACKET' Exp . 'RBRACKET' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): shift 100 + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 53: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + Exps -> Exp . 'COMMA' Exps + Exps -> Exp . + actions: action 'LPAR' (noprec): reduce Exps --> Exp + action 'RPAR' (noprec): reduce Exps --> Exp + action 'LBRACKET' (noprec): reduce Exps --> Exp + action 'RBRACKET' (noprec): reduce Exps --> Exp + action 'LCURLY' (noprec): reduce Exps --> Exp + action 'RCURLY' (noprec): reduce Exps --> Exp + action 'FUN' (noprec): reduce Exps --> Exp + action 'FN' (noprec): reduce Exps --> Exp + action 'COMMA' (noprec): shift 101 + action 'SEMICOLON' (noprec): reduce Exps --> Exp + action 'READ' (noprec): reduce Exps --> Exp + action 'WRITE' (noprec): reduce Exps --> Exp + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): reduce Exps --> Exp + action 'OP' (noprec): reduce Exps --> Exp + action 'MAP' (noprec): reduce Exps --> Exp + action 'REDUCE' (noprec): reduce Exps --> Exp + action 'IOTA' (noprec): reduce Exps --> Exp + action 'ARROW' (noprec): reduce Exps --> Exp + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): reduce Exps --> Exp + action 'INT' (noprec): reduce Exps --> Exp + action 'CHAR' (noprec): reduce Exps --> Exp + action 'BOOL' (noprec): reduce Exps --> Exp + action 'IF' (noprec): reduce Exps --> Exp + action 'THEN' (noprec): reduce Exps --> Exp + action 'ELSE' (noprec): reduce Exps --> Exp + action 'LET' (noprec): reduce Exps --> Exp + action 'IN' (noprec): reduce Exps --> Exp + action 'EOF' (noprec): reduce Exps --> Exp + action 'ID' (noprec): reduce Exps --> Exp + action 'STRINGLIT' (noprec): reduce Exps --> Exp + action 'CHARLIT' (noprec): reduce Exps --> Exp + action 'NUM' (noprec): reduce Exps --> Exp + action 'error' (noprec): reduce Exps --> Exp + action '#' (noprec): reduce Exps --> Exp + action '$$' (noprec): reduce Exps --> Exp + immediate action: gotos:state 54: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + FunArg -> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp . + actions: action 'LPAR' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'RPAR' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'LBRACKET' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'RBRACKET' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'LCURLY' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'RCURLY' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'FUN' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'FN' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'COMMA' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'SEMICOLON' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'READ' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'WRITE' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'OP' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'MAP' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'REDUCE' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'IOTA' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'ARROW' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'INT' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'CHAR' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'BOOL' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'IF' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'THEN' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'ELSE' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'LET' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'IN' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'EOF' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'ID' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'STRINGLIT' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'CHARLIT' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'NUM' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action 'error' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action '#' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + action '$$' (noprec): reduce FunArg --> 'FN' Type 'LPAR' 'RPAR' 'ARROW' Exp + immediate action: gotos:state 55: items: Exp -> Exp . 'PLUS' Exp + Exp -> Exp . 'MINUS' Exp + Exp -> Exp . 'DEQ' Exp + Exp -> Exp . 'LTH' Exp + FunArg -> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp . + actions: action 'LPAR' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'RPAR' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'LBRACKET' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'RBRACKET' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'LCURLY' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'RCURLY' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'FUN' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'FN' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'COMMA' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'SEMICOLON' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'READ' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'WRITE' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'DEQ' (explicit left 9998): shift 58 + action 'LTH' (explicit left 9998): shift 59 + action 'EQ' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'OP' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'MAP' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'REDUCE' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'IOTA' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'ARROW' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'PLUS' (explicit left 9999): shift 56 + action 'MINUS' (explicit left 9999): shift 57 + action 'LESS' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'INT' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'CHAR' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'BOOL' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'IF' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'THEN' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'ELSE' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'LET' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'IN' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'EOF' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'ID' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'STRINGLIT' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'CHARLIT' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'NUM' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action 'error' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action '#' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + action '$$' (noprec): reduce FunArg --> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' Exp + immediate action: gotos:state 56: items: Exp -> Exp 'PLUS' . Exp + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 35 +state 57: items: Exp -> Exp 'MINUS' . Exp + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 36 +state 58: items: Exp -> Exp 'DEQ' . Exp + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 37 +state 59: items: Exp -> Exp 'LTH' . Exp + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 38 +state 60: items: Exp -> 'IF' . Exp 'THEN' Exp 'ELSE' Exp + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 39 +state 61: items: Exp -> 'IF' Exp 'THEN' . Exp 'ELSE' Exp + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 40 +state 62: items: Exp -> 'IF' Exp 'THEN' Exp 'ELSE' . Exp + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 41 +state 63: items: Exp -> 'ID' 'LPAR' . Exps 'RPAR' + Exp -> 'ID' 'LPAR' . 'RPAR' + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): shift 66 + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 53 + goto Exps: 64 +state 64: items: Exp -> 'ID' 'LPAR' Exps . 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): shift 65 + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 65: items: Exp -> 'ID' 'LPAR' Exps 'RPAR' . + actions: action 'LPAR' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'RPAR' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'LBRACKET' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'RBRACKET' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'LCURLY' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'RCURLY' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'FUN' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'FN' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'COMMA' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'SEMICOLON' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'READ' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'WRITE' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'DEQ' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'LTH' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'EQ' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'OP' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'MAP' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'REDUCE' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'IOTA' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'ARROW' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'PLUS' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'MINUS' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'LESS' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'INT' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'CHAR' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'BOOL' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'IF' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'THEN' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'ELSE' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'LET' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'IN' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'EOF' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'ID' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'STRINGLIT' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'CHARLIT' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'NUM' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action 'error' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action '#' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + action '$$' (noprec): reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' + immediate action: reduce Exp --> 'ID' 'LPAR' Exps 'RPAR' gotos:state 66: items: Exp -> 'ID' 'LPAR' 'RPAR' . + actions: action 'LPAR' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'RPAR' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'LBRACKET' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'RBRACKET' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'LCURLY' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'RCURLY' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'FUN' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'FN' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'COMMA' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'SEMICOLON' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'READ' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'WRITE' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'DEQ' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'LTH' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'EQ' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'OP' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'MAP' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'REDUCE' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'IOTA' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'ARROW' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'PLUS' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'MINUS' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'LESS' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'INT' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'CHAR' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'BOOL' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'IF' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'THEN' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'ELSE' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'LET' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'IN' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'EOF' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'ID' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'STRINGLIT' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'CHARLIT' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'NUM' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action 'error' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action '#' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + action '$$' (noprec): reduce Exp --> 'ID' 'LPAR' 'RPAR' + immediate action: reduce Exp --> 'ID' 'LPAR' 'RPAR' gotos:state 67: items: Exp -> 'READ' . 'LPAR' Type 'RPAR' + actions: action 'LPAR' (noprec): shift 68 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 68: items: Exp -> 'READ' 'LPAR' . Type 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): shift 20 + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): shift 17 + action 'CHAR' (noprec): shift 18 + action 'BOOL' (noprec): shift 19 + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Type: 69 +state 69: items: Exp -> 'READ' 'LPAR' Type . 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): shift 70 + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 70: items: Exp -> 'READ' 'LPAR' Type 'RPAR' . + actions: action 'LPAR' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'RPAR' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'LBRACKET' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'RBRACKET' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'LCURLY' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'RCURLY' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'FUN' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'FN' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'COMMA' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'SEMICOLON' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'READ' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'WRITE' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'DEQ' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'LTH' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'EQ' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'OP' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'MAP' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'REDUCE' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'IOTA' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'ARROW' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'PLUS' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'MINUS' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'LESS' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'INT' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'CHAR' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'BOOL' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'IF' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'THEN' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'ELSE' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'LET' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'IN' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'EOF' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'ID' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'STRINGLIT' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'CHARLIT' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'NUM' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action 'error' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action '#' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + action '$$' (noprec): reduce Exp --> 'READ' 'LPAR' Type 'RPAR' + immediate action: reduce Exp --> 'READ' 'LPAR' Type 'RPAR' gotos:state 71: items: Exp -> 'WRITE' . 'LPAR' Exp 'RPAR' + actions: action 'LPAR' (noprec): shift 72 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 72: items: Exp -> 'WRITE' 'LPAR' . Exp 'RPAR' + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 42 +state 73: items: Exp -> 'WRITE' 'LPAR' Exp 'RPAR' . + actions: action 'LPAR' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'RPAR' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'LBRACKET' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'RBRACKET' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'LCURLY' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'RCURLY' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'FUN' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'FN' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'COMMA' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'SEMICOLON' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'READ' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'WRITE' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'DEQ' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'LTH' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'EQ' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'OP' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'MAP' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'REDUCE' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'IOTA' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'ARROW' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'PLUS' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'MINUS' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'LESS' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'INT' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'CHAR' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'BOOL' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'IF' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'THEN' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'ELSE' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'LET' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'IN' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'EOF' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'ID' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'STRINGLIT' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'CHARLIT' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'NUM' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action 'error' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action '#' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + action '$$' (noprec): reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' + immediate action: reduce Exp --> 'WRITE' 'LPAR' Exp 'RPAR' gotos:state 74: items: Exp -> 'IOTA' . 'LPAR' Exp 'RPAR' + actions: action 'LPAR' (noprec): shift 75 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 75: items: Exp -> 'IOTA' 'LPAR' . Exp 'RPAR' + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 43 +state 76: items: Exp -> 'IOTA' 'LPAR' Exp 'RPAR' . + actions: action 'LPAR' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'RPAR' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'LBRACKET' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'RBRACKET' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'LCURLY' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'RCURLY' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'FUN' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'FN' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'COMMA' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'SEMICOLON' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'READ' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'WRITE' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'DEQ' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'LTH' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'EQ' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'OP' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'MAP' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'REDUCE' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'IOTA' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'ARROW' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'PLUS' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'MINUS' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'LESS' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'INT' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'CHAR' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'BOOL' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'IF' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'THEN' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'ELSE' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'LET' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'IN' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'EOF' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'ID' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'STRINGLIT' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'CHARLIT' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'NUM' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action 'error' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action '#' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + action '$$' (noprec): reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' + immediate action: reduce Exp --> 'IOTA' 'LPAR' Exp 'RPAR' gotos:state 77: items: Exp -> 'MAP' . 'LPAR' FunArg 'COMMA' Exp 'RPAR' + actions: action 'LPAR' (noprec): shift 78 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 78: items: Exp -> 'MAP' 'LPAR' . FunArg 'COMMA' Exp 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): shift 104 + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 103 + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto FunArg: 79 +state 79: items: Exp -> 'MAP' 'LPAR' FunArg . 'COMMA' Exp 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): shift 80 + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 80: items: Exp -> 'MAP' 'LPAR' FunArg 'COMMA' . Exp 'RPAR' + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 44 +state 81: items: Exp -> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' . + actions: action 'LPAR' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'RPAR' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'LBRACKET' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'RBRACKET' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'LCURLY' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'RCURLY' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'FUN' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'FN' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'COMMA' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'SEMICOLON' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'READ' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'WRITE' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'DEQ' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'LTH' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'EQ' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'OP' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'MAP' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'REDUCE' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'IOTA' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'ARROW' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'PLUS' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'MINUS' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'LESS' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'INT' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'CHAR' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'BOOL' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'IF' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'THEN' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'ELSE' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'LET' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'IN' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'EOF' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'ID' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'STRINGLIT' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'CHARLIT' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'NUM' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action 'error' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action '#' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + action '$$' (noprec): reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' + immediate action: reduce Exp --> 'MAP' 'LPAR' FunArg 'COMMA' Exp 'RPAR' gotos:state 82: items: Exp -> 'REDUCE' . 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + Exp -> 'REDUCE' . 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + actions: action 'LPAR' (noprec): shift 83 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 83: items: Exp -> 'REDUCE' 'LPAR' . FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + Exp -> 'REDUCE' 'LPAR' . 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): shift 104 + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): shift 88 + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 103 + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto FunArg: 84 +state 84: items: Exp -> 'REDUCE' 'LPAR' FunArg . 'COMMA' Exp 'COMMA' Exp 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): shift 85 + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 85: items: Exp -> 'REDUCE' 'LPAR' FunArg 'COMMA' . Exp 'COMMA' Exp 'RPAR' + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 45 +state 86: items: Exp -> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' . Exp 'RPAR' + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 46 +state 87: items: Exp -> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' . + actions: action 'LPAR' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'RPAR' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'LBRACKET' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'RBRACKET' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'LCURLY' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'RCURLY' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'FUN' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'FN' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'COMMA' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'SEMICOLON' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'READ' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'WRITE' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'DEQ' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'LTH' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'EQ' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'OP' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'MAP' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'REDUCE' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'IOTA' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'ARROW' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'PLUS' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'MINUS' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'LESS' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'INT' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'CHAR' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'BOOL' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'IF' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'THEN' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'ELSE' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'LET' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'IN' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'EOF' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'ID' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'STRINGLIT' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'CHARLIT' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'NUM' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'error' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action '#' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + action '$$' (noprec): reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' + immediate action: reduce Exp --> 'REDUCE' 'LPAR' FunArg 'COMMA' Exp 'COMMA' Exp 'RPAR' gotos:state 88: items: Exp -> 'REDUCE' 'LPAR' 'OP' . BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (explicit left 9999): shift 27 + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto BinOp: 89 +state 89: items: Exp -> 'REDUCE' 'LPAR' 'OP' BinOp . 'COMMA' Exp 'COMMA' Exp 'RPAR' + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): shift 90 + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 90: items: Exp -> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' . Exp 'COMMA' Exp 'RPAR' + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 47 +state 91: items: Exp -> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' . Exp 'RPAR' + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 48 +state 92: items: Exp -> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' . + actions: action 'LPAR' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'RPAR' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'LBRACKET' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'RBRACKET' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'LCURLY' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'RCURLY' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'FUN' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'FN' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'COMMA' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'SEMICOLON' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'READ' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'WRITE' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'DEQ' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'LTH' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'EQ' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'OP' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'MAP' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'REDUCE' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'IOTA' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'ARROW' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'PLUS' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'MINUS' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'LESS' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'INT' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'CHAR' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'BOOL' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'IF' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'THEN' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'ELSE' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'LET' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'IN' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'EOF' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'ID' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'STRINGLIT' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'CHARLIT' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'NUM' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action 'error' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action '#' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + action '$$' (noprec): reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' + immediate action: reduce Exp --> 'REDUCE' 'LPAR' 'OP' BinOp 'COMMA' Exp 'COMMA' Exp 'RPAR' gotos:state 93: items: Exp -> 'LPAR' . Exp 'RPAR' + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 49 +state 94: items: Exp -> 'LPAR' Exp 'RPAR' . + actions: action 'LPAR' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'RPAR' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'LBRACKET' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'RBRACKET' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'LCURLY' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'RCURLY' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'FUN' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'FN' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'COMMA' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'SEMICOLON' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'READ' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'WRITE' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'DEQ' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'LTH' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'EQ' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'OP' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'MAP' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'REDUCE' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'IOTA' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'ARROW' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'PLUS' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'MINUS' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'LESS' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'INT' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'CHAR' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'BOOL' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'IF' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'THEN' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'ELSE' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'LET' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'IN' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'EOF' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'ID' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'STRINGLIT' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'CHARLIT' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'NUM' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action 'error' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action '#' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + action '$$' (noprec): reduce Exp --> 'LPAR' Exp 'RPAR' + immediate action: reduce Exp --> 'LPAR' Exp 'RPAR' gotos:state 95: items: Exp -> 'LET' . 'ID' 'EQ' Exp 'IN' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 96 + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 96: items: Exp -> 'LET' 'ID' . 'EQ' Exp 'IN' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): shift 97 + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 97: items: Exp -> 'LET' 'ID' 'EQ' . Exp 'IN' Exp + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 50 +state 98: items: Exp -> 'LET' 'ID' 'EQ' Exp 'IN' . Exp + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 51 +state 99: items: Exp -> 'ID' 'LBRACKET' . Exp 'RBRACKET' + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 52 +state 100: items: Exp -> 'ID' 'LBRACKET' Exp 'RBRACKET' . + actions: action 'LPAR' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'RPAR' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'LBRACKET' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'RBRACKET' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'LCURLY' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'RCURLY' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'FUN' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'FN' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'COMMA' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'SEMICOLON' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'READ' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'WRITE' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'DEQ' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'LTH' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'EQ' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'OP' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'MAP' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'REDUCE' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'IOTA' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'ARROW' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'PLUS' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'MINUS' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'LESS' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'INT' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'CHAR' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'BOOL' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'IF' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'THEN' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'ELSE' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'LET' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'IN' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'EOF' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'ID' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'STRINGLIT' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'CHARLIT' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'NUM' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action 'error' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action '#' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + action '$$' (noprec): reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' + immediate action: reduce Exp --> 'ID' 'LBRACKET' Exp 'RBRACKET' gotos:state 101: items: Exps -> Exp 'COMMA' . Exps + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 53 + goto Exps: 102 +state 102: items: Exps -> Exp 'COMMA' Exps . + actions: action 'LPAR' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'RPAR' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'LBRACKET' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'RBRACKET' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'LCURLY' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'RCURLY' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'FUN' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'FN' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'COMMA' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'SEMICOLON' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'READ' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'WRITE' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'DEQ' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'LTH' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'EQ' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'OP' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'MAP' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'REDUCE' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'IOTA' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'ARROW' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'PLUS' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'MINUS' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'LESS' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'INT' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'CHAR' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'BOOL' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'IF' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'THEN' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'ELSE' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'LET' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'IN' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'EOF' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'ID' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'STRINGLIT' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'CHARLIT' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'NUM' (noprec): reduce Exps --> Exp 'COMMA' Exps + action 'error' (noprec): reduce Exps --> Exp 'COMMA' Exps + action '#' (noprec): reduce Exps --> Exp 'COMMA' Exps + action '$$' (noprec): reduce Exps --> Exp 'COMMA' Exps + immediate action: reduce Exps --> Exp 'COMMA' Exps gotos:state 103: items: FunArg -> 'ID' . + actions: action 'LPAR' (noprec): reduce FunArg --> 'ID' + action 'RPAR' (noprec): reduce FunArg --> 'ID' + action 'LBRACKET' (noprec): reduce FunArg --> 'ID' + action 'RBRACKET' (noprec): reduce FunArg --> 'ID' + action 'LCURLY' (noprec): reduce FunArg --> 'ID' + action 'RCURLY' (noprec): reduce FunArg --> 'ID' + action 'FUN' (noprec): reduce FunArg --> 'ID' + action 'FN' (noprec): reduce FunArg --> 'ID' + action 'COMMA' (noprec): reduce FunArg --> 'ID' + action 'SEMICOLON' (noprec): reduce FunArg --> 'ID' + action 'READ' (noprec): reduce FunArg --> 'ID' + action 'WRITE' (noprec): reduce FunArg --> 'ID' + action 'DEQ' (noprec): reduce FunArg --> 'ID' + action 'LTH' (noprec): reduce FunArg --> 'ID' + action 'EQ' (noprec): reduce FunArg --> 'ID' + action 'OP' (noprec): reduce FunArg --> 'ID' + action 'MAP' (noprec): reduce FunArg --> 'ID' + action 'REDUCE' (noprec): reduce FunArg --> 'ID' + action 'IOTA' (noprec): reduce FunArg --> 'ID' + action 'ARROW' (noprec): reduce FunArg --> 'ID' + action 'PLUS' (noprec): reduce FunArg --> 'ID' + action 'MINUS' (noprec): reduce FunArg --> 'ID' + action 'LESS' (noprec): reduce FunArg --> 'ID' + action 'INT' (noprec): reduce FunArg --> 'ID' + action 'CHAR' (noprec): reduce FunArg --> 'ID' + action 'BOOL' (noprec): reduce FunArg --> 'ID' + action 'IF' (noprec): reduce FunArg --> 'ID' + action 'THEN' (noprec): reduce FunArg --> 'ID' + action 'ELSE' (noprec): reduce FunArg --> 'ID' + action 'LET' (noprec): reduce FunArg --> 'ID' + action 'IN' (noprec): reduce FunArg --> 'ID' + action 'EOF' (noprec): reduce FunArg --> 'ID' + action 'ID' (noprec): reduce FunArg --> 'ID' + action 'STRINGLIT' (noprec): reduce FunArg --> 'ID' + action 'CHARLIT' (noprec): reduce FunArg --> 'ID' + action 'NUM' (noprec): reduce FunArg --> 'ID' + action 'error' (noprec): reduce FunArg --> 'ID' + action '#' (noprec): reduce FunArg --> 'ID' + action '$$' (noprec): reduce FunArg --> 'ID' + immediate action: reduce FunArg --> 'ID' gotos:state 104: items: FunArg -> 'FN' . Type 'LPAR' 'RPAR' 'ARROW' Exp + FunArg -> 'FN' . Type 'LPAR' Params 'RPAR' 'ARROW' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): shift 20 + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): shift 17 + action 'CHAR' (noprec): shift 18 + action 'BOOL' (noprec): shift 19 + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Type: 105 +state 105: items: FunArg -> 'FN' Type . 'LPAR' 'RPAR' 'ARROW' Exp + FunArg -> 'FN' Type . 'LPAR' Params 'RPAR' 'ARROW' Exp + actions: action 'LPAR' (noprec): shift 106 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 106: items: FunArg -> 'FN' Type 'LPAR' . 'RPAR' 'ARROW' Exp + FunArg -> 'FN' Type 'LPAR' . Params 'RPAR' 'ARROW' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): shift 107 + action 'LBRACKET' (noprec): shift 20 + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): shift 17 + action 'CHAR' (noprec): shift 18 + action 'BOOL' (noprec): shift 19 + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Type: 23 + goto Params: 109 +state 107: items: FunArg -> 'FN' Type 'LPAR' 'RPAR' . 'ARROW' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): shift 108 + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 108: items: FunArg -> 'FN' Type 'LPAR' 'RPAR' 'ARROW' . Exp + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 54 +state 109: items: FunArg -> 'FN' Type 'LPAR' Params . 'RPAR' 'ARROW' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): shift 110 + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 110: items: FunArg -> 'FN' Type 'LPAR' Params 'RPAR' . 'ARROW' Exp + actions: action 'LPAR' (noprec): error + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): error + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): error + action 'WRITE' (noprec): error + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): error + action 'REDUCE' (noprec): error + action 'IOTA' (noprec): error + action 'ARROW' (noprec): shift 111 + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): error + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): error + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): error + action 'STRINGLIT' (noprec): error + action 'CHARLIT' (noprec): error + action 'NUM' (noprec): error + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos:state 111: items: FunArg -> 'FN' Type 'LPAR' Params 'RPAR' 'ARROW' . Exp + actions: action 'LPAR' (noprec): shift 93 + action 'RPAR' (noprec): error + action 'LBRACKET' (noprec): error + action 'RBRACKET' (noprec): error + action 'LCURLY' (noprec): shift 32 + action 'RCURLY' (noprec): error + action 'FUN' (noprec): error + action 'FN' (noprec): error + action 'COMMA' (noprec): error + action 'SEMICOLON' (noprec): error + action 'READ' (noprec): shift 67 + action 'WRITE' (noprec): shift 71 + action 'DEQ' (noprec): error + action 'LTH' (noprec): error + action 'EQ' (noprec): error + action 'OP' (noprec): error + action 'MAP' (noprec): shift 77 + action 'REDUCE' (noprec): shift 82 + action 'IOTA' (noprec): shift 74 + action 'ARROW' (noprec): error + action 'PLUS' (noprec): error + action 'MINUS' (noprec): error + action 'LESS' (noprec): error + action 'INT' (noprec): error + action 'CHAR' (noprec): error + action 'BOOL' (noprec): error + action 'IF' (noprec): shift 60 + action 'THEN' (noprec): error + action 'ELSE' (noprec): error + action 'LET' (noprec): shift 95 + action 'IN' (noprec): error + action 'EOF' (noprec): error + action 'ID' (noprec): shift 30 + action 'STRINGLIT' (noprec): shift 31 + action 'CHARLIT' (noprec): shift 29 + action 'NUM' (noprec): shift 28 + action 'error' (noprec): error + action '#' (noprec): error + action '$$' (noprec): error + immediate action: gotos: goto Exp: 55 + +startStates = 0 +------------------------ diff --git a/W1/fasto/Fasto/RegAlloc.fs b/W1/fasto/Fasto/RegAlloc.fs new file mode 100644 index 0000000..df2eb43 --- /dev/null +++ b/W1/fasto/Fasto/RegAlloc.fs @@ -0,0 +1,493 @@ +(* A register allocator for MIPS. *) + +module RegAlloc + +(* registerAlloc takes a list of MIPS instructions, a set of + registers that are live at the end of the code, three register + numbers: + 1) The lowest allocatable register (typically 2). + 2) The highest caller-saves register. + 3) The highest allocatable register (typically 25). + and the number of already spilled variables. This should be 0 in the initial + call unless some variables are forced to spill before register allocation. + Registers up to (and including) the highest caller-saves + register are assumed to be caller-saves. Those above are assumed to + be callee-saves. + + registerAlloc returns: + a modified instruction list where null moves have been removed, + a set of the variables that are live at entry, + plus a number indicating the highest used register number. + + The latter can be used for deciding which callee-saves registers + need to be saved. + + Limitations: + + - Works for a single procedure body only. + + - Assumes all JALs eventually return to the next instruction and + preserve callee-saves registers when doing so. + + - Does caller-saves preservation only by allocating variables that + are live across procedure calls to callee-saves registers and + variables not live across call preferably to caller-saves. + + - Can only remove null moves if they are implemented by ORI (rx,ry,"0"). + Use the pseudo-instruction MOVE (rx,ry) for this. + +*) + +open Mips + +exception MyError of string + +exception Not_colourable of string + +let spilledVars : Set ref = ref (Set.empty) + +let rec destRegs (lst : Instruction list) : Set = + match lst with + | [] -> Set.empty + | (i::ilist) -> Set.union (destReg i) (destRegs ilist) + + +(* variables and registers that can be overwritten *) +and destReg (i : Instruction) : Set = + match i with + | LA (rt,v) -> Set.singleton rt + | LUI (rt,v) -> Set.singleton rt + | ADD (rd,rs,rt) -> Set.singleton rd + | ADDI (rd,rs,v) -> Set.singleton rd + | SUB (rd,rs,rt) -> Set.singleton rd + | MUL (rd,rs,rt) -> Set.singleton rd + | DIV (rd,rs,rt) -> Set.singleton rd + | AND (rd,rs,rt) -> Set.singleton rd + | ANDI (rd,rs,v) -> Set.singleton rd + | OR (rd,rs,rt) -> Set.singleton rd + | ORI (rd,rs,v) -> Set.singleton rd + | XOR (rd,rs,rt) -> Set.singleton rd + | XORI (rd,rs,v) -> Set.singleton rd + | SLL (rd,rt,v) -> Set.singleton rd + | SRA (rd,rt,v) -> Set.singleton rd + | SLT (rd,rs,rt) -> Set.singleton rd + | SLTI (rd,rs,v) -> Set.singleton rd + | JAL (lab,argRegs) -> Set.add (RN 31) (Set.ofList argRegs) + | LW (rd,rs,v) -> Set.singleton rd + | LB (rd,rs,v) -> Set.singleton rd + | SYSCALL -> Set.singleton (RN 2) (* return value is in $2 *) + | _ -> Set.empty + +(* variables and register that can be read by i *) +let usedRegs (i : Instruction) : Set = + match i with + | ADD (rd,rs,rt) -> Set.ofList [rs;rt] + | ADDI (rd,rs,v) -> Set.singleton rs + | SUB (rd,rs,rt) -> Set.ofList [rs;rt] + | MUL (rd,rs,rt) -> Set.ofList [rs;rt] + | DIV (rd,rs,rt) -> Set.ofList [rs;rt] + | AND (rd,rs,rt) -> Set.ofList [rs;rt] + | ANDI (rd,rs,v) -> Set.singleton rs + | OR (rd,rs,rt) -> Set.ofList [rs;rt] + | ORI (rd,rs,v) -> Set.singleton rs + | XOR (rd,rs,rt) -> Set.ofList [rs;rt] + | XORI (rd,rs,v) -> Set.singleton rs + | SLL (rd,rt,v) -> Set.singleton rt + | SRA (rd,rt,v) -> Set.singleton rt + | SLT (rd,rs,rt) -> Set.ofList [rs;rt] + | SLTI (rd,rs,v) -> Set.singleton rs + | BEQ (rs,rt,v) -> Set.ofList [rs;rt] + | BNE (rs,rt,v) -> Set.ofList [rs;rt] + | BGEZ (rs,v) -> Set.singleton rs + | J lab -> Set.empty + | JAL (lab,argRegs) -> Set.ofList argRegs + (* argRegs are argument registers *) + | JR (r,resRegs) -> Set.ofList (r::resRegs) + (* r is jump register, + resRegs are registers required to be live *) + | LW (rd,rs,v) -> Set.singleton rs + | SW (rd,rs,v) -> Set.ofList [rs;rd] + | LB (rd,rs,v) -> Set.singleton rs + | SB (rd,rs,v) -> Set.ofList [rs;rd] + | SYSCALL -> Set.ofList [RN 2; RN 4; RN 5] + (* $2 is control register and $4, $5 are arguments *) + | _ -> Set.empty + + +let live_step ilist llist liveAtEnd = + let rec scan (is : Instruction list) = + match is with + | [] -> [] + | (i::is) -> + let ls1 = scan is + if List.isEmpty ls1 + then [instruct i liveAtEnd] + else (instruct i (List.head ls1)) :: ls1 + + (* live variables and registers *) + and instruct (i : Instruction) (live : Set) : Set = + match i with + | BEQ (rs,rt,v) -> Set.union (Set.ofList [rs;rt]) (Set.union live (live_at v)) + | BNE (rs,rt,v) -> Set.union (Set.ofList [rs;rt]) (Set.union live (live_at v)) + | BGEZ (rs,v) -> Set.union (Set.singleton rs) (Set.union live (live_at v)) + | J lab -> live_at lab + | JR (r,resRegs) -> Set.ofList (r::resRegs) + (* r is jump register, resRegs are registers required to be live *) + | _ -> Set.union (usedRegs i) (Set.difference live (destReg i)) + + and live_at lab : Set = search ilist llist lab + + and search a1 a2 a3 : Set = + match (a1, a2, a3) with + | ([], [], lab) -> Set.empty + | (LABEL k :: is, l::ls, lab) -> + if k = lab then l else search is ls lab + | (_::is, _::ls, lab) -> search is ls lab + | (a, b, l) -> raise (MyError "should not happen in RegAlloc.live_step.search!") + + let res = scan ilist + res + +let rec iterate_live ilist llist liveAtEnd = + let llist1 = live_step ilist llist liveAtEnd + if llist1 = llist + then llist + else iterate_live ilist llist1 liveAtEnd + +let rec init_list = function + | [] -> [] + | (i::is) -> Set.empty :: init_list is + +(* live_regs finds for each instruction those symbolic register names *) +(* that are live at entry to this instruction *) + +let live_regs ilist liveAtEnd = + iterate_live ilist (init_list ilist) liveAtEnd + +let rec regs lst (rs : Set) : Set = + match lst with + | [] -> rs + | (l :: llist) -> Set.union l (regs llist rs) + +let numerical r = + match r with + | RN _ -> true + | RS _ -> false + +let filterSymbolic rs = Set.filter (fun a -> not (numerical a)) rs + +let rec findRegs llist = filterSymbolic (regs llist Set.empty) + +(* conflicts ilist llist callerSaves r *) +(* finds those variables that interferere with r *) +(* in instructions ilist with live-out specified by llist *) +(* callerSaves are the caller-saves registers *) + +let rec conflicts = function + | ([], [], callerSaves, RN r) -> Set.remove (RN r) callerSaves + (* all numerical interfere with all other caller-saves *) + | ([], [], callerSaves, RS _) -> Set.empty + | (ORI (rd,rs,0) :: ilist, l :: llist, callerSaves, r) -> + if r=rd (* if destination *) + then Set.union (Set.remove rs (Set.remove r l)) (* interfere with live except rs *) + (conflicts (ilist, llist, callerSaves, r)) + else if r=rs (* if source, no interference *) + then conflicts (ilist, llist, callerSaves, r) + else if Set.contains r l (* otherwise, live interfere with rd *) + then Set.add rd (conflicts (ilist, llist, callerSaves, r)) + else conflicts (ilist, llist, callerSaves, r) + | (JAL (f,argRegs) :: ilist, l :: llist, callerSaves, r) -> + if (Set.contains r l) (* live vars interfere with caller-saves regs *) + then Set.union (Set.remove r callerSaves) + (conflicts (ilist, llist, callerSaves, r)) + else if Set.contains r callerSaves + then Set.union (Set.remove r l) + (conflicts (ilist, llist, callerSaves, r)) + else conflicts (ilist, llist, callerSaves, r) + | (i :: ilist, l :: llist, callerSaves, r) -> + if (Set.contains r (destReg i)) (* destination register *) + then Set.union (Set.remove r l) (* conflicts with other live vars *) + (conflicts (ilist, llist, callerSaves, r)) + else if Set.contains r l (* all live vars *) + then Set.union (destReg i) (* conflict with destination *) + (conflicts (ilist, llist, callerSaves, r)) + else conflicts (ilist, llist, callerSaves, r) + | _ -> raise (MyError "conflicts used at undefined instance") + + + +(* Interference graph is represented as a list of registers *) +(* each paired with a list of the registers with which it conflicts *) + +let graph ilist llist callerSaves = + let rs = Set.union callerSaves (findRegs llist) |> Set.toList + List.zip rs (List.map (fun r -> conflicts (ilist, ((List.tail llist)@[Set.empty]), callerSaves, r)) rs) + + + + +(* finds move-related registers *) + +let rec findMoves ilist llist = + let rs = findRegs llist |> Set.toList + List.zip rs (List.map (fun r -> findMoves1 r ilist) rs) + +and findMoves1 r = function + | [] -> Set.empty + | (ORI (rd,rs,0) :: ilist) -> + Set.union ( if rd=r then Set.singleton rs + elif rs=r then Set.singleton rd + else Set.empty) + (findMoves1 r ilist) + | (i::ilist) -> findMoves1 r ilist + + + +(* sorts by number of conflicts, but with numeric registers last *) + +let be4 (a, ac) (b, bc) = + match (a, b) with + | (RN i, RN j) -> i <= j + | (RN _, RS _) -> false + | (RS _, RN _) -> true + | (RS sa, RS sb) -> + match (Set.contains sa (!spilledVars), Set.contains sb (!spilledVars)) with + | (false, false) -> Set.count ac <= Set.count bc + | (true , false) -> false + | (false, true ) -> true + | (true , true ) -> Set.count ac <= Set.count bc + +let rec sortByOrder = function + | [] -> [] + | (g : (reg * Set<'b>) list) -> + let rec split = function + | [] -> ([],[]) + | (a::g) -> + let (l, g1) = ascending a g [] + let (g2,g3) = split g1 + (rev2 l g3, g2) + and ascending a g l = + match g with + | [] -> (a::l,[]) + | (b::g1) -> + if be4 a b + then ascending b g1 (a::l) + else (a::l,g) + and rev2 g l2 = + match g with + | [] -> l2 + | (a::l1) -> rev2 l1 (a::l2) + + let rec merge = function + | ([], l2) -> l2 + | (l1, []) -> l1 + | (a::r1, b::r2) -> + if be4 a b + then a :: merge (r1, b::r2) + else b :: merge (a::r1, r2) + + let (g1,g2) = split g + if List.isEmpty g1 then g2 + elif List.isEmpty g2 then g1 + else merge (sortByOrder g1, sortByOrder g2) + + + +(* n-colour graph using Briggs' algorithm *) + +let rec colourGraph g rmin rmax moveRelated = + select (simplify (sortByOrder g) []) + (mList rmin rmax) moveRelated [] + +and simplify h l = + match h with + | [] -> l + | (r,c) :: g -> + simplify (sortByOrder (removeNode r g)) ((r,c)::l) + +and removeNode r = function + | [] -> [] + | ((r1,c)::g) -> + (r1,Set.remove r c) :: removeNode r g + +and select rcl regs moveRelated sl = + match rcl with + | [] -> sl + | ((r,c)::l) -> + let rnum = + if numerical r then r + else let possible = NotIn c sl regs + let related = lookUp2 r moveRelated + let related2 = Set.map (fun r -> lookUp r sl) related + let mPossible= Set.intersect possible related2 + if Set.isEmpty possible then raise (Not_colourable (ppReg r)) + elif Set.isEmpty mPossible then Set.minElement possible //hd possible + else Set.minElement mPossible //hd mPossible + select l regs moveRelated ((r,rnum)::sl) + +and NotIn rcs sl regs : Set = + Set.fold (fun acc r -> Set.remove (lookUp r sl) acc) regs rcs + +and lookUp r = function + | [] -> RN 0 + | ((r1,n)::sl) -> + if numerical r then r + else if r=r1 then n else lookUp r sl + +and lookUp2 r = function + | [] -> Set.empty + | ((r1,ms)::sl) -> if r=r1 then ms else lookUp2 r sl + +and mList m n : Set = + if m > n then Set.empty + else Set.add (RN m) (mList (m+1) n) + + +let rec filterNullMoves ilist allocs = + match ilist with + | [] -> [] + + | (ORI (rd,rs,0) :: ilist_tl) -> + let rd1 = lookUp rd allocs + let rs1 = lookUp rs allocs + if rd1 = rs1 || rd1 = RN 0 + then COMMENT ("\tori\t"+ ppReg rd+","+ ppReg rs+",0") + :: filterNullMoves ilist_tl allocs + else ORI (rd,rs,0) :: filterNullMoves ilist_tl allocs + + | (i :: ilist_tl) -> + i :: filterNullMoves ilist_tl allocs + +and printList = function + | [] -> "" + | (r :: rs) -> r+" "+ printList rs + +let rec printGraph = function + | [] -> [] + | ((r,rs) :: g) -> + [COMMENT ("interferes: "+r+" with "+printList rs)] + @ printGraph g + +let renameReg allocs inst = + let renTo inst1 = [inst1; COMMENT ("was:" + ppMips inst)] + match inst with + | LA (rt,l) -> + renTo (LA (lookUp rt allocs, l)) + | LUI (rt,v) -> + renTo (LUI (lookUp rt allocs, v)) + | ADD (rd,rs,rt) -> + renTo (ADD (lookUp rd allocs, lookUp rs allocs, lookUp rt allocs)) + | ADDI (rd,rs,v) -> + renTo (ADDI (lookUp rd allocs, lookUp rs allocs, v)) + | SUB (rd,rs,rt) -> + renTo (SUB (lookUp rd allocs, lookUp rs allocs, lookUp rt allocs)) + | MUL (rd,rs,rt) -> + renTo (MUL (lookUp rd allocs, lookUp rs allocs, lookUp rt allocs)) + | DIV (rd,rs,rt) -> + renTo (DIV (lookUp rd allocs, lookUp rs allocs, lookUp rt allocs)) + | AND (rd,rs,rt) -> + renTo (AND (lookUp rd allocs, lookUp rs allocs, lookUp rt allocs)) + | ANDI (rd,rs,v) -> + renTo (ANDI (lookUp rd allocs, lookUp rs allocs, v)) + | OR (rd,rs,rt) -> + renTo (OR (lookUp rd allocs, lookUp rs allocs, lookUp rt allocs)) + | ORI (rd,rs,v) -> + renTo (ORI (lookUp rd allocs, lookUp rs allocs, v)) + | XOR (rd,rs,rt) -> + renTo (XOR (lookUp rd allocs, lookUp rs allocs, lookUp rt allocs)) + | XORI (rd,rs,v) -> + renTo (XORI (lookUp rd allocs, lookUp rs allocs, v)) + | SLL (rd,rt,v) -> + renTo (SLL (lookUp rd allocs, lookUp rt allocs, v)) + | SRA (rd,rt,v) -> + renTo (SRA (lookUp rd allocs, lookUp rt allocs, v)) + | SLT (rd,rs,rt) -> + renTo (SLT (lookUp rd allocs, lookUp rs allocs, lookUp rt allocs)) + | SLTI (rd,rs,v) -> + renTo (SLTI (lookUp rd allocs, lookUp rs allocs, v)) + | BEQ (rs,rt,l) -> + renTo (BEQ (lookUp rs allocs, lookUp rt allocs, l)) + | BGEZ(rs,l) -> + renTo (BGEZ(lookUp rs allocs, l)) + | BNE (rs,rt,l) -> + renTo (BNE (lookUp rs allocs, lookUp rt allocs, l)) + | JAL (lab,argRegs) -> + [JAL (lab, List.map (fun r -> lookUp r allocs) argRegs); + COMMENT ("was:" + ppMips inst + + ", " + String.concat " " (List.map ppReg argRegs))] + | JR (r, resRegs) -> + [JR (lookUp r allocs, List.map (fun r -> lookUp r allocs) resRegs); + COMMENT ("was:" + ppMips inst + + ", " + String.concat " " (List.map ppReg resRegs))] + | LW (rd,rs,v) -> + renTo (LW (lookUp rd allocs, lookUp rs allocs, v)) + | SW (rd,rs,v) -> + renTo (SW (lookUp rd allocs, lookUp rs allocs, v)) + | LB (rd,rs,v) -> + renTo (LB (lookUp rd allocs, lookUp rs allocs, v)) + | SB (rd,rs,v) -> + renTo (SB (lookUp rd allocs, lookUp rs allocs, v)) + | _ -> [inst] + +let spill1 i r offset = + let d = destReg i + let u = usedRegs i + let hdlst = if Set.contains r u + then [Mips.LW (r, RN 29, offset)] + else [] + let tllst = if Set.contains r d + then [Mips.SW (r, RN 29, offset)] + else [] + hdlst @ [i] @ tllst + +let rec spill ilist r offset = + match ilist with + | [] -> [] + | (i::is) -> spill1 i r offset @ spill is r offset + +let rec maxreg lst m = + match lst with + | [] -> m + | ((r,RN n)::rs) -> maxreg rs (if m < n then n else m) + | ((_,RS _)::rs) -> raise (MyError "maxreg of non-numeric register") + +(* arguments: + ilist is list of MIPS instructions + liveAtEnd is a set of variables that are live at the end of ilist + rmin is first allocable register (caller-saves) + callerMax is highest caller-saves register + rmax is highest allocable register + spilled is number of registers spilled so far -- should be 0 initially +*) +let rec registerAlloc (ilist : Mips.Instruction list) + (liveAtEnd : Set) + (rmin : int) + (callerMax : int) + (rmax : int) + (spilled : int) + : (Mips.Instruction list * Set * int * int) = + try + let llist = live_regs ilist liveAtEnd + let callerSaves = mList rmin callerMax + let iGraph = graph ilist llist callerSaves + let moveRelated = findMoves ilist llist + let allocs = colourGraph iGraph rmin rmax moveRelated + let deadRegs = Set.difference (filterSymbolic (destRegs ilist)) + ( (List.map (fun (x,_) -> x) allocs) |> Set.ofList ) + let allocs1 = allocs @ (List.map (fun r -> (r, RN 0)) (Set.toList deadRegs)) + let ilist1 = filterNullMoves ilist allocs1 + let ilist2 = List.concat (List.map (renameReg allocs1) ilist1) + (ilist2, List.head llist, maxreg allocs 0, spilled) + with + | (Not_colourable sr) -> + printfn "%s spilled\n" sr + spilledVars := Set.add sr (!spilledVars) + let offset = (4*spilled) + let ilist' = spill ilist (RS sr) offset + let ilist'' = [Mips.SW (RS sr, RN 29,offset)] + @ ilist' @ + (if Set.contains (RS sr) liveAtEnd + then [Mips.LW (RS sr, RN 29, offset)] + else []) + registerAlloc ilist'' liveAtEnd rmin callerMax rmax (spilled + 1) + diff --git a/W1/fasto/Fasto/SymTab.fs b/W1/fasto/Fasto/SymTab.fs new file mode 100644 index 0000000..76a53f3 --- /dev/null +++ b/W1/fasto/Fasto/SymTab.fs @@ -0,0 +1,37 @@ +(* A polymorphic symbol table. *) + +module SymTab + +open System + +(* +A symbol table is just a list of tuples identifiers and values. This allows for +easy shadowing, as a shadowing binding can be quickly placed at the head of the +list. +*) +type SymTab<'a> = SymTab of (string * 'a) list + +let empty () = SymTab [] + +let rec lookup n tab = + match tab with + | SymTab [] -> None + | SymTab ((n1,i1)::remtab) -> + if n = n1 + then Some i1 + else lookup n (SymTab remtab) + +let bind n i (SymTab stab) = SymTab ((n,i)::stab) + +let remove n (SymTab stab) = + SymTab (List.filter (fun (x, _) -> x <> n) stab) + +let removeMany ns (SymTab stab) = + SymTab (List.filter (fun (x, _) -> + not (List.exists (fun y -> y = x) ns)) stab) + +let combine (SymTab t1) (SymTab t2) = SymTab (t1 @ t2) + +let fromList l = SymTab l + +let toList (SymTab lst) = lst diff --git a/W1/fasto/Fasto/SymTab.fsi b/W1/fasto/Fasto/SymTab.fsi new file mode 100644 index 0000000..cd0ec10 --- /dev/null +++ b/W1/fasto/Fasto/SymTab.fsi @@ -0,0 +1,38 @@ +(* +A polymorphic symbol table. +A symbol table is a data structure associating names (strings) with values. It +is useful for keeping track of binidngs. Bindings can be shadowed --- the +active binding is the one made most recently. +*) + +module SymTab + (* A symbol table with values of type 'a. *) + //type SymTab<'a> = SymTab of (string * 'a) list + // when 'a : equality + + (* Create an empty symbol table. *) + val empty : unit -> SymTab<'a> when 'a : equality + + (* Look up the active binding for the name. *) + val lookup : string -> SymTab<'a> -> Option<'a> + + (* Bind the name to a value, shadowing any existing + binidngs with the same name. *) + val bind : string -> 'a -> SymTab<'a> -> SymTab<'a> + + (* Remove all existing bindings of the given name. *) + val remove : string -> SymTab<'a > -> SymTab<'a> + + (* Remove all existing bindings of all the given names. *) + val removeMany : string list -> SymTab<'a > -> SymTab<'a > + + (* Combine two symbol tables. The first table shadows the second. *) + val combine : SymTab<'a > -> SymTab<'a > -> SymTab<'a > + + (* Create a symbol table from a list of name-value pairs. + In case of duplicates, the bindings are shadowed in reverse order from + the head of the list. That is, the active binding will ne the one + closest to the head of the list. *) + val fromList : (string * 'a) list -> SymTab<'a > + val toList : SymTab<'a > -> (string * 'a) list + diff --git a/W1/fasto/Fasto/TypeChecker.fs b/W1/fasto/Fasto/TypeChecker.fs new file mode 100644 index 0000000..84ff77b --- /dev/null +++ b/W1/fasto/Fasto/TypeChecker.fs @@ -0,0 +1,391 @@ +(* A type-checker for Fasto. *) + +module TypeChecker + +(* + +A type-checker checks that all operations in a (Fasto) program are performed on +operands of an appropriate type. Furthermore, a type-checker infers any types +missing in the original program text, necessary for well-defined machine code +generation. + +The main function of interest in this module is: + + val checkProg : Fasto.UnknownTypes.Prog -> Fasto.KnownTypes.Prog + +*) + +open AbSyn + +(* An exception for reporting type errors. *) +exception MyError of string * Position + +type FunTable = SymTab.SymTab<(Type * Type list * Position)> +type VarTable = SymTab.SymTab + + +(* Table of predefined conversion functions *) +let initFunctionTable : FunTable = + SymTab.fromList + [( "chr", (Char, [Int], (0,0))); + ( "ord", (Int, [Char], (0,0))) + ] + +(* Pretty-printer for function types, for error messages *) +let showFunType (args : Type list, res : Type) : string = + match args with + | [] -> " () -> " + ppType res + | args -> (String.concat " * " (List.map ppType args)) + + " -> " + ppType res + +let reportError msg pos = raise (MyError (msg, pos)) + +let reportTypeWrong place tExp tFound pos = + reportError ("Type mismatch in " + place + ": expected " + + ppType tExp + ", but got " + ppType tFound) pos + +let reportTypesDifferent place tFound1 tFound2 pos = + reportError ("Type mismatch in " + place + ": expected " + + "equal types, but got " + ppType tFound1 + + " and " + ppType tFound2) pos + +let reportTypeWrongKind place kExp tFound pos = + reportError ("Type mismatch in " + place + ": expected a(n) " + + kExp + " type, but got " + ppType tFound) pos + +let reportArityWrong place nExp (args, res) pos = + reportError ("Arity mismatch in " + place + ": expected " + + "a function of arity " + string nExp + ", but got " + + showFunType (args, res)) pos + +let reportUnknownId kind name pos = + reportError ("Unkown " + kind + " identifier: " + name) pos + +let reportOther msg pos = reportError msg pos + +(* Determine if a value of some type can be printed with write() *) +let printable (tp : Type) : bool = + match tp with + | Int -> true + | Bool -> true + | Char -> true + | Array Char -> true + | _ -> false (* For all other array types *) + +(* Type-check the two operands to a binary operator - they must both be + of type 't'. Returns the decorated operands on success. *) +let rec checkBinOp (ftab : FunTable) + (vtab : VarTable) + (pos : Position, t : Type, e1 : UntypedExp, e2 : UntypedExp) + : (TypedExp * TypedExp) = + let (t1, e1') = checkExp ftab vtab e1 + let (t2, e2') = checkExp ftab vtab e2 + if t1 <> t then + reportTypeWrong "1st argument of binary operator" t t1 pos + if t2 <> t then + reportTypeWrong "2nd argument of binary operator" t t2 pos + (e1', e2') + +(* Determine the type of an expression. On the way, decorate each + node in the syntax tree with inferred types. The result consists + of a pair: the result type tupled with the type-decorated + expression. An exception is raised immediately on the first type mismatch + by reportError. (We could instead collect each error as part of the + result of checkExp and report all errors at the end.) *) + +and checkExp (ftab : FunTable) + (vtab : VarTable) + (exp : UntypedExp) + : (Type * TypedExp) = + match exp with + | Constant (v, pos) -> (valueType v, Constant (v, pos)) + | StringLit (s, pos) -> (Array Char, StringLit (s, pos)) + | ArrayLit ([], _, pos) -> reportOther "Impossible empty array" pos + | ArrayLit (exp::exps, _, pos) -> + let (type_exp, exp_dec) = checkExp ftab vtab exp + let exps_dec = + List.map (fun ei -> let (ti, ei') = checkExp ftab vtab ei + if ti <> type_exp then + reportTypesDifferent "components of array literal" + type_exp ti pos + ei') + exps + (Array type_exp, ArrayLit (exp_dec :: exps_dec, type_exp, pos)) + + | Var (s, pos) -> + match SymTab.lookup s vtab with + | None -> reportUnknownId "variable" s pos + | Some t -> (t, Var (s, pos)) + + | Plus (e1, e2, pos) -> + let (e1_dec, e2_dec) = checkBinOp ftab vtab (pos, Int, e1, e2) + (Int, Plus (e1_dec, e2_dec, pos)) + + | Minus (e1, e2, pos) -> + let (e1_dec, e2_dec) = checkBinOp ftab vtab (pos, Int, e1, e2) + (Int, Minus (e1_dec, e2_dec, pos)) + + (* TODO project task 1: + Implement by pattern matching Plus/Minus above. + See `AbSyn.fs` for the expression constructors of `Times`, ... + *) + | Times (e1, e2, pos) -> + failwith "Unimplemented type check of multiplication" + + | Divide (_, _, _) -> + failwith "Unimplemented type check of division" + + | And (_, _, _) -> + failwith "Unimplemented type check of &&" + + | Or (_, _, _) -> + failwith "Unimplemented type check of ||" + + | Not (_, _) -> + failwith "Unimplemented type check of not" + + | Negate (_, _) -> + failwith "Unimplemented type check of negate" + + (* The types for e1, e2 must be the same. The result is always a Bool. *) + | Equal (e1, e2, pos) -> + let (t1, e1') = checkExp ftab vtab e1 + let (t2, e2') = checkExp ftab vtab e2 + match (t1 = t2, t1) with + | (false, _) -> reportTypesDifferent "arguments of == " t1 t2 pos + | (true, Array _) -> reportTypeWrongKind "arguments of == " "base" t1 pos + | _ -> (Bool, Equal (e1', e2', pos)) + + | Less (e1, e2, pos) -> + let (t1, e1') = checkExp ftab vtab e1 + let (t2, e2') = checkExp ftab vtab e2 + match (t1 = t2, t1) with + | (false, _) -> reportTypesDifferent "arguments of < " t1 t2 pos + | (true, Array _) -> reportTypeWrongKind "arguments of < " "base" t1 pos + | _ -> (Bool, Less (e1', e2', pos)) + + | If (pred, e1, e2, pos) -> + let (pred_t, pred') = checkExp ftab vtab pred + let (t1, e1') = checkExp ftab vtab e1 + let (t2, e2') = checkExp ftab vtab e2 + let target_type = if t1 = t2 then t1 + else reportTypesDifferent "branches of conditional" + t1 t2 pos + match pred_t with + | Bool -> (target_type, If (pred', e1', e2', pos)) + | _ -> reportTypeWrong "predicate in conditional" Bool pred_t pos + + (* special case for length *) + | Apply ("length", [arg], pos) -> + let (targ, arg') = checkExp ftab vtab arg + match targ with + | Array _ -> (Int, Apply("length", [arg'], pos)) + | _ -> reportTypeWrongKind "argument of length" "array" targ pos + | Apply ("length", args, pos) -> + reportOther ("Arity mismatch: length expects 1 argument, but got " + + string (List.length args)) pos + + (* Look up f in function table, get a list of expected types for each + function argument and an expected type for the return value. Check + each actual argument. Ensure that each actual argument type has the + expected type. *) + | Apply (f, args, pos) -> + let (result_type, expected_arg_types, _) = + match SymTab.lookup f ftab with + | Some tup -> tup (* 2-tuple *) + | None -> reportUnknownId "function" f pos + let nargs = List.length args + let ntypes = List.length expected_arg_types + if nargs <> ntypes then + reportOther ("Arity mismatch: expected " + string ntypes + + " argument(s), but got " + string nargs) pos + let args_dec = + List.mapi2 (fun i ti ai -> + let (ti', ai') = checkExp ftab vtab ai + if ti' <> ti then + reportTypeWrong ("function argument #"+string (i+1)) + ti ti' pos + ai') + expected_arg_types args + (result_type, Apply (f, args_dec, pos)) + + | Let (Dec (name, exp, pos1), exp_body, pos2) -> + let (t1, exp_dec) = checkExp ftab vtab exp + let new_vtab = SymTab.bind name t1 vtab + let (t2, exp_body_dec) = checkExp ftab new_vtab exp_body + (t2, Let (Dec (name, exp_dec, pos1), exp_body_dec, pos2)) + + | Read (t, pos) -> + match t with + | Array _ -> reportTypeWrongKind "argument of read" "base" t pos + | _ -> (t, Read (t, pos)) + + | Write (e, _, pos) -> + let (t, e') = checkExp ftab vtab e + if printable t + then (t, Write (e', t, pos)) + else reportTypeWrongKind "argument of write" "printable" t pos + + | Index (s, i_exp, t, pos) -> + let (e_type, i_exp_dec) = checkExp ftab vtab i_exp + let arr_type = + match SymTab.lookup s vtab with + | Some (Array t) -> t + | None -> reportUnknownId "indexed-variable" s pos + | Some other -> reportTypeWrongKind ("indexed variable " + s) "array" other pos + (arr_type, Index (s, i_exp_dec, arr_type, pos)) + + | Iota (n_exp, pos) -> + let (e_type, n_exp_dec) = checkExp ftab vtab n_exp + if e_type <> Int then + reportTypeWrong "argument of iota" Int e_type pos + (Array Int, Iota (n_exp_dec, pos)) + + | Map (f, arr_exp, _, _, pos) -> + let (arr_type, arr_exp_dec) = checkExp ftab vtab arr_exp + let elem_type = + match arr_type with + | Array t -> t + | _ -> reportTypeWrongKind "second argument of map" "array" arr_type pos + let (f', f_res_type, f_arg_type) = + match checkFunArg ftab vtab pos f with + | (f', res, [a1]) -> (f', res, a1) + | (_, res, args) -> + reportArityWrong "first argument of map" 1 (args,res) pos + if elem_type <> f_arg_type then + reportTypesDifferent "function-argument and array-element types in map" + f_arg_type elem_type pos + (Array f_res_type, Map (f', arr_exp_dec, elem_type, f_res_type, pos)) + + | Reduce (f, e_exp, arr_exp, _, pos) -> + let (e_type , e_dec ) = checkExp ftab vtab e_exp + let (arr_type, arr_dec) = checkExp ftab vtab arr_exp + let elem_type = + match arr_type with + | Array t -> t + | _ -> reportTypeWrongKind "third argument of reduce" "array" arr_type pos + let (f', f_argres_type) = + match checkFunArg ftab vtab pos f with + | (f', res, [a1; a2]) -> + if a1 <> a2 then + reportTypesDifferent "argument types of operation in reduce" + a1 a2 pos + if res <> a1 then + reportTypesDifferent "argument and return type of operation in reduce" + a1 res pos + (f', res) + | (_, res, args) -> + reportArityWrong "operation in reduce" 2 (args,res) pos + if elem_type <> f_argres_type then + reportTypesDifferent "operation and array-element types in reduce" + f_argres_type elem_type pos + if e_type <> f_argres_type then + reportTypesDifferent "operation and start-element types in scan" + f_argres_type e_type pos + (f_argres_type, Reduce (f', e_dec, arr_dec, elem_type, pos)) + + (* TODO project task 2: + See `AbSyn.fs` for the expression constructors of + `Replicate`, `Filter`, `Scan`. + + Hints for `replicate(n, a)`: + - recursively type check `n` and `a` + - check that `n` has integer type + - assuming `a` is of type `t` the result type + of replicate is `[t]` + *) + | Replicate (_, _, _, _) -> + failwith "Unimplemented type check of replicate" + + (* TODO project task 2: Hint for `filter(f, arr)` + Look into the type-checking lecture slides for the type rule of `map` + and think of what needs to be changed for filter (?) + Use `checkFunArg` to get the signature of the function argument `f`. + Check that: + - `f` has type `ta -> Bool` + - `arr` should be of type `[ta]` + - the result of filter should have type `[tb]` + *) + | Filter (_, _, _, _) -> + failwith "Unimplemented type check of filter" + + (* TODO project task 2: `scan(f, ne, arr)` + Hint: Implementation is very similar to `reduce(f, ne, arr)`. + (The difference between `scan` and `reduce` is that + scan's return type is the same as the type of `arr`, + while reduce's return type is that of an element of `arr`). + *) + | Scan (_, _, _, _, _) -> + failwith "Unimplemented type check of scan" + +and checkFunArg (ftab : FunTable) + (vtab : VarTable) + (pos : Position) + (ff : UntypedFunArg) + : (TypedFunArg * Type * Type list) = + match ff with + | FunName fname -> + match SymTab.lookup fname ftab with + | None -> reportUnknownId "parameter function" fname pos + | Some (ret_type, arg_types, _) -> (FunName fname, ret_type, arg_types) + | Lambda (rettype, parms, body, funpos) -> + let lambda = FunDec ("", rettype, parms, body, funpos) + let (FunDec (_, _, _, body', _)) = + checkFunWithVtable ftab vtab pos lambda + ( Lambda (rettype, parms, body', pos) + , rettype + , List.map (fun (Param (_, ty)) -> ty) parms) + + +(* Check a function declaration, but using a given vtable rather +than an empty one. *) +and checkFunWithVtable (ftab : FunTable) + (vtab : VarTable) + (pos : Position) + (fdec : UntypedFunDec) + : TypedFunDec = + let (FunDec (fname, rettype, parms, body, funpos)) = fdec + (* Expand vtable by adding the parameters to vtab. *) + let addParam ptable (Param (pname, ty)) = + match SymTab.lookup pname ptable with + | Some _ -> reportOther ("Multiple parameters named " + pname) + funpos + | None -> SymTab.bind pname ty ptable + let paramtable = List.fold addParam (SymTab.empty()) parms + let vtab' = SymTab.combine paramtable vtab + let (body_type, body') = checkExp ftab vtab' body + if body_type = rettype + then (FunDec (fname, rettype, parms, body', pos)) + else reportTypeWrong "function body" rettype body_type funpos + + +(* Convert a funDec into the (fname, ([arg types], result type), + pos) entries that the function table, ftab, consists of, and + update the function table with that entry. *) +let updateFunctionTable (ftab : FunTable) + (fundec : UntypedFunDec) + : FunTable = + let (FunDec (fname, ret_type, args, _, pos)) = fundec + let arg_types = List.map (fun (Param (_, ty)) -> ty) args + match SymTab.lookup fname ftab with + | Some (_, _, old_pos) -> reportOther ("Duplicate function " + fname) pos + | None -> SymTab.bind fname (ret_type, arg_types, pos) ftab + +(* Functions are guaranteed by syntax to have a known declared type. This + type is checked against the type of the function body, taking into + account declared argument types and types of other functions called. + *) +let checkFun (ftab : FunTable) + (fundec : UntypedFunDec) + : TypedFunDec = + let (FunDec (_, _, _, _, pos)) = fundec + checkFunWithVtable ftab (SymTab.empty()) pos fundec + +let checkProg (funDecs : UntypedFunDec list) : TypedFunDec list = + let ftab = List.fold updateFunctionTable initFunctionTable funDecs + let decorated_funDecs = List.map (checkFun ftab) funDecs + match SymTab.lookup "main" ftab with + | None -> reportOther "No main function defined" (0,0) + | Some (_, [], _) -> decorated_funDecs (* all fine! *) + | Some (ret_type, args, mainpos) -> + reportArityWrong "declaration of main" 0 (args,ret_type) mainpos diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/FSharp.Core.dll b/W1/fasto/Fasto/bin/Debug/net6.0/FSharp.Core.dll new file mode 100755 index 0000000..f38b4fd Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/FSharp.Core.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/Fasto b/W1/fasto/Fasto/bin/Debug/net6.0/Fasto new file mode 100755 index 0000000..ba198ca Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/Fasto differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.deps.json b/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.deps.json new file mode 100644 index 0000000..0ac7ddb --- /dev/null +++ b/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.deps.json @@ -0,0 +1,114 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v6.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v6.0": { + "Fasto/1.0.0": { + "dependencies": { + "FSharp.Core": "6.0.1", + "FsLexYacc": "10.2.0" + }, + "runtime": { + "Fasto.dll": {} + } + }, + "FSharp.Core/6.0.1": { + "runtime": { + "lib/netstandard2.1/FSharp.Core.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.121.52202" + } + }, + "resources": { + "lib/netstandard2.1/cs/FSharp.Core.resources.dll": { + "locale": "cs" + }, + "lib/netstandard2.1/de/FSharp.Core.resources.dll": { + "locale": "de" + }, + "lib/netstandard2.1/es/FSharp.Core.resources.dll": { + "locale": "es" + }, + "lib/netstandard2.1/fr/FSharp.Core.resources.dll": { + "locale": "fr" + }, + "lib/netstandard2.1/it/FSharp.Core.resources.dll": { + "locale": "it" + }, + "lib/netstandard2.1/ja/FSharp.Core.resources.dll": { + "locale": "ja" + }, + "lib/netstandard2.1/ko/FSharp.Core.resources.dll": { + "locale": "ko" + }, + "lib/netstandard2.1/pl/FSharp.Core.resources.dll": { + "locale": "pl" + }, + "lib/netstandard2.1/pt-BR/FSharp.Core.resources.dll": { + "locale": "pt-BR" + }, + "lib/netstandard2.1/ru/FSharp.Core.resources.dll": { + "locale": "ru" + }, + "lib/netstandard2.1/tr/FSharp.Core.resources.dll": { + "locale": "tr" + }, + "lib/netstandard2.1/zh-Hans/FSharp.Core.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netstandard2.1/zh-Hant/FSharp.Core.resources.dll": { + "locale": "zh-Hant" + } + } + }, + "FsLexYacc/10.2.0": { + "dependencies": { + "FSharp.Core": "6.0.1", + "FsLexYacc.Runtime": "10.2.0" + } + }, + "FsLexYacc.Runtime/10.2.0": { + "dependencies": { + "FSharp.Core": "6.0.1" + }, + "runtime": { + "lib/netstandard2.0/FsLexYacc.Runtime.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "10.2.0.0" + } + } + } + } + }, + "libraries": { + "Fasto/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "FSharp.Core/6.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VrFAiW8dEEekk+0aqlbvMNZzDvYXmgWZwAt68AUBqaWK8RnoEVUNglj66bZzhs4/U63q0EfXlhcEKnH1sTYLjw==", + "path": "fsharp.core/6.0.1", + "hashPath": "fsharp.core.6.0.1.nupkg.sha512" + }, + "FsLexYacc/10.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-q7mhuEMm8rvFAJ9jaH1atYCRN96tMbjHarYIDooeMKFCbUuqvep+vA2ijGhA06GZ5BG+jg4TjG6dt/4gR2qHHA==", + "path": "fslexyacc/10.2.0", + "hashPath": "fslexyacc.10.2.0.nupkg.sha512" + }, + "FsLexYacc.Runtime/10.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-d2+gguRIvsn1e7AycVc0r7L1QWptrnUOvQvJLbgkANcS5SjfM/FRgfUGwfqV2cJo3KOFQB5Mqmda/4YTQkkvdA==", + "path": "fslexyacc.runtime/10.2.0", + "hashPath": "fslexyacc.runtime.10.2.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.dll b/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.dll new file mode 100644 index 0000000..9e2e880 Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.pdb b/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.pdb new file mode 100644 index 0000000..8b79e3e Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.pdb differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.runtimeconfig.json b/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.runtimeconfig.json new file mode 100644 index 0000000..4986d16 --- /dev/null +++ b/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.runtimeconfig.json @@ -0,0 +1,9 @@ +{ + "runtimeOptions": { + "tfm": "net6.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "6.0.0" + } + } +} \ No newline at end of file diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/FsLexYacc.Runtime.dll b/W1/fasto/Fasto/bin/Debug/net6.0/FsLexYacc.Runtime.dll new file mode 100755 index 0000000..de0a2b4 Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/FsLexYacc.Runtime.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/cs/FSharp.Core.resources.dll b/W1/fasto/Fasto/bin/Debug/net6.0/cs/FSharp.Core.resources.dll new file mode 100755 index 0000000..db77a00 Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/cs/FSharp.Core.resources.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/de/FSharp.Core.resources.dll b/W1/fasto/Fasto/bin/Debug/net6.0/de/FSharp.Core.resources.dll new file mode 100755 index 0000000..b3628de Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/de/FSharp.Core.resources.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/es/FSharp.Core.resources.dll b/W1/fasto/Fasto/bin/Debug/net6.0/es/FSharp.Core.resources.dll new file mode 100755 index 0000000..b2d4174 Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/es/FSharp.Core.resources.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/fr/FSharp.Core.resources.dll b/W1/fasto/Fasto/bin/Debug/net6.0/fr/FSharp.Core.resources.dll new file mode 100755 index 0000000..b78a076 Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/fr/FSharp.Core.resources.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/it/FSharp.Core.resources.dll b/W1/fasto/Fasto/bin/Debug/net6.0/it/FSharp.Core.resources.dll new file mode 100755 index 0000000..d7a8b08 Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/it/FSharp.Core.resources.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/ja/FSharp.Core.resources.dll b/W1/fasto/Fasto/bin/Debug/net6.0/ja/FSharp.Core.resources.dll new file mode 100755 index 0000000..8424f57 Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/ja/FSharp.Core.resources.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/ko/FSharp.Core.resources.dll b/W1/fasto/Fasto/bin/Debug/net6.0/ko/FSharp.Core.resources.dll new file mode 100755 index 0000000..5303dc8 Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/ko/FSharp.Core.resources.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/pl/FSharp.Core.resources.dll b/W1/fasto/Fasto/bin/Debug/net6.0/pl/FSharp.Core.resources.dll new file mode 100755 index 0000000..100bb50 Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/pl/FSharp.Core.resources.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/pt-BR/FSharp.Core.resources.dll b/W1/fasto/Fasto/bin/Debug/net6.0/pt-BR/FSharp.Core.resources.dll new file mode 100755 index 0000000..461b6f4 Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/pt-BR/FSharp.Core.resources.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/ru/FSharp.Core.resources.dll b/W1/fasto/Fasto/bin/Debug/net6.0/ru/FSharp.Core.resources.dll new file mode 100755 index 0000000..da9e58f Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/ru/FSharp.Core.resources.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/tr/FSharp.Core.resources.dll b/W1/fasto/Fasto/bin/Debug/net6.0/tr/FSharp.Core.resources.dll new file mode 100755 index 0000000..2bd2fc1 Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/tr/FSharp.Core.resources.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/zh-Hans/FSharp.Core.resources.dll b/W1/fasto/Fasto/bin/Debug/net6.0/zh-Hans/FSharp.Core.resources.dll new file mode 100755 index 0000000..cdb82a3 Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/zh-Hans/FSharp.Core.resources.dll differ diff --git a/W1/fasto/Fasto/bin/Debug/net6.0/zh-Hant/FSharp.Core.resources.dll b/W1/fasto/Fasto/bin/Debug/net6.0/zh-Hant/FSharp.Core.resources.dll new file mode 100755 index 0000000..56e4282 Binary files /dev/null and b/W1/fasto/Fasto/bin/Debug/net6.0/zh-Hant/FSharp.Core.resources.dll differ diff --git a/W1/fasto/Fasto/obj/Debug/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.fs b/W1/fasto/Fasto/obj/Debug/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.fs new file mode 100644 index 0000000..7b54f55 --- /dev/null +++ b/W1/fasto/Fasto/obj/Debug/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.fs @@ -0,0 +1,3 @@ +namespace Microsoft.BuildSettings + [] + do () diff --git a/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.AssemblyInfo.fs b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.AssemblyInfo.fs new file mode 100644 index 0000000..819cabd --- /dev/null +++ b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.AssemblyInfo.fs @@ -0,0 +1,17 @@ +// +// Generated by the FSharp WriteCodeFragment class. +// +namespace FSharp + +open System +open System.Reflection + + +[] +[] +[] +[] +[] +[] +[] +do() diff --git a/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.AssemblyInfoInputs.cache b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.AssemblyInfoInputs.cache new file mode 100644 index 0000000..2910c19 --- /dev/null +++ b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +87b9cc0b5fae546ac1375c9e8703b89da9781f13 diff --git a/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.assets.cache b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.assets.cache new file mode 100644 index 0000000..a8329b8 Binary files /dev/null and b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.assets.cache differ diff --git a/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.dll b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.dll new file mode 100644 index 0000000..9e2e880 Binary files /dev/null and b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.dll differ diff --git a/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.fsproj.AssemblyReference.cache b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.fsproj.AssemblyReference.cache new file mode 100644 index 0000000..2eb1946 Binary files /dev/null and b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.fsproj.AssemblyReference.cache differ diff --git a/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.fsproj.CopyComplete b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.fsproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.fsproj.CoreCompileInputs.cache b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.fsproj.CoreCompileInputs.cache new file mode 100644 index 0000000..955ac63 --- /dev/null +++ b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.fsproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +080b0941452a640a75792128618fd775c389a0f7 diff --git a/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.fsproj.FileListAbsolute.txt b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.fsproj.FileListAbsolute.txt new file mode 100644 index 0000000..1915f64 --- /dev/null +++ b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.fsproj.FileListAbsolute.txt @@ -0,0 +1,27 @@ +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/Fasto +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.deps.json +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.runtimeconfig.json +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.pdb +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/FSharp.Core.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/FsLexYacc.Runtime.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/cs/FSharp.Core.resources.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/de/FSharp.Core.resources.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/es/FSharp.Core.resources.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/fr/FSharp.Core.resources.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/it/FSharp.Core.resources.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/ja/FSharp.Core.resources.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/ko/FSharp.Core.resources.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/pl/FSharp.Core.resources.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/pt-BR/FSharp.Core.resources.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/ru/FSharp.Core.resources.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/tr/FSharp.Core.resources.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/zh-Hans/FSharp.Core.resources.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/zh-Hant/FSharp.Core.resources.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.fsproj.AssemblyReference.cache +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.AssemblyInfoInputs.cache +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.AssemblyInfo.fs +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.fsproj.CopyComplete +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.dll +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.pdb +/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.genruntimeconfig.cache diff --git a/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.genruntimeconfig.cache b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.genruntimeconfig.cache new file mode 100644 index 0000000..8163af3 --- /dev/null +++ b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.genruntimeconfig.cache @@ -0,0 +1 @@ +b7acdde169d1ecf0a99f7c2664e583fb2a6533df diff --git a/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.pdb b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.pdb new file mode 100644 index 0000000..8b79e3e Binary files /dev/null and b/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.pdb differ diff --git a/W1/fasto/Fasto/obj/Debug/net6.0/apphost b/W1/fasto/Fasto/obj/Debug/net6.0/apphost new file mode 100755 index 0000000..ba198ca Binary files /dev/null and b/W1/fasto/Fasto/obj/Debug/net6.0/apphost differ diff --git a/W1/fasto/Fasto/obj/Fasto.fsproj.nuget.dgspec.json b/W1/fasto/Fasto/obj/Fasto.fsproj.nuget.dgspec.json new file mode 100644 index 0000000..4366372 --- /dev/null +++ b/W1/fasto/Fasto/obj/Fasto.fsproj.nuget.dgspec.json @@ -0,0 +1,74 @@ +{ + "format": 1, + "restore": { + "/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsproj": {} + }, + "projects": { + "/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsproj", + "projectName": "Fasto", + "projectPath": "/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsproj", + "packagesPath": "/home/nikolaj/.nuget/packages/", + "outputPath": "/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nikolaj/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net6.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net6.0": { + "targetAlias": "net6.0", + "projectReferences": {} + } + } + }, + "frameworks": { + "net6.0": { + "targetAlias": "net6.0", + "dependencies": { + "FSharp.Core": { + "include": "Runtime, Compile, Build, Native, Analyzers, BuildTransitive", + "target": "Package", + "version": "[6.0.1, )", + "generatePathProperty": true + }, + "FsLexYacc": { + "target": "Package", + "version": "[10.2.0, )", + "generatePathProperty": true + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[6.0.2, 6.0.2]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/6.0.102/RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/W1/fasto/Fasto/obj/Fasto.fsproj.nuget.g.props b/W1/fasto/Fasto/obj/Fasto.fsproj.nuget.g.props new file mode 100644 index 0000000..96af958 --- /dev/null +++ b/W1/fasto/Fasto/obj/Fasto.fsproj.nuget.g.props @@ -0,0 +1,19 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nikolaj/.nuget/packages/ + /home/nikolaj/.nuget/packages/ + PackageReference + 6.0.0 + + + + + + /home/nikolaj/.nuget/packages/fsharp.core/6.0.1 + /home/nikolaj/.nuget/packages/fslexyacc/10.2.0 + + \ No newline at end of file diff --git a/W1/fasto/Fasto/obj/Fasto.fsproj.nuget.g.targets b/W1/fasto/Fasto/obj/Fasto.fsproj.nuget.g.targets new file mode 100644 index 0000000..f23b3e2 --- /dev/null +++ b/W1/fasto/Fasto/obj/Fasto.fsproj.nuget.g.targets @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/W1/fasto/Fasto/obj/fsac.cache b/W1/fasto/Fasto/obj/fsac.cache new file mode 100644 index 0000000..5508ca8 --- /dev/null +++ b/W1/fasto/Fasto/obj/fsac.cache @@ -0,0 +1,2 @@ +4/30/2022 11:13:20 AM +{"Options":{"ProjectFileName":"/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsproj","ProjectId":null,"SourceFiles":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.AssemblyInfo.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/AbSyn.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/SymTab.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Parser.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Lexer.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Interpreter.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/TypeChecker.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/CallGraph.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Inlining.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/DeadFunctionRemoval.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/DeadBindingRemoval.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/CopyConstPropFold.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Mips.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/RegAlloc.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/CodeGen.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsx"],"OtherOptions":["-o:/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.dll","-g","--debug:portable","--noframework","--define:TRACE","--define:DEBUG","--define:NET","--define:NET6_0","--define:NETCOREAPP","--define:NET5_0_OR_GREATER","--define:NET6_0_OR_GREATER","--define:NETCOREAPP1_0_OR_GREATER","--define:NETCOREAPP1_1_OR_GREATER","--define:NETCOREAPP2_0_OR_GREATER","--define:NETCOREAPP2_1_OR_GREATER","--define:NETCOREAPP2_2_OR_GREATER","--define:NETCOREAPP3_0_OR_GREATER","--define:NETCOREAPP3_1_OR_GREATER","--optimize-","--tailcalls-","-r:/home/nikolaj/.nuget/packages/fsharp.core/6.0.1/lib/netstandard2.1/FSharp.Core.dll","-r:/home/nikolaj/.nuget/packages/fslexyacc.runtime/10.2.0/lib/netstandard2.0/FsLexYacc.Runtime.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.CSharp.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.VisualBasic.Core.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.VisualBasic.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.Win32.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.Win32.Registry.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/mscorlib.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/netstandard.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.AppContext.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Buffers.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.Concurrent.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.Immutable.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.NonGeneric.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.Specialized.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.Annotations.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.DataAnnotations.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.EventBasedAsync.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.TypeConverter.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Configuration.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Console.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Core.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Data.Common.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Data.DataSetExtensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Data.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Contracts.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Debug.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.DiagnosticSource.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.FileVersionInfo.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Process.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.StackTrace.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.TextWriterTraceListener.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Tools.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.TraceSource.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Tracing.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Drawing.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Drawing.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Dynamic.Runtime.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Formats.Asn1.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Globalization.Calendars.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Globalization.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Globalization.Extensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Compression.Brotli.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Compression.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Compression.FileSystem.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Compression.ZipFile.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.AccessControl.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.DriveInfo.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.Watcher.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.IsolatedStorage.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.MemoryMappedFiles.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Pipes.AccessControl.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Pipes.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.UnmanagedMemoryStream.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Linq.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Linq.Expressions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Linq.Parallel.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Linq.Queryable.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Memory.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Http.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Http.Json.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.HttpListener.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Mail.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.NameResolution.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.NetworkInformation.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Ping.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Requests.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Security.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.ServicePoint.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Sockets.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebClient.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebHeaderCollection.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebProxy.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebSockets.Client.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebSockets.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Numerics.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Numerics.Vectors.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ObjectModel.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.DispatchProxy.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Emit.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Emit.ILGeneration.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Emit.Lightweight.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Extensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Metadata.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.TypeExtensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Resources.Reader.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Resources.ResourceManager.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Resources.Writer.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.CompilerServices.Unsafe.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.CompilerServices.VisualC.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Extensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Handles.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.InteropServices.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.InteropServices.RuntimeInformation.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Intrinsics.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Loader.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Numerics.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.Formatters.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.Json.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.Xml.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.AccessControl.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Claims.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Algorithms.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Cng.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Csp.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Encoding.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.OpenSsl.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.X509Certificates.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Principal.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Principal.Windows.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.SecureString.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ServiceModel.Web.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ServiceProcess.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Encoding.CodePages.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Encoding.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Encoding.Extensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Encodings.Web.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Json.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.RegularExpressions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Channels.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Overlapped.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Tasks.Dataflow.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Tasks.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Tasks.Extensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Tasks.Parallel.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Thread.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.ThreadPool.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Timer.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Transactions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Transactions.Local.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ValueTuple.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Web.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Web.HttpUtility.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Windows.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.Linq.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.ReaderWriter.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.Serialization.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XDocument.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XmlDocument.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XmlSerializer.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XPath.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XPath.XDocument.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/WindowsBase.dll","--target:exe","--warn:3","--warnaserror:3239","--fullpaths","--flaterrors","--highentropyva+","--targetprofile:netcore","--nocopyfsharpcore","--deterministic+","--simpleresolution"],"ReferencedProjects":[],"IsIncompleteTypeCheckEnvironment":false,"UseScriptResolutionRules":false,"LoadTime":"2022-04-30T13:17:01.3965334+02:00","UnresolvedReferences":null,"OriginalLoadReferences":[],"Stamp":null},"OutFile":{"Case":"Some","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.dll"]},"References":["/home/nikolaj/.nuget/packages/fsharp.core/6.0.1/lib/netstandard2.1/FSharp.Core.dll","/home/nikolaj/.nuget/packages/fslexyacc.runtime/10.2.0/lib/netstandard2.0/FsLexYacc.Runtime.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.CSharp.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.VisualBasic.Core.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.VisualBasic.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.Win32.Primitives.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.Win32.Registry.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/mscorlib.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/netstandard.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.AppContext.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Buffers.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.Concurrent.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.Immutable.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.NonGeneric.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.Specialized.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.Annotations.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.DataAnnotations.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.EventBasedAsync.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.Primitives.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.TypeConverter.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Configuration.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Console.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Core.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Data.Common.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Data.DataSetExtensions.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Data.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Contracts.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Debug.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.DiagnosticSource.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.FileVersionInfo.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Process.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.StackTrace.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.TextWriterTraceListener.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Tools.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.TraceSource.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Tracing.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Drawing.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Drawing.Primitives.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Dynamic.Runtime.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Formats.Asn1.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Globalization.Calendars.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Globalization.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Globalization.Extensions.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Compression.Brotli.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Compression.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Compression.FileSystem.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Compression.ZipFile.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.AccessControl.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.DriveInfo.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.Primitives.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.Watcher.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.IsolatedStorage.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.MemoryMappedFiles.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Pipes.AccessControl.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Pipes.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.UnmanagedMemoryStream.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Linq.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Linq.Expressions.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Linq.Parallel.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Linq.Queryable.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Memory.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Http.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Http.Json.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.HttpListener.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Mail.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.NameResolution.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.NetworkInformation.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Ping.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Primitives.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Requests.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Security.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.ServicePoint.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Sockets.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebClient.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebHeaderCollection.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebProxy.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebSockets.Client.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebSockets.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Numerics.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Numerics.Vectors.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ObjectModel.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.DispatchProxy.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Emit.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Emit.ILGeneration.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Emit.Lightweight.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Extensions.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Metadata.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Primitives.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.TypeExtensions.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Resources.Reader.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Resources.ResourceManager.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Resources.Writer.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.CompilerServices.Unsafe.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.CompilerServices.VisualC.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Extensions.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Handles.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.InteropServices.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.InteropServices.RuntimeInformation.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Intrinsics.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Loader.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Numerics.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.Formatters.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.Json.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.Primitives.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.Xml.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.AccessControl.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Claims.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Algorithms.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Cng.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Csp.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Encoding.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.OpenSsl.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Primitives.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.X509Certificates.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Principal.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Principal.Windows.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.SecureString.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ServiceModel.Web.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ServiceProcess.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Encoding.CodePages.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Encoding.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Encoding.Extensions.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Encodings.Web.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Json.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.RegularExpressions.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Channels.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Overlapped.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Tasks.Dataflow.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Tasks.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Tasks.Extensions.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Tasks.Parallel.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Thread.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.ThreadPool.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Timer.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Transactions.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Transactions.Local.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ValueTuple.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Web.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Web.HttpUtility.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Windows.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.Linq.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.ReaderWriter.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.Serialization.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XDocument.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XmlDocument.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XmlSerializer.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XPath.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XPath.XDocument.dll","/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/WindowsBase.dll"],"Items":[{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/AbSyn.fs",{"Link":"AbSyn.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/SymTab.fs",{"Link":"SymTab.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Parser.fs",{"Link":"Parser.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Lexer.fs",{"Link":"Lexer.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Interpreter.fs",{"Link":"Interpreter.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/TypeChecker.fs",{"Link":"TypeChecker.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/CallGraph.fs",{"Link":"CallGraph.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Inlining.fs",{"Link":"Inlining.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/DeadFunctionRemoval.fs",{"Link":"DeadFunctionRemoval.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/DeadBindingRemoval.fs",{"Link":"DeadBindingRemoval.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/CopyConstPropFold.fs",{"Link":"CopyConstPropFold.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Mips.fs",{"Link":"Mips.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/RegAlloc.fs",{"Link":"RegAlloc.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/CodeGen.fs",{"Link":"CodeGen.fs"}]},{"Case":"Compile","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsx",{"Link":"Fasto.fsx"}]}],"ProjectFileName":"/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsproj","ExtraInfo":{"ProjectId":{"Case":"Some","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsproj"]},"ProjectFileName":"/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsproj","TargetFramework":"net6.0","SourceFiles":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.AssemblyInfo.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/AbSyn.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/SymTab.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Parser.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Lexer.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Interpreter.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/TypeChecker.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/CallGraph.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Inlining.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/DeadFunctionRemoval.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/DeadBindingRemoval.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/CopyConstPropFold.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Mips.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/RegAlloc.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/CodeGen.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsx"],"OtherOptions":["-o:/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.dll","-g","--debug:portable","--noframework","--define:TRACE","--define:DEBUG","--define:NET","--define:NET6_0","--define:NETCOREAPP","--define:NET5_0_OR_GREATER","--define:NET6_0_OR_GREATER","--define:NETCOREAPP1_0_OR_GREATER","--define:NETCOREAPP1_1_OR_GREATER","--define:NETCOREAPP2_0_OR_GREATER","--define:NETCOREAPP2_1_OR_GREATER","--define:NETCOREAPP2_2_OR_GREATER","--define:NETCOREAPP3_0_OR_GREATER","--define:NETCOREAPP3_1_OR_GREATER","--optimize-","--tailcalls-","-r:/home/nikolaj/.nuget/packages/fsharp.core/6.0.1/lib/netstandard2.1/FSharp.Core.dll","-r:/home/nikolaj/.nuget/packages/fslexyacc.runtime/10.2.0/lib/netstandard2.0/FsLexYacc.Runtime.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.CSharp.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.VisualBasic.Core.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.VisualBasic.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.Win32.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/Microsoft.Win32.Registry.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/mscorlib.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/netstandard.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.AppContext.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Buffers.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.Concurrent.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.Immutable.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.NonGeneric.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Collections.Specialized.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.Annotations.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.DataAnnotations.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.EventBasedAsync.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ComponentModel.TypeConverter.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Configuration.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Console.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Core.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Data.Common.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Data.DataSetExtensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Data.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Contracts.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Debug.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.DiagnosticSource.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.FileVersionInfo.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Process.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.StackTrace.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.TextWriterTraceListener.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Tools.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.TraceSource.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Diagnostics.Tracing.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Drawing.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Drawing.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Dynamic.Runtime.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Formats.Asn1.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Globalization.Calendars.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Globalization.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Globalization.Extensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Compression.Brotli.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Compression.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Compression.FileSystem.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Compression.ZipFile.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.AccessControl.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.DriveInfo.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.FileSystem.Watcher.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.IsolatedStorage.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.MemoryMappedFiles.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Pipes.AccessControl.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.Pipes.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.IO.UnmanagedMemoryStream.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Linq.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Linq.Expressions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Linq.Parallel.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Linq.Queryable.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Memory.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Http.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Http.Json.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.HttpListener.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Mail.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.NameResolution.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.NetworkInformation.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Ping.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Requests.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Security.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.ServicePoint.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.Sockets.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebClient.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebHeaderCollection.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebProxy.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebSockets.Client.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Net.WebSockets.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Numerics.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Numerics.Vectors.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ObjectModel.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.DispatchProxy.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Emit.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Emit.ILGeneration.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Emit.Lightweight.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Extensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Metadata.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Reflection.TypeExtensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Resources.Reader.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Resources.ResourceManager.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Resources.Writer.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.CompilerServices.Unsafe.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.CompilerServices.VisualC.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Extensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Handles.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.InteropServices.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.InteropServices.RuntimeInformation.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Intrinsics.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Loader.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Numerics.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.Formatters.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.Json.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Runtime.Serialization.Xml.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.AccessControl.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Claims.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Algorithms.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Cng.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Csp.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Encoding.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.OpenSsl.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.Primitives.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Cryptography.X509Certificates.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Principal.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.Principal.Windows.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Security.SecureString.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ServiceModel.Web.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ServiceProcess.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Encoding.CodePages.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Encoding.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Encoding.Extensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Encodings.Web.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.Json.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Text.RegularExpressions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Channels.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Overlapped.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Tasks.Dataflow.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Tasks.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Tasks.Extensions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Tasks.Parallel.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Thread.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.ThreadPool.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Threading.Timer.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Transactions.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Transactions.Local.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.ValueTuple.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Web.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Web.HttpUtility.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Windows.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.Linq.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.ReaderWriter.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.Serialization.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XDocument.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XmlDocument.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XmlSerializer.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XPath.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/System.Xml.XPath.XDocument.dll","-r:/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0/WindowsBase.dll","--target:exe","--warn:3","--warnaserror:3239","--fullpaths","--flaterrors","--highentropyva+","--targetprofile:netcore","--nocopyfsharpcore","--deterministic+","--simpleresolution"],"ReferencedProjects":[],"PackageReferences":[{"Name":"FSharp.Core","Version":"6.0.1","FullPath":"/home/nikolaj/.nuget/packages/fsharp.core/6.0.1/lib/netstandard2.1/FSharp.Core.dll"},{"Name":"FsLexYacc.Runtime","Version":"10.2.0","FullPath":"/home/nikolaj/.nuget/packages/fslexyacc.runtime/10.2.0/lib/netstandard2.0/FsLexYacc.Runtime.dll"}],"LoadTime":"2022-04-30T13:17:01.3965334+02:00","TargetPath":"/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/Fasto.dll","ProjectOutputType":{"Case":"Exe"},"ProjectSdkInfo":{"IsTestProject":false,"Configuration":"Debug","IsPackable":true,"TargetFramework":"net6.0","TargetFrameworkIdentifier":".NETCoreApp","TargetFrameworkVersion":"v6.0","MSBuildAllProjects":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/Fasto.fsproj.nuget.g.targets","/usr/share/dotnet/sdk/6.0.102/FSharp/Microsoft.FSharp.NetSdk.props","/usr/share/dotnet/sdk/6.0.102/FSharp/Microsoft.FSharp.NetSdk.targets","/usr/share/dotnet/sdk/6.0.102/FSharp/Microsoft.FSharp.Targets","/usr/share/dotnet/sdk/6.0.102/Current/Microsoft.Common.targets/ImportAfter/Microsoft.TestPlatform.ImportAfter.targets","/usr/share/dotnet/sdk/6.0.102/FSharp/Microsoft.FSharp.Overrides.NetSdk.targets"],"MSBuildToolsVersion":"","ProjectAssetsFile":"/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/project.assets.json","RestoreSuccess":true,"Configurations":["Debug","Release"],"TargetFrameworks":[],"RunArguments":{"Case":"Some","Fields":[""]},"RunCommand":{"Case":"Some","Fields":["/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/bin/Debug/net6.0/Fasto"]},"IsPublishable":{"Case":"Some","Fields":[true]}},"Items":[{"Case":"Compile","Fields":["obj/Debug/net6.0/Fasto.AssemblyInfo.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/Debug/net6.0/Fasto.AssemblyInfo.fs"]},{"Case":"Compile","Fields":["AbSyn.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/AbSyn.fs"]},{"Case":"Compile","Fields":["SymTab.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/SymTab.fs"]},{"Case":"Compile","Fields":["Parser.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Parser.fs"]},{"Case":"Compile","Fields":["Lexer.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Lexer.fs"]},{"Case":"Compile","Fields":["Interpreter.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Interpreter.fs"]},{"Case":"Compile","Fields":["TypeChecker.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/TypeChecker.fs"]},{"Case":"Compile","Fields":["CallGraph.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/CallGraph.fs"]},{"Case":"Compile","Fields":["Inlining.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Inlining.fs"]},{"Case":"Compile","Fields":["DeadFunctionRemoval.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/DeadFunctionRemoval.fs"]},{"Case":"Compile","Fields":["DeadBindingRemoval.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/DeadBindingRemoval.fs"]},{"Case":"Compile","Fields":["CopyConstPropFold.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/CopyConstPropFold.fs"]},{"Case":"Compile","Fields":["Mips.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Mips.fs"]},{"Case":"Compile","Fields":["RegAlloc.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/RegAlloc.fs"]},{"Case":"Compile","Fields":["CodeGen.fs","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/CodeGen.fs"]},{"Case":"Compile","Fields":["Fasto.fsx","/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsx"]}],"CustomProperties":[]}} diff --git a/W1/fasto/Fasto/obj/project.assets.json b/W1/fasto/Fasto/obj/project.assets.json new file mode 100644 index 0000000..53c5f46 --- /dev/null +++ b/W1/fasto/Fasto/obj/project.assets.json @@ -0,0 +1,296 @@ +{ + "version": 3, + "targets": { + "net6.0": { + "FSharp.Core/6.0.1": { + "type": "package", + "compile": { + "lib/netstandard2.1/FSharp.Core.dll": {} + }, + "runtime": { + "lib/netstandard2.1/FSharp.Core.dll": {} + }, + "resource": { + "lib/netstandard2.1/cs/FSharp.Core.resources.dll": { + "locale": "cs" + }, + "lib/netstandard2.1/de/FSharp.Core.resources.dll": { + "locale": "de" + }, + "lib/netstandard2.1/es/FSharp.Core.resources.dll": { + "locale": "es" + }, + "lib/netstandard2.1/fr/FSharp.Core.resources.dll": { + "locale": "fr" + }, + "lib/netstandard2.1/it/FSharp.Core.resources.dll": { + "locale": "it" + }, + "lib/netstandard2.1/ja/FSharp.Core.resources.dll": { + "locale": "ja" + }, + "lib/netstandard2.1/ko/FSharp.Core.resources.dll": { + "locale": "ko" + }, + "lib/netstandard2.1/pl/FSharp.Core.resources.dll": { + "locale": "pl" + }, + "lib/netstandard2.1/pt-BR/FSharp.Core.resources.dll": { + "locale": "pt-BR" + }, + "lib/netstandard2.1/ru/FSharp.Core.resources.dll": { + "locale": "ru" + }, + "lib/netstandard2.1/tr/FSharp.Core.resources.dll": { + "locale": "tr" + }, + "lib/netstandard2.1/zh-Hans/FSharp.Core.resources.dll": { + "locale": "zh-Hans" + }, + "lib/netstandard2.1/zh-Hant/FSharp.Core.resources.dll": { + "locale": "zh-Hant" + } + }, + "contentFiles": { + "contentFiles/any/any/_._": { + "buildAction": "None", + "codeLanguage": "any", + "copyToOutput": false + } + } + }, + "FsLexYacc/10.2.0": { + "type": "package", + "dependencies": { + "FSharp.Core": "4.5.2", + "FsLexYacc.Runtime": "[10.2.0, 10.3.0)" + }, + "build": { + "build/FsLexYacc.targets": {} + } + }, + "FsLexYacc.Runtime/10.2.0": { + "type": "package", + "dependencies": { + "FSharp.Core": "4.5.2" + }, + "compile": { + "lib/netstandard2.0/FsLexYacc.Runtime.dll": {} + }, + "runtime": { + "lib/netstandard2.0/FsLexYacc.Runtime.dll": {} + } + } + } + }, + "libraries": { + "FSharp.Core/6.0.1": { + "sha512": "VrFAiW8dEEekk+0aqlbvMNZzDvYXmgWZwAt68AUBqaWK8RnoEVUNglj66bZzhs4/U63q0EfXlhcEKnH1sTYLjw==", + "type": "package", + "path": "fsharp.core/6.0.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "contentFiles/any/netstandard2.0/FSharp.Core.xml", + "contentFiles/any/netstandard2.1/FSharp.Core.xml", + "fsharp.core.6.0.1.nupkg.sha512", + "fsharp.core.nuspec", + "lib/netstandard2.0/FSharp.Core.dll", + "lib/netstandard2.0/FSharp.Core.xml", + "lib/netstandard2.0/cs/FSharp.Core.resources.dll", + "lib/netstandard2.0/de/FSharp.Core.resources.dll", + "lib/netstandard2.0/es/FSharp.Core.resources.dll", + "lib/netstandard2.0/fr/FSharp.Core.resources.dll", + "lib/netstandard2.0/it/FSharp.Core.resources.dll", + "lib/netstandard2.0/ja/FSharp.Core.resources.dll", + "lib/netstandard2.0/ko/FSharp.Core.resources.dll", + "lib/netstandard2.0/pl/FSharp.Core.resources.dll", + "lib/netstandard2.0/pt-BR/FSharp.Core.resources.dll", + "lib/netstandard2.0/ru/FSharp.Core.resources.dll", + "lib/netstandard2.0/tr/FSharp.Core.resources.dll", + "lib/netstandard2.0/zh-Hans/FSharp.Core.resources.dll", + "lib/netstandard2.0/zh-Hant/FSharp.Core.resources.dll", + "lib/netstandard2.1/FSharp.Core.dll", + "lib/netstandard2.1/FSharp.Core.xml", + "lib/netstandard2.1/cs/FSharp.Core.resources.dll", + "lib/netstandard2.1/de/FSharp.Core.resources.dll", + "lib/netstandard2.1/es/FSharp.Core.resources.dll", + "lib/netstandard2.1/fr/FSharp.Core.resources.dll", + "lib/netstandard2.1/it/FSharp.Core.resources.dll", + "lib/netstandard2.1/ja/FSharp.Core.resources.dll", + "lib/netstandard2.1/ko/FSharp.Core.resources.dll", + "lib/netstandard2.1/pl/FSharp.Core.resources.dll", + "lib/netstandard2.1/pt-BR/FSharp.Core.resources.dll", + "lib/netstandard2.1/ru/FSharp.Core.resources.dll", + "lib/netstandard2.1/tr/FSharp.Core.resources.dll", + "lib/netstandard2.1/zh-Hans/FSharp.Core.resources.dll", + "lib/netstandard2.1/zh-Hant/FSharp.Core.resources.dll" + ] + }, + "FsLexYacc/10.2.0": { + "sha512": "q7mhuEMm8rvFAJ9jaH1atYCRN96tMbjHarYIDooeMKFCbUuqvep+vA2ijGhA06GZ5BG+jg4TjG6dt/4gR2qHHA==", + "type": "package", + "path": "fslexyacc/10.2.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "build/FsLexYacc.targets", + "build/fslex/netcoreapp3.1/FSharp.Core.dll", + "build/fslex/netcoreapp3.1/FsLexYacc.Runtime.dll", + "build/fslex/netcoreapp3.1/cs/FSharp.Core.resources.dll", + "build/fslex/netcoreapp3.1/de/FSharp.Core.resources.dll", + "build/fslex/netcoreapp3.1/en/FSharp.Core.resources.dll", + "build/fslex/netcoreapp3.1/es/FSharp.Core.resources.dll", + "build/fslex/netcoreapp3.1/fr/FSharp.Core.resources.dll", + "build/fslex/netcoreapp3.1/fslex.deps.json", + "build/fslex/netcoreapp3.1/fslex.dll", + "build/fslex/netcoreapp3.1/fslex.pdb", + "build/fslex/netcoreapp3.1/fslex.runtimeconfig.json", + "build/fslex/netcoreapp3.1/it/FSharp.Core.resources.dll", + "build/fslex/netcoreapp3.1/ja/FSharp.Core.resources.dll", + "build/fslex/netcoreapp3.1/ko/FSharp.Core.resources.dll", + "build/fslex/netcoreapp3.1/pl/FSharp.Core.resources.dll", + "build/fslex/netcoreapp3.1/pt-BR/FSharp.Core.resources.dll", + "build/fslex/netcoreapp3.1/ru/FSharp.Core.resources.dll", + "build/fslex/netcoreapp3.1/tr/FSharp.Core.resources.dll", + "build/fslex/netcoreapp3.1/zh-Hans/FSharp.Core.resources.dll", + "build/fslex/netcoreapp3.1/zh-Hant/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/FSharp.Core.dll", + "build/fsyacc/netcoreapp3.1/FsLexYacc.Runtime.dll", + "build/fsyacc/netcoreapp3.1/FsLexYacc.targets", + "build/fsyacc/netcoreapp3.1/cs/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/de/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/en/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/es/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/fr/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/fsyacc.deps.json", + "build/fsyacc/netcoreapp3.1/fsyacc.dll", + "build/fsyacc/netcoreapp3.1/fsyacc.pdb", + "build/fsyacc/netcoreapp3.1/fsyacc.runtimeconfig.json", + "build/fsyacc/netcoreapp3.1/it/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/ja/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/ko/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/pl/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/pt-BR/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/ru/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/tr/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/zh-Hans/FSharp.Core.resources.dll", + "build/fsyacc/netcoreapp3.1/zh-Hant/FSharp.Core.resources.dll", + "fslexyacc.10.2.0.nupkg.sha512", + "fslexyacc.nuspec", + "src/FsLexYacc.targets", + "src/fslex/Arg.fs", + "src/fslex/Arg.fsi", + "src/fslex/Lexing.fs", + "src/fslex/Lexing.fsi", + "src/fslex/Parsing.fs", + "src/fslex/Parsing.fsi", + "src/fslex/fslex.fs", + "src/fslex/fslex.fsx", + "src/fslex/fslexast.fs", + "src/fslex/fslexlex.fs", + "src/fslex/fslexpars.fs", + "src/fsyacc/Arg.fs", + "src/fsyacc/Arg.fsi", + "src/fsyacc/Lexing.fs", + "src/fsyacc/Lexing.fsi", + "src/fsyacc/Parsing.fs", + "src/fsyacc/Parsing.fsi", + "src/fsyacc/fsyacc.fs", + "src/fsyacc/fsyacc.fsx", + "src/fsyacc/fsyaccast.fs", + "src/fsyacc/fsyacclex.fs", + "src/fsyacc/fsyaccpars.fs" + ] + }, + "FsLexYacc.Runtime/10.2.0": { + "sha512": "d2+gguRIvsn1e7AycVc0r7L1QWptrnUOvQvJLbgkANcS5SjfM/FRgfUGwfqV2cJo3KOFQB5Mqmda/4YTQkkvdA==", + "type": "package", + "path": "fslexyacc.runtime/10.2.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "fslexyacc.runtime.10.2.0.nupkg.sha512", + "fslexyacc.runtime.nuspec", + "lib/netstandard2.0/FsLexYacc.Runtime.dll", + "lib/netstandard2.0/FsLexYacc.Runtime.xml" + ] + } + }, + "projectFileDependencyGroups": { + "net6.0": [ + "FSharp.Core >= 6.0.1", + "FsLexYacc >= 10.2.0" + ] + }, + "packageFolders": { + "/home/nikolaj/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsproj", + "projectName": "Fasto", + "projectPath": "/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsproj", + "packagesPath": "/home/nikolaj/.nuget/packages/", + "outputPath": "/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nikolaj/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net6.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net6.0": { + "targetAlias": "net6.0", + "projectReferences": {} + } + } + }, + "frameworks": { + "net6.0": { + "targetAlias": "net6.0", + "dependencies": { + "FSharp.Core": { + "include": "Runtime, Compile, Build, Native, Analyzers, BuildTransitive", + "target": "Package", + "version": "[6.0.1, )", + "generatePathProperty": true + }, + "FsLexYacc": { + "target": "Package", + "version": "[10.2.0, )", + "generatePathProperty": true + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[6.0.2, 6.0.2]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/6.0.102/RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/W1/fasto/Fasto/obj/project.nuget.cache b/W1/fasto/Fasto/obj/project.nuget.cache new file mode 100644 index 0000000..75073f3 --- /dev/null +++ b/W1/fasto/Fasto/obj/project.nuget.cache @@ -0,0 +1,13 @@ +{ + "version": 2, + "dgSpecHash": "RvrlPXqzrerAmjCEsDp9hnBux5+zPzH9QDVhzxhEGgcrIhK4thZN8C4a/J574RNoAAnJimpb0UxsPN2Xr5Kpfg==", + "success": true, + "projectFilePath": "/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/fasto/Fasto/Fasto.fsproj", + "expectedPackageFiles": [ + "/home/nikolaj/.nuget/packages/fsharp.core/6.0.1/fsharp.core.6.0.1.nupkg.sha512", + "/home/nikolaj/.nuget/packages/fslexyacc/10.2.0/fslexyacc.10.2.0.nupkg.sha512", + "/home/nikolaj/.nuget/packages/fslexyacc.runtime/10.2.0/fslexyacc.runtime.10.2.0.nupkg.sha512", + "/home/nikolaj/.nuget/packages/microsoft.aspnetcore.app.ref/6.0.2/microsoft.aspnetcore.app.ref.6.0.2.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/W1/fasto/Makefile b/W1/fasto/Makefile new file mode 100644 index 0000000..7029438 --- /dev/null +++ b/W1/fasto/Makefile @@ -0,0 +1,6 @@ +all: + dotnet build Fasto + +clean: + rm -rf Fasto/bin Fasto/obj + rm -f Fasto/Parser.fs Fasto/Parser.fsi Fasto/Parser.fsyacc.output Fasto/Lexer.fs diff --git a/W1/fasto/README.txt b/W1/fasto/README.txt new file mode 100644 index 0000000..96f3187 --- /dev/null +++ b/W1/fasto/README.txt @@ -0,0 +1,22 @@ +# The Fasto Compiler (v1.0, 2022-04-27) + +This is the compiler for the Fasto programming language. The source +code resides in the `Fasto` directory. + +Note that you need the .NET 6.0 SDK (*not* a Mono-based F#) installed +on your machine, with the `dotnet` executable in your search path. +Additionally, you should have `bash` to execute the various test +scripts, and the Java Runtime Environment (full SDK not needed) to run +the MARS simulator. + +To build the compiler, run `make` (or just `dotnet build Fasto`). + +To interpret, compile, or optimize a Fasto program, run `bin/fasto.sh`. + +To execute a compiled program (in MIPS assembly), run `bin/mars.sh`. + +To compile and immediately execute a Fasto program, run `bin/compilerun.sh`. + +To run all tests from the `tests` directory (or some other), run +`bin/runtests.sh`. Use `-i` to run in interpreted mode, and `-o` to +turn on the optimizations in the compiler. diff --git a/W1/fasto/bin/Mars4_5.jar b/W1/fasto/bin/Mars4_5.jar new file mode 100644 index 0000000..0021281 Binary files /dev/null and b/W1/fasto/bin/Mars4_5.jar differ diff --git a/W1/fasto/bin/compilerun.sh b/W1/fasto/bin/compilerun.sh new file mode 100755 index 0000000..a4fbbec --- /dev/null +++ b/W1/fasto/bin/compilerun.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env sh +# +# Compile and run a FASTO program. This script should work on Linux, Mac, and +# Microsoft Windows with Cygwin . +# +# The Mars4_5.jar simulator must be in your Fasto "bin" directory, or you must +# export its location into the environment variable named MARS. +# +# If '-o' is given as the first argument, the program will be optimised. +# +# Usage: bin/compilerun.sh [-o] PROGRAM.fo + +set -e # Exit on first error. + +base_dir="$(dirname "$0")" + +if [ $# -eq 0 ]; then + echo "Usage: $0 [-o] PROGRAM.fo" + exit 1 +fi + +if [ "$1" = -o ]; then + flags=-o + shift +else + flags=-c +fi + +prog_input="$1" + +# Compile. +"$base_dir/../bin/fasto.sh" $flags "$1" + +# Run +$base_dir/../bin/mars.sh "$(dirname "$prog_input")/$(basename "$prog_input" .fo).asm" 2> /dev/null diff --git a/W1/fasto/bin/fasto.sh b/W1/fasto/bin/fasto.sh new file mode 100755 index 0000000..3958e52 --- /dev/null +++ b/W1/fasto/bin/fasto.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -e # Die on first error. + +base_dir="$(dirname "$0")" + +# Determine location of executable. Does this work on all platforms? +if ! [ "$FASTO" ]; then + FASTO="$base_dir/../Fasto/bin/Debug/net6.0/Fasto.dll" + if [[ $(uname -o 2> /dev/null) = "Cygwin" ]]; then + FASTO="$(cygpath -w "FASTO")" + fi +fi + +# Verify that .NET is installed. +dotnet --version &> /dev/null || (echo "Could not find dotnet" && exit 1) + +dotnet $FASTO "$@" + + diff --git a/W1/fasto/bin/mars.sh b/W1/fasto/bin/mars.sh new file mode 100755 index 0000000..dc362ce --- /dev/null +++ b/W1/fasto/bin/mars.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -e # Die on first error. + +base_dir="$(dirname "$0")" + +# Determine location of MARS. +if ! [ "$MARS" ]; then + MARS="$base_dir/../bin/Mars4_5.jar" + if [[ $(uname -o 2> /dev/null) = "Cygwin" ]]; then + MARS="$(cygpath -w "$MARS")" + fi +fi + +# Verify that Java is installed. +java -version &> /dev/null || (echo "Could not find java" && exit 1) + +java -jar "$MARS" nc "$@" + + diff --git a/W1/fasto/bin/runtests.sh b/W1/fasto/bin/runtests.sh new file mode 100755 index 0000000..07f4706 --- /dev/null +++ b/W1/fasto/bin/runtests.sh @@ -0,0 +1,152 @@ +#!/usr/bin/env bash +# +# Run all tests. +# +# Use -o to optimise the test programs before compiling them. +# Use -i to interpret the test programs instead of compiling them. +# +# You can just run this script with no arguments. If you want to run +# tests from a certain directory, specify that as the last argument. +# For example, if you are in the root directory, and want to run the +# tests in 'my_tests_dir` with optimisations enabled, you can run: +# +# $ ./bin/runtests.sh -o my_tests_dir +# +# Test programs (those ending with '.fo') are given their corresponding +# '.in' files as standard in when running, and are expected to produce +# the contents of the corresponding '.out' files, or the error of the +# corresponding '.err' files. If no corresponding '.in' file exists, +# the program is expected to fail at compile time. +# +# The Mars4_5.jar simulator must be in your Fasto "bin" directory, or +# you must export its location into the environment variable named MARS, +# unless you're using the '-i' option, in which case MARS is not used. +# +# If no argument is given, the script will run the tests in the current +# directory; otherwise it will use the first argument as a directory, +# and run the tests in that directory. +# +# Authors through the ages: +# Troels Henriksen . +# Rasmus Wriedt Larsen +# Mathias Grymer +# Niels G. W. Serup + +set -e # Die on first error. + +base_dir="$(dirname "$0")" +fasto="$base_dir/../bin/fasto.sh" +mars="$base_dir/../bin/mars.sh" + +# Determine fasto command-line flags. +if [ "$1" = -o ]; then + flags=-o + shift +elif [ "$1" = -i ]; then + flags='' + shift +else + flags=-c +fi + +# Find the directory containing the test programs. +tests_dir="$1" +if ! [ "$tests_dir" ]; then + tests_dir="$base_dir/../tests" +fi +tests_dir="$(echo "$tests_dir" | sed 's/\/*$//')" + +# Remove all whitespace and NUL bytes when comparing results, because +# Mars and the interpreter puts different amounts -- and to handle +# Windows/OSX/Unix line ending differences. +fix_whitespace() { + cat "$1" | tr -d '\000' | tr -d ' \t\n\r\f' 1>&1 +} + +check_equal() { + if [ -f $tests_dir/$OUTPUT ]; then + + EXPECTED=$(fix_whitespace "$tests_dir/$OUTPUT") + ACTUAL=$(fix_whitespace "$TESTOUT") + if [ "$EXPECTED" = "$ACTUAL" ]; then + rm -f $TESTOUT + else + echo "Output for $PROG does not match expected output." + echo "Compare $TESTOUT and $tests_dir/$OUTPUT." + return 1 + fi + fi +} + +# make -C "$base_dir/.." + +file_len=0 +for FO in $tests_dir/*fo; do + L=$(basename "$FO") + if ((${#L} > $file_len)); then + file_len=${#L} + fi +done +file_len=$(($file_len+4)) + +echo +if [ "$flags" = "" ]; then + echo "=== Running Fasto test programs (interpreted) ===" +elif [ "$flags" = "-c" ]; then + echo "=== Running Fasto test programs (compiled) ===" +elif [ "$flags" = "-o" ]; then + echo "=== Running Fasto test programs (compiled, with optimizations) ===" +fi +echo +for FO in $tests_dir/*fo; do + FO=$(basename "$FO") + PROG=$(echo $FO|sed 's/.fo$//') + INPUT=$(echo $FO|sed 's/fo$/in/') + OUTPUT=$(echo $FO|sed 's/fo$/out/') + ERROUT=$(echo $FO|sed 's/fo$/err/') + ASM=$(echo $FO|sed 's/fo$/asm/') + TESTOUT=$tests_dir/$OUTPUT-testresult + + if [ -f $tests_dir/$INPUT ]; then + # Is positive test. + echo -n "Testing" + printf "%*s" $file_len " $FO: " + if [ "$flags" ]; then + # Compile. + if $fasto $flags $tests_dir/$PROG; then + $mars $tests_dir/$ASM < $tests_dir/$INPUT > $TESTOUT 2>/dev/null + if check_equal; then + echo -e "\033[92mSuccess.\033[0m" + else + echo -e "\033[91mExecution error.\033[0m" + fi + else + echo -e "\033[91mCompilation error.\033[0m" + fi + else + # Interpret. + cat $tests_dir/$INPUT | $fasto -r $tests_dir/$PROG | grep -v "Result of 'main'" > $TESTOUT 2>&1 + if check_equal; then + echo -e "\033[92mSuccess.\033[0m" + else + echo -e "\033[91mInterpretation error.\033[0m" + fi + fi + else + # Is negative test. + echo -n "Testing" + printf "%*s" $file_len "$FO: " + if $fasto -c $tests_dir/$PROG > $TESTOUT 2>&1; then + echo -e "\033[91mCompiled but should result in compile error.\033[0m" + elif [ -f $tests_dir/$ERROUT ]; then + EXPECTED=$(fix_whitespace $tests_dir/$ERROUT) + ACTUAL=$(fix_whitespace $TESTOUT) + if [ "$EXPECTED" = "$ACTUAL" ]; then + rm -f $TESTOUT + echo -e "\033[92mSuccess.\033[0m" + else + echo -e "\033[91mThe error for $PROG does not match the expected error. Compare $TESTOUT and $tests_dir/$ERROUT.\033[0m" + fi + fi + fi +done diff --git a/W1/fasto/doc/GroupProj-2022.pdf b/W1/fasto/doc/GroupProj-2022.pdf new file mode 100644 index 0000000..4352d06 Binary files /dev/null and b/W1/fasto/doc/GroupProj-2022.pdf differ diff --git a/W1/fasto/tests/assign1.asm b/W1/fasto/tests/assign1.asm new file mode 100644 index 0000000..8bc874d --- /dev/null +++ b/W1/fasto/tests/assign1.asm @@ -0,0 +1,623 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _Incorre_58_ +# was: la _Incorre_58__addr, _Incorre_58_ + ori $3, $0, 16 +# was: ori _Incorre_58__init, $0, 16 + sw $3, 0($4) +# was: sw _Incorre_58__init, 0(_Incorre_58__addr) + la $4, _Incorre_49_ +# was: la _Incorre_49__addr, _Incorre_49_ + ori $3, $0, 16 +# was: ori _Incorre_49__init, $0, 16 + sw $3, 0($4) +# was: sw _Incorre_49__init, 0(_Incorre_49__addr) + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function mul +mul: + sw $31, -4($29) + sw $16, -8($29) + addi $29, $29, -12 + ori $16, $2, 0 +# was: ori _param_x_1_, $2, 0 +# ori _param_y_2_,$3,0 +# ori _eq_L_8_,_param_y_2_,0 + ori $4, $0, 0 +# was: ori _eq_R_9_, $0, 0 + ori $2, $0, 0 +# was: ori _cond_7_, $0, 0 + bne $3, $4, _false_10_ +# was: bne _eq_L_8_, _eq_R_9_, _false_10_ + ori $2, $0, 1 +# was: ori _cond_7_, $0, 1 +_false_10_: + bne $2, $0, _then_4_ +# was: bne _cond_7_, $0, _then_4_ + j _else_5_ +_then_4_: + ori $2, $0, 0 +# was: ori _mulres_3_, $0, 0 + j _endif_6_ +_else_5_: +# ori _lt_L_15_,_param_y_2_,0 + ori $2, $0, 0 +# was: ori _lt_R_16_, $0, 0 + slt $2, $3, $2 +# was: slt _cond_14_, _lt_L_15_, _lt_R_16_ + bne $2, $0, _then_11_ +# was: bne _cond_14_, $0, _then_11_ + j _else_12_ +_then_11_: + ori $2, $16, 0 +# was: ori _arg_19_, _param_x_1_, 0 +# ori _plus_L_21_,_param_y_2_,0 + ori $4, $0, 1 +# was: ori _plus_R_22_, $0, 1 + add $3, $3, $4 +# was: add _arg_20_, _plus_L_21_, _plus_R_22_ +# ori $2,_arg_19_,0 +# ori $3,_arg_20_,0 + jal mul +# was: jal mul, $2 $3 +# ori _minus_L_17_,$2,0 +# ori _minus_R_18_,_param_x_1_,0 + sub $2, $2, $16 +# was: sub _mulres_3_, _minus_L_17_, _minus_R_18_ + j _endif_13_ +_else_12_: + ori $2, $16, 0 +# was: ori _arg_25_, _param_x_1_, 0 +# ori _minus_L_27_,_param_y_2_,0 + ori $4, $0, 1 +# was: ori _minus_R_28_, $0, 1 + sub $3, $3, $4 +# was: sub _arg_26_, _minus_L_27_, _minus_R_28_ +# ori $2,_arg_25_,0 +# ori $3,_arg_26_,0 + jal mul +# was: jal mul, $2 $3 +# ori _plus_L_23_,$2,0 +# ori _plus_R_24_,_param_x_1_,0 + add $2, $2, $16 +# was: add _mulres_3_, _plus_L_23_, _plus_R_24_ +_endif_13_: +_endif_6_: +# ori $2,_mulres_3_,0 + addi $29, $29, 12 + lw $16, -8($29) + lw $31, -4($29) + jr $31 +# Function readInt +readInt: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_i_29_,$2,0 + jal getint +# was: jal getint, $2 +# ori _readIntres_30_,$2,0 +# ori $2,_readIntres_30_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function squareSum +squareSum: + sw $31, -4($29) + sw $16, -8($29) + addi $29, $29, -12 + ori $16, $2, 0 +# was: ori _param_x_31_, $2, 0 + ori $2, $3, 0 +# was: ori _param_y_32_, $3, 0 +# ori _plus_L_34_,_param_x_31_,0 +# ori _arg_36_,_param_y_32_,0 + ori $3, $2, 0 +# was: ori _arg_37_, _param_y_32_, 0 +# ori $2,_arg_36_,0 +# ori $3,_arg_37_,0 + jal mul +# was: jal mul, $2 $3 +# ori _plus_R_35_,$2,0 + add $2, $16, $2 +# was: add _squareSumres_33_, _plus_L_34_, _plus_R_35_ +# ori $2,_squareSumres_33_,0 + addi $29, $29, 12 + lw $16, -8($29) + lw $31, -4($29) + jr $31 +# Function main +main: + sw $31, -4($29) + sw $21, -28($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -32 + jal getint +# was: jal getint, $2 + ori $17, $2, 0 +# was: ori _letBind_39_, $2, 0 +# ori _eq_L_44_,_letBind_39_,0 + ori $3, $0, 0 +# was: ori _eq_R_45_, $0, 0 + ori $2, $0, 0 +# was: ori _cond_43_, $0, 0 + bne $17, $3, _false_46_ +# was: bne _eq_L_44_, _eq_R_45_, _false_46_ + ori $2, $0, 1 +# was: ori _cond_43_, $0, 1 +_false_46_: + bne $2, $0, _then_40_ +# was: bne _cond_43_, $0, _then_40_ + j _else_41_ +_then_40_: + la $2, _Incorre_49_ +# was: la _tmp_48_, _Incorre_49_ +# _Incorre_49_: string "Incorrect Input!" +# ori _letBind_47_,_tmp_48_,0 +# ori $2,_tmp_48_,0 + jal putstring +# was: jal putstring, $2 + ori $16, $0, 0 +# was: ori _mainres_38_, $0, 0 + j _endif_42_ +_else_41_: +# ori _lt_L_54_,_letBind_39_,0 + ori $2, $0, 0 +# was: ori _lt_R_55_, $0, 0 + slt $2, $17, $2 +# was: slt _cond_53_, _lt_L_54_, _lt_R_55_ + bne $2, $0, _then_50_ +# was: bne _cond_53_, $0, _then_50_ + j _else_51_ +_then_50_: + la $2, _Incorre_58_ +# was: la _tmp_57_, _Incorre_58_ +# _Incorre_58_: string "Incorrect Input!" +# ori _letBind_56_,_tmp_57_,0 +# ori $2,_tmp_57_,0 + jal putstring +# was: jal putstring, $2 + ori $16, $0, 0 +# was: ori _mainres_38_, $0, 0 + j _endif_52_ +_else_51_: +# ori _size_reg_64_,_letBind_39_,0 + bgez $17, _safe_lab_65_ +# was: bgez _size_reg_64_, _safe_lab_65_ + ori $5, $0, 15 +# was: ori $5, $0, 15 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_65_: + ori $2, $28, 0 +# was: ori _arr_reg_61_, $28, 0 + sll $3, $17, 2 +# was: sll _tmp_71_, _size_reg_64_, 2 + addi $3, $3, 4 +# was: addi _tmp_71_, _tmp_71_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_71_ + sw $17, 0($2) +# was: sw _size_reg_64_, 0(_arr_reg_61_) + addi $4, $2, 4 +# was: addi _addr_reg_66_, _arr_reg_61_, 4 + ori $5, $0, 0 +# was: ori _i_reg_67_, $0, 0 +_loop_beg_68_: + sub $3, $5, $17 +# was: sub _tmp_reg_70_, _i_reg_67_, _size_reg_64_ + bgez $3, _loop_end_69_ +# was: bgez _tmp_reg_70_, _loop_end_69_ + sw $5, 0($4) +# was: sw _i_reg_67_, 0(_addr_reg_66_) + addi $4, $4, 4 +# was: addi _addr_reg_66_, _addr_reg_66_, 4 + addi $5, $5, 1 +# was: addi _i_reg_67_, _i_reg_67_, 1 + j _loop_beg_68_ +_loop_end_69_: + lw $18, 0($2) +# was: lw _size_reg_60_, 0(_arr_reg_61_) + ori $16, $28, 0 +# was: ori _letBind_59_, $28, 0 + sll $3, $18, 2 +# was: sll _tmp_78_, _size_reg_60_, 2 + addi $3, $3, 4 +# was: addi _tmp_78_, _tmp_78_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_78_ + sw $18, 0($16) +# was: sw _size_reg_60_, 0(_letBind_59_) + addi $20, $16, 4 +# was: addi _addr_reg_72_, _letBind_59_, 4 + ori $19, $0, 0 +# was: ori _i_reg_73_, $0, 0 + addi $21, $2, 4 +# was: addi _elem_reg_62_, _arr_reg_61_, 4 +_loop_beg_74_: + sub $2, $19, $18 +# was: sub _tmp_reg_76_, _i_reg_73_, _size_reg_60_ + bgez $2, _loop_end_75_ +# was: bgez _tmp_reg_76_, _loop_end_75_ + lw $2, 0($21) +# was: lw _res_reg_63_, 0(_elem_reg_62_) + addi $21, $21, 4 +# was: addi _elem_reg_62_, _elem_reg_62_, 4 +# ori $2,_res_reg_63_,0 + jal readInt +# was: jal readInt, $2 +# ori _tmp_reg_77_,$2,0 +# ori _res_reg_63_,_tmp_reg_77_,0 + sw $2, 0($20) +# was: sw _res_reg_63_, 0(_addr_reg_72_) + addi $20, $20, 4 +# was: addi _addr_reg_72_, _addr_reg_72_, 4 + addi $19, $19, 1 +# was: addi _i_reg_73_, _i_reg_73_, 1 + j _loop_beg_74_ +_loop_end_75_: +# ori _size_reg_84_,_letBind_39_,0 + bgez $17, _safe_lab_85_ +# was: bgez _size_reg_84_, _safe_lab_85_ + ori $5, $0, 16 +# was: ori $5, $0, 16 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_85_: + ori $5, $28, 0 +# was: ori _arr_reg_81_, $28, 0 + sll $2, $17, 2 +# was: sll _tmp_91_, _size_reg_84_, 2 + addi $2, $2, 4 +# was: addi _tmp_91_, _tmp_91_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_91_ + sw $17, 0($5) +# was: sw _size_reg_84_, 0(_arr_reg_81_) + addi $2, $5, 4 +# was: addi _addr_reg_86_, _arr_reg_81_, 4 + ori $3, $0, 0 +# was: ori _i_reg_87_, $0, 0 +_loop_beg_88_: + sub $4, $3, $17 +# was: sub _tmp_reg_90_, _i_reg_87_, _size_reg_84_ + bgez $4, _loop_end_89_ +# was: bgez _tmp_reg_90_, _loop_end_89_ + sw $3, 0($2) +# was: sw _i_reg_87_, 0(_addr_reg_86_) + addi $2, $2, 4 +# was: addi _addr_reg_86_, _addr_reg_86_, 4 + addi $3, $3, 1 +# was: addi _i_reg_87_, _i_reg_87_, 1 + j _loop_beg_88_ +_loop_end_89_: + lw $2, 0($5) +# was: lw _size_reg_80_, 0(_arr_reg_81_) + ori $17, $28, 0 +# was: ori _letBind_79_, $28, 0 + sll $3, $2, 2 +# was: sll _tmp_127_, _size_reg_80_, 2 + addi $3, $3, 4 +# was: addi _tmp_127_, _tmp_127_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_127_ + sw $2, 0($17) +# was: sw _size_reg_80_, 0(_letBind_79_) + addi $3, $17, 4 +# was: addi _addr_reg_92_, _letBind_79_, 4 + ori $4, $0, 0 +# was: ori _i_reg_93_, $0, 0 + addi $5, $5, 4 +# was: addi _elem_reg_82_, _arr_reg_81_, 4 +_loop_beg_94_: + sub $6, $4, $2 +# was: sub _tmp_reg_96_, _i_reg_93_, _size_reg_80_ + bgez $6, _loop_end_95_ +# was: bgez _tmp_reg_96_, _loop_end_95_ + lw $7, 0($5) +# was: lw _res_reg_83_, 0(_elem_reg_82_) + addi $5, $5, 4 +# was: addi _elem_reg_82_, _elem_reg_82_, 4 +# ori _eq_L_102_,_res_reg_83_,0 + ori $8, $0, 0 +# was: ori _eq_R_103_, $0, 0 + ori $6, $0, 0 +# was: ori _cond_101_, $0, 0 + bne $7, $8, _false_104_ +# was: bne _eq_L_102_, _eq_R_103_, _false_104_ + ori $6, $0, 1 +# was: ori _cond_101_, $0, 1 +_false_104_: + bne $6, $0, _then_98_ +# was: bne _cond_101_, $0, _then_98_ + j _else_99_ +_then_98_: +# ori _arr_ind_105_,_res_reg_83_,0 + addi $6, $16, 4 +# was: addi _arr_reg_106_, _letBind_59_, 4 + lw $8, 0($16) +# was: lw _size_reg_107_, 0(_letBind_59_) + bgez $7, _safe_lab_110_ +# was: bgez _arr_ind_105_, _safe_lab_110_ +_error_lab_109_: + ori $5, $0, 16 +# was: ori $5, $0, 16 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_110_: + sub $8, $7, $8 +# was: sub _tmp_reg_108_, _arr_ind_105_, _size_reg_107_ + bgez $8, _error_lab_109_ +# was: bgez _tmp_reg_108_, _error_lab_109_ + sll $7, $7, 2 +# was: sll _arr_ind_105_, _arr_ind_105_, 2 + add $6, $6, $7 +# was: add _arr_reg_106_, _arr_reg_106_, _arr_ind_105_ + lw $7, 0($6) +# was: lw _fun_arg_res_97_, 0(_arr_reg_106_) + j _endif_100_ +_else_99_: + ori $6, $7, 0 +# was: ori _arr_ind_113_, _res_reg_83_, 0 + addi $8, $16, 4 +# was: addi _arr_reg_114_, _letBind_59_, 4 + lw $9, 0($16) +# was: lw _size_reg_115_, 0(_letBind_59_) + bgez $6, _safe_lab_118_ +# was: bgez _arr_ind_113_, _safe_lab_118_ +_error_lab_117_: + ori $5, $0, 16 +# was: ori $5, $0, 16 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_118_: + sub $9, $6, $9 +# was: sub _tmp_reg_116_, _arr_ind_113_, _size_reg_115_ + bgez $9, _error_lab_117_ +# was: bgez _tmp_reg_116_, _error_lab_117_ + sll $6, $6, 2 +# was: sll _arr_ind_113_, _arr_ind_113_, 2 + add $8, $8, $6 +# was: add _arr_reg_114_, _arr_reg_114_, _arr_ind_113_ + lw $6, 0($8) +# was: lw _minus_L_111_, 0(_arr_reg_114_) + ori $8, $7, 0 +# was: ori _minus_L_120_, _res_reg_83_, 0 + ori $7, $0, 1 +# was: ori _minus_R_121_, $0, 1 + sub $7, $8, $7 +# was: sub _arr_ind_119_, _minus_L_120_, _minus_R_121_ + addi $8, $16, 4 +# was: addi _arr_reg_122_, _letBind_59_, 4 + lw $9, 0($16) +# was: lw _size_reg_123_, 0(_letBind_59_) + bgez $7, _safe_lab_126_ +# was: bgez _arr_ind_119_, _safe_lab_126_ +_error_lab_125_: + ori $5, $0, 16 +# was: ori $5, $0, 16 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_126_: + sub $9, $7, $9 +# was: sub _tmp_reg_124_, _arr_ind_119_, _size_reg_123_ + bgez $9, _error_lab_125_ +# was: bgez _tmp_reg_124_, _error_lab_125_ + sll $7, $7, 2 +# was: sll _arr_ind_119_, _arr_ind_119_, 2 + add $8, $8, $7 +# was: add _arr_reg_122_, _arr_reg_122_, _arr_ind_119_ + lw $7, 0($8) +# was: lw _minus_R_112_, 0(_arr_reg_122_) + sub $7, $6, $7 +# was: sub _fun_arg_res_97_, _minus_L_111_, _minus_R_112_ +_endif_100_: +# ori _res_reg_83_,_fun_arg_res_97_,0 + sw $7, 0($3) +# was: sw _res_reg_83_, 0(_addr_reg_92_) + addi $3, $3, 4 +# was: addi _addr_reg_92_, _addr_reg_92_, 4 + addi $4, $4, 1 +# was: addi _i_reg_93_, _i_reg_93_, 1 + j _loop_beg_94_ +_loop_end_95_: +# ori _arr_reg_129_,_letBind_79_,0 + lw $16, 0($17) +# was: lw _size_reg_130_, 0(_arr_reg_129_) + ori $2, $0, 0 +# was: ori _tmp_128_, $0, 0 + addi $17, $17, 4 +# was: addi _arr_reg_129_, _arr_reg_129_, 4 + ori $18, $0, 0 +# was: ori _ind_var_131_, $0, 0 +_loop_beg_133_: + sub $3, $18, $16 +# was: sub _tmp_reg_132_, _ind_var_131_, _size_reg_130_ + bgez $3, _loop_end_134_ +# was: bgez _tmp_reg_132_, _loop_end_134_ + lw $3, 0($17) +# was: lw _tmp_reg_132_, 0(_arr_reg_129_) + addi $17, $17, 4 +# was: addi _arr_reg_129_, _arr_reg_129_, 4 +# ori $2,_tmp_128_,0 +# ori $3,_tmp_reg_132_,0 + jal squareSum +# was: jal squareSum, $2 $3 +# ori _tmp_reg_135_,$2,0 +# ori _tmp_128_,_tmp_reg_135_,0 + addi $18, $18, 1 +# was: addi _ind_var_131_, _ind_var_131_, 1 + j _loop_beg_133_ +_loop_end_134_: + ori $16, $2, 0 +# was: ori _mainres_38_, _tmp_128_, 0 + ori $2, $16, 0 +# was: ori $2, _mainres_38_, 0 + jal putint +# was: jal putint, $2 +_endif_52_: +_endif_42_: + ori $2, $16, 0 +# was: ori $2, _mainres_38_, 0 + addi $29, $29, 32 + lw $21, -28($29) + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_Incorre_58_: + .space 4 + .asciiz "Incorrect Input!" + .align 2 +_Incorre_49_: + .space 4 + .asciiz "Incorrect Input!" + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/assign1.fo b/W1/fasto/tests/assign1.fo new file mode 100644 index 0000000..f6c4aee --- /dev/null +++ b/W1/fasto/tests/assign1.fo @@ -0,0 +1,17 @@ +fun int mul(int x, int y) = + if y == 0 then 0 + else if y < 0 then mul(x, y+1) - x + else mul(x, y-1) + x + +fun int readInt(int i) = read(int) + +fun int squareSum(int x, int y) = x + mul(y, y) + +fun int main() = + let n = read(int) in + if n == 0 then let a = write("Incorrect Input!") in 0 + else if n < 0 then let a = write("Incorrect Input!") in 0 + else + let arr = map(readInt, iota(n)) in + let dif = map(fn int (int x) => if x == 0 then arr[x] else arr[x] - arr[x-1], iota(n)) in + write(reduce(squareSum, 0, dif)) diff --git a/W1/fasto/tests/assign1.in b/W1/fasto/tests/assign1.in new file mode 100644 index 0000000..12c6509 --- /dev/null +++ b/W1/fasto/tests/assign1.in @@ -0,0 +1,5 @@ +4 +3 +7 +2 +4 diff --git a/W1/fasto/tests/assign1.out b/W1/fasto/tests/assign1.out new file mode 100644 index 0000000..fb1e7bc --- /dev/null +++ b/W1/fasto/tests/assign1.out @@ -0,0 +1 @@ +54 diff --git a/W1/fasto/tests/comprehension.asm b/W1/fasto/tests/comprehension.asm new file mode 100644 index 0000000..7210858 --- /dev/null +++ b/W1/fasto/tests/comprehension.asm @@ -0,0 +1,605 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function main +main: + sw $31, -4($29) + sw $21, -28($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -32 + jal getint +# was: jal getint, $2 + ori $5, $2, 0 +# was: ori _letBind_2_, $2, 0 +# ori _size_reg_4_,_letBind_2_,0 + bgez $5, _safe_lab_5_ +# was: bgez _size_reg_4_, _safe_lab_5_ + ori $5, $0, 6 +# was: ori $5, $0, 6 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_5_: + ori $9, $28, 0 +# was: ori _letBind_3_, $28, 0 + sll $2, $5, 2 +# was: sll _tmp_11_, _size_reg_4_, 2 + addi $2, $2, 4 +# was: addi _tmp_11_, _tmp_11_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_11_ + sw $5, 0($9) +# was: sw _size_reg_4_, 0(_letBind_3_) + addi $4, $9, 4 +# was: addi _addr_reg_6_, _letBind_3_, 4 + ori $2, $0, 0 +# was: ori _i_reg_7_, $0, 0 +_loop_beg_8_: + sub $3, $2, $5 +# was: sub _tmp_reg_10_, _i_reg_7_, _size_reg_4_ + bgez $3, _loop_end_9_ +# was: bgez _tmp_reg_10_, _loop_end_9_ + sw $2, 0($4) +# was: sw _i_reg_7_, 0(_addr_reg_6_) + addi $4, $4, 4 +# was: addi _addr_reg_6_, _addr_reg_6_, 4 + addi $2, $2, 1 +# was: addi _i_reg_7_, _i_reg_7_, 1 + j _loop_beg_8_ +_loop_end_9_: + ori $2, $5, 0 +# was: ori _size_reg_13_, _letBind_2_, 0 + bgez $2, _safe_lab_14_ +# was: bgez _size_reg_13_, _safe_lab_14_ + ori $5, $0, 7 +# was: ori $5, $0, 7 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_14_: + ori $8, $28, 0 +# was: ori _letBind_12_, $28, 0 + sll $3, $2, 2 +# was: sll _tmp_20_, _size_reg_13_, 2 + addi $3, $3, 4 +# was: addi _tmp_20_, _tmp_20_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_20_ + sw $2, 0($8) +# was: sw _size_reg_13_, 0(_letBind_12_) + addi $5, $8, 4 +# was: addi _addr_reg_15_, _letBind_12_, 4 + ori $4, $0, 0 +# was: ori _i_reg_16_, $0, 0 +_loop_beg_17_: + sub $3, $4, $2 +# was: sub _tmp_reg_19_, _i_reg_16_, _size_reg_13_ + bgez $3, _loop_end_18_ +# was: bgez _tmp_reg_19_, _loop_end_18_ + sw $4, 0($5) +# was: sw _i_reg_16_, 0(_addr_reg_15_) + addi $5, $5, 4 +# was: addi _addr_reg_15_, _addr_reg_15_, 4 + addi $4, $4, 1 +# was: addi _i_reg_16_, _i_reg_16_, 1 + j _loop_beg_17_ +_loop_end_18_: +# ori _len_arr_24_,_letBind_3_,0 + lw $2, 0($9) +# was: lw _mult1_L_22_, 0(_len_arr_24_) +# ori _len_arr_25_,_letBind_12_,0 + lw $3, 0($8) +# was: lw _mult2_R_23_, 0(_len_arr_25_) + mul $2, $2, $3 +# was: mul _letBind_21_, _mult1_L_22_, _mult2_R_23_ +# ori _size_reg_31_,_letBind_21_,0 + bgez $2, _safe_lab_32_ +# was: bgez _size_reg_31_, _safe_lab_32_ + ori $5, $0, 8 +# was: ori $5, $0, 8 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_32_: + ori $7, $28, 0 +# was: ori _arr_reg_28_, $28, 0 + sll $3, $2, 2 +# was: sll _tmp_38_, _size_reg_31_, 2 + addi $3, $3, 4 +# was: addi _tmp_38_, _tmp_38_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_38_ + sw $2, 0($7) +# was: sw _size_reg_31_, 0(_arr_reg_28_) + addi $5, $7, 4 +# was: addi _addr_reg_33_, _arr_reg_28_, 4 + ori $4, $0, 0 +# was: ori _i_reg_34_, $0, 0 +_loop_beg_35_: + sub $3, $4, $2 +# was: sub _tmp_reg_37_, _i_reg_34_, _size_reg_31_ + bgez $3, _loop_end_36_ +# was: bgez _tmp_reg_37_, _loop_end_36_ + sw $4, 0($5) +# was: sw _i_reg_34_, 0(_addr_reg_33_) + addi $5, $5, 4 +# was: addi _addr_reg_33_, _addr_reg_33_, 4 + addi $4, $4, 1 +# was: addi _i_reg_34_, _i_reg_34_, 1 + j _loop_beg_35_ +_loop_end_36_: + lw $3, 0($7) +# was: lw _size_reg_27_, 0(_arr_reg_28_) + ori $4, $28, 0 +# was: ori _letBind_26_, $28, 0 + sll $5, $3, 2 +# was: sll _tmp_88_, _size_reg_27_, 2 + addi $5, $5, 4 +# was: addi _tmp_88_, _tmp_88_, 4 + add $28, $28, $5 +# was: add $28, $28, _tmp_88_ + sw $3, 0($4) +# was: sw _size_reg_27_, 0(_letBind_26_) + addi $6, $4, 4 +# was: addi _addr_reg_39_, _letBind_26_, 4 + ori $5, $0, 0 +# was: ori _i_reg_40_, $0, 0 + addi $7, $7, 4 +# was: addi _elem_reg_29_, _arr_reg_28_, 4 +_loop_beg_41_: + sub $10, $5, $3 +# was: sub _tmp_reg_43_, _i_reg_40_, _size_reg_27_ + bgez $10, _loop_end_42_ +# was: bgez _tmp_reg_43_, _loop_end_42_ + lw $11, 0($7) +# was: lw _res_reg_30_, 0(_elem_reg_29_) + addi $7, $7, 4 +# was: addi _elem_reg_29_, _elem_reg_29_, 4 +# ori _div1_L_46_,_letBind_21_,0 +# ori _len_arr_49_,_letBind_12_,0 + lw $10, 0($8) +# was: lw _div2_R_47_, 0(_len_arr_49_) + bne $10, $0, _safe_div_48_ +# was: bne _div2_R_47_, $0, _safe_div_48_ + ori $5, $0, 8 +# was: ori $5, $0, 8 + la $6, _Msg_DivZero_ +# was: la $6, _Msg_DivZero_ + j _RuntimeError_ +_safe_div_48_: + div $10, $2, $10 +# was: div _letBind_45_, _div1_L_46_, _div2_R_47_ +# ori _div1_L_51_,_res_reg_30_,0 +# ori _div2_R_52_,_letBind_45_,0 + bne $10, $0, _safe_div_53_ +# was: bne _div2_R_52_, $0, _safe_div_53_ + ori $5, $0, 8 +# was: ori $5, $0, 8 + la $6, _Msg_DivZero_ +# was: la $6, _Msg_DivZero_ + j _RuntimeError_ +_safe_div_53_: + div $13, $11, $10 +# was: div _letBind_50_, _div1_L_51_, _div2_R_52_ +# ori _minus_L_55_,_res_reg_30_,0 +# ori _mult1_L_57_,_letBind_50_,0 +# ori _mult2_R_58_,_letBind_45_,0 + mul $12, $13, $10 +# was: mul _minus_R_56_, _mult1_L_57_, _mult2_R_58_ + sub $11, $11, $12 +# was: sub _letBind_54_, _minus_L_55_, _minus_R_56_ +# ori _arr_ind_60_,_letBind_50_,0 + addi $12, $8, 4 +# was: addi _arr_reg_61_, _letBind_12_, 4 + lw $14, 0($8) +# was: lw _size_reg_62_, 0(_letBind_12_) + bgez $13, _safe_lab_65_ +# was: bgez _arr_ind_60_, _safe_lab_65_ +_error_lab_64_: + ori $5, $0, 8 +# was: ori $5, $0, 8 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_65_: + sub $14, $13, $14 +# was: sub _tmp_reg_63_, _arr_ind_60_, _size_reg_62_ + bgez $14, _error_lab_64_ +# was: bgez _tmp_reg_63_, _error_lab_64_ + sll $13, $13, 2 +# was: sll _arr_ind_60_, _arr_ind_60_, 2 + add $12, $12, $13 +# was: add _arr_reg_61_, _arr_reg_61_, _arr_ind_60_ + lw $12, 0($12) +# was: lw _letBind_59_, 0(_arr_reg_61_) +# ori _div1_L_67_,_letBind_45_,0 +# ori _len_arr_70_,_letBind_3_,0 + lw $13, 0($9) +# was: lw _div2_R_68_, 0(_len_arr_70_) + bne $13, $0, _safe_div_69_ +# was: bne _div2_R_68_, $0, _safe_div_69_ + ori $5, $0, 8 +# was: ori $5, $0, 8 + la $6, _Msg_DivZero_ +# was: la $6, _Msg_DivZero_ + j _RuntimeError_ +_safe_div_69_: + div $10, $10, $13 +# was: div _letBind_66_, _div1_L_67_, _div2_R_68_ +# ori _div1_L_72_,_letBind_54_,0 +# ori _div2_R_73_,_letBind_66_,0 + bne $10, $0, _safe_div_74_ +# was: bne _div2_R_73_, $0, _safe_div_74_ + ori $5, $0, 8 +# was: ori $5, $0, 8 + la $6, _Msg_DivZero_ +# was: la $6, _Msg_DivZero_ + j _RuntimeError_ +_safe_div_74_: + div $11, $11, $10 +# was: div _letBind_71_, _div1_L_72_, _div2_R_73_ +# ori _arr_ind_76_,_letBind_71_,0 + addi $10, $9, 4 +# was: addi _arr_reg_77_, _letBind_3_, 4 + lw $13, 0($9) +# was: lw _size_reg_78_, 0(_letBind_3_) + bgez $11, _safe_lab_81_ +# was: bgez _arr_ind_76_, _safe_lab_81_ +_error_lab_80_: + ori $5, $0, 8 +# was: ori $5, $0, 8 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_81_: + sub $13, $11, $13 +# was: sub _tmp_reg_79_, _arr_ind_76_, _size_reg_78_ + bgez $13, _error_lab_80_ +# was: bgez _tmp_reg_79_, _error_lab_80_ + sll $11, $11, 2 +# was: sll _arr_ind_76_, _arr_ind_76_, 2 + add $10, $10, $11 +# was: add _arr_reg_77_, _arr_reg_77_, _arr_ind_76_ + lw $10, 0($10) +# was: lw _letBind_75_, 0(_arr_reg_77_) +# ori _plus_L_86_,_letBind_75_,0 +# ori _plus_R_87_,_letBind_59_,0 + add $11, $10, $12 +# was: add _div1_L_83_, _plus_L_86_, _plus_R_87_ + ori $10, $0, 2 +# was: ori _div2_R_84_, $0, 2 + bne $10, $0, _safe_div_85_ +# was: bne _div2_R_84_, $0, _safe_div_85_ + ori $5, $0, 8 +# was: ori $5, $0, 8 + la $6, _Msg_DivZero_ +# was: la $6, _Msg_DivZero_ + j _RuntimeError_ +_safe_div_85_: + div $10, $11, $10 +# was: div _letBind_82_, _div1_L_83_, _div2_R_84_ +# ori _fun_arg_res_44_,_letBind_82_,0 + ori $11, $10, 0 +# was: ori _res_reg_30_, _fun_arg_res_44_, 0 + sw $11, 0($6) +# was: sw _res_reg_30_, 0(_addr_reg_39_) + addi $6, $6, 4 +# was: addi _addr_reg_39_, _addr_reg_39_, 4 + addi $5, $5, 1 +# was: addi _i_reg_40_, _i_reg_40_, 1 + j _loop_beg_41_ +_loop_end_42_: +# ori _arr_reg_91_,_letBind_26_,0 + lw $3, 0($4) +# was: lw _size_reg_90_, 0(_arr_reg_91_) + ori $2, $28, 0 +# was: ori _letBind_89_, $28, 0 + sll $5, $3, 2 +# was: sll _tmp_112_, _size_reg_90_, 2 + addi $5, $5, 4 +# was: addi _tmp_112_, _tmp_112_, 4 + add $28, $28, $5 +# was: add $28, $28, _tmp_112_ + sw $3, 0($2) +# was: sw _size_reg_90_, 0(_letBind_89_) + addi $5, $2, 4 +# was: addi _addr_reg_95_, _letBind_89_, 4 + addi $4, $4, 4 +# was: addi _arr_reg_91_, _arr_reg_91_, 4 + ori $6, $0, 0 +# was: ori _i_reg_96_, $0, 0 + ori $7, $0, 0 +# was: ori _count_reg_94_, $0, 0 +_loop_beg_97_: + sub $8, $6, $3 +# was: sub _tmp_reg_100_, _i_reg_96_, _size_reg_90_ + bgez $8, _loop_end_98_ +# was: bgez _tmp_reg_100_, _loop_end_98_ + lw $10, 0($4) +# was: lw _elem_reg_92_, 0(_arr_reg_91_) + addi $4, $4, 4 +# was: addi _arr_reg_91_, _arr_reg_91_, 4 +# ori _minus_L_104_,_elem_reg_92_,0 + ori $9, $10, 0 +# was: ori _div1_L_108_, _elem_reg_92_, 0 + ori $8, $0, 5 +# was: ori _div2_R_109_, $0, 5 + bne $8, $0, _safe_div_110_ +# was: bne _div2_R_109_, $0, _safe_div_110_ + ori $5, $0, 8 +# was: ori $5, $0, 8 + la $6, _Msg_DivZero_ +# was: la $6, _Msg_DivZero_ + j _RuntimeError_ +_safe_div_110_: + div $8, $9, $8 +# was: div _mult1_L_106_, _div1_L_108_, _div2_R_109_ + ori $9, $0, 5 +# was: ori _mult2_R_107_, $0, 5 + mul $8, $8, $9 +# was: mul _minus_R_105_, _mult1_L_106_, _mult2_R_107_ + sub $9, $10, $8 +# was: sub _eq_L_102_, _minus_L_104_, _minus_R_105_ + ori $11, $0, 0 +# was: ori _eq_R_103_, $0, 0 + ori $8, $0, 0 +# was: ori _fun_arg_res_101_, $0, 0 + bne $9, $11, _false_111_ +# was: bne _eq_L_102_, _eq_R_103_, _false_111_ + ori $8, $0, 1 +# was: ori _fun_arg_res_101_, $0, 1 +_false_111_: +# ori _bool_reg_93_,_fun_arg_res_101_,0 + beq $8, $0, _if_end_99_ +# was: beq _bool_reg_93_, $0, _if_end_99_ + sw $10, 0($5) +# was: sw _elem_reg_92_, 0(_addr_reg_95_) + addi $5, $5, 4 +# was: addi _addr_reg_95_, _addr_reg_95_, 4 + addi $7, $7, 1 +# was: addi _count_reg_94_, _count_reg_94_, 1 +_if_end_99_: + addi $6, $6, 1 +# was: addi _i_reg_96_, _i_reg_96_, 1 + j _loop_beg_97_ +_loop_end_98_: + sw $7, 0($2) +# was: sw _count_reg_94_, 0(_letBind_89_) +# ori _arr_reg_115_,_letBind_89_,0 + lw $4, 0($2) +# was: lw _size_reg_114_, 0(_arr_reg_115_) + ori $6, $28, 0 +# was: ori _letBind_113_, $28, 0 + sll $3, $4, 2 +# was: sll _tmp_126_, _size_reg_114_, 2 + addi $3, $3, 4 +# was: addi _tmp_126_, _tmp_126_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_126_ + sw $4, 0($6) +# was: sw _size_reg_114_, 0(_letBind_113_) + addi $3, $6, 4 +# was: addi _addr_reg_118_, _letBind_113_, 4 + ori $5, $0, 0 +# was: ori _i_reg_119_, $0, 0 + addi $2, $2, 4 +# was: addi _elem_reg_116_, _arr_reg_115_, 4 +_loop_beg_120_: + sub $7, $5, $4 +# was: sub _tmp_reg_122_, _i_reg_119_, _size_reg_114_ + bgez $7, _loop_end_121_ +# was: bgez _tmp_reg_122_, _loop_end_121_ + lw $7, 0($2) +# was: lw _res_reg_117_, 0(_elem_reg_116_) + addi $2, $2, 4 +# was: addi _elem_reg_116_, _elem_reg_116_, 4 +# ori _mult1_L_124_,_res_reg_117_,0 + ori $8, $7, 0 +# was: ori _mult2_R_125_, _res_reg_117_, 0 + mul $7, $7, $8 +# was: mul _fun_arg_res_123_, _mult1_L_124_, _mult2_R_125_ +# ori _res_reg_117_,_fun_arg_res_123_,0 + sw $7, 0($3) +# was: sw _res_reg_117_, 0(_addr_reg_118_) + addi $3, $3, 4 +# was: addi _addr_reg_118_, _addr_reg_118_, 4 + addi $5, $5, 1 +# was: addi _i_reg_119_, _i_reg_119_, 1 + j _loop_beg_120_ +_loop_end_121_: +# ori _arr_reg_128_,_letBind_113_,0 + lw $17, 0($6) +# was: lw _size_reg_127_, 0(_arr_reg_128_) + ori $16, $28, 0 +# was: ori _mainres_1_, $28, 0 + sll $2, $17, 2 +# was: sll _tmp_138_, _size_reg_127_, 2 + addi $2, $2, 4 +# was: addi _tmp_138_, _tmp_138_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_138_ + sw $17, 0($16) +# was: sw _size_reg_127_, 0(_mainres_1_) + addi $18, $16, 4 +# was: addi _addr_reg_131_, _mainres_1_, 4 + ori $19, $0, 0 +# was: ori _i_reg_132_, $0, 0 + addi $20, $6, 4 +# was: addi _elem_reg_129_, _arr_reg_128_, 4 +_loop_beg_133_: + sub $2, $19, $17 +# was: sub _tmp_reg_135_, _i_reg_132_, _size_reg_127_ + bgez $2, _loop_end_134_ +# was: bgez _tmp_reg_135_, _loop_end_134_ + lw $21, 0($20) +# was: lw _res_reg_130_, 0(_elem_reg_129_) + addi $20, $20, 4 +# was: addi _elem_reg_129_, _elem_reg_129_, 4 +# ori _tmp_137_,_res_reg_130_,0 +# ori _fun_arg_res_136_,_tmp_137_,0 + ori $2, $21, 0 +# was: ori $2, _fun_arg_res_136_, 0 + jal putint +# was: jal putint, $2 +# ori _res_reg_130_,_fun_arg_res_136_,0 + sw $21, 0($18) +# was: sw _res_reg_130_, 0(_addr_reg_131_) + addi $18, $18, 4 +# was: addi _addr_reg_131_, _addr_reg_131_, 4 + addi $19, $19, 1 +# was: addi _i_reg_132_, _i_reg_132_, 1 + j _loop_beg_133_ +_loop_end_134_: + ori $2, $16, 0 +# was: ori $2, _mainres_1_, 0 + addi $29, $29, 32 + lw $21, -28($29) + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/comprehension.fo b/W1/fasto/tests/comprehension.fo new file mode 100644 index 0000000..b9f25e8 --- /dev/null +++ b/W1/fasto/tests/comprehension.fo @@ -0,0 +1,8 @@ +fun int write_int(int x) = write(x) +fun [int] write_int_arr([int] x) = map(write_int, x) + +fun [int] main() = + let n = read (int) in + let x = iota (n) in + let y = iota (n) in + write_int_arr ([int r*r | i <- x, j <-y; int r = (i+j) / 2; r - (r/5)*5 == 0 ]) diff --git a/W1/fasto/tests/comprehension.in b/W1/fasto/tests/comprehension.in new file mode 100644 index 0000000..60d3b2f --- /dev/null +++ b/W1/fasto/tests/comprehension.in @@ -0,0 +1 @@ +15 diff --git a/W1/fasto/tests/comprehension.out b/W1/fasto/tests/comprehension.out new file mode 100644 index 0000000..34a083f --- /dev/null +++ b/W1/fasto/tests/comprehension.out @@ -0,0 +1 @@ +0 0 25 25 0 25 25 25 25 25 25 25 25 25 25 25 25 100 25 25 100 100 25 25 100 100 25 25 100 100 25 25 100 100 25 100 100 100 100 100 100 100 100 diff --git a/W1/fasto/tests/copyConstPropFold0.asm b/W1/fasto/tests/copyConstPropFold0.asm new file mode 100644 index 0000000..95f4b11 --- /dev/null +++ b/W1/fasto/tests/copyConstPropFold0.asm @@ -0,0 +1,171 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function main +main: + sw $31, -4($29) + sw $16, -8($29) + addi $29, $29, -12 + jal getint +# was: jal getint, $2 +# ori _letBind_2_,$2,0 + ori $3, $2, 0 +# was: ori _plus_L_6_, _letBind_2_, 0 + ori $2, $0, 2 +# was: ori _plus_R_7_, $0, 2 + add $2, $3, $2 +# was: add _mult1_L_4_, _plus_L_6_, _plus_R_7_ + ori $3, $0, 0 +# was: ori _mult2_R_5_, $0, 0 + mul $16, $2, $3 +# was: mul _letBind_3_, _mult1_L_4_, _mult2_R_5_ +# ori _tmp_8_,_letBind_3_,0 +# ori _mainres_1_,_tmp_8_,0 + ori $2, $16, 0 +# was: ori $2, _mainres_1_, 0 + jal putint +# was: jal putint, $2 + ori $2, $16, 0 +# was: ori $2, _mainres_1_, 0 + addi $29, $29, 12 + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/copyConstPropFold0.fo b/W1/fasto/tests/copyConstPropFold0.fo new file mode 100644 index 0000000..541e83d --- /dev/null +++ b/W1/fasto/tests/copyConstPropFold0.fo @@ -0,0 +1,9 @@ +fun int f(int x, int y) = + (x + 2) * (y - 2) + +fun int main() = + let a = read(int) in + let b = let x = a in + let y = 2 in + (x + 2) * (y - 2) + in write(b) diff --git a/W1/fasto/tests/copyConstPropFold0.in b/W1/fasto/tests/copyConstPropFold0.in new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/W1/fasto/tests/copyConstPropFold0.in @@ -0,0 +1 @@ +4 diff --git a/W1/fasto/tests/copyConstPropFold0.out b/W1/fasto/tests/copyConstPropFold0.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/W1/fasto/tests/copyConstPropFold0.out @@ -0,0 +1 @@ +0 diff --git a/W1/fasto/tests/copyConstPropFold1.asm b/W1/fasto/tests/copyConstPropFold1.asm new file mode 100644 index 0000000..ba901c5 --- /dev/null +++ b/W1/fasto/tests/copyConstPropFold1.asm @@ -0,0 +1,220 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function main +main: + sw $31, -4($29) + sw $16, -8($29) + addi $29, $29, -12 + ori $3, $0, 40 +# was: ori _size_reg_3_, $0, 40 + bgez $3, _safe_lab_4_ +# was: bgez _size_reg_3_, _safe_lab_4_ + ori $5, $0, 3 +# was: ori $5, $0, 3 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_4_: + ori $2, $28, 0 +# was: ori _letBind_2_, $28, 0 + sll $4, $3, 2 +# was: sll _tmp_10_, _size_reg_3_, 2 + addi $4, $4, 4 +# was: addi _tmp_10_, _tmp_10_, 4 + add $28, $28, $4 +# was: add $28, $28, _tmp_10_ + sw $3, 0($2) +# was: sw _size_reg_3_, 0(_letBind_2_) + addi $6, $2, 4 +# was: addi _addr_reg_5_, _letBind_2_, 4 + ori $5, $0, 0 +# was: ori _i_reg_6_, $0, 0 +_loop_beg_7_: + sub $4, $5, $3 +# was: sub _tmp_reg_9_, _i_reg_6_, _size_reg_3_ + bgez $4, _loop_end_8_ +# was: bgez _tmp_reg_9_, _loop_end_8_ + sw $5, 0($6) +# was: sw _i_reg_6_, 0(_addr_reg_5_) + addi $6, $6, 4 +# was: addi _addr_reg_5_, _addr_reg_5_, 4 + addi $5, $5, 1 +# was: addi _i_reg_6_, _i_reg_6_, 1 + j _loop_beg_7_ +_loop_end_8_: + ori $4, $0, 4 +# was: ori _arr_ind_12_, $0, 4 + addi $3, $2, 4 +# was: addi _arr_reg_13_, _letBind_2_, 4 + lw $2, 0($2) +# was: lw _size_reg_14_, 0(_letBind_2_) + bgez $4, _safe_lab_17_ +# was: bgez _arr_ind_12_, _safe_lab_17_ +_error_lab_16_: + ori $5, $0, 5 +# was: ori $5, $0, 5 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_17_: + sub $2, $4, $2 +# was: sub _tmp_reg_15_, _arr_ind_12_, _size_reg_14_ + bgez $2, _error_lab_16_ +# was: bgez _tmp_reg_15_, _error_lab_16_ + sll $4, $4, 2 +# was: sll _arr_ind_12_, _arr_ind_12_, 2 + add $3, $3, $4 +# was: add _arr_reg_13_, _arr_reg_13_, _arr_ind_12_ + lw $16, 0($3) +# was: lw _letBind_11_, 0(_arr_reg_13_) +# ori _tmp_18_,_letBind_11_,0 +# ori _mainres_1_,_tmp_18_,0 + ori $2, $16, 0 +# was: ori $2, _mainres_1_, 0 + jal putint +# was: jal putint, $2 + ori $2, $16, 0 +# was: ori $2, _mainres_1_, 0 + addi $29, $29, 12 + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/copyConstPropFold1.fo b/W1/fasto/tests/copyConstPropFold1.fo new file mode 100644 index 0000000..eb70057 --- /dev/null +++ b/W1/fasto/tests/copyConstPropFold1.fo @@ -0,0 +1,6 @@ +fun int main() = + let length = 40 in + let array = iota(length) in + let index = length / 10 in + let x = array[index] in + write(x * 1 + 0) diff --git a/W1/fasto/tests/copyConstPropFold1.in b/W1/fasto/tests/copyConstPropFold1.in new file mode 100644 index 0000000..e69de29 diff --git a/W1/fasto/tests/copyConstPropFold1.out b/W1/fasto/tests/copyConstPropFold1.out new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/W1/fasto/tests/copyConstPropFold1.out @@ -0,0 +1 @@ +4 diff --git a/W1/fasto/tests/dead_bnd_rem.asm b/W1/fasto/tests/dead_bnd_rem.asm new file mode 100644 index 0000000..c90ad82 --- /dev/null +++ b/W1/fasto/tests/dead_bnd_rem.asm @@ -0,0 +1,175 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function main +main: + sw $31, -4($29) + sw $16, -8($29) + addi $29, $29, -12 + jal getint +# was: jal getint, $2 +# ori _letBind_2_,$2,0 +# ori _plus_L_4_,_letBind_2_,0 + ori $3, $0, 2 +# was: ori _plus_R_5_, $0, 2 + add $3, $2, $3 +# was: add _letBind_3_, _plus_L_4_, _plus_R_5_ +# ori _plus_L_7_,_letBind_2_,0 + ori $4, $0, 3 +# was: ori _plus_R_8_, $0, 3 + add $2, $2, $4 +# was: add _letBind_6_, _plus_L_7_, _plus_R_8_ +# ori _mult1_L_10_,_letBind_3_,0 +# ori _mult2_R_11_,_letBind_6_,0 + mul $16, $3, $2 +# was: mul _letBind_9_, _mult1_L_10_, _mult2_R_11_ +# ori _tmp_12_,_letBind_9_,0 +# ori _mainres_1_,_tmp_12_,0 + ori $2, $16, 0 +# was: ori $2, _mainres_1_, 0 + jal putint +# was: jal putint, $2 + ori $2, $16, 0 +# was: ori $2, _mainres_1_, 0 + addi $29, $29, 12 + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/dead_bnd_rem.fo b/W1/fasto/tests/dead_bnd_rem.fo new file mode 100644 index 0000000..0c9889b --- /dev/null +++ b/W1/fasto/tests/dead_bnd_rem.fo @@ -0,0 +1,16 @@ +fun int main() = + let y = read(int) in + let x = y * y in + let z = + let x = + let x = x + 3 in + let x = x + y + in x + 8 + in y + in + let x = y + 2 in + let w = x + 2 + z in + let v = + let y = y + 3 + in x * y + in write(v) diff --git a/W1/fasto/tests/dead_bnd_rem.in b/W1/fasto/tests/dead_bnd_rem.in new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/W1/fasto/tests/dead_bnd_rem.in @@ -0,0 +1 @@ +10 diff --git a/W1/fasto/tests/dead_bnd_rem.out b/W1/fasto/tests/dead_bnd_rem.out new file mode 100644 index 0000000..91b629b --- /dev/null +++ b/W1/fasto/tests/dead_bnd_rem.out @@ -0,0 +1 @@ +156 diff --git a/W1/fasto/tests/fail_parse.err b/W1/fasto/tests/fail_parse.err new file mode 100644 index 0000000..fefd496 --- /dev/null +++ b/W1/fasto/tests/fail_parse.err @@ -0,0 +1 @@ +Parse error: Error at line 2, column 12 diff --git a/W1/fasto/tests/fail_parse.fo b/W1/fasto/tests/fail_parse.fo new file mode 100644 index 0000000..a8c2403 --- /dev/null +++ b/W1/fasto/tests/fail_parse.fo @@ -0,0 +1,3 @@ +fun int main() = + let n = in + write(2) diff --git a/W1/fasto/tests/fib.asm b/W1/fasto/tests/fib.asm new file mode 100644 index 0000000..8d101cf --- /dev/null +++ b/W1/fasto/tests/fib.asm @@ -0,0 +1,239 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function fibo +fibo: + sw $31, -4($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -16 + ori $16, $2, 0 +# was: ori _param_n_1_, $2, 0 +# ori _eq_L_7_,_param_n_1_,0 + ori $3, $0, 0 +# was: ori _eq_R_8_, $0, 0 + ori $2, $0, 0 +# was: ori _cond_6_, $0, 0 + bne $16, $3, _false_9_ +# was: bne _eq_L_7_, _eq_R_8_, _false_9_ + ori $2, $0, 1 +# was: ori _cond_6_, $0, 1 +_false_9_: + bne $2, $0, _then_3_ +# was: bne _cond_6_, $0, _then_3_ + j _else_4_ +_then_3_: + ori $2, $0, 0 +# was: ori _fibores_2_, $0, 0 + j _endif_5_ +_else_4_: +# ori _eq_L_14_,_param_n_1_,0 + ori $3, $0, 1 +# was: ori _eq_R_15_, $0, 1 + ori $2, $0, 0 +# was: ori _cond_13_, $0, 0 + bne $16, $3, _false_16_ +# was: bne _eq_L_14_, _eq_R_15_, _false_16_ + ori $2, $0, 1 +# was: ori _cond_13_, $0, 1 +_false_16_: + bne $2, $0, _then_10_ +# was: bne _cond_13_, $0, _then_10_ + j _else_11_ +_then_10_: + ori $2, $0, 1 +# was: ori _fibores_2_, $0, 1 + j _endif_12_ +_else_11_: +# ori _minus_L_20_,_param_n_1_,0 + ori $2, $0, 1 +# was: ori _minus_R_21_, $0, 1 + sub $2, $16, $2 +# was: sub _arg_19_, _minus_L_20_, _minus_R_21_ +# ori $2,_arg_19_,0 + jal fibo +# was: jal fibo, $2 + ori $17, $2, 0 +# was: ori _plus_L_17_, $2, 0 +# ori _minus_L_23_,_param_n_1_,0 + ori $2, $0, 2 +# was: ori _minus_R_24_, $0, 2 + sub $2, $16, $2 +# was: sub _arg_22_, _minus_L_23_, _minus_R_24_ +# ori $2,_arg_22_,0 + jal fibo +# was: jal fibo, $2 +# ori _plus_R_18_,$2,0 + add $2, $17, $2 +# was: add _fibores_2_, _plus_L_17_, _plus_R_18_ +_endif_12_: +_endif_5_: +# ori $2,_fibores_2_,0 + addi $29, $29, 16 + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +# Function main +main: + sw $31, -4($29) + sw $16, -8($29) + addi $29, $29, -12 + jal getint +# was: jal getint, $2 +# ori _letBind_26_,$2,0 +# ori _arg_28_,_letBind_26_,0 +# ori $2,_arg_28_,0 + jal fibo +# was: jal fibo, $2 +# ori _tmp_27_,$2,0 + ori $16, $2, 0 +# was: ori _mainres_25_, _tmp_27_, 0 + ori $2, $16, 0 +# was: ori $2, _mainres_25_, 0 + jal putint +# was: jal putint, $2 + ori $2, $16, 0 +# was: ori $2, _mainres_25_, 0 + addi $29, $29, 12 + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/fib.fo b/W1/fasto/tests/fib.fo new file mode 100644 index 0000000..a84afb3 --- /dev/null +++ b/W1/fasto/tests/fib.fo @@ -0,0 +1,8 @@ +fun int fibo(int n) = + if n == 0 then 0 + else if n == 1 then 1 + else fibo(n - 1) + fibo(n - 2) + +fun int main() = + let n = read(int) in + write(fibo(n)) diff --git a/W1/fasto/tests/fib.in b/W1/fasto/tests/fib.in new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/W1/fasto/tests/fib.in @@ -0,0 +1 @@ +10 diff --git a/W1/fasto/tests/fib.out b/W1/fasto/tests/fib.out new file mode 100644 index 0000000..f1daf02 --- /dev/null +++ b/W1/fasto/tests/fib.out @@ -0,0 +1 @@ +55 diff --git a/W1/fasto/tests/filter-on-2darr.asm b/W1/fasto/tests/filter-on-2darr.asm new file mode 100644 index 0000000..a19d18c --- /dev/null +++ b/W1/fasto/tests/filter-on-2darr.asm @@ -0,0 +1,474 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function main +main: + sw $31, -4($29) + sw $25, -48($29) + sw $24, -44($29) + sw $23, -40($29) + sw $22, -36($29) + sw $21, -32($29) + sw $20, -28($29) + sw $19, -24($29) + sw $18, -20($29) + sw $17, -16($29) + sw $16, -12($29) + addi $29, $29, -52 + sw $2, 0($29) +# was: sw _fun_arg_res_84_, 0($29) + jal getint +# was: jal getint, $2 +# ori _letBind_2_,$2,0 + ori $3, $2, 0 +# was: ori _size_reg_8_, _letBind_2_, 0 + bgez $3, _safe_lab_9_ +# was: bgez _size_reg_8_, _safe_lab_9_ + ori $5, $0, 11 +# was: ori $5, $0, 11 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_9_: + ori $2, $28, 0 +# was: ori _arr_reg_5_, $28, 0 + sll $4, $3, 2 +# was: sll _tmp_15_, _size_reg_8_, 2 + addi $4, $4, 4 +# was: addi _tmp_15_, _tmp_15_, 4 + add $28, $28, $4 +# was: add $28, $28, _tmp_15_ + sw $3, 0($2) +# was: sw _size_reg_8_, 0(_arr_reg_5_) + addi $4, $2, 4 +# was: addi _addr_reg_10_, _arr_reg_5_, 4 + ori $5, $0, 0 +# was: ori _i_reg_11_, $0, 0 +_loop_beg_12_: + sub $6, $5, $3 +# was: sub _tmp_reg_14_, _i_reg_11_, _size_reg_8_ + bgez $6, _loop_end_13_ +# was: bgez _tmp_reg_14_, _loop_end_13_ + sw $5, 0($4) +# was: sw _i_reg_11_, 0(_addr_reg_10_) + addi $4, $4, 4 +# was: addi _addr_reg_10_, _addr_reg_10_, 4 + addi $5, $5, 1 +# was: addi _i_reg_11_, _i_reg_11_, 1 + j _loop_beg_12_ +_loop_end_13_: + lw $5, 0($2) +# was: lw _size_reg_4_, 0(_arr_reg_5_) + ori $4, $28, 0 +# was: ori _letBind_3_, $28, 0 + sll $3, $5, 2 +# was: sll _tmp_32_, _size_reg_4_, 2 + addi $3, $3, 4 +# was: addi _tmp_32_, _tmp_32_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_32_ + sw $5, 0($4) +# was: sw _size_reg_4_, 0(_letBind_3_) + addi $6, $4, 4 +# was: addi _addr_reg_16_, _letBind_3_, 4 + ori $7, $0, 0 +# was: ori _i_reg_17_, $0, 0 + addi $3, $2, 4 +# was: addi _elem_reg_6_, _arr_reg_5_, 4 +_loop_beg_18_: + sub $2, $7, $5 +# was: sub _tmp_reg_20_, _i_reg_17_, _size_reg_4_ + bgez $2, _loop_end_19_ +# was: bgez _tmp_reg_20_, _loop_end_19_ + lw $8, 0($3) +# was: lw _res_reg_7_, 0(_elem_reg_6_) + addi $3, $3, 4 +# was: addi _elem_reg_6_, _elem_reg_6_, 4 +# ori _plus_L_23_,_res_reg_7_,0 + ori $2, $0, 2 +# was: ori _plus_R_24_, $0, 2 + add $2, $8, $2 +# was: add _size_reg_22_, _plus_L_23_, _plus_R_24_ + bgez $2, _safe_lab_25_ +# was: bgez _size_reg_22_, _safe_lab_25_ + ori $5, $0, 10 +# was: ori $5, $0, 10 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_25_: + ori $8, $28, 0 +# was: ori _fun_arg_res_21_, $28, 0 + sll $9, $2, 2 +# was: sll _tmp_31_, _size_reg_22_, 2 + addi $9, $9, 4 +# was: addi _tmp_31_, _tmp_31_, 4 + add $28, $28, $9 +# was: add $28, $28, _tmp_31_ + sw $2, 0($8) +# was: sw _size_reg_22_, 0(_fun_arg_res_21_) + addi $10, $8, 4 +# was: addi _addr_reg_26_, _fun_arg_res_21_, 4 + ori $9, $0, 0 +# was: ori _i_reg_27_, $0, 0 +_loop_beg_28_: + sub $11, $9, $2 +# was: sub _tmp_reg_30_, _i_reg_27_, _size_reg_22_ + bgez $11, _loop_end_29_ +# was: bgez _tmp_reg_30_, _loop_end_29_ + sw $9, 0($10) +# was: sw _i_reg_27_, 0(_addr_reg_26_) + addi $10, $10, 4 +# was: addi _addr_reg_26_, _addr_reg_26_, 4 + addi $9, $9, 1 +# was: addi _i_reg_27_, _i_reg_27_, 1 + j _loop_beg_28_ +_loop_end_29_: +# ori _res_reg_7_,_fun_arg_res_21_,0 + sw $8, 0($6) +# was: sw _res_reg_7_, 0(_addr_reg_16_) + addi $6, $6, 4 +# was: addi _addr_reg_16_, _addr_reg_16_, 4 + addi $7, $7, 1 +# was: addi _i_reg_17_, _i_reg_17_, 1 + j _loop_beg_18_ +_loop_end_19_: + ori $3, $4, 0 +# was: ori _arr_reg_35_, _letBind_3_, 0 + lw $2, 0($3) +# was: lw _size_reg_34_, 0(_arr_reg_35_) + ori $4, $28, 0 +# was: ori _letBind_33_, $28, 0 + sll $5, $2, 2 +# was: sll _tmp_64_, _size_reg_34_, 2 + addi $5, $5, 4 +# was: addi _tmp_64_, _tmp_64_, 4 + add $28, $28, $5 +# was: add $28, $28, _tmp_64_ + sw $2, 0($4) +# was: sw _size_reg_34_, 0(_letBind_33_) + addi $6, $4, 4 +# was: addi _addr_reg_39_, _letBind_33_, 4 + addi $3, $3, 4 +# was: addi _arr_reg_35_, _arr_reg_35_, 4 + ori $5, $0, 0 +# was: ori _i_reg_40_, $0, 0 + ori $7, $0, 0 +# was: ori _count_reg_38_, $0, 0 +_loop_beg_41_: + sub $8, $5, $2 +# was: sub _tmp_reg_44_, _i_reg_40_, _size_reg_34_ + bgez $8, _loop_end_42_ +# was: bgez _tmp_reg_44_, _loop_end_42_ + lw $8, 0($3) +# was: lw _elem_reg_36_, 0(_arr_reg_35_) + addi $3, $3, 4 +# was: addi _arr_reg_35_, _arr_reg_35_, 4 + ori $10, $8, 0 +# was: ori _arr_reg_47_, _elem_reg_36_, 0 + lw $11, 0($10) +# was: lw _size_reg_48_, 0(_arr_reg_47_) + ori $13, $0, 0 +# was: ori _letBind_46_, $0, 0 + addi $10, $10, 4 +# was: addi _arr_reg_47_, _arr_reg_47_, 4 + ori $9, $0, 0 +# was: ori _ind_var_49_, $0, 0 +_loop_beg_51_: + sub $12, $9, $11 +# was: sub _tmp_reg_50_, _ind_var_49_, _size_reg_48_ + bgez $12, _loop_end_52_ +# was: bgez _tmp_reg_50_, _loop_end_52_ + lw $12, 0($10) +# was: lw _tmp_reg_50_, 0(_arr_reg_47_) + addi $10, $10, 4 +# was: addi _arr_reg_47_, _arr_reg_47_, 4 +# ori _plus_L_54_,_letBind_46_,0 +# ori _plus_R_55_,_tmp_reg_50_,0 + add $13, $13, $12 +# was: add _fun_arg_res_53_, _plus_L_54_, _plus_R_55_ +# ori _letBind_46_,_fun_arg_res_53_,0 + addi $9, $9, 1 +# was: addi _ind_var_49_, _ind_var_49_, 1 + j _loop_beg_51_ +_loop_end_52_: +# ori _div1_L_60_,_letBind_46_,0 + ori $9, $0, 2 +# was: ori _div2_R_61_, $0, 2 + bne $9, $0, _safe_div_62_ +# was: bne _div2_R_61_, $0, _safe_div_62_ + ori $5, $0, 6 +# was: ori $5, $0, 6 + la $6, _Msg_DivZero_ +# was: la $6, _Msg_DivZero_ + j _RuntimeError_ +_safe_div_62_: + div $10, $13, $9 +# was: div _mult1_L_58_, _div1_L_60_, _div2_R_61_ + ori $9, $0, 2 +# was: ori _mult2_R_59_, $0, 2 + mul $9, $10, $9 +# was: mul _eq_L_56_, _mult1_L_58_, _mult2_R_59_ +# ori _eq_R_57_,_letBind_46_,0 + ori $10, $0, 0 +# was: ori _fun_arg_res_45_, $0, 0 + bne $9, $13, _false_63_ +# was: bne _eq_L_56_, _eq_R_57_, _false_63_ + ori $10, $0, 1 +# was: ori _fun_arg_res_45_, $0, 1 +_false_63_: +# ori _bool_reg_37_,_fun_arg_res_45_,0 + beq $10, $0, _if_end_43_ +# was: beq _bool_reg_37_, $0, _if_end_43_ + sw $8, 0($6) +# was: sw _elem_reg_36_, 0(_addr_reg_39_) + addi $6, $6, 4 +# was: addi _addr_reg_39_, _addr_reg_39_, 4 + addi $7, $7, 1 +# was: addi _count_reg_38_, _count_reg_38_, 1 +_if_end_43_: + addi $5, $5, 1 +# was: addi _i_reg_40_, _i_reg_40_, 1 + j _loop_beg_41_ +_loop_end_42_: + sw $7, 0($4) +# was: sw _count_reg_38_, 0(_letBind_33_) +# ori _arr_reg_66_,_letBind_33_,0 + lw $17, 0($4) +# was: lw _size_reg_65_, 0(_arr_reg_66_) + ori $16, $28, 0 +# was: ori _mainres_1_, $28, 0 + sll $2, $17, 2 +# was: sll _tmp_87_, _size_reg_65_, 2 + addi $2, $2, 4 +# was: addi _tmp_87_, _tmp_87_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_87_ + sw $17, 0($16) +# was: sw _size_reg_65_, 0(_mainres_1_) + addi $19, $16, 4 +# was: addi _addr_reg_69_, _mainres_1_, 4 + ori $18, $0, 0 +# was: ori _i_reg_70_, $0, 0 + addi $20, $4, 4 +# was: addi _elem_reg_67_, _arr_reg_66_, 4 +_loop_beg_71_: + sub $2, $18, $17 +# was: sub _tmp_reg_73_, _i_reg_70_, _size_reg_65_ + bgez $2, _loop_end_72_ +# was: bgez _tmp_reg_73_, _loop_end_72_ + lw $2, 0($20) +# was: lw _res_reg_68_, 0(_elem_reg_67_) + addi $20, $20, 4 +# was: addi _elem_reg_67_, _elem_reg_67_, 4 +# ori _arr_reg_76_,_res_reg_68_,0 + lw $22, 0($2) +# was: lw _size_reg_75_, 0(_arr_reg_76_) + ori $21, $28, 0 +# was: ori _fun_arg_res_74_, $28, 0 + sll $3, $22, 2 +# was: sll _tmp_86_, _size_reg_75_, 2 + addi $3, $3, 4 +# was: addi _tmp_86_, _tmp_86_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_86_ + sw $22, 0($21) +# was: sw _size_reg_75_, 0(_fun_arg_res_74_) + addi $23, $21, 4 +# was: addi _addr_reg_79_, _fun_arg_res_74_, 4 + ori $24, $0, 0 +# was: ori _i_reg_80_, $0, 0 + addi $25, $2, 4 +# was: addi _elem_reg_77_, _arr_reg_76_, 4 +_loop_beg_81_: + sub $2, $24, $22 +# was: sub _tmp_reg_83_, _i_reg_80_, _size_reg_75_ + bgez $2, _loop_end_82_ +# was: bgez _tmp_reg_83_, _loop_end_82_ + lw $2, 0($25) +# was: lw _res_reg_78_, 0(_elem_reg_77_) + addi $25, $25, 4 +# was: addi _elem_reg_77_, _elem_reg_77_, 4 +# ori _tmp_85_,_res_reg_78_,0 +# ori _fun_arg_res_84_,_tmp_85_,0 + sw $2, 0($29) +# was: sw _fun_arg_res_84_, 0($29) + lw $2, 0($29) +# was: lw _fun_arg_res_84_, 0($29) +# ori $2,_fun_arg_res_84_,0 + jal putint +# was: jal putint, $2 + lw $2, 0($29) +# was: lw _fun_arg_res_84_, 0($29) +# ori _res_reg_78_,_fun_arg_res_84_,0 + sw $2, 0($23) +# was: sw _res_reg_78_, 0(_addr_reg_79_) + addi $23, $23, 4 +# was: addi _addr_reg_79_, _addr_reg_79_, 4 + addi $24, $24, 1 +# was: addi _i_reg_80_, _i_reg_80_, 1 + j _loop_beg_81_ +_loop_end_82_: + ori $2, $21, 0 +# was: ori _res_reg_68_, _fun_arg_res_74_, 0 + sw $2, 0($19) +# was: sw _res_reg_68_, 0(_addr_reg_69_) + addi $19, $19, 4 +# was: addi _addr_reg_69_, _addr_reg_69_, 4 + addi $18, $18, 1 +# was: addi _i_reg_70_, _i_reg_70_, 1 + j _loop_beg_71_ +_loop_end_72_: + ori $2, $16, 0 +# was: ori $2, _mainres_1_, 0 + addi $29, $29, 52 + lw $25, -48($29) + lw $24, -44($29) + lw $23, -40($29) + lw $22, -36($29) + lw $21, -32($29) + lw $20, -28($29) + lw $19, -24($29) + lw $18, -20($29) + lw $17, -16($29) + lw $16, -12($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/filter-on-2darr.fo b/W1/fasto/tests/filter-on-2darr.fo new file mode 100644 index 0000000..e257ed9 --- /dev/null +++ b/W1/fasto/tests/filter-on-2darr.fo @@ -0,0 +1,17 @@ +fun int write_int(int x) = write(x) +fun [int] write_1darr( [int] x) = map(write_int , x) +fun [[int]] write_2darr([[int]] x) = map(write_1darr, x) + +fun bool even(int a) = + (a / 2) * 2 == a + +fun [[int]] main() = + let n = read(int) in + let a2d = map( fn [int] (int i) => iota(i+2) + , iota(n)) in + let a2df= filter(fn bool ([int] a) => + let r = reduce(op +, 0, a) + in even(r) + , a2d) + in write_2darr(a2df) + diff --git a/W1/fasto/tests/filter-on-2darr.in b/W1/fasto/tests/filter-on-2darr.in new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/W1/fasto/tests/filter-on-2darr.in @@ -0,0 +1 @@ +5 diff --git a/W1/fasto/tests/filter-on-2darr.out b/W1/fasto/tests/filter-on-2darr.out new file mode 100644 index 0000000..f9a4136 --- /dev/null +++ b/W1/fasto/tests/filter-on-2darr.out @@ -0,0 +1,2 @@ +0 1 2 3 0 1 2 3 4 + diff --git a/W1/fasto/tests/filter.asm b/W1/fasto/tests/filter.asm new file mode 100644 index 0000000..a823eea --- /dev/null +++ b/W1/fasto/tests/filter.asm @@ -0,0 +1,431 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function main +main: + sw $31, -4($29) + sw $21, -28($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -32 + jal getint +# was: jal getint, $2 +# ori _letBind_2_,$2,0 + ori $3, $2, 0 +# was: ori _size_reg_9_, _letBind_2_, 0 + bgez $3, _safe_lab_10_ +# was: bgez _size_reg_9_, _safe_lab_10_ + ori $5, $0, 10 +# was: ori $5, $0, 10 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_10_: + ori $2, $28, 0 +# was: ori _arr_reg_5_, $28, 0 + sll $4, $3, 2 +# was: sll _tmp_16_, _size_reg_9_, 2 + addi $4, $4, 4 +# was: addi _tmp_16_, _tmp_16_, 4 + add $28, $28, $4 +# was: add $28, $28, _tmp_16_ + sw $3, 0($2) +# was: sw _size_reg_9_, 0(_arr_reg_5_) + addi $5, $2, 4 +# was: addi _addr_reg_11_, _arr_reg_5_, 4 + ori $6, $0, 0 +# was: ori _i_reg_12_, $0, 0 +_loop_beg_13_: + sub $4, $6, $3 +# was: sub _tmp_reg_15_, _i_reg_12_, _size_reg_9_ + bgez $4, _loop_end_14_ +# was: bgez _tmp_reg_15_, _loop_end_14_ + sw $6, 0($5) +# was: sw _i_reg_12_, 0(_addr_reg_11_) + addi $5, $5, 4 +# was: addi _addr_reg_11_, _addr_reg_11_, 4 + addi $6, $6, 1 +# was: addi _i_reg_12_, _i_reg_12_, 1 + j _loop_beg_13_ +_loop_end_14_: + lw $5, 0($2) +# was: lw _size_reg_4_, 0(_arr_reg_5_) + ori $6, $28, 0 +# was: ori _letBind_3_, $28, 0 + sll $3, $5, 2 +# was: sll _tmp_32_, _size_reg_4_, 2 + addi $3, $3, 4 +# was: addi _tmp_32_, _tmp_32_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_32_ + sw $5, 0($6) +# was: sw _size_reg_4_, 0(_letBind_3_) + addi $3, $6, 4 +# was: addi _addr_reg_17_, _letBind_3_, 4 + addi $2, $2, 4 +# was: addi _arr_reg_5_, _arr_reg_5_, 4 + ori $4, $0, 0 +# was: ori _i_reg_18_, $0, 0 + ori $7, $0, 0 +# was: ori _count_reg_8_, $0, 0 +_loop_beg_19_: + sub $8, $4, $5 +# was: sub _tmp_reg_22_, _i_reg_18_, _size_reg_4_ + bgez $8, _loop_end_20_ +# was: bgez _tmp_reg_22_, _loop_end_20_ + lw $10, 0($2) +# was: lw _elem_reg_6_, 0(_arr_reg_5_) + addi $2, $2, 4 +# was: addi _arr_reg_5_, _arr_reg_5_, 4 +# ori _eq_L_24_,_elem_reg_6_,0 + ori $9, $10, 0 +# was: ori _div1_L_28_, _elem_reg_6_, 0 + ori $8, $0, 2 +# was: ori _div2_R_29_, $0, 2 + bne $8, $0, _safe_div_30_ +# was: bne _div2_R_29_, $0, _safe_div_30_ + ori $5, $0, 10 +# was: ori $5, $0, 10 + la $6, _Msg_DivZero_ +# was: la $6, _Msg_DivZero_ + j _RuntimeError_ +_safe_div_30_: + div $8, $9, $8 +# was: div _mult1_L_26_, _div1_L_28_, _div2_R_29_ + ori $9, $0, 2 +# was: ori _mult2_R_27_, $0, 2 + mul $8, $8, $9 +# was: mul _eq_R_25_, _mult1_L_26_, _mult2_R_27_ + ori $9, $0, 0 +# was: ori _fun_arg_res_23_, $0, 0 + bne $10, $8, _false_31_ +# was: bne _eq_L_24_, _eq_R_25_, _false_31_ + ori $9, $0, 1 +# was: ori _fun_arg_res_23_, $0, 1 +_false_31_: +# ori _bool_reg_7_,_fun_arg_res_23_,0 + beq $9, $0, _if_end_21_ +# was: beq _bool_reg_7_, $0, _if_end_21_ + sw $10, 0($3) +# was: sw _elem_reg_6_, 0(_addr_reg_17_) + addi $3, $3, 4 +# was: addi _addr_reg_17_, _addr_reg_17_, 4 + addi $7, $7, 1 +# was: addi _count_reg_8_, _count_reg_8_, 1 +_if_end_21_: + addi $4, $4, 1 +# was: addi _i_reg_18_, _i_reg_18_, 1 + j _loop_beg_19_ +_loop_end_20_: + sw $7, 0($6) +# was: sw _count_reg_8_, 0(_letBind_3_) + ori $2, $6, 0 +# was: ori _arr_reg_35_, _letBind_3_, 0 + lw $3, 0($2) +# was: lw _size_reg_34_, 0(_arr_reg_35_) + ori $4, $28, 0 +# was: ori _letBind_33_, $28, 0 + sll $5, $3, 2 +# was: sll _tmp_46_, _size_reg_34_, 2 + addi $5, $5, 4 +# was: addi _tmp_46_, _tmp_46_, 4 + add $28, $28, $5 +# was: add $28, $28, _tmp_46_ + sw $3, 0($4) +# was: sw _size_reg_34_, 0(_letBind_33_) + addi $6, $4, 4 +# was: addi _addr_reg_38_, _letBind_33_, 4 + ori $5, $0, 0 +# was: ori _i_reg_39_, $0, 0 + addi $2, $2, 4 +# was: addi _elem_reg_36_, _arr_reg_35_, 4 +_loop_beg_40_: + sub $7, $5, $3 +# was: sub _tmp_reg_42_, _i_reg_39_, _size_reg_34_ + bgez $7, _loop_end_41_ +# was: bgez _tmp_reg_42_, _loop_end_41_ + lw $7, 0($2) +# was: lw _res_reg_37_, 0(_elem_reg_36_) + addi $2, $2, 4 +# was: addi _elem_reg_36_, _elem_reg_36_, 4 + ori $8, $7, 0 +# was: ori _mult1_L_44_, _res_reg_37_, 0 +# ori _mult2_R_45_,_res_reg_37_,0 + mul $7, $8, $7 +# was: mul _fun_arg_res_43_, _mult1_L_44_, _mult2_R_45_ +# ori _res_reg_37_,_fun_arg_res_43_,0 + sw $7, 0($6) +# was: sw _res_reg_37_, 0(_addr_reg_38_) + addi $6, $6, 4 +# was: addi _addr_reg_38_, _addr_reg_38_, 4 + addi $5, $5, 1 +# was: addi _i_reg_39_, _i_reg_39_, 1 + j _loop_beg_40_ +_loop_end_41_: + ori $2, $4, 0 +# was: ori _arr_reg_49_, _letBind_33_, 0 + lw $3, 0($2) +# was: lw _size_reg_48_, 0(_arr_reg_49_) + ori $4, $28, 0 +# was: ori _letBind_47_, $28, 0 + sll $5, $3, 2 +# was: sll _tmp_68_, _size_reg_48_, 2 + addi $5, $5, 4 +# was: addi _tmp_68_, _tmp_68_, 4 + add $28, $28, $5 +# was: add $28, $28, _tmp_68_ + sw $3, 0($4) +# was: sw _size_reg_48_, 0(_letBind_47_) + addi $5, $4, 4 +# was: addi _addr_reg_53_, _letBind_47_, 4 + addi $2, $2, 4 +# was: addi _arr_reg_49_, _arr_reg_49_, 4 + ori $6, $0, 0 +# was: ori _i_reg_54_, $0, 0 + ori $7, $0, 0 +# was: ori _count_reg_52_, $0, 0 +_loop_beg_55_: + sub $8, $6, $3 +# was: sub _tmp_reg_58_, _i_reg_54_, _size_reg_48_ + bgez $8, _loop_end_56_ +# was: bgez _tmp_reg_58_, _loop_end_56_ + lw $8, 0($2) +# was: lw _elem_reg_50_, 0(_arr_reg_49_) + addi $2, $2, 4 +# was: addi _arr_reg_49_, _arr_reg_49_, 4 +# ori _div1_L_64_,_elem_reg_50_,0 + ori $9, $0, 16 +# was: ori _div2_R_65_, $0, 16 + bne $9, $0, _safe_div_66_ +# was: bne _div2_R_65_, $0, _safe_div_66_ + ori $5, $0, 6 +# was: ori $5, $0, 6 + la $6, _Msg_DivZero_ +# was: la $6, _Msg_DivZero_ + j _RuntimeError_ +_safe_div_66_: + div $10, $8, $9 +# was: div _mult1_L_62_, _div1_L_64_, _div2_R_65_ + ori $9, $0, 16 +# was: ori _mult2_R_63_, $0, 16 + mul $10, $10, $9 +# was: mul _eq_L_60_, _mult1_L_62_, _mult2_R_63_ +# ori _eq_R_61_,_elem_reg_50_,0 + ori $9, $0, 0 +# was: ori _fun_arg_res_59_, $0, 0 + bne $10, $8, _false_67_ +# was: bne _eq_L_60_, _eq_R_61_, _false_67_ + ori $9, $0, 1 +# was: ori _fun_arg_res_59_, $0, 1 +_false_67_: +# ori _bool_reg_51_,_fun_arg_res_59_,0 + beq $9, $0, _if_end_57_ +# was: beq _bool_reg_51_, $0, _if_end_57_ + sw $8, 0($5) +# was: sw _elem_reg_50_, 0(_addr_reg_53_) + addi $5, $5, 4 +# was: addi _addr_reg_53_, _addr_reg_53_, 4 + addi $7, $7, 1 +# was: addi _count_reg_52_, _count_reg_52_, 1 +_if_end_57_: + addi $6, $6, 1 +# was: addi _i_reg_54_, _i_reg_54_, 1 + j _loop_beg_55_ +_loop_end_56_: + sw $7, 0($4) +# was: sw _count_reg_52_, 0(_letBind_47_) +# ori _arr_reg_70_,_letBind_47_,0 + lw $16, 0($4) +# was: lw _size_reg_69_, 0(_arr_reg_70_) + ori $17, $28, 0 +# was: ori _mainres_1_, $28, 0 + sll $2, $16, 2 +# was: sll _tmp_80_, _size_reg_69_, 2 + addi $2, $2, 4 +# was: addi _tmp_80_, _tmp_80_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_80_ + sw $16, 0($17) +# was: sw _size_reg_69_, 0(_mainres_1_) + addi $18, $17, 4 +# was: addi _addr_reg_73_, _mainres_1_, 4 + ori $19, $0, 0 +# was: ori _i_reg_74_, $0, 0 + addi $20, $4, 4 +# was: addi _elem_reg_71_, _arr_reg_70_, 4 +_loop_beg_75_: + sub $2, $19, $16 +# was: sub _tmp_reg_77_, _i_reg_74_, _size_reg_69_ + bgez $2, _loop_end_76_ +# was: bgez _tmp_reg_77_, _loop_end_76_ + lw $21, 0($20) +# was: lw _res_reg_72_, 0(_elem_reg_71_) + addi $20, $20, 4 +# was: addi _elem_reg_71_, _elem_reg_71_, 4 +# ori _tmp_79_,_res_reg_72_,0 +# ori _fun_arg_res_78_,_tmp_79_,0 + ori $2, $21, 0 +# was: ori $2, _fun_arg_res_78_, 0 + jal putint +# was: jal putint, $2 +# ori _res_reg_72_,_fun_arg_res_78_,0 + sw $21, 0($18) +# was: sw _res_reg_72_, 0(_addr_reg_73_) + addi $18, $18, 4 +# was: addi _addr_reg_73_, _addr_reg_73_, 4 + addi $19, $19, 1 +# was: addi _i_reg_74_, _i_reg_74_, 1 + j _loop_beg_75_ +_loop_end_76_: + ori $2, $17, 0 +# was: ori $2, _mainres_1_, 0 + addi $29, $29, 32 + lw $21, -28($29) + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/filter.fo b/W1/fasto/tests/filter.fo new file mode 100644 index 0000000..6e5f58f --- /dev/null +++ b/W1/fasto/tests/filter.fo @@ -0,0 +1,13 @@ +fun int write_int(int x) = write(x) + +fun [int] write_int_arr([int] x) = map(write_int, x) + +fun bool isMul16(int a) = + (a / 16) * 16 == a + +fun [int] main() = + let n = read(int) in + let x = filter(fn bool (int a) => a == (a/2)*2, iota(n)) in + let y = map (fn int (int a) => a * a, x) in + let z = filter(isMul16, y) + in write_int_arr(z) diff --git a/W1/fasto/tests/filter.in b/W1/fasto/tests/filter.in new file mode 100644 index 0000000..60d3b2f --- /dev/null +++ b/W1/fasto/tests/filter.in @@ -0,0 +1 @@ +15 diff --git a/W1/fasto/tests/filter.out b/W1/fasto/tests/filter.out new file mode 100644 index 0000000..25971fa --- /dev/null +++ b/W1/fasto/tests/filter.out @@ -0,0 +1 @@ +0 16 64 144 diff --git a/W1/fasto/tests/inline_map.asm b/W1/fasto/tests/inline_map.asm new file mode 100644 index 0000000..88bf437 --- /dev/null +++ b/W1/fasto/tests/inline_map.asm @@ -0,0 +1,458 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function plus5 +plus5: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_x_1_,$2,0 +# ori _plus_L_3_,_param_x_1_,0 + ori $3, $0, 5 +# was: ori _plus_R_4_, $0, 5 + add $2, $2, $3 +# was: add _plus5res_2_, _plus_L_3_, _plus_R_4_ +# ori $2,_plus5res_2_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function mul2 +mul2: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_x_5_,$2,0 + ori $3, $2, 0 +# was: ori _plus_L_7_, _param_x_5_, 0 +# ori _plus_R_8_,_param_x_5_,0 + add $2, $3, $2 +# was: add _mul2res_6_, _plus_L_7_, _plus_R_8_ +# ori $2,_mul2res_6_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function testcomp +testcomp: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_x_9_,$2,0 +# ori _arg_12_,_param_x_9_,0 +# ori $2,_arg_12_,0 + jal write_int_arr +# was: jal write_int_arr, $2 +# ori _arg_11_,$2,0 +# ori $2,_arg_11_,0 + jal write_int_arr +# was: jal write_int_arr, $2 +# ori _testcompres_10_,$2,0 +# ori $2,_testcompres_10_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function write_int +write_int: + sw $31, -4($29) + sw $16, -8($29) + addi $29, $29, -12 +# ori _param_x_13_,$2,0 + ori $16, $2, 0 +# was: ori _tmp_15_, _param_x_13_, 0 +# ori _write_intres_14_,_tmp_15_,0 + ori $2, $16, 0 +# was: ori $2, _write_intres_14_, 0 + jal putint +# was: jal putint, $2 + ori $2, $16, 0 +# was: ori $2, _write_intres_14_, 0 + addi $29, $29, 12 + lw $16, -8($29) + lw $31, -4($29) + jr $31 +# Function write_int_arr +write_int_arr: + sw $31, -4($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -28 +# ori _param_x_16_,$2,0 +# ori _arr_reg_19_,_param_x_16_,0 + lw $16, 0($2) +# was: lw _size_reg_18_, 0(_arr_reg_19_) + ori $17, $28, 0 +# was: ori _write_int_arrres_17_, $28, 0 + sll $3, $16, 2 +# was: sll _tmp_28_, _size_reg_18_, 2 + addi $3, $3, 4 +# was: addi _tmp_28_, _tmp_28_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_28_ + sw $16, 0($17) +# was: sw _size_reg_18_, 0(_write_int_arrres_17_) + addi $18, $17, 4 +# was: addi _addr_reg_22_, _write_int_arrres_17_, 4 + ori $19, $0, 0 +# was: ori _i_reg_23_, $0, 0 + addi $20, $2, 4 +# was: addi _elem_reg_20_, _arr_reg_19_, 4 +_loop_beg_24_: + sub $2, $19, $16 +# was: sub _tmp_reg_26_, _i_reg_23_, _size_reg_18_ + bgez $2, _loop_end_25_ +# was: bgez _tmp_reg_26_, _loop_end_25_ + lw $2, 0($20) +# was: lw _res_reg_21_, 0(_elem_reg_20_) + addi $20, $20, 4 +# was: addi _elem_reg_20_, _elem_reg_20_, 4 +# ori $2,_res_reg_21_,0 + jal write_int +# was: jal write_int, $2 +# ori _tmp_reg_27_,$2,0 +# ori _res_reg_21_,_tmp_reg_27_,0 + sw $2, 0($18) +# was: sw _res_reg_21_, 0(_addr_reg_22_) + addi $18, $18, 4 +# was: addi _addr_reg_22_, _addr_reg_22_, 4 + addi $19, $19, 1 +# was: addi _i_reg_23_, _i_reg_23_, 1 + j _loop_beg_24_ +_loop_end_25_: + ori $2, $17, 0 +# was: ori $2, _write_int_arrres_17_, 0 + addi $29, $29, 28 + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +# Function boo +boo: + sw $31, -4($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -28 +# ori _param_a_29_,$2,0 + ori $4, $0, 5 +# was: ori _plus_L_33_, $0, 5 + ori $3, $0, 3 +# was: ori _plus_R_34_, $0, 3 + add $0, $4, $3 +# was: add _letBind_32_, _plus_L_33_, _plus_R_34_ +# ori _arr_reg_36_,_param_a_29_,0 + lw $17, 0($2) +# was: lw _size_reg_35_, 0(_arr_reg_36_) + ori $16, $28, 0 +# was: ori _letBind_31_, $28, 0 + sll $3, $17, 2 +# was: sll _tmp_45_, _size_reg_35_, 2 + addi $3, $3, 4 +# was: addi _tmp_45_, _tmp_45_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_45_ + sw $17, 0($16) +# was: sw _size_reg_35_, 0(_letBind_31_) + addi $18, $16, 4 +# was: addi _addr_reg_39_, _letBind_31_, 4 + ori $19, $0, 0 +# was: ori _i_reg_40_, $0, 0 + addi $20, $2, 4 +# was: addi _elem_reg_37_, _arr_reg_36_, 4 +_loop_beg_41_: + sub $2, $19, $17 +# was: sub _tmp_reg_43_, _i_reg_40_, _size_reg_35_ + bgez $2, _loop_end_42_ +# was: bgez _tmp_reg_43_, _loop_end_42_ + lw $2, 0($20) +# was: lw _res_reg_38_, 0(_elem_reg_37_) + addi $20, $20, 4 +# was: addi _elem_reg_37_, _elem_reg_37_, 4 +# ori $2,_res_reg_38_,0 + jal plus5 +# was: jal plus5, $2 +# ori _tmp_reg_44_,$2,0 +# ori _res_reg_38_,_tmp_reg_44_,0 + sw $2, 0($18) +# was: sw _res_reg_38_, 0(_addr_reg_39_) + addi $18, $18, 4 +# was: addi _addr_reg_39_, _addr_reg_39_, 4 + addi $19, $19, 1 +# was: addi _i_reg_40_, _i_reg_40_, 1 + j _loop_beg_41_ +_loop_end_42_: + ori $2, $16, 0 +# was: ori _boores_30_, _letBind_31_, 0 +# ori $2,_boores_30_,0 + addi $29, $29, 28 + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +# Function main +main: + sw $31, -4($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -28 + jal getint +# was: jal getint, $2 + ori $3, $2, 0 +# was: ori _letBind_47_, $2, 0 +# ori _size_reg_49_,_letBind_47_,0 + bgez $3, _safe_lab_50_ +# was: bgez _size_reg_49_, _safe_lab_50_ + ori $5, $0, 15 +# was: ori $5, $0, 15 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_50_: + ori $2, $28, 0 +# was: ori _letBind_48_, $28, 0 + sll $4, $3, 2 +# was: sll _tmp_56_, _size_reg_49_, 2 + addi $4, $4, 4 +# was: addi _tmp_56_, _tmp_56_, 4 + add $28, $28, $4 +# was: add $28, $28, _tmp_56_ + sw $3, 0($2) +# was: sw _size_reg_49_, 0(_letBind_48_) + addi $5, $2, 4 +# was: addi _addr_reg_51_, _letBind_48_, 4 + ori $6, $0, 0 +# was: ori _i_reg_52_, $0, 0 +_loop_beg_53_: + sub $4, $6, $3 +# was: sub _tmp_reg_55_, _i_reg_52_, _size_reg_49_ + bgez $4, _loop_end_54_ +# was: bgez _tmp_reg_55_, _loop_end_54_ + sw $6, 0($5) +# was: sw _i_reg_52_, 0(_addr_reg_51_) + addi $5, $5, 4 +# was: addi _addr_reg_51_, _addr_reg_51_, 4 + addi $6, $6, 1 +# was: addi _i_reg_52_, _i_reg_52_, 1 + j _loop_beg_53_ +_loop_end_54_: +# ori _plus_L_59_,_letBind_47_,0 + ori $4, $3, 0 +# was: ori _plus_R_60_, _letBind_47_, 0 + add $0, $3, $4 +# was: add _letBind_58_, _plus_L_59_, _plus_R_60_ + ori $4, $3, 0 +# was: ori _plus_L_63_, _letBind_47_, 0 +# ori _plus_R_64_,_letBind_47_,0 + add $4, $4, $3 +# was: add _plus_L_61_, _plus_L_63_, _plus_R_64_ +# ori _plus_R_62_,_letBind_47_,0 + add $0, $4, $3 +# was: add _letBind_57_, _plus_L_61_, _plus_R_62_ +# ori _arg_66_,_letBind_48_,0 +# ori $2,_arg_66_,0 + jal boo +# was: jal boo, $2 +# ori _letBind_65_,$2,0 +# ori _arr_reg_69_,_letBind_65_,0 + lw $16, 0($2) +# was: lw _size_reg_68_, 0(_arr_reg_69_) + ori $17, $28, 0 +# was: ori _letBind_67_, $28, 0 + sll $3, $16, 2 +# was: sll _tmp_78_, _size_reg_68_, 2 + addi $3, $3, 4 +# was: addi _tmp_78_, _tmp_78_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_78_ + sw $16, 0($17) +# was: sw _size_reg_68_, 0(_letBind_67_) + addi $18, $17, 4 +# was: addi _addr_reg_72_, _letBind_67_, 4 + ori $19, $0, 0 +# was: ori _i_reg_73_, $0, 0 + addi $20, $2, 4 +# was: addi _elem_reg_70_, _arr_reg_69_, 4 +_loop_beg_74_: + sub $2, $19, $16 +# was: sub _tmp_reg_76_, _i_reg_73_, _size_reg_68_ + bgez $2, _loop_end_75_ +# was: bgez _tmp_reg_76_, _loop_end_75_ + lw $2, 0($20) +# was: lw _res_reg_71_, 0(_elem_reg_70_) + addi $20, $20, 4 +# was: addi _elem_reg_70_, _elem_reg_70_, 4 +# ori $2,_res_reg_71_,0 + jal mul2 +# was: jal mul2, $2 +# ori _tmp_reg_77_,$2,0 +# ori _res_reg_71_,_tmp_reg_77_,0 + sw $2, 0($18) +# was: sw _res_reg_71_, 0(_addr_reg_72_) + addi $18, $18, 4 +# was: addi _addr_reg_72_, _addr_reg_72_, 4 + addi $19, $19, 1 +# was: addi _i_reg_73_, _i_reg_73_, 1 + j _loop_beg_74_ +_loop_end_75_: + ori $2, $17, 0 +# was: ori _arg_79_, _letBind_67_, 0 +# ori $2,_arg_79_,0 + jal write_int_arr +# was: jal write_int_arr, $2 +# ori _mainres_46_,$2,0 +# ori $2,_mainres_46_,0 + addi $29, $29, 28 + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/inline_map.fo b/W1/fasto/tests/inline_map.fo new file mode 100644 index 0000000..272eb9a --- /dev/null +++ b/W1/fasto/tests/inline_map.fo @@ -0,0 +1,19 @@ +fun int plus5(int x) = x + 5 + +fun int mul2(int x) = x + x + +fun [int] testcomp([int] x) = write_int_arr(write_int_arr(x)) + +fun int write_int(int x) = write(x) + +fun [int] write_int_arr([int] x) = map(write_int, x) + +fun [int] boo([int] a) = let x = (let y = 5 + 3 in map(plus5, a)) in x + +fun [int] main() = + let N = read(int) in + let z = iota(N) in + let q = (let z = N + N in N + N + N) in + let y = boo(z) in + let w = map(mul2, y) in + write_int_arr(w) diff --git a/W1/fasto/tests/inline_map.in b/W1/fasto/tests/inline_map.in new file mode 100644 index 0000000..e373ee6 --- /dev/null +++ b/W1/fasto/tests/inline_map.in @@ -0,0 +1 @@ +50 diff --git a/W1/fasto/tests/inline_map.out b/W1/fasto/tests/inline_map.out new file mode 100644 index 0000000..b04d56c --- /dev/null +++ b/W1/fasto/tests/inline_map.out @@ -0,0 +1 @@ +10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 diff --git a/W1/fasto/tests/inline_shadow.asm b/W1/fasto/tests/inline_shadow.asm new file mode 100644 index 0000000..29cb61f --- /dev/null +++ b/W1/fasto/tests/inline_shadow.asm @@ -0,0 +1,246 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function zero +zero: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_b_1_,$2,0 +# ori _cond_6_,_param_b_1_,0 + bne $2, $0, _then_3_ +# was: bne _cond_6_, $0, _then_3_ + j _else_4_ +_then_3_: + ori $2, $0, 0 +# was: ori _zerores_2_, $0, 0 + j _endif_5_ +_else_4_: +# ori _arg_7_,_param_b_1_,0 +# ori $2,_arg_7_,0 + jal zero +# was: jal zero, $2 +# ori _zerores_2_,$2,0 +_endif_5_: +# ori $2,_zerores_2_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function main +main: + sw $31, -4($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -16 + ori $16, $0, 4132 +# was: ori _tmp_10_, $0, 4132 +# ori _letBind_9_,_tmp_10_,0 + ori $2, $16, 0 +# was: ori $2, _letBind_9_, 0 + jal putint +# was: jal putint, $2 + ori $2, $0, 1 +# was: ori _arg_14_, $0, 1 +# ori $2,_arg_14_,0 + jal zero +# was: jal zero, $2 + ori $6, $2, 0 +# was: ori _letBind_13_, $2, 0 + ori $2, $0, 1 +# was: ori _plus_L_16_, $0, 1 +# ori _plus_R_17_,_letBind_13_,0 + add $4, $2, $6 +# was: add _letBind_15_, _plus_L_16_, _plus_R_17_ + ori $2, $0, 2 +# was: ori _plus_L_19_, $0, 2 +# ori _plus_R_20_,_letBind_13_,0 + add $2, $2, $6 +# was: add _letBind_18_, _plus_L_19_, _plus_R_20_ + ori $3, $0, 3 +# was: ori _plus_L_22_, $0, 3 +# ori _plus_R_23_,_letBind_13_,0 + add $3, $3, $6 +# was: add _letBind_21_, _plus_L_22_, _plus_R_23_ + ori $5, $0, 4 +# was: ori _plus_L_25_, $0, 4 +# ori _plus_R_26_,_letBind_13_,0 + add $6, $5, $6 +# was: add _letBind_24_, _plus_L_25_, _plus_R_26_ + ori $5, $0, 1000 +# was: ori _mult1_L_33_, $0, 1000 +# ori _mult2_R_34_,_letBind_24_,0 + mul $5, $5, $6 +# was: mul _plus_L_31_, _mult1_L_33_, _mult2_R_34_ + ori $6, $0, 100 +# was: ori _mult1_L_35_, $0, 100 +# ori _mult2_R_36_,_letBind_15_,0 + mul $4, $6, $4 +# was: mul _plus_R_32_, _mult1_L_35_, _mult2_R_36_ + add $5, $5, $4 +# was: add _plus_L_29_, _plus_L_31_, _plus_R_32_ + ori $4, $0, 10 +# was: ori _mult1_L_37_, $0, 10 +# ori _mult2_R_38_,_letBind_21_,0 + mul $3, $4, $3 +# was: mul _plus_R_30_, _mult1_L_37_, _mult2_R_38_ + add $3, $5, $3 +# was: add _plus_L_27_, _plus_L_29_, _plus_R_30_ +# ori _plus_R_28_,_letBind_18_,0 + add $17, $3, $2 +# was: add _tmp_12_, _plus_L_27_, _plus_R_28_ +# ori _letBind_11_,_tmp_12_,0 + ori $2, $17, 0 +# was: ori $2, _letBind_11_, 0 + jal putint +# was: jal putint, $2 + ori $2, $0, 10000 +# was: ori _mult1_L_41_, $0, 10000 +# ori _mult2_R_42_,_letBind_9_,0 + mul $2, $2, $16 +# was: mul _plus_L_39_, _mult1_L_41_, _mult2_R_42_ +# ori _plus_R_40_,_letBind_11_,0 + add $2, $2, $17 +# was: add _mainres_8_, _plus_L_39_, _plus_R_40_ +# ori $2,_mainres_8_,0 + addi $29, $29, 16 + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/inline_shadow.fo b/W1/fasto/tests/inline_shadow.fo new file mode 100644 index 0000000..af856ae --- /dev/null +++ b/W1/fasto/tests/inline_shadow.fo @@ -0,0 +1,15 @@ +fun int f(int a, int b, int c, int d) = 1000*a + 100*b + 10*c + d + +fun int zero(bool b) = if b then 0 else zero(b) + +fun int test(int z) = + let a = 1+z in + let b = 2+z in + let c = 3+z in + let d = 4+z in + f(d,a,c,b) + +fun int main() = + let r1 = write(test(0)) in + let r2 = write(test(zero(true))) in + 10000*r1+r2 \ No newline at end of file diff --git a/W1/fasto/tests/inline_shadow.in b/W1/fasto/tests/inline_shadow.in new file mode 100644 index 0000000..e69de29 diff --git a/W1/fasto/tests/inline_shadow.out b/W1/fasto/tests/inline_shadow.out new file mode 100644 index 0000000..e8ef558 --- /dev/null +++ b/W1/fasto/tests/inline_shadow.out @@ -0,0 +1,2 @@ +4132 +4132 diff --git a/W1/fasto/tests/io_mssp.asm b/W1/fasto/tests/io_mssp.asm new file mode 100644 index 0000000..c89ed87 --- /dev/null +++ b/W1/fasto/tests/io_mssp.asm @@ -0,0 +1,897 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _aaMSSPa_193_ +# was: la _aaMSSPa_193__addr, _aaMSSPa_193_ + ori $3, $0, 18 +# was: ori _aaMSSPa_193__init, $0, 18 + sw $3, 0($4) +# was: sw _aaMSSPa_193__init, 0(_aaMSSPa_193__addr) + la $4, _a__str__33_ +# was: la _a__str__33__addr, _a__str__33_ + ori $3, $0, 1 +# was: ori _a__str__33__init, $0, 1 + sw $3, 0($4) +# was: sw _a__str__33__init, 0(_a__str__33__addr) + la $4, _aa__str_29_ +# was: la _aa__str_29__addr, _aa__str_29_ + ori $3, $0, 2 +# was: ori _aa__str_29__init, $0, 2 + sw $3, 0($4) +# was: sw _aa__str_29__init, 0(_aa__str_29__addr) + la $4, _Introdu_24_ +# was: la _Introdu_24__addr, _Introdu_24_ + ori $3, $0, 17 +# was: ori _Introdu_24__init, $0, 17 + sw $3, 0($4) +# was: sw _Introdu_24__init, 0(_Introdu_24__addr) + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function main +main: + sw $31, -4($29) + sw $21, -28($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -32 + ori $2, $0, 8 +# was: ori _size_reg_3_, $0, 8 + bgez $2, _safe_lab_4_ +# was: bgez _size_reg_3_, _safe_lab_4_ + ori $5, $0, 10 +# was: ori $5, $0, 10 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_4_: + ori $3, $28, 0 +# was: ori _letBind_2_, $28, 0 + sll $4, $2, 2 +# was: sll _tmp_10_, _size_reg_3_, 2 + addi $4, $4, 4 +# was: addi _tmp_10_, _tmp_10_, 4 + add $28, $28, $4 +# was: add $28, $28, _tmp_10_ + sw $2, 0($3) +# was: sw _size_reg_3_, 0(_letBind_2_) + addi $5, $3, 4 +# was: addi _addr_reg_5_, _letBind_2_, 4 + ori $6, $0, 0 +# was: ori _i_reg_6_, $0, 0 +_loop_beg_7_: + sub $4, $6, $2 +# was: sub _tmp_reg_9_, _i_reg_6_, _size_reg_3_ + bgez $4, _loop_end_8_ +# was: bgez _tmp_reg_9_, _loop_end_8_ + sw $6, 0($5) +# was: sw _i_reg_6_, 0(_addr_reg_5_) + addi $5, $5, 4 +# was: addi _addr_reg_5_, _addr_reg_5_, 4 + addi $6, $6, 1 +# was: addi _i_reg_6_, _i_reg_6_, 1 + j _loop_beg_7_ +_loop_end_8_: + ori $2, $3, 0 +# was: ori _arr_reg_13_, _letBind_2_, 0 + lw $16, 0($2) +# was: lw _size_reg_12_, 0(_arr_reg_13_) + ori $17, $28, 0 +# was: ori _letBind_11_, $28, 0 + sll $3, $16, 2 +# was: sll _tmp_34_, _size_reg_12_, 2 + addi $3, $3, 4 +# was: addi _tmp_34_, _tmp_34_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_34_ + sw $16, 0($17) +# was: sw _size_reg_12_, 0(_letBind_11_) + addi $18, $17, 4 +# was: addi _addr_reg_16_, _letBind_11_, 4 + ori $19, $0, 0 +# was: ori _i_reg_17_, $0, 0 + addi $20, $2, 4 +# was: addi _elem_reg_14_, _arr_reg_13_, 4 +_loop_beg_18_: + sub $2, $19, $16 +# was: sub _tmp_reg_20_, _i_reg_17_, _size_reg_12_ + bgez $2, _loop_end_19_ +# was: bgez _tmp_reg_20_, _loop_end_19_ + lw $21, 0($20) +# was: lw _res_reg_15_, 0(_elem_reg_14_) + addi $20, $20, 4 +# was: addi _elem_reg_14_, _elem_reg_14_, 4 + la $2, _Introdu_24_ +# was: la _tmp_23_, _Introdu_24_ +# _Introdu_24_: string "Introduce number " +# ori _letBind_22_,_tmp_23_,0 +# ori $2,_tmp_23_,0 + jal putstring +# was: jal putstring, $2 + ori $2, $21, 0 +# was: ori _tmp_26_, _res_reg_15_, 0 +# ori _letBind_25_,_tmp_26_,0 +# ori $2,_letBind_25_,0 + jal putint +# was: jal putint, $2 + la $2, _aa__str_29_ +# was: la _tmp_28_, _aa__str_29_ +# _aa__str_29_: string ": " +# ori _letBind_27_,_tmp_28_,0 +# ori $2,_tmp_28_,0 + jal putstring +# was: jal putstring, $2 + jal getint +# was: jal getint, $2 + ori $21, $2, 0 +# was: ori _letBind_30_, $2, 0 + la $2, _a__str__33_ +# was: la _tmp_32_, _a__str__33_ +# _a__str__33_: string "\n" +# ori _letBind_31_,_tmp_32_,0 +# ori $2,_tmp_32_,0 + jal putstring +# was: jal putstring, $2 +# ori _fun_arg_res_21_,_letBind_30_,0 +# ori _res_reg_15_,_fun_arg_res_21_,0 + sw $21, 0($18) +# was: sw _res_reg_15_, 0(_addr_reg_16_) + addi $18, $18, 4 +# was: addi _addr_reg_16_, _addr_reg_16_, 4 + addi $19, $19, 1 +# was: addi _i_reg_17_, _i_reg_17_, 1 + j _loop_beg_18_ +_loop_end_19_: +# ori _arr_reg_37_,_letBind_11_,0 + lw $6, 0($17) +# was: lw _size_reg_36_, 0(_arr_reg_37_) + ori $5, $28, 0 +# was: ori _letBind_35_, $28, 0 + sll $2, $6, 2 +# was: sll _tmp_57_, _size_reg_36_, 2 + addi $2, $2, 4 +# was: addi _tmp_57_, _tmp_57_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_57_ + sw $6, 0($5) +# was: sw _size_reg_36_, 0(_letBind_35_) + addi $8, $5, 4 +# was: addi _addr_reg_40_, _letBind_35_, 4 + ori $7, $0, 0 +# was: ori _i_reg_41_, $0, 0 + addi $9, $17, 4 +# was: addi _elem_reg_38_, _arr_reg_37_, 4 +_loop_beg_42_: + sub $2, $7, $6 +# was: sub _tmp_reg_44_, _i_reg_41_, _size_reg_36_ + bgez $2, _loop_end_43_ +# was: bgez _tmp_reg_44_, _loop_end_43_ + lw $10, 0($9) +# was: lw _res_reg_39_, 0(_elem_reg_38_) + addi $9, $9, 4 +# was: addi _elem_reg_38_, _elem_reg_38_, 4 +# ori _lt_L_51_,_res_reg_39_,0 + ori $2, $0, 0 +# was: ori _lt_R_52_, $0, 0 + slt $2, $10, $2 +# was: slt _cond_50_, _lt_L_51_, _lt_R_52_ + bne $2, $0, _then_47_ +# was: bne _cond_50_, $0, _then_47_ + j _else_48_ +_then_47_: + ori $4, $0, 0 +# was: ori _letBind_46_, $0, 0 + j _endif_49_ +_else_48_: + ori $4, $10, 0 +# was: ori _letBind_46_, _res_reg_39_, 0 +_endif_49_: + ori $11, $0, 4 +# was: ori _size_reg_53_, $0, 4 + ori $3, $28, 0 +# was: ori _fun_arg_res_45_, $28, 0 + sll $2, $11, 2 +# was: sll _tmp_56_, _size_reg_53_, 2 + addi $2, $2, 4 +# was: addi _tmp_56_, _tmp_56_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_56_ + sw $11, 0($3) +# was: sw _size_reg_53_, 0(_fun_arg_res_45_) + addi $2, $3, 4 +# was: addi _addr_reg_54_, _fun_arg_res_45_, 4 +# ori _tmp_reg_55_,_letBind_46_,0 + sw $4, 0($2) +# was: sw _tmp_reg_55_, 0(_addr_reg_54_) + addi $2, $2, 4 +# was: addi _addr_reg_54_, _addr_reg_54_, 4 +# ori _tmp_reg_55_,_letBind_46_,0 + sw $4, 0($2) +# was: sw _tmp_reg_55_, 0(_addr_reg_54_) + addi $2, $2, 4 +# was: addi _addr_reg_54_, _addr_reg_54_, 4 +# ori _tmp_reg_55_,_letBind_46_,0 + sw $4, 0($2) +# was: sw _tmp_reg_55_, 0(_addr_reg_54_) + addi $2, $2, 4 +# was: addi _addr_reg_54_, _addr_reg_54_, 4 + ori $4, $10, 0 +# was: ori _tmp_reg_55_, _res_reg_39_, 0 + sw $4, 0($2) +# was: sw _tmp_reg_55_, 0(_addr_reg_54_) + addi $2, $2, 4 +# was: addi _addr_reg_54_, _addr_reg_54_, 4 + ori $10, $3, 0 +# was: ori _res_reg_39_, _fun_arg_res_45_, 0 + sw $10, 0($8) +# was: sw _res_reg_39_, 0(_addr_reg_40_) + addi $8, $8, 4 +# was: addi _addr_reg_40_, _addr_reg_40_, 4 + addi $7, $7, 1 +# was: addi _i_reg_41_, _i_reg_41_, 1 + j _loop_beg_42_ +_loop_end_43_: + ori $2, $0, 4 +# was: ori _size_reg_59_, $0, 4 + ori $16, $28, 0 +# was: ori _letBind_58_, $28, 0 + sll $3, $2, 2 +# was: sll _tmp_62_, _size_reg_59_, 2 + addi $3, $3, 4 +# was: addi _tmp_62_, _tmp_62_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_62_ + sw $2, 0($16) +# was: sw _size_reg_59_, 0(_letBind_58_) + addi $2, $16, 4 +# was: addi _addr_reg_60_, _letBind_58_, 4 + ori $3, $0, 0 +# was: ori _tmp_reg_61_, $0, 0 + sw $3, 0($2) +# was: sw _tmp_reg_61_, 0(_addr_reg_60_) + addi $2, $2, 4 +# was: addi _addr_reg_60_, _addr_reg_60_, 4 + ori $3, $0, 0 +# was: ori _tmp_reg_61_, $0, 0 + sw $3, 0($2) +# was: sw _tmp_reg_61_, 0(_addr_reg_60_) + addi $2, $2, 4 +# was: addi _addr_reg_60_, _addr_reg_60_, 4 + ori $3, $0, 0 +# was: ori _tmp_reg_61_, $0, 0 + sw $3, 0($2) +# was: sw _tmp_reg_61_, 0(_addr_reg_60_) + addi $2, $2, 4 +# was: addi _addr_reg_60_, _addr_reg_60_, 4 + ori $3, $0, 0 +# was: ori _tmp_reg_61_, $0, 0 + sw $3, 0($2) +# was: sw _tmp_reg_61_, 0(_addr_reg_60_) + addi $2, $2, 4 +# was: addi _addr_reg_60_, _addr_reg_60_, 4 + ori $3, $5, 0 +# was: ori _arr_reg_64_, _letBind_35_, 0 + lw $2, 0($3) +# was: lw _size_reg_65_, 0(_arr_reg_64_) +# ori _letBind_63_,_letBind_58_,0 + addi $3, $3, 4 +# was: addi _arr_reg_64_, _arr_reg_64_, 4 + ori $4, $0, 0 +# was: ori _ind_var_66_, $0, 0 +_loop_beg_68_: + sub $6, $4, $2 +# was: sub _tmp_reg_67_, _ind_var_66_, _size_reg_65_ + bgez $6, _loop_end_69_ +# was: bgez _tmp_reg_67_, _loop_end_69_ + lw $6, 0($3) +# was: lw _tmp_reg_67_, 0(_arr_reg_64_) + addi $3, $3, 4 +# was: addi _arr_reg_64_, _arr_reg_64_, 4 + ori $5, $0, 0 +# was: ori _arr_ind_72_, $0, 0 + addi $7, $16, 4 +# was: addi _arr_reg_73_, _letBind_63_, 4 + lw $8, 0($16) +# was: lw _size_reg_74_, 0(_letBind_63_) + bgez $5, _safe_lab_77_ +# was: bgez _arr_ind_72_, _safe_lab_77_ +_error_lab_76_: + ori $5, $0, 28 +# was: ori $5, $0, 28 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_77_: + sub $8, $5, $8 +# was: sub _tmp_reg_75_, _arr_ind_72_, _size_reg_74_ + bgez $8, _error_lab_76_ +# was: bgez _tmp_reg_75_, _error_lab_76_ + sll $5, $5, 2 +# was: sll _arr_ind_72_, _arr_ind_72_, 2 + add $7, $7, $5 +# was: add _arr_reg_73_, _arr_reg_73_, _arr_ind_72_ + lw $9, 0($7) +# was: lw _letBind_71_, 0(_arr_reg_73_) + ori $7, $0, 0 +# was: ori _arr_ind_79_, $0, 0 + addi $5, $6, 4 +# was: addi _arr_reg_80_, _tmp_reg_67_, 4 + lw $8, 0($6) +# was: lw _size_reg_81_, 0(_tmp_reg_67_) + bgez $7, _safe_lab_84_ +# was: bgez _arr_ind_79_, _safe_lab_84_ +_error_lab_83_: + ori $5, $0, 28 +# was: ori $5, $0, 28 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_84_: + sub $8, $7, $8 +# was: sub _tmp_reg_82_, _arr_ind_79_, _size_reg_81_ + bgez $8, _error_lab_83_ +# was: bgez _tmp_reg_82_, _error_lab_83_ + sll $7, $7, 2 +# was: sll _arr_ind_79_, _arr_ind_79_, 2 + add $5, $5, $7 +# was: add _arr_reg_80_, _arr_reg_80_, _arr_ind_79_ + lw $5, 0($5) +# was: lw _letBind_78_, 0(_arr_reg_80_) +# ori _lt_L_90_,_letBind_71_,0 +# ori _lt_R_91_,_letBind_78_,0 + slt $7, $9, $5 +# was: slt _cond_89_, _lt_L_90_, _lt_R_91_ + bne $7, $0, _then_86_ +# was: bne _cond_89_, $0, _then_86_ + j _else_87_ +_then_86_: + ori $9, $5, 0 +# was: ori _letBind_85_, _letBind_78_, 0 + j _endif_88_ +_else_87_: +# ori _letBind_85_,_letBind_71_,0 +_endif_88_: + ori $5, $0, 2 +# was: ori _arr_ind_95_, $0, 2 + addi $7, $16, 4 +# was: addi _arr_reg_96_, _letBind_63_, 4 + lw $8, 0($16) +# was: lw _size_reg_97_, 0(_letBind_63_) + bgez $5, _safe_lab_100_ +# was: bgez _arr_ind_95_, _safe_lab_100_ +_error_lab_99_: + ori $5, $0, 28 +# was: ori $5, $0, 28 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_100_: + sub $8, $5, $8 +# was: sub _tmp_reg_98_, _arr_ind_95_, _size_reg_97_ + bgez $8, _error_lab_99_ +# was: bgez _tmp_reg_98_, _error_lab_99_ + sll $5, $5, 2 +# was: sll _arr_ind_95_, _arr_ind_95_, 2 + add $7, $7, $5 +# was: add _arr_reg_96_, _arr_reg_96_, _arr_ind_95_ + lw $8, 0($7) +# was: lw _plus_L_93_, 0(_arr_reg_96_) + ori $5, $0, 1 +# was: ori _arr_ind_101_, $0, 1 + addi $7, $6, 4 +# was: addi _arr_reg_102_, _tmp_reg_67_, 4 + lw $10, 0($6) +# was: lw _size_reg_103_, 0(_tmp_reg_67_) + bgez $5, _safe_lab_106_ +# was: bgez _arr_ind_101_, _safe_lab_106_ +_error_lab_105_: + ori $5, $0, 28 +# was: ori $5, $0, 28 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_106_: + sub $10, $5, $10 +# was: sub _tmp_reg_104_, _arr_ind_101_, _size_reg_103_ + bgez $10, _error_lab_105_ +# was: bgez _tmp_reg_104_, _error_lab_105_ + sll $5, $5, 2 +# was: sll _arr_ind_101_, _arr_ind_101_, 2 + add $7, $7, $5 +# was: add _arr_reg_102_, _arr_reg_102_, _arr_ind_101_ + lw $5, 0($7) +# was: lw _plus_R_94_, 0(_arr_reg_102_) + add $5, $8, $5 +# was: add _letBind_92_, _plus_L_93_, _plus_R_94_ +# ori _lt_L_112_,_letBind_85_,0 +# ori _lt_R_113_,_letBind_92_,0 + slt $7, $9, $5 +# was: slt _cond_111_, _lt_L_112_, _lt_R_113_ + bne $7, $0, _then_108_ +# was: bne _cond_111_, $0, _then_108_ + j _else_109_ +_then_108_: +# ori _letBind_107_,_letBind_92_,0 + j _endif_110_ +_else_109_: + ori $5, $9, 0 +# was: ori _letBind_107_, _letBind_85_, 0 +_endif_110_: + ori $7, $0, 1 +# was: ori _arr_ind_115_, $0, 1 + addi $8, $16, 4 +# was: addi _arr_reg_116_, _letBind_63_, 4 + lw $9, 0($16) +# was: lw _size_reg_117_, 0(_letBind_63_) + bgez $7, _safe_lab_120_ +# was: bgez _arr_ind_115_, _safe_lab_120_ +_error_lab_119_: + ori $5, $0, 29 +# was: ori $5, $0, 29 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_120_: + sub $9, $7, $9 +# was: sub _tmp_reg_118_, _arr_ind_115_, _size_reg_117_ + bgez $9, _error_lab_119_ +# was: bgez _tmp_reg_118_, _error_lab_119_ + sll $7, $7, 2 +# was: sll _arr_ind_115_, _arr_ind_115_, 2 + add $8, $8, $7 +# was: add _arr_reg_116_, _arr_reg_116_, _arr_ind_115_ + lw $7, 0($8) +# was: lw _letBind_114_, 0(_arr_reg_116_) + ori $9, $0, 3 +# was: ori _arr_ind_124_, $0, 3 + addi $10, $16, 4 +# was: addi _arr_reg_125_, _letBind_63_, 4 + lw $8, 0($16) +# was: lw _size_reg_126_, 0(_letBind_63_) + bgez $9, _safe_lab_129_ +# was: bgez _arr_ind_124_, _safe_lab_129_ +_error_lab_128_: + ori $5, $0, 29 +# was: ori $5, $0, 29 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_129_: + sub $8, $9, $8 +# was: sub _tmp_reg_127_, _arr_ind_124_, _size_reg_126_ + bgez $8, _error_lab_128_ +# was: bgez _tmp_reg_127_, _error_lab_128_ + sll $9, $9, 2 +# was: sll _arr_ind_124_, _arr_ind_124_, 2 + add $10, $10, $9 +# was: add _arr_reg_125_, _arr_reg_125_, _arr_ind_124_ + lw $9, 0($10) +# was: lw _plus_L_122_, 0(_arr_reg_125_) + ori $8, $0, 1 +# was: ori _arr_ind_130_, $0, 1 + addi $10, $6, 4 +# was: addi _arr_reg_131_, _tmp_reg_67_, 4 + lw $11, 0($6) +# was: lw _size_reg_132_, 0(_tmp_reg_67_) + bgez $8, _safe_lab_135_ +# was: bgez _arr_ind_130_, _safe_lab_135_ +_error_lab_134_: + ori $5, $0, 29 +# was: ori $5, $0, 29 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_135_: + sub $11, $8, $11 +# was: sub _tmp_reg_133_, _arr_ind_130_, _size_reg_132_ + bgez $11, _error_lab_134_ +# was: bgez _tmp_reg_133_, _error_lab_134_ + sll $8, $8, 2 +# was: sll _arr_ind_130_, _arr_ind_130_, 2 + add $10, $10, $8 +# was: add _arr_reg_131_, _arr_reg_131_, _arr_ind_130_ + lw $8, 0($10) +# was: lw _plus_R_123_, 0(_arr_reg_131_) + add $8, $9, $8 +# was: add _letBind_121_, _plus_L_122_, _plus_R_123_ +# ori _lt_L_141_,_letBind_114_,0 +# ori _lt_R_142_,_letBind_121_,0 + slt $9, $7, $8 +# was: slt _cond_140_, _lt_L_141_, _lt_R_142_ + bne $9, $0, _then_137_ +# was: bne _cond_140_, $0, _then_137_ + j _else_138_ +_then_137_: + ori $7, $8, 0 +# was: ori _letBind_136_, _letBind_121_, 0 + j _endif_139_ +_else_138_: +# ori _letBind_136_,_letBind_114_,0 +_endif_139_: + ori $8, $0, 2 +# was: ori _arr_ind_146_, $0, 2 + addi $9, $16, 4 +# was: addi _arr_reg_147_, _letBind_63_, 4 + lw $10, 0($16) +# was: lw _size_reg_148_, 0(_letBind_63_) + bgez $8, _safe_lab_151_ +# was: bgez _arr_ind_146_, _safe_lab_151_ +_error_lab_150_: + ori $5, $0, 30 +# was: ori $5, $0, 30 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_151_: + sub $10, $8, $10 +# was: sub _tmp_reg_149_, _arr_ind_146_, _size_reg_148_ + bgez $10, _error_lab_150_ +# was: bgez _tmp_reg_149_, _error_lab_150_ + sll $8, $8, 2 +# was: sll _arr_ind_146_, _arr_ind_146_, 2 + add $9, $9, $8 +# was: add _arr_reg_147_, _arr_reg_147_, _arr_ind_146_ + lw $8, 0($9) +# was: lw _plus_L_144_, 0(_arr_reg_147_) + ori $9, $0, 3 +# was: ori _arr_ind_152_, $0, 3 + addi $10, $6, 4 +# was: addi _arr_reg_153_, _tmp_reg_67_, 4 + lw $11, 0($6) +# was: lw _size_reg_154_, 0(_tmp_reg_67_) + bgez $9, _safe_lab_157_ +# was: bgez _arr_ind_152_, _safe_lab_157_ +_error_lab_156_: + ori $5, $0, 30 +# was: ori $5, $0, 30 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_157_: + sub $11, $9, $11 +# was: sub _tmp_reg_155_, _arr_ind_152_, _size_reg_154_ + bgez $11, _error_lab_156_ +# was: bgez _tmp_reg_155_, _error_lab_156_ + sll $9, $9, 2 +# was: sll _arr_ind_152_, _arr_ind_152_, 2 + add $10, $10, $9 +# was: add _arr_reg_153_, _arr_reg_153_, _arr_ind_152_ + lw $9, 0($10) +# was: lw _plus_R_145_, 0(_arr_reg_153_) + add $8, $8, $9 +# was: add _letBind_143_, _plus_L_144_, _plus_R_145_ + ori $9, $0, 2 +# was: ori _arr_ind_159_, $0, 2 + addi $10, $6, 4 +# was: addi _arr_reg_160_, _tmp_reg_67_, 4 + lw $11, 0($6) +# was: lw _size_reg_161_, 0(_tmp_reg_67_) + bgez $9, _safe_lab_164_ +# was: bgez _arr_ind_159_, _safe_lab_164_ +_error_lab_163_: + ori $5, $0, 30 +# was: ori $5, $0, 30 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_164_: + sub $11, $9, $11 +# was: sub _tmp_reg_162_, _arr_ind_159_, _size_reg_161_ + bgez $11, _error_lab_163_ +# was: bgez _tmp_reg_162_, _error_lab_163_ + sll $9, $9, 2 +# was: sll _arr_ind_159_, _arr_ind_159_, 2 + add $10, $10, $9 +# was: add _arr_reg_160_, _arr_reg_160_, _arr_ind_159_ + lw $9, 0($10) +# was: lw _letBind_158_, 0(_arr_reg_160_) +# ori _lt_L_170_,_letBind_143_,0 +# ori _lt_R_171_,_letBind_158_,0 + slt $10, $8, $9 +# was: slt _cond_169_, _lt_L_170_, _lt_R_171_ + bne $10, $0, _then_166_ +# was: bne _cond_169_, $0, _then_166_ + j _else_167_ +_then_166_: + ori $8, $9, 0 +# was: ori _letBind_165_, _letBind_158_, 0 + j _endif_168_ +_else_167_: +# ori _letBind_165_,_letBind_143_,0 +_endif_168_: + ori $10, $0, 3 +# was: ori _arr_ind_175_, $0, 3 + addi $9, $16, 4 +# was: addi _arr_reg_176_, _letBind_63_, 4 + lw $11, 0($16) +# was: lw _size_reg_177_, 0(_letBind_63_) + bgez $10, _safe_lab_180_ +# was: bgez _arr_ind_175_, _safe_lab_180_ +_error_lab_179_: + ori $5, $0, 31 +# was: ori $5, $0, 31 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_180_: + sub $11, $10, $11 +# was: sub _tmp_reg_178_, _arr_ind_175_, _size_reg_177_ + bgez $11, _error_lab_179_ +# was: bgez _tmp_reg_178_, _error_lab_179_ + sll $10, $10, 2 +# was: sll _arr_ind_175_, _arr_ind_175_, 2 + add $9, $9, $10 +# was: add _arr_reg_176_, _arr_reg_176_, _arr_ind_175_ + lw $11, 0($9) +# was: lw _plus_L_173_, 0(_arr_reg_176_) + ori $9, $0, 3 +# was: ori _arr_ind_181_, $0, 3 + addi $10, $6, 4 +# was: addi _arr_reg_182_, _tmp_reg_67_, 4 + lw $6, 0($6) +# was: lw _size_reg_183_, 0(_tmp_reg_67_) + bgez $9, _safe_lab_186_ +# was: bgez _arr_ind_181_, _safe_lab_186_ +_error_lab_185_: + ori $5, $0, 31 +# was: ori $5, $0, 31 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_186_: + sub $6, $9, $6 +# was: sub _tmp_reg_184_, _arr_ind_181_, _size_reg_183_ + bgez $6, _error_lab_185_ +# was: bgez _tmp_reg_184_, _error_lab_185_ + sll $9, $9, 2 +# was: sll _arr_ind_181_, _arr_ind_181_, 2 + add $10, $10, $9 +# was: add _arr_reg_182_, _arr_reg_182_, _arr_ind_181_ + lw $6, 0($10) +# was: lw _plus_R_174_, 0(_arr_reg_182_) + add $9, $11, $6 +# was: add _letBind_172_, _plus_L_173_, _plus_R_174_ + ori $10, $0, 4 +# was: ori _size_reg_187_, $0, 4 + ori $16, $28, 0 +# was: ori _fun_arg_res_70_, $28, 0 + sll $6, $10, 2 +# was: sll _tmp_190_, _size_reg_187_, 2 + addi $6, $6, 4 +# was: addi _tmp_190_, _tmp_190_, 4 + add $28, $28, $6 +# was: add $28, $28, _tmp_190_ + sw $10, 0($16) +# was: sw _size_reg_187_, 0(_fun_arg_res_70_) + addi $6, $16, 4 +# was: addi _addr_reg_188_, _fun_arg_res_70_, 4 +# ori _tmp_reg_189_,_letBind_107_,0 + sw $5, 0($6) +# was: sw _tmp_reg_189_, 0(_addr_reg_188_) + addi $6, $6, 4 +# was: addi _addr_reg_188_, _addr_reg_188_, 4 + ori $5, $7, 0 +# was: ori _tmp_reg_189_, _letBind_136_, 0 + sw $5, 0($6) +# was: sw _tmp_reg_189_, 0(_addr_reg_188_) + addi $6, $6, 4 +# was: addi _addr_reg_188_, _addr_reg_188_, 4 + ori $5, $8, 0 +# was: ori _tmp_reg_189_, _letBind_165_, 0 + sw $5, 0($6) +# was: sw _tmp_reg_189_, 0(_addr_reg_188_) + addi $6, $6, 4 +# was: addi _addr_reg_188_, _addr_reg_188_, 4 + ori $5, $9, 0 +# was: ori _tmp_reg_189_, _letBind_172_, 0 + sw $5, 0($6) +# was: sw _tmp_reg_189_, 0(_addr_reg_188_) + addi $6, $6, 4 +# was: addi _addr_reg_188_, _addr_reg_188_, 4 +# ori _letBind_63_,_fun_arg_res_70_,0 + addi $4, $4, 1 +# was: addi _ind_var_66_, _ind_var_66_, 1 + j _loop_beg_68_ +_loop_end_69_: + la $2, _aaMSSPa_193_ +# was: la _tmp_192_, _aaMSSPa_193_ +# _aaMSSPa_193_: string "\n\nMSSP result is: " +# ori _letBind_191_,_tmp_192_,0 +# ori $2,_tmp_192_,0 + jal putstring +# was: jal putstring, $2 + ori $3, $0, 0 +# was: ori _arr_ind_195_, $0, 0 + addi $2, $16, 4 +# was: addi _arr_reg_196_, _letBind_63_, 4 + lw $4, 0($16) +# was: lw _size_reg_197_, 0(_letBind_63_) + bgez $3, _safe_lab_200_ +# was: bgez _arr_ind_195_, _safe_lab_200_ +_error_lab_199_: + ori $5, $0, 44 +# was: ori $5, $0, 44 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_200_: + sub $4, $3, $4 +# was: sub _tmp_reg_198_, _arr_ind_195_, _size_reg_197_ + bgez $4, _error_lab_199_ +# was: bgez _tmp_reg_198_, _error_lab_199_ + sll $3, $3, 2 +# was: sll _arr_ind_195_, _arr_ind_195_, 2 + add $2, $2, $3 +# was: add _arr_reg_196_, _arr_reg_196_, _arr_ind_195_ + lw $16, 0($2) +# was: lw _tmp_194_, 0(_arr_reg_196_) +# ori _mainres_1_,_tmp_194_,0 + ori $2, $16, 0 +# was: ori $2, _mainres_1_, 0 + jal putint +# was: jal putint, $2 + ori $2, $16, 0 +# was: ori $2, _mainres_1_, 0 + addi $29, $29, 32 + lw $21, -28($29) + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_aaMSSPa_193_: + .space 4 + .asciiz "\n\nMSSP result is: " + .align 2 +_a__str__33_: + .space 4 + .asciiz "\n" + .align 2 +_aa__str_29_: + .space 4 + .asciiz ": " + .align 2 +_Introdu_24_: + .space 4 + .asciiz "Introduce number " + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/io_mssp.fo b/W1/fasto/tests/io_mssp.fo new file mode 100644 index 0000000..24d7a5b --- /dev/null +++ b/W1/fasto/tests/io_mssp.fo @@ -0,0 +1,44 @@ +fun int read_int(int i) = + let t = write("Introduce number ") in + let t = write(i) in + let t = write(": ") in + let m = read(int) in + let t = write("\n") in + m + +fun [int] read_int_arr(int n) = + let itsp = iota(n) in + map(read_int, itsp) + +fun int write_int(int i) = write(i) + +fun bool write_int_arr([int] arr) = + let a = write(" { ") in + let v = map(write_int, arr) in + let a = write(" }\n") in + true + +fun int max(int x, int y) = if (x < y) then y else x + +fun [int] mapper(int x) = + let xm = max(x, 0) in + {xm, xm, xm, x} + +fun [int] reducer([int] a, [int] b) = + let mss = max(max(a[0], b[0]), a[2] + b[1]) in + let mis = max(a[1], a[3] + b[1]) in + let mcs = max(a[2] + b[3], b[2]) in + let ts = a[3] + b[3] + in {mss, mis, mcs, ts} + +fun [int] mssp(int n) = + let in_arr = read_int_arr(n) in + // let inarr = {1, 0 - 2, 3, 4, 0 - 1, 5, 0 - 6, 1} in + let map_arr = map(mapper, in_arr) in + let ne = {0, 0, 0, 0} + in reduce(reducer, ne, map_arr) + +fun int main() = + let arr = mssp(8) in + let t = write("\n\nMSSP result is: ") in + write(arr[0]) diff --git a/W1/fasto/tests/io_mssp.in b/W1/fasto/tests/io_mssp.in new file mode 100644 index 0000000..8619a34 --- /dev/null +++ b/W1/fasto/tests/io_mssp.in @@ -0,0 +1,8 @@ +1 +-2 +3 +4 +-1 +5 +-6 +1 diff --git a/W1/fasto/tests/io_mssp.out b/W1/fasto/tests/io_mssp.out new file mode 100644 index 0000000..271e28a --- /dev/null +++ b/W1/fasto/tests/io_mssp.out @@ -0,0 +1,11 @@ +Introduce number 0 : +Introduce number 1 : +Introduce number 2 : +Introduce number 3 : +Introduce number 4 : +Introduce number 5 : +Introduce number 6 : +Introduce number 7 : + + +MSSP result is: 11 diff --git a/W1/fasto/tests/iota.asm b/W1/fasto/tests/iota.asm new file mode 100644 index 0000000..dd71444 --- /dev/null +++ b/W1/fasto/tests/iota.asm @@ -0,0 +1,393 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function main +main: + sw $31, -4($29) + sw $16, -8($29) + addi $29, $29, -12 + ori $2, $0, 7 +# was: ori _size_reg_3_, $0, 7 + bgez $2, _safe_lab_4_ +# was: bgez _size_reg_3_, _safe_lab_4_ + ori $5, $0, 2 +# was: ori $5, $0, 2 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_4_: + ori $16, $28, 0 +# was: ori _letBind_2_, $28, 0 + sll $3, $2, 2 +# was: sll _tmp_10_, _size_reg_3_, 2 + addi $3, $3, 4 +# was: addi _tmp_10_, _tmp_10_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_10_ + sw $2, 0($16) +# was: sw _size_reg_3_, 0(_letBind_2_) + addi $4, $16, 4 +# was: addi _addr_reg_5_, _letBind_2_, 4 + ori $3, $0, 0 +# was: ori _i_reg_6_, $0, 0 +_loop_beg_7_: + sub $5, $3, $2 +# was: sub _tmp_reg_9_, _i_reg_6_, _size_reg_3_ + bgez $5, _loop_end_8_ +# was: bgez _tmp_reg_9_, _loop_end_8_ + sw $3, 0($4) +# was: sw _i_reg_6_, 0(_addr_reg_5_) + addi $4, $4, 4 +# was: addi _addr_reg_5_, _addr_reg_5_, 4 + addi $3, $3, 1 +# was: addi _i_reg_6_, _i_reg_6_, 1 + j _loop_beg_7_ +_loop_end_8_: + ori $2, $0, 0 +# was: ori _arr_ind_13_, $0, 0 + addi $3, $16, 4 +# was: addi _arr_reg_14_, _letBind_2_, 4 + lw $4, 0($16) +# was: lw _size_reg_15_, 0(_letBind_2_) + bgez $2, _safe_lab_18_ +# was: bgez _arr_ind_13_, _safe_lab_18_ +_error_lab_17_: + ori $5, $0, 3 +# was: ori $5, $0, 3 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_18_: + sub $4, $2, $4 +# was: sub _tmp_reg_16_, _arr_ind_13_, _size_reg_15_ + bgez $4, _error_lab_17_ +# was: bgez _tmp_reg_16_, _error_lab_17_ + sll $2, $2, 2 +# was: sll _arr_ind_13_, _arr_ind_13_, 2 + add $3, $3, $2 +# was: add _arr_reg_14_, _arr_reg_14_, _arr_ind_13_ + lw $2, 0($3) +# was: lw _tmp_12_, 0(_arr_reg_14_) +# ori _letBind_11_,_tmp_12_,0 +# ori $2,_letBind_11_,0 + jal putint +# was: jal putint, $2 + ori $3, $0, 1 +# was: ori _arr_ind_21_, $0, 1 + addi $2, $16, 4 +# was: addi _arr_reg_22_, _letBind_2_, 4 + lw $4, 0($16) +# was: lw _size_reg_23_, 0(_letBind_2_) + bgez $3, _safe_lab_26_ +# was: bgez _arr_ind_21_, _safe_lab_26_ +_error_lab_25_: + ori $5, $0, 4 +# was: ori $5, $0, 4 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_26_: + sub $4, $3, $4 +# was: sub _tmp_reg_24_, _arr_ind_21_, _size_reg_23_ + bgez $4, _error_lab_25_ +# was: bgez _tmp_reg_24_, _error_lab_25_ + sll $3, $3, 2 +# was: sll _arr_ind_21_, _arr_ind_21_, 2 + add $2, $2, $3 +# was: add _arr_reg_22_, _arr_reg_22_, _arr_ind_21_ + lw $2, 0($2) +# was: lw _tmp_20_, 0(_arr_reg_22_) +# ori _letBind_19_,_tmp_20_,0 +# ori $2,_letBind_19_,0 + jal putint +# was: jal putint, $2 + ori $2, $0, 2 +# was: ori _arr_ind_29_, $0, 2 + addi $3, $16, 4 +# was: addi _arr_reg_30_, _letBind_2_, 4 + lw $4, 0($16) +# was: lw _size_reg_31_, 0(_letBind_2_) + bgez $2, _safe_lab_34_ +# was: bgez _arr_ind_29_, _safe_lab_34_ +_error_lab_33_: + ori $5, $0, 5 +# was: ori $5, $0, 5 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_34_: + sub $4, $2, $4 +# was: sub _tmp_reg_32_, _arr_ind_29_, _size_reg_31_ + bgez $4, _error_lab_33_ +# was: bgez _tmp_reg_32_, _error_lab_33_ + sll $2, $2, 2 +# was: sll _arr_ind_29_, _arr_ind_29_, 2 + add $3, $3, $2 +# was: add _arr_reg_30_, _arr_reg_30_, _arr_ind_29_ + lw $2, 0($3) +# was: lw _tmp_28_, 0(_arr_reg_30_) +# ori _letBind_27_,_tmp_28_,0 +# ori $2,_letBind_27_,0 + jal putint +# was: jal putint, $2 + ori $2, $0, 3 +# was: ori _arr_ind_37_, $0, 3 + addi $3, $16, 4 +# was: addi _arr_reg_38_, _letBind_2_, 4 + lw $4, 0($16) +# was: lw _size_reg_39_, 0(_letBind_2_) + bgez $2, _safe_lab_42_ +# was: bgez _arr_ind_37_, _safe_lab_42_ +_error_lab_41_: + ori $5, $0, 6 +# was: ori $5, $0, 6 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_42_: + sub $4, $2, $4 +# was: sub _tmp_reg_40_, _arr_ind_37_, _size_reg_39_ + bgez $4, _error_lab_41_ +# was: bgez _tmp_reg_40_, _error_lab_41_ + sll $2, $2, 2 +# was: sll _arr_ind_37_, _arr_ind_37_, 2 + add $3, $3, $2 +# was: add _arr_reg_38_, _arr_reg_38_, _arr_ind_37_ + lw $2, 0($3) +# was: lw _tmp_36_, 0(_arr_reg_38_) +# ori _letBind_35_,_tmp_36_,0 +# ori $2,_letBind_35_,0 + jal putint +# was: jal putint, $2 + ori $2, $0, 4 +# was: ori _arr_ind_45_, $0, 4 + addi $3, $16, 4 +# was: addi _arr_reg_46_, _letBind_2_, 4 + lw $4, 0($16) +# was: lw _size_reg_47_, 0(_letBind_2_) + bgez $2, _safe_lab_50_ +# was: bgez _arr_ind_45_, _safe_lab_50_ +_error_lab_49_: + ori $5, $0, 7 +# was: ori $5, $0, 7 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_50_: + sub $4, $2, $4 +# was: sub _tmp_reg_48_, _arr_ind_45_, _size_reg_47_ + bgez $4, _error_lab_49_ +# was: bgez _tmp_reg_48_, _error_lab_49_ + sll $2, $2, 2 +# was: sll _arr_ind_45_, _arr_ind_45_, 2 + add $3, $3, $2 +# was: add _arr_reg_46_, _arr_reg_46_, _arr_ind_45_ + lw $2, 0($3) +# was: lw _tmp_44_, 0(_arr_reg_46_) +# ori _letBind_43_,_tmp_44_,0 +# ori $2,_letBind_43_,0 + jal putint +# was: jal putint, $2 + ori $2, $0, 5 +# was: ori _arr_ind_53_, $0, 5 + addi $3, $16, 4 +# was: addi _arr_reg_54_, _letBind_2_, 4 + lw $4, 0($16) +# was: lw _size_reg_55_, 0(_letBind_2_) + bgez $2, _safe_lab_58_ +# was: bgez _arr_ind_53_, _safe_lab_58_ +_error_lab_57_: + ori $5, $0, 8 +# was: ori $5, $0, 8 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_58_: + sub $4, $2, $4 +# was: sub _tmp_reg_56_, _arr_ind_53_, _size_reg_55_ + bgez $4, _error_lab_57_ +# was: bgez _tmp_reg_56_, _error_lab_57_ + sll $2, $2, 2 +# was: sll _arr_ind_53_, _arr_ind_53_, 2 + add $3, $3, $2 +# was: add _arr_reg_54_, _arr_reg_54_, _arr_ind_53_ + lw $2, 0($3) +# was: lw _tmp_52_, 0(_arr_reg_54_) +# ori _letBind_51_,_tmp_52_,0 +# ori $2,_letBind_51_,0 + jal putint +# was: jal putint, $2 + ori $2, $0, 6 +# was: ori _arr_ind_61_, $0, 6 + addi $3, $16, 4 +# was: addi _arr_reg_62_, _letBind_2_, 4 + lw $4, 0($16) +# was: lw _size_reg_63_, 0(_letBind_2_) + bgez $2, _safe_lab_66_ +# was: bgez _arr_ind_61_, _safe_lab_66_ +_error_lab_65_: + ori $5, $0, 9 +# was: ori $5, $0, 9 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_66_: + sub $4, $2, $4 +# was: sub _tmp_reg_64_, _arr_ind_61_, _size_reg_63_ + bgez $4, _error_lab_65_ +# was: bgez _tmp_reg_64_, _error_lab_65_ + sll $2, $2, 2 +# was: sll _arr_ind_61_, _arr_ind_61_, 2 + add $3, $3, $2 +# was: add _arr_reg_62_, _arr_reg_62_, _arr_ind_61_ + lw $2, 0($3) +# was: lw _tmp_60_, 0(_arr_reg_62_) +# ori _letBind_59_,_tmp_60_,0 +# ori $2,_letBind_59_,0 + jal putint +# was: jal putint, $2 + ori $2, $0, 0 +# was: ori _mainres_1_, $0, 0 +# ori $2,_mainres_1_,0 + addi $29, $29, 12 + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/iota.fo b/W1/fasto/tests/iota.fo new file mode 100644 index 0000000..04f1c63 --- /dev/null +++ b/W1/fasto/tests/iota.fo @@ -0,0 +1,10 @@ +fun int main() = + let a = iota(7) in + let tmp = write(a[0]) in + let tmp = write(a[1]) in + let tmp = write(a[2]) in + let tmp = write(a[3]) in + let tmp = write(a[4]) in + let tmp = write(a[5]) in + let tmp = write(a[6]) in + 0 diff --git a/W1/fasto/tests/iota.in b/W1/fasto/tests/iota.in new file mode 100644 index 0000000..e69de29 diff --git a/W1/fasto/tests/iota.out b/W1/fasto/tests/iota.out new file mode 100644 index 0000000..7be611d --- /dev/null +++ b/W1/fasto/tests/iota.out @@ -0,0 +1 @@ +0 1 2 3 4 5 6 diff --git a/W1/fasto/tests/lambda.asm b/W1/fasto/tests/lambda.asm new file mode 100644 index 0000000..4b54603 --- /dev/null +++ b/W1/fasto/tests/lambda.asm @@ -0,0 +1,368 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _a__str__45_ +# was: la _a__str__45__addr, _a__str__45_ + ori $3, $0, 1 +# was: ori _a__str__45__init, $0, 1 + sw $3, 0($4) +# was: sw _a__str__45__init, 0(_a__str__45__addr) + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function write_int +write_int: + sw $31, -4($29) + sw $16, -8($29) + addi $29, $29, -12 +# ori _param_x_1_,$2,0 + ori $16, $2, 0 +# was: ori _tmp_3_, _param_x_1_, 0 +# ori _write_intres_2_,_tmp_3_,0 + ori $2, $16, 0 +# was: ori $2, _write_intres_2_, 0 + jal putint +# was: jal putint, $2 + ori $2, $16, 0 +# was: ori $2, _write_intres_2_, 0 + addi $29, $29, 12 + lw $16, -8($29) + lw $31, -4($29) + jr $31 +# Function write_int_arr +write_int_arr: + sw $31, -4($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -28 +# ori _param_x_4_,$2,0 +# ori _arr_reg_7_,_param_x_4_,0 + lw $16, 0($2) +# was: lw _size_reg_6_, 0(_arr_reg_7_) + ori $17, $28, 0 +# was: ori _write_int_arrres_5_, $28, 0 + sll $3, $16, 2 +# was: sll _tmp_16_, _size_reg_6_, 2 + addi $3, $3, 4 +# was: addi _tmp_16_, _tmp_16_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_16_ + sw $16, 0($17) +# was: sw _size_reg_6_, 0(_write_int_arrres_5_) + addi $18, $17, 4 +# was: addi _addr_reg_10_, _write_int_arrres_5_, 4 + ori $19, $0, 0 +# was: ori _i_reg_11_, $0, 0 + addi $20, $2, 4 +# was: addi _elem_reg_8_, _arr_reg_7_, 4 +_loop_beg_12_: + sub $2, $19, $16 +# was: sub _tmp_reg_14_, _i_reg_11_, _size_reg_6_ + bgez $2, _loop_end_13_ +# was: bgez _tmp_reg_14_, _loop_end_13_ + lw $2, 0($20) +# was: lw _res_reg_9_, 0(_elem_reg_8_) + addi $20, $20, 4 +# was: addi _elem_reg_8_, _elem_reg_8_, 4 +# ori $2,_res_reg_9_,0 + jal write_int +# was: jal write_int, $2 +# ori _tmp_reg_15_,$2,0 +# ori _res_reg_9_,_tmp_reg_15_,0 + sw $2, 0($18) +# was: sw _res_reg_9_, 0(_addr_reg_10_) + addi $18, $18, 4 +# was: addi _addr_reg_10_, _addr_reg_10_, 4 + addi $19, $19, 1 +# was: addi _i_reg_11_, _i_reg_11_, 1 + j _loop_beg_12_ +_loop_end_13_: + ori $2, $17, 0 +# was: ori $2, _write_int_arrres_5_, 0 + addi $29, $29, 28 + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +# Function main +main: + sw $31, -4($29) + sw $16, -8($29) + addi $29, $29, -12 + jal getint +# was: jal getint, $2 +# ori _letBind_18_,$2,0 + ori $5, $2, 0 +# was: ori _size_reg_20_, _letBind_18_, 0 + bgez $5, _safe_lab_21_ +# was: bgez _size_reg_20_, _safe_lab_21_ + ori $5, $0, 7 +# was: ori $5, $0, 7 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_21_: + ori $6, $28, 0 +# was: ori _letBind_19_, $28, 0 + sll $2, $5, 2 +# was: sll _tmp_27_, _size_reg_20_, 2 + addi $2, $2, 4 +# was: addi _tmp_27_, _tmp_27_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_27_ + sw $5, 0($6) +# was: sw _size_reg_20_, 0(_letBind_19_) + addi $2, $6, 4 +# was: addi _addr_reg_22_, _letBind_19_, 4 + ori $4, $0, 0 +# was: ori _i_reg_23_, $0, 0 +_loop_beg_24_: + sub $3, $4, $5 +# was: sub _tmp_reg_26_, _i_reg_23_, _size_reg_20_ + bgez $3, _loop_end_25_ +# was: bgez _tmp_reg_26_, _loop_end_25_ + sw $4, 0($2) +# was: sw _i_reg_23_, 0(_addr_reg_22_) + addi $2, $2, 4 +# was: addi _addr_reg_22_, _addr_reg_22_, 4 + addi $4, $4, 1 +# was: addi _i_reg_23_, _i_reg_23_, 1 + j _loop_beg_24_ +_loop_end_25_: +# ori _arr_reg_31_,_letBind_19_,0 + lw $2, 0($6) +# was: lw _size_reg_30_, 0(_arr_reg_31_) + ori $3, $28, 0 +# was: ori _arg_29_, $28, 0 + sll $4, $2, 2 +# was: sll _tmp_42_, _size_reg_30_, 2 + addi $4, $4, 4 +# was: addi _tmp_42_, _tmp_42_, 4 + add $28, $28, $4 +# was: add $28, $28, _tmp_42_ + sw $2, 0($3) +# was: sw _size_reg_30_, 0(_arg_29_) + addi $4, $3, 4 +# was: addi _addr_reg_34_, _arg_29_, 4 + ori $5, $0, 0 +# was: ori _i_reg_35_, $0, 0 + addi $6, $6, 4 +# was: addi _elem_reg_32_, _arr_reg_31_, 4 +_loop_beg_36_: + sub $7, $5, $2 +# was: sub _tmp_reg_38_, _i_reg_35_, _size_reg_30_ + bgez $7, _loop_end_37_ +# was: bgez _tmp_reg_38_, _loop_end_37_ + lw $7, 0($6) +# was: lw _res_reg_33_, 0(_elem_reg_32_) + addi $6, $6, 4 +# was: addi _elem_reg_32_, _elem_reg_32_, 4 +# ori _plus_L_40_,_res_reg_33_,0 + ori $8, $0, 2 +# was: ori _plus_R_41_, $0, 2 + add $7, $7, $8 +# was: add _fun_arg_res_39_, _plus_L_40_, _plus_R_41_ +# ori _res_reg_33_,_fun_arg_res_39_,0 + sw $7, 0($4) +# was: sw _res_reg_33_, 0(_addr_reg_34_) + addi $4, $4, 4 +# was: addi _addr_reg_34_, _addr_reg_34_, 4 + addi $5, $5, 1 +# was: addi _i_reg_35_, _i_reg_35_, 1 + j _loop_beg_36_ +_loop_end_37_: + ori $2, $3, 0 +# was: ori $2, _arg_29_, 0 + jal write_int_arr +# was: jal write_int_arr, $2 + ori $16, $2, 0 +# was: ori _letBind_28_, $2, 0 + la $2, _a__str__45_ +# was: la _tmp_44_, _a__str__45_ +# _a__str__45_: string "\n" +# ori _letBind_43_,_tmp_44_,0 +# ori $2,_tmp_44_,0 + jal putstring +# was: jal putstring, $2 +# ori _arr_reg_47_,_letBind_28_,0 + lw $2, 0($16) +# was: lw _size_reg_48_, 0(_arr_reg_47_) + ori $4, $0, 0 +# was: ori _arg_46_, $0, 0 + addi $16, $16, 4 +# was: addi _arr_reg_47_, _arr_reg_47_, 4 + ori $3, $0, 0 +# was: ori _ind_var_49_, $0, 0 +_loop_beg_51_: + sub $5, $3, $2 +# was: sub _tmp_reg_50_, _ind_var_49_, _size_reg_48_ + bgez $5, _loop_end_52_ +# was: bgez _tmp_reg_50_, _loop_end_52_ + lw $5, 0($16) +# was: lw _tmp_reg_50_, 0(_arr_reg_47_) + addi $16, $16, 4 +# was: addi _arr_reg_47_, _arr_reg_47_, 4 +# ori _plus_L_54_,_arg_46_,0 +# ori _plus_R_55_,_tmp_reg_50_,0 + add $4, $4, $5 +# was: add _fun_arg_res_53_, _plus_L_54_, _plus_R_55_ +# ori _arg_46_,_fun_arg_res_53_,0 + addi $3, $3, 1 +# was: addi _ind_var_49_, _ind_var_49_, 1 + j _loop_beg_51_ +_loop_end_52_: + ori $2, $4, 0 +# was: ori $2, _arg_46_, 0 + jal write_int +# was: jal write_int, $2 +# ori _mainres_17_,$2,0 +# ori $2,_mainres_17_,0 + addi $29, $29, 12 + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_a__str__45_: + .space 4 + .asciiz "\n" + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/lambda.fo b/W1/fasto/tests/lambda.fo new file mode 100644 index 0000000..f052e36 --- /dev/null +++ b/W1/fasto/tests/lambda.fo @@ -0,0 +1,10 @@ +fun int write_int(int x) = write(x) + +fun [int] write_int_arr([int] x) = map(write_int, x) + +fun int main() = + let N = read(int) in + let z = iota(N) in + let w = write_int_arr(map(fn int (int x) => x + 2, z)) in + let nl = write("\n") in + write_int(reduce(op+, 0, w)) diff --git a/W1/fasto/tests/lambda.in b/W1/fasto/tests/lambda.in new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/W1/fasto/tests/lambda.in @@ -0,0 +1 @@ +10 diff --git a/W1/fasto/tests/lambda.out b/W1/fasto/tests/lambda.out new file mode 100644 index 0000000..531e7a6 --- /dev/null +++ b/W1/fasto/tests/lambda.out @@ -0,0 +1,2 @@ +2 3 4 5 6 7 8 9 10 11 +65 diff --git a/W1/fasto/tests/map_red_io.asm b/W1/fasto/tests/map_red_io.asm new file mode 100644 index 0000000..5f78a5e --- /dev/null +++ b/W1/fasto/tests/map_red_io.asm @@ -0,0 +1,477 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _Maxacha_82_ +# was: la _Maxacha_82__addr, _Maxacha_82_ + ori $3, $0, 10 +# was: ori _Maxacha_82__init, $0, 10 + sw $3, 0($4) +# was: sw _Maxacha_82__init, 0(_Maxacha_82__addr) + la $4, _a__str__79_ +# was: la _a__str__79__addr, _a__str__79_ + ori $3, $0, 1 +# was: ori _a__str__79__init, $0, 1 + sw $3, 0($4) +# was: sw _a__str__79__init, 0(_a__str__79__addr) + la $4, _Sumaa___74_ +# was: la _Sumaa___74__addr, _Sumaa___74_ + ori $3, $0, 5 +# was: ori _Sumaa___74__init, $0, 5 + sw $3, 0($4) +# was: sw _Sumaa___74__init, 0(_Sumaa___74__addr) + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function plus100 +plus100: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_x_1_,$2,0 +# ori _plus_L_3_,_param_x_1_,0 + ori $3, $0, 100 +# was: ori _plus_R_4_, $0, 100 + add $2, $2, $3 +# was: add _plus100res_2_, _plus_L_3_, _plus_R_4_ +# ori $2,_plus100res_2_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function read_chr +read_chr: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_i_5_,$2,0 + jal getchar +# was: jal getchar, $2 +# ori _read_chrres_6_,$2,0 +# ori $2,_read_chrres_6_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function plus +plus: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_x_7_,$2,0 +# ori _param_y_8_,$3,0 +# ori _plus_L_10_,_param_x_7_,0 +# ori _plus_R_11_,_param_y_8_,0 + add $2, $2, $3 +# was: add _plusres_9_, _plus_L_10_, _plus_R_11_ +# ori $2,_plusres_9_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function max_chr +max_chr: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_a_12_,$2,0 +# ori _param_b_13_,$3,0 +# ori _lt_L_19_,_param_a_12_,0 +# ori _lt_R_20_,_param_b_13_,0 + slt $4, $2, $3 +# was: slt _cond_18_, _lt_L_19_, _lt_R_20_ + bne $4, $0, _then_15_ +# was: bne _cond_18_, $0, _then_15_ + j _else_16_ +_then_15_: + ori $2, $3, 0 +# was: ori _max_chrres_14_, _param_b_13_, 0 + j _endif_17_ +_else_16_: +# ori _max_chrres_14_,_param_a_12_,0 +_endif_17_: +# ori $2,_max_chrres_14_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function main +main: + sw $31, -4($29) + sw $21, -28($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -32 + jal getint +# was: jal getint, $2 +# ori _letBind_22_,$2,0 +# ori _size_reg_24_,_letBind_22_,0 + bgez $2, _safe_lab_25_ +# was: bgez _size_reg_24_, _safe_lab_25_ + ori $5, $0, 10 +# was: ori $5, $0, 10 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_25_: + ori $16, $28, 0 +# was: ori _letBind_23_, $28, 0 + sll $3, $2, 2 +# was: sll _tmp_31_, _size_reg_24_, 2 + addi $3, $3, 4 +# was: addi _tmp_31_, _tmp_31_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_31_ + sw $2, 0($16) +# was: sw _size_reg_24_, 0(_letBind_23_) + addi $3, $16, 4 +# was: addi _addr_reg_26_, _letBind_23_, 4 + ori $4, $0, 0 +# was: ori _i_reg_27_, $0, 0 +_loop_beg_28_: + sub $5, $4, $2 +# was: sub _tmp_reg_30_, _i_reg_27_, _size_reg_24_ + bgez $5, _loop_end_29_ +# was: bgez _tmp_reg_30_, _loop_end_29_ + sw $4, 0($3) +# was: sw _i_reg_27_, 0(_addr_reg_26_) + addi $3, $3, 4 +# was: addi _addr_reg_26_, _addr_reg_26_, 4 + addi $4, $4, 1 +# was: addi _i_reg_27_, _i_reg_27_, 1 + j _loop_beg_28_ +_loop_end_29_: +# ori _arr_reg_34_,_letBind_23_,0 + lw $17, 0($16) +# was: lw _size_reg_33_, 0(_arr_reg_34_) + ori $20, $28, 0 +# was: ori _letBind_32_, $28, 0 + sll $2, $17, 2 +# was: sll _tmp_43_, _size_reg_33_, 2 + addi $2, $2, 4 +# was: addi _tmp_43_, _tmp_43_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_43_ + sw $17, 0($20) +# was: sw _size_reg_33_, 0(_letBind_32_) + addi $18, $20, 4 +# was: addi _addr_reg_37_, _letBind_32_, 4 + ori $19, $0, 0 +# was: ori _i_reg_38_, $0, 0 + addi $21, $16, 4 +# was: addi _elem_reg_35_, _arr_reg_34_, 4 +_loop_beg_39_: + sub $2, $19, $17 +# was: sub _tmp_reg_41_, _i_reg_38_, _size_reg_33_ + bgez $2, _loop_end_40_ +# was: bgez _tmp_reg_41_, _loop_end_40_ + lw $2, 0($21) +# was: lw _res_reg_36_, 0(_elem_reg_35_) + addi $21, $21, 4 +# was: addi _elem_reg_35_, _elem_reg_35_, 4 +# ori $2,_res_reg_36_,0 + jal plus100 +# was: jal plus100, $2 +# ori _tmp_reg_42_,$2,0 +# ori _res_reg_36_,_tmp_reg_42_,0 + sw $2, 0($18) +# was: sw _res_reg_36_, 0(_addr_reg_37_) + addi $18, $18, 4 +# was: addi _addr_reg_37_, _addr_reg_37_, 4 + addi $19, $19, 1 +# was: addi _i_reg_38_, _i_reg_38_, 1 + j _loop_beg_39_ +_loop_end_40_: +# ori _arr_reg_45_,_letBind_32_,0 + lw $18, 0($20) +# was: lw _size_reg_46_, 0(_arr_reg_45_) + ori $17, $0, 0 +# was: ori _letBind_44_, $0, 0 + addi $20, $20, 4 +# was: addi _arr_reg_45_, _arr_reg_45_, 4 + ori $19, $0, 0 +# was: ori _ind_var_47_, $0, 0 +_loop_beg_49_: + sub $3, $19, $18 +# was: sub _tmp_reg_48_, _ind_var_47_, _size_reg_46_ + bgez $3, _loop_end_50_ +# was: bgez _tmp_reg_48_, _loop_end_50_ + lw $3, 0($20) +# was: lw _tmp_reg_48_, 0(_arr_reg_45_) + addi $20, $20, 4 +# was: addi _arr_reg_45_, _arr_reg_45_, 4 + ori $2, $17, 0 +# was: ori $2, _letBind_44_, 0 +# ori $3,_tmp_reg_48_,0 + jal plus +# was: jal plus, $2 $3 +# ori _tmp_reg_51_,$2,0 + ori $17, $2, 0 +# was: ori _letBind_44_, _tmp_reg_51_, 0 + addi $19, $19, 1 +# was: addi _ind_var_47_, _ind_var_47_, 1 + j _loop_beg_49_ +_loop_end_50_: + ori $2, $16, 0 +# was: ori _arr_reg_54_, _letBind_23_, 0 + lw $18, 0($2) +# was: lw _size_reg_53_, 0(_arr_reg_54_) + ori $16, $28, 0 +# was: ori _letBind_52_, $28, 0 + addi $3, $18, 3 +# was: addi _tmp_63_, _size_reg_53_, 3 + sra $3, $3, 2 +# was: sra _tmp_63_, _tmp_63_, 2 + sll $3, $3, 2 +# was: sll _tmp_63_, _tmp_63_, 2 + addi $3, $3, 4 +# was: addi _tmp_63_, _tmp_63_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_63_ + sw $18, 0($16) +# was: sw _size_reg_53_, 0(_letBind_52_) + addi $20, $16, 4 +# was: addi _addr_reg_57_, _letBind_52_, 4 + ori $19, $0, 0 +# was: ori _i_reg_58_, $0, 0 + addi $21, $2, 4 +# was: addi _elem_reg_55_, _arr_reg_54_, 4 +_loop_beg_59_: + sub $2, $19, $18 +# was: sub _tmp_reg_61_, _i_reg_58_, _size_reg_53_ + bgez $2, _loop_end_60_ +# was: bgez _tmp_reg_61_, _loop_end_60_ + lw $2, 0($21) +# was: lw _res_reg_56_, 0(_elem_reg_55_) + addi $21, $21, 4 +# was: addi _elem_reg_55_, _elem_reg_55_, 4 +# ori $2,_res_reg_56_,0 + jal read_chr +# was: jal read_chr, $2 +# ori _tmp_reg_62_,$2,0 +# ori _res_reg_56_,_tmp_reg_62_,0 + sb $2, 0($20) +# was: sb _res_reg_56_, 0(_addr_reg_57_) + addi $20, $20, 1 +# was: addi _addr_reg_57_, _addr_reg_57_, 1 + addi $19, $19, 1 +# was: addi _i_reg_58_, _i_reg_58_, 1 + j _loop_beg_59_ +_loop_end_60_: + ori $20, $16, 0 +# was: ori _arr_reg_65_, _letBind_52_, 0 + lw $19, 0($20) +# was: lw _size_reg_66_, 0(_arr_reg_65_) + ori $18, $0, 97 +# was: ori _letBind_64_, $0, 97 + addi $20, $20, 4 +# was: addi _arr_reg_65_, _arr_reg_65_, 4 + ori $21, $0, 0 +# was: ori _ind_var_67_, $0, 0 +_loop_beg_69_: + sub $3, $21, $19 +# was: sub _tmp_reg_68_, _ind_var_67_, _size_reg_66_ + bgez $3, _loop_end_70_ +# was: bgez _tmp_reg_68_, _loop_end_70_ + lb $3, 0($20) +# was: lb _tmp_reg_68_, 0(_arr_reg_65_) + addi $20, $20, 1 +# was: addi _arr_reg_65_, _arr_reg_65_, 1 + ori $2, $18, 0 +# was: ori $2, _letBind_64_, 0 +# ori $3,_tmp_reg_68_,0 + jal max_chr +# was: jal max_chr, $2 $3 +# ori _tmp_reg_71_,$2,0 + ori $18, $2, 0 +# was: ori _letBind_64_, _tmp_reg_71_, 0 + addi $21, $21, 1 +# was: addi _ind_var_67_, _ind_var_67_, 1 + j _loop_beg_69_ +_loop_end_70_: + la $2, _Sumaa___74_ +# was: la _tmp_73_, _Sumaa___74_ +# _Sumaa___74_: string "Sum: " +# ori _letBind_72_,_tmp_73_,0 +# ori $2,_tmp_73_,0 + jal putstring +# was: jal putstring, $2 + ori $2, $17, 0 +# was: ori _tmp_76_, _letBind_44_, 0 +# ori _letBind_75_,_tmp_76_,0 +# ori $2,_letBind_75_,0 + jal putint +# was: jal putint, $2 + la $2, _a__str__79_ +# was: la _tmp_78_, _a__str__79_ +# _a__str__79_: string "\n" +# ori _letBind_77_,_tmp_78_,0 +# ori $2,_tmp_78_,0 + jal putstring +# was: jal putstring, $2 + la $2, _Maxacha_82_ +# was: la _tmp_81_, _Maxacha_82_ +# _Maxacha_82_: string "Max char: " +# ori _letBind_80_,_tmp_81_,0 +# ori $2,_tmp_81_,0 + jal putstring +# was: jal putstring, $2 + ori $2, $18, 0 +# was: ori _tmp_84_, _letBind_64_, 0 +# ori _letBind_83_,_tmp_84_,0 +# ori $2,_letBind_83_,0 + jal putchar +# was: jal putchar, $2 + ori $2, $16, 0 +# was: ori _mainres_21_, _letBind_52_, 0 +# ori $2,_mainres_21_,0 + addi $29, $29, 32 + lw $21, -28($29) + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_Maxacha_82_: + .space 4 + .asciiz "Max char: " + .align 2 +_a__str__79_: + .space 4 + .asciiz "\n" + .align 2 +_Sumaa___74_: + .space 4 + .asciiz "Sum: " + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/map_red_io.fo b/W1/fasto/tests/map_red_io.fo new file mode 100644 index 0000000..5fbb312 --- /dev/null +++ b/W1/fasto/tests/map_red_io.fo @@ -0,0 +1,20 @@ +fun int plus100 (int x) = x + 100 +fun char read_chr(int i) = read(char) + +fun int plus (int x, int y) = x + y +fun char max_chr(char a, char b) = + if a < b then b else a + +fun [char] main() = + let n = read(int) in // read n ints from the keyboard + let a = iota(n) in // produce a = {0, 1, ... n − 1} + let b = map(plus100, a) in // b = {100, 101, ... , n + 99} + let d = reduce(plus, 0, b) in // d = 100 + 101 + ... + (n + 99) + let c = map(read_chr, a) in // reads N chars from keyboard + let m = reduce(max_chr, 'a', c) in // get the max element of c + let tmp = write("Sum: ") in // print string "Sum: " + let tmp = write(d) in // print d (the sum of b) + let tmp = write("\n") in // print newline + let tmp = write("Max char: ") in // print " Max char: " + let tmp = write(m) in // print max elem of char array + c // result is input char array diff --git a/W1/fasto/tests/map_red_io.in b/W1/fasto/tests/map_red_io.in new file mode 100644 index 0000000..b6619ff --- /dev/null +++ b/W1/fasto/tests/map_red_io.in @@ -0,0 +1,5 @@ +4 +c +a +b +d diff --git a/W1/fasto/tests/map_red_io.out b/W1/fasto/tests/map_red_io.out new file mode 100644 index 0000000..6511326 --- /dev/null +++ b/W1/fasto/tests/map_red_io.out @@ -0,0 +1,2 @@ +Sum: 406 +Max char: d diff --git a/W1/fasto/tests/multilet.asm b/W1/fasto/tests/multilet.asm new file mode 100644 index 0000000..6c2a305 --- /dev/null +++ b/W1/fasto/tests/multilet.asm @@ -0,0 +1,174 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function main +main: + sw $31, -4($29) + sw $16, -8($29) + addi $29, $29, -12 + jal getint +# was: jal getint, $2 +# ori _letBind_2_,$2,0 + ori $3, $2, 0 +# was: ori _plus_L_4_, _letBind_2_, 0 +# ori _plus_R_5_,_letBind_2_,0 + add $3, $3, $2 +# was: add _letBind_3_, _plus_L_4_, _plus_R_5_ +# ori _minus_L_7_,_letBind_3_,0 + ori $4, $0, 1 +# was: ori _minus_R_8_, $0, 1 + sub $3, $3, $4 +# was: sub _letBind_6_, _minus_L_7_, _minus_R_8_ +# ori _mult1_L_10_,_letBind_2_,0 +# ori _mult2_R_11_,_letBind_6_,0 + mul $16, $2, $3 +# was: mul _tmp_9_, _mult1_L_10_, _mult2_R_11_ +# ori _mainres_1_,_tmp_9_,0 + ori $2, $16, 0 +# was: ori $2, _mainres_1_, 0 + jal putint +# was: jal putint, $2 + ori $2, $16, 0 +# was: ori $2, _mainres_1_, 0 + addi $29, $29, 12 + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/multilet.fo b/W1/fasto/tests/multilet.fo new file mode 100644 index 0000000..9d720bb --- /dev/null +++ b/W1/fasto/tests/multilet.fo @@ -0,0 +1,3 @@ +fun int main () = + let n = read(int); x = n+n; y = x-1 + in write(n*y) diff --git a/W1/fasto/tests/multilet.in b/W1/fasto/tests/multilet.in new file mode 100644 index 0000000..1e8b314 --- /dev/null +++ b/W1/fasto/tests/multilet.in @@ -0,0 +1 @@ +6 diff --git a/W1/fasto/tests/multilet.out b/W1/fasto/tests/multilet.out new file mode 100644 index 0000000..d1cbcfa --- /dev/null +++ b/W1/fasto/tests/multilet.out @@ -0,0 +1 @@ +66 \ No newline at end of file diff --git a/W1/fasto/tests/neg_simple.err b/W1/fasto/tests/neg_simple.err new file mode 100644 index 0000000..63d56da --- /dev/null +++ b/W1/fasto/tests/neg_simple.err @@ -0,0 +1 @@ +Type error: Arity mismatch in declaration of main: expected a function of arity 0, but got int -> int at line 2, column 9 diff --git a/W1/fasto/tests/neg_simple.fo b/W1/fasto/tests/neg_simple.fo new file mode 100644 index 0000000..b9e47c8 --- /dev/null +++ b/W1/fasto/tests/neg_simple.fo @@ -0,0 +1,2 @@ +// A simple negative test, as 'main' cannot take any arguments. +fun int main(int t) = t diff --git a/W1/fasto/tests/negate.asm b/W1/fasto/tests/negate.asm new file mode 100644 index 0000000..0cbe2d6 --- /dev/null +++ b/W1/fasto/tests/negate.asm @@ -0,0 +1,319 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _a__str__35_ +# was: la _a__str__35__addr, _a__str__35_ + ori $3, $0, 1 +# was: ori _a__str__35__init, $0, 1 + sw $3, 0($4) +# was: sw _a__str__35__init, 0(_a__str__35__addr) + la $4, _a__str__25_ +# was: la _a__str__25__addr, _a__str__25_ + ori $3, $0, 1 +# was: ori _a__str__25__init, $0, 1 + sw $3, 0($4) +# was: sw _a__str__25__init, 0(_a__str__25__addr) + la $4, _a__str__19_ +# was: la _a__str__19__addr, _a__str__19_ + ori $3, $0, 1 +# was: ori _a__str__19__init, $0, 1 + sw $3, 0($4) +# was: sw _a__str__19__init, 0(_a__str__19__addr) + la $4, _a__str__13_ +# was: la _a__str__13__addr, _a__str__13_ + ori $3, $0, 1 +# was: ori _a__str__13__init, $0, 1 + sw $3, 0($4) +# was: sw _a__str__13__init, 0(_a__str__13__addr) + la $4, _a__str__7_ +# was: la _a__str__7__addr, _a__str__7_ + ori $3, $0, 1 +# was: ori _a__str__7__init, $0, 1 + sw $3, 0($4) +# was: sw _a__str__7__init, 0(_a__str__7__addr) + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function main +main: + sw $31, -4($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -24 + ori $16, $0, 1 +# was: ori _tmp_3_, $0, 1 +# ori _letBind_2_,_tmp_3_,0 + la $2, _true +# was: la $2, _true + bne $16, $0, _wBoolF_4_ +# was: bne _letBind_2_, $0, _wBoolF_4_ + la $2, _false +# was: la $2, _false +_wBoolF_4_: + jal putstring +# was: jal putstring, $2 + la $2, _a__str__7_ +# was: la _tmp_6_, _a__str__7_ +# _a__str__7_: string "\n" +# ori _letBind_5_,_tmp_6_,0 +# ori $2,_tmp_6_,0 + jal putstring +# was: jal putstring, $2 + ori $17, $0, 0 +# was: ori _tmp_9_, $0, 0 +# ori _letBind_8_,_tmp_9_,0 + la $2, _true +# was: la $2, _true + bne $17, $0, _wBoolF_10_ +# was: bne _letBind_8_, $0, _wBoolF_10_ + la $2, _false +# was: la $2, _false +_wBoolF_10_: + jal putstring +# was: jal putstring, $2 + la $2, _a__str__13_ +# was: la _tmp_12_, _a__str__13_ +# _a__str__13_: string "\n" +# ori _letBind_11_,_tmp_12_,0 +# ori $2,_tmp_12_,0 + jal putstring +# was: jal putstring, $2 + ori $18, $0, 0 +# was: ori _tmp_15_, $0, 0 +# ori _letBind_14_,_tmp_15_,0 + la $2, _true +# was: la $2, _true + bne $18, $0, _wBoolF_16_ +# was: bne _letBind_14_, $0, _wBoolF_16_ + la $2, _false +# was: la $2, _false +_wBoolF_16_: + jal putstring +# was: jal putstring, $2 + la $2, _a__str__19_ +# was: la _tmp_18_, _a__str__19_ +# _a__str__19_: string "\n" +# ori _letBind_17_,_tmp_18_,0 +# ori $2,_tmp_18_,0 + jal putstring +# was: jal putstring, $2 + ori $19, $0, 1 +# was: ori _tmp_21_, $0, 1 +# ori _letBind_20_,_tmp_21_,0 + la $2, _true +# was: la $2, _true + bne $19, $0, _wBoolF_22_ +# was: bne _letBind_20_, $0, _wBoolF_22_ + la $2, _false +# was: la $2, _false +_wBoolF_22_: + jal putstring +# was: jal putstring, $2 + la $2, _a__str__25_ +# was: la _tmp_24_, _a__str__25_ +# _a__str__25_: string "\n" +# ori _letBind_23_,_tmp_24_,0 +# ori $2,_tmp_24_,0 + jal putstring +# was: jal putstring, $2 +# ori _letBind_26_,_letBind_2_,0 + beq $16, $0, _endLabel_29_ +# was: beq _letBind_26_, $0, _endLabel_29_ + ori $16, $17, 0 +# was: ori _letBind_26_, _letBind_8_, 0 +_endLabel_29_: + beq $16, $0, _endLabel_28_ +# was: beq _letBind_26_, $0, _endLabel_28_ + ori $16, $18, 0 +# was: ori _letBind_26_, _letBind_14_, 0 +_endLabel_28_: + beq $16, $0, _endLabel_27_ +# was: beq _letBind_26_, $0, _endLabel_27_ + ori $16, $19, 0 +# was: ori _letBind_26_, _letBind_20_, 0 +_endLabel_27_: +# ori _tmp_31_,_letBind_26_,0 +# ori _letBind_30_,_tmp_31_,0 + la $2, _true +# was: la $2, _true + bne $16, $0, _wBoolF_32_ +# was: bne _letBind_30_, $0, _wBoolF_32_ + la $2, _false +# was: la $2, _false +_wBoolF_32_: + jal putstring +# was: jal putstring, $2 + la $2, _a__str__35_ +# was: la _tmp_34_, _a__str__35_ +# _a__str__35_: string "\n" +# ori _letBind_33_,_tmp_34_,0 +# ori $2,_tmp_34_,0 + jal putstring +# was: jal putstring, $2 + ori $2, $16, 0 +# was: ori _mainres_1_, _letBind_30_, 0 +# ori $2,_mainres_1_,0 + addi $29, $29, 24 + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_a__str__35_: + .space 4 + .asciiz "\n" + .align 2 +_a__str__25_: + .space 4 + .asciiz "\n" + .align 2 +_a__str__19_: + .space 4 + .asciiz "\n" + .align 2 +_a__str__13_: + .space 4 + .asciiz "\n" + .align 2 +_a__str__7_: + .space 4 + .asciiz "\n" + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/negate.fo b/W1/fasto/tests/negate.fo new file mode 100644 index 0000000..1cc019c --- /dev/null +++ b/W1/fasto/tests/negate.fo @@ -0,0 +1,11 @@ +fun bool write_nl(bool b) = + let res = write(b) in + let tmp = write("\n") in + res + +fun bool main() = + let x0 = write_nl(3 / 2 == 1) in + let x1 = write_nl(~3 / 2 == ~2) in + let x2 = write_nl(3 /~2 == ~2) in + let x3 = write_nl(~3 /~2 == 1) in + write_nl(x0 && x1 && x2 && x3) diff --git a/W1/fasto/tests/negate.in b/W1/fasto/tests/negate.in new file mode 100644 index 0000000..e69de29 diff --git a/W1/fasto/tests/negate.out b/W1/fasto/tests/negate.out new file mode 100644 index 0000000..363db97 --- /dev/null +++ b/W1/fasto/tests/negate.out @@ -0,0 +1,5 @@ +true +false +false +true +false diff --git a/W1/fasto/tests/ordchr.asm b/W1/fasto/tests/ordchr.asm new file mode 100644 index 0000000..0b061c3 --- /dev/null +++ b/W1/fasto/tests/ordchr.asm @@ -0,0 +1,427 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function read_char +read_char: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_i_1_,$2,0 + jal getchar +# was: jal getchar, $2 +# ori _read_charres_2_,$2,0 +# ori $2,_read_charres_2_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function read_string +read_string: + sw $31, -4($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -28 +# ori _param_n_3_,$2,0 + ori $3, $2, 0 +# was: ori _size_reg_9_, _param_n_3_, 0 + bgez $3, _safe_lab_10_ +# was: bgez _size_reg_9_, _safe_lab_10_ + ori $5, $0, 3 +# was: ori $5, $0, 3 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_10_: + ori $2, $28, 0 +# was: ori _arr_reg_6_, $28, 0 + sll $4, $3, 2 +# was: sll _tmp_16_, _size_reg_9_, 2 + addi $4, $4, 4 +# was: addi _tmp_16_, _tmp_16_, 4 + add $28, $28, $4 +# was: add $28, $28, _tmp_16_ + sw $3, 0($2) +# was: sw _size_reg_9_, 0(_arr_reg_6_) + addi $6, $2, 4 +# was: addi _addr_reg_11_, _arr_reg_6_, 4 + ori $5, $0, 0 +# was: ori _i_reg_12_, $0, 0 +_loop_beg_13_: + sub $4, $5, $3 +# was: sub _tmp_reg_15_, _i_reg_12_, _size_reg_9_ + bgez $4, _loop_end_14_ +# was: bgez _tmp_reg_15_, _loop_end_14_ + sw $5, 0($6) +# was: sw _i_reg_12_, 0(_addr_reg_11_) + addi $6, $6, 4 +# was: addi _addr_reg_11_, _addr_reg_11_, 4 + addi $5, $5, 1 +# was: addi _i_reg_12_, _i_reg_12_, 1 + j _loop_beg_13_ +_loop_end_14_: + lw $16, 0($2) +# was: lw _size_reg_5_, 0(_arr_reg_6_) + ori $17, $28, 0 +# was: ori _read_stringres_4_, $28, 0 + addi $3, $16, 3 +# was: addi _tmp_23_, _size_reg_5_, 3 + sra $3, $3, 2 +# was: sra _tmp_23_, _tmp_23_, 2 + sll $3, $3, 2 +# was: sll _tmp_23_, _tmp_23_, 2 + addi $3, $3, 4 +# was: addi _tmp_23_, _tmp_23_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_23_ + sw $16, 0($17) +# was: sw _size_reg_5_, 0(_read_stringres_4_) + addi $18, $17, 4 +# was: addi _addr_reg_17_, _read_stringres_4_, 4 + ori $19, $0, 0 +# was: ori _i_reg_18_, $0, 0 + addi $20, $2, 4 +# was: addi _elem_reg_7_, _arr_reg_6_, 4 +_loop_beg_19_: + sub $2, $19, $16 +# was: sub _tmp_reg_21_, _i_reg_18_, _size_reg_5_ + bgez $2, _loop_end_20_ +# was: bgez _tmp_reg_21_, _loop_end_20_ + lw $2, 0($20) +# was: lw _res_reg_8_, 0(_elem_reg_7_) + addi $20, $20, 4 +# was: addi _elem_reg_7_, _elem_reg_7_, 4 +# ori $2,_res_reg_8_,0 + jal read_char +# was: jal read_char, $2 +# ori _tmp_reg_22_,$2,0 +# ori _res_reg_8_,_tmp_reg_22_,0 + sb $2, 0($18) +# was: sb _res_reg_8_, 0(_addr_reg_17_) + addi $18, $18, 1 +# was: addi _addr_reg_17_, _addr_reg_17_, 1 + addi $19, $19, 1 +# was: addi _i_reg_18_, _i_reg_18_, 1 + j _loop_beg_19_ +_loop_end_20_: + ori $2, $17, 0 +# was: ori $2, _read_stringres_4_, 0 + addi $29, $29, 28 + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +# Function add_one +add_one: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_x_24_,$2,0 +# ori _plus_L_26_,_param_x_24_,0 + ori $3, $0, 1 +# was: ori _plus_R_27_, $0, 1 + add $2, $2, $3 +# was: add _add_oneres_25_, _plus_L_26_, _plus_R_27_ +# ori $2,_add_oneres_25_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function main +main: + sw $31, -4($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -28 + jal getint +# was: jal getint, $2 +# ori _letBind_29_,$2,0 +# ori _arg_31_,_letBind_29_,0 +# ori $2,_arg_31_,0 + jal read_string +# was: jal read_string, $2 +# ori _letBind_30_,$2,0 +# ori _arr_reg_42_,_letBind_30_,0 + lw $18, 0($2) +# was: lw _size_reg_41_, 0(_arr_reg_42_) + ori $20, $28, 0 +# was: ori _arr_reg_38_, $28, 0 + sll $3, $18, 2 +# was: sll _tmp_51_, _size_reg_41_, 2 + addi $3, $3, 4 +# was: addi _tmp_51_, _tmp_51_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_51_ + sw $18, 0($20) +# was: sw _size_reg_41_, 0(_arr_reg_38_) + addi $17, $20, 4 +# was: addi _addr_reg_45_, _arr_reg_38_, 4 + ori $16, $0, 0 +# was: ori _i_reg_46_, $0, 0 + addi $19, $2, 4 +# was: addi _elem_reg_43_, _arr_reg_42_, 4 +_loop_beg_47_: + sub $2, $16, $18 +# was: sub _tmp_reg_49_, _i_reg_46_, _size_reg_41_ + bgez $2, _loop_end_48_ +# was: bgez _tmp_reg_49_, _loop_end_48_ + lb $2, 0($19) +# was: lb _res_reg_44_, 0(_elem_reg_43_) + addi $19, $19, 1 +# was: addi _elem_reg_43_, _elem_reg_43_, 1 +# ori $2,_res_reg_44_,0 + jal ord +# was: jal ord, $2 +# ori _tmp_reg_50_,$2,0 +# ori _res_reg_44_,_tmp_reg_50_,0 + sw $2, 0($17) +# was: sw _res_reg_44_, 0(_addr_reg_45_) + addi $17, $17, 4 +# was: addi _addr_reg_45_, _addr_reg_45_, 4 + addi $16, $16, 1 +# was: addi _i_reg_46_, _i_reg_46_, 1 + j _loop_beg_47_ +_loop_end_48_: + lw $19, 0($20) +# was: lw _size_reg_37_, 0(_arr_reg_38_) + ori $16, $28, 0 +# was: ori _arr_reg_34_, $28, 0 + sll $2, $19, 2 +# was: sll _tmp_58_, _size_reg_37_, 2 + addi $2, $2, 4 +# was: addi _tmp_58_, _tmp_58_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_58_ + sw $19, 0($16) +# was: sw _size_reg_37_, 0(_arr_reg_34_) + addi $18, $16, 4 +# was: addi _addr_reg_52_, _arr_reg_34_, 4 + ori $17, $0, 0 +# was: ori _i_reg_53_, $0, 0 + addi $20, $20, 4 +# was: addi _elem_reg_39_, _arr_reg_38_, 4 +_loop_beg_54_: + sub $2, $17, $19 +# was: sub _tmp_reg_56_, _i_reg_53_, _size_reg_37_ + bgez $2, _loop_end_55_ +# was: bgez _tmp_reg_56_, _loop_end_55_ + lw $2, 0($20) +# was: lw _res_reg_40_, 0(_elem_reg_39_) + addi $20, $20, 4 +# was: addi _elem_reg_39_, _elem_reg_39_, 4 +# ori $2,_res_reg_40_,0 + jal add_one +# was: jal add_one, $2 +# ori _tmp_reg_57_,$2,0 +# ori _res_reg_40_,_tmp_reg_57_,0 + sw $2, 0($18) +# was: sw _res_reg_40_, 0(_addr_reg_52_) + addi $18, $18, 4 +# was: addi _addr_reg_52_, _addr_reg_52_, 4 + addi $17, $17, 1 +# was: addi _i_reg_53_, _i_reg_53_, 1 + j _loop_beg_54_ +_loop_end_55_: + lw $18, 0($16) +# was: lw _size_reg_33_, 0(_arr_reg_34_) + ori $17, $28, 0 +# was: ori _letBind_32_, $28, 0 + addi $2, $18, 3 +# was: addi _tmp_65_, _size_reg_33_, 3 + sra $2, $2, 2 +# was: sra _tmp_65_, _tmp_65_, 2 + sll $2, $2, 2 +# was: sll _tmp_65_, _tmp_65_, 2 + addi $2, $2, 4 +# was: addi _tmp_65_, _tmp_65_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_65_ + sw $18, 0($17) +# was: sw _size_reg_33_, 0(_letBind_32_) + addi $19, $17, 4 +# was: addi _addr_reg_59_, _letBind_32_, 4 + ori $20, $0, 0 +# was: ori _i_reg_60_, $0, 0 + addi $16, $16, 4 +# was: addi _elem_reg_35_, _arr_reg_34_, 4 +_loop_beg_61_: + sub $2, $20, $18 +# was: sub _tmp_reg_63_, _i_reg_60_, _size_reg_33_ + bgez $2, _loop_end_62_ +# was: bgez _tmp_reg_63_, _loop_end_62_ + lw $2, 0($16) +# was: lw _res_reg_36_, 0(_elem_reg_35_) + addi $16, $16, 4 +# was: addi _elem_reg_35_, _elem_reg_35_, 4 +# ori $2,_res_reg_36_,0 + jal chr +# was: jal chr, $2 +# ori _tmp_reg_64_,$2,0 +# ori _res_reg_36_,_tmp_reg_64_,0 + sb $2, 0($19) +# was: sb _res_reg_36_, 0(_addr_reg_59_) + addi $19, $19, 1 +# was: addi _addr_reg_59_, _addr_reg_59_, 1 + addi $20, $20, 1 +# was: addi _i_reg_60_, _i_reg_60_, 1 + j _loop_beg_61_ +_loop_end_62_: + ori $2, $17, 0 +# was: ori _tmp_66_, _letBind_32_, 0 + ori $16, $2, 0 +# was: ori _mainres_28_, _tmp_66_, 0 +# ori $2,_tmp_66_,0 + jal putstring +# was: jal putstring, $2 + ori $2, $16, 0 +# was: ori $2, _mainres_28_, 0 + addi $29, $29, 28 + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/ordchr.fo b/W1/fasto/tests/ordchr.fo new file mode 100644 index 0000000..992d667 --- /dev/null +++ b/W1/fasto/tests/ordchr.fo @@ -0,0 +1,11 @@ +fun char read_char(int i) = read(char) + +fun [char] read_string(int n) = map(read_char, iota(n)) + +fun int add_one(int x) = x + 1 + +fun [char] main() = + let n = read(int) in + let s1 = read_string(n) in + let s2 = map(chr, map(add_one, map(ord, s1))) in + write(s2) diff --git a/W1/fasto/tests/ordchr.in b/W1/fasto/tests/ordchr.in new file mode 100644 index 0000000..6784e1f --- /dev/null +++ b/W1/fasto/tests/ordchr.in @@ -0,0 +1,4 @@ +3 +f +o +o diff --git a/W1/fasto/tests/ordchr.out b/W1/fasto/tests/ordchr.out new file mode 100644 index 0000000..fa241e7 --- /dev/null +++ b/W1/fasto/tests/ordchr.out @@ -0,0 +1 @@ +gpp diff --git a/W1/fasto/tests/proj_figure3.asm b/W1/fasto/tests/proj_figure3.asm new file mode 100644 index 0000000..202498c --- /dev/null +++ b/W1/fasto/tests/proj_figure3.asm @@ -0,0 +1,382 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function plus100 +plus100: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_x_1_,$2,0 +# ori _plus_L_3_,_param_x_1_,0 + ori $3, $0, 100 +# was: ori _plus_R_4_, $0, 100 + add $2, $2, $3 +# was: add _plus100res_2_, _plus_L_3_, _plus_R_4_ +# ori $2,_plus100res_2_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function plus +plus: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_x_5_,$2,0 +# ori _param_y_6_,$3,0 +# ori _plus_L_8_,_param_x_5_,0 +# ori _plus_R_9_,_param_y_6_,0 + add $2, $2, $3 +# was: add _plusres_7_, _plus_L_8_, _plus_R_9_ +# ori $2,_plusres_7_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function main +main: + sw $31, -4($29) + sw $21, -28($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -32 + jal getint +# was: jal getint, $2 +# ori _letBind_11_,$2,0 +# ori _size_reg_13_,_letBind_11_,0 + bgez $2, _safe_lab_14_ +# was: bgez _size_reg_13_, _safe_lab_14_ + ori $5, $0, 6 +# was: ori $5, $0, 6 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_14_: + ori $20, $28, 0 +# was: ori _letBind_12_, $28, 0 + sll $3, $2, 2 +# was: sll _tmp_20_, _size_reg_13_, 2 + addi $3, $3, 4 +# was: addi _tmp_20_, _tmp_20_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_20_ + sw $2, 0($20) +# was: sw _size_reg_13_, 0(_letBind_12_) + addi $5, $20, 4 +# was: addi _addr_reg_15_, _letBind_12_, 4 + ori $3, $0, 0 +# was: ori _i_reg_16_, $0, 0 +_loop_beg_17_: + sub $4, $3, $2 +# was: sub _tmp_reg_19_, _i_reg_16_, _size_reg_13_ + bgez $4, _loop_end_18_ +# was: bgez _tmp_reg_19_, _loop_end_18_ + sw $3, 0($5) +# was: sw _i_reg_16_, 0(_addr_reg_15_) + addi $5, $5, 4 +# was: addi _addr_reg_15_, _addr_reg_15_, 4 + addi $3, $3, 1 +# was: addi _i_reg_16_, _i_reg_16_, 1 + j _loop_beg_17_ +_loop_end_18_: +# ori _arr_reg_23_,_letBind_12_,0 + lw $17, 0($20) +# was: lw _size_reg_22_, 0(_arr_reg_23_) + ori $16, $28, 0 +# was: ori _letBind_21_, $28, 0 + sll $2, $17, 2 +# was: sll _tmp_32_, _size_reg_22_, 2 + addi $2, $2, 4 +# was: addi _tmp_32_, _tmp_32_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_32_ + sw $17, 0($16) +# was: sw _size_reg_22_, 0(_letBind_21_) + addi $19, $16, 4 +# was: addi _addr_reg_26_, _letBind_21_, 4 + ori $18, $0, 0 +# was: ori _i_reg_27_, $0, 0 + addi $21, $20, 4 +# was: addi _elem_reg_24_, _arr_reg_23_, 4 +_loop_beg_28_: + sub $2, $18, $17 +# was: sub _tmp_reg_30_, _i_reg_27_, _size_reg_22_ + bgez $2, _loop_end_29_ +# was: bgez _tmp_reg_30_, _loop_end_29_ + lw $2, 0($21) +# was: lw _res_reg_25_, 0(_elem_reg_24_) + addi $21, $21, 4 +# was: addi _elem_reg_24_, _elem_reg_24_, 4 +# ori $2,_res_reg_25_,0 + jal plus100 +# was: jal plus100, $2 +# ori _tmp_reg_31_,$2,0 +# ori _res_reg_25_,_tmp_reg_31_,0 + sw $2, 0($19) +# was: sw _res_reg_25_, 0(_addr_reg_26_) + addi $19, $19, 4 +# was: addi _addr_reg_26_, _addr_reg_26_, 4 + addi $18, $18, 1 +# was: addi _i_reg_27_, _i_reg_27_, 1 + j _loop_beg_28_ +_loop_end_29_: +# ori _arr_reg_34_,_letBind_12_,0 + lw $17, 0($20) +# was: lw _size_reg_35_, 0(_arr_reg_34_) + ori $2, $0, 0 +# was: ori _letBind_33_, $0, 0 + addi $20, $20, 4 +# was: addi _arr_reg_34_, _arr_reg_34_, 4 + ori $18, $0, 0 +# was: ori _ind_var_36_, $0, 0 +_loop_beg_38_: + sub $3, $18, $17 +# was: sub _tmp_reg_37_, _ind_var_36_, _size_reg_35_ + bgez $3, _loop_end_39_ +# was: bgez _tmp_reg_37_, _loop_end_39_ + lw $3, 0($20) +# was: lw _tmp_reg_37_, 0(_arr_reg_34_) + addi $20, $20, 4 +# was: addi _arr_reg_34_, _arr_reg_34_, 4 +# ori $2,_letBind_33_,0 +# ori $3,_tmp_reg_37_,0 + jal plus +# was: jal plus, $2 $3 +# ori _tmp_reg_40_,$2,0 +# ori _letBind_33_,_tmp_reg_40_,0 + addi $18, $18, 1 +# was: addi _ind_var_36_, _ind_var_36_, 1 + j _loop_beg_38_ +_loop_end_39_: + ori $2, $16, 0 +# was: ori _arr_reg_43_, _letBind_21_, 0 + lw $16, 0($2) +# was: lw _size_reg_42_, 0(_arr_reg_43_) + ori $17, $28, 0 +# was: ori _letBind_41_, $28, 0 + addi $3, $16, 3 +# was: addi _tmp_52_, _size_reg_42_, 3 + sra $3, $3, 2 +# was: sra _tmp_52_, _tmp_52_, 2 + sll $3, $3, 2 +# was: sll _tmp_52_, _tmp_52_, 2 + addi $3, $3, 4 +# was: addi _tmp_52_, _tmp_52_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_52_ + sw $16, 0($17) +# was: sw _size_reg_42_, 0(_letBind_41_) + addi $18, $17, 4 +# was: addi _addr_reg_46_, _letBind_41_, 4 + ori $19, $0, 0 +# was: ori _i_reg_47_, $0, 0 + addi $20, $2, 4 +# was: addi _elem_reg_44_, _arr_reg_43_, 4 +_loop_beg_48_: + sub $2, $19, $16 +# was: sub _tmp_reg_50_, _i_reg_47_, _size_reg_42_ + bgez $2, _loop_end_49_ +# was: bgez _tmp_reg_50_, _loop_end_49_ + lw $2, 0($20) +# was: lw _res_reg_45_, 0(_elem_reg_44_) + addi $20, $20, 4 +# was: addi _elem_reg_44_, _elem_reg_44_, 4 +# ori $2,_res_reg_45_,0 + jal chr +# was: jal chr, $2 +# ori _tmp_reg_51_,$2,0 +# ori _res_reg_45_,_tmp_reg_51_,0 + sb $2, 0($18) +# was: sb _res_reg_45_, 0(_addr_reg_46_) + addi $18, $18, 1 +# was: addi _addr_reg_46_, _addr_reg_46_, 1 + addi $19, $19, 1 +# was: addi _i_reg_47_, _i_reg_47_, 1 + j _loop_beg_48_ +_loop_end_49_: + ori $2, $0, 1 +# was: ori _arr_ind_56_, $0, 1 + addi $3, $17, 4 +# was: addi _arr_reg_57_, _letBind_41_, 4 + lw $4, 0($17) +# was: lw _size_reg_58_, 0(_letBind_41_) + bgez $2, _safe_lab_61_ +# was: bgez _arr_ind_56_, _safe_lab_61_ +_error_lab_60_: + ori $5, $0, 10 +# was: ori $5, $0, 10 + la $6, _Msg_IllegalIndex_ +# was: la $6, _Msg_IllegalIndex_ + j _RuntimeError_ +_safe_lab_61_: + sub $4, $2, $4 +# was: sub _tmp_reg_59_, _arr_ind_56_, _size_reg_58_ + bgez $4, _error_lab_60_ +# was: bgez _tmp_reg_59_, _error_lab_60_ + add $3, $3, $2 +# was: add _arr_reg_57_, _arr_reg_57_, _arr_ind_56_ + lb $2, 0($3) +# was: lb _arg_55_, 0(_arr_reg_57_) +# ori $2,_arg_55_,0 + jal ord +# was: jal ord, $2 +# ori _tmp_54_,$2,0 +# ori _letBind_53_,_tmp_54_,0 +# ori $2,_letBind_53_,0 + jal putint +# was: jal putint, $2 + ori $2, $17, 0 +# was: ori _tmp_62_, _letBind_41_, 0 + ori $16, $2, 0 +# was: ori _mainres_10_, _tmp_62_, 0 +# ori $2,_tmp_62_,0 + jal putstring +# was: jal putstring, $2 + ori $2, $16, 0 +# was: ori $2, _mainres_10_, 0 + addi $29, $29, 32 + lw $21, -28($29) + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/proj_figure3.fo b/W1/fasto/tests/proj_figure3.fo new file mode 100644 index 0000000..74e0271 --- /dev/null +++ b/W1/fasto/tests/proj_figure3.fo @@ -0,0 +1,11 @@ +fun int plus100(int x) = x + 100 +fun int plus(int x, int y) = x + y + +fun [char] main() = + let n = read(int) in // read N from the keyboard + let a = iota(n) in // produce a = {0, 1, ..., n - 1} + let b = map(plus100, a) in // b = {100, 101, ..., n + 99} + let d = reduce(plus, 0, a) in // d = 0 + 0 + 1 + 2 + ... + (n - 1) + let c = map(chr, b) in // c = {'d', 'e', 'f', ...} + let e = write(ord(c[1])) in // c[1] == 'e', ord('e') == 101 + write(c) // output "def..." to screen diff --git a/W1/fasto/tests/proj_figure3.in b/W1/fasto/tests/proj_figure3.in new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/W1/fasto/tests/proj_figure3.in @@ -0,0 +1 @@ +3 diff --git a/W1/fasto/tests/proj_figure3.out b/W1/fasto/tests/proj_figure3.out new file mode 100644 index 0000000..d2771af --- /dev/null +++ b/W1/fasto/tests/proj_figure3.out @@ -0,0 +1 @@ +101 def diff --git a/W1/fasto/tests/reduce.asm b/W1/fasto/tests/reduce.asm new file mode 100644 index 0000000..4323dc3 --- /dev/null +++ b/W1/fasto/tests/reduce.asm @@ -0,0 +1,236 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function incr +incr: + sw $31, -4($29) + addi $29, $29, -8 +# ori _param_a_1_,$2,0 +# ori _param_b_2_,$3,0 +# ori _plus_L_4_,_param_a_1_,0 +# ori _plus_R_5_,_param_b_2_,0 + add $2, $2, $3 +# was: add _incrres_3_, _plus_L_4_, _plus_R_5_ +# ori $2,_incrres_3_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function main +main: + sw $31, -4($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -20 + ori $3, $0, 3 +# was: ori _size_reg_14_, $0, 3 + ori $16, $28, 0 +# was: ori _arr_reg_8_, $28, 0 + sll $2, $3, 2 +# was: sll _tmp_17_, _size_reg_14_, 2 + addi $2, $2, 4 +# was: addi _tmp_17_, _tmp_17_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_17_ + sw $3, 0($16) +# was: sw _size_reg_14_, 0(_arr_reg_8_) + addi $3, $16, 4 +# was: addi _addr_reg_15_, _arr_reg_8_, 4 + ori $2, $0, 1 +# was: ori _tmp_reg_16_, $0, 1 + sw $2, 0($3) +# was: sw _tmp_reg_16_, 0(_addr_reg_15_) + addi $3, $3, 4 +# was: addi _addr_reg_15_, _addr_reg_15_, 4 + ori $2, $0, 2 +# was: ori _tmp_reg_16_, $0, 2 + sw $2, 0($3) +# was: sw _tmp_reg_16_, 0(_addr_reg_15_) + addi $3, $3, 4 +# was: addi _addr_reg_15_, _addr_reg_15_, 4 + ori $2, $0, 3 +# was: ori _tmp_reg_16_, $0, 3 + sw $2, 0($3) +# was: sw _tmp_reg_16_, 0(_addr_reg_15_) + addi $3, $3, 4 +# was: addi _addr_reg_15_, _addr_reg_15_, 4 + lw $17, 0($16) +# was: lw _size_reg_9_, 0(_arr_reg_8_) + ori $2, $0, 0 +# was: ori _letBind_7_, $0, 0 + addi $16, $16, 4 +# was: addi _arr_reg_8_, _arr_reg_8_, 4 + ori $18, $0, 0 +# was: ori _ind_var_10_, $0, 0 +_loop_beg_12_: + sub $3, $18, $17 +# was: sub _tmp_reg_11_, _ind_var_10_, _size_reg_9_ + bgez $3, _loop_end_13_ +# was: bgez _tmp_reg_11_, _loop_end_13_ + lw $3, 0($16) +# was: lw _tmp_reg_11_, 0(_arr_reg_8_) + addi $16, $16, 4 +# was: addi _arr_reg_8_, _arr_reg_8_, 4 +# ori $2,_letBind_7_,0 +# ori $3,_tmp_reg_11_,0 + jal incr +# was: jal incr, $2 $3 +# ori _tmp_reg_18_,$2,0 +# ori _letBind_7_,_tmp_reg_18_,0 + addi $18, $18, 1 +# was: addi _ind_var_10_, _ind_var_10_, 1 + j _loop_beg_12_ +_loop_end_13_: +# ori _tmp_19_,_letBind_7_,0 + ori $16, $2, 0 +# was: ori _mainres_6_, _tmp_19_, 0 + ori $2, $16, 0 +# was: ori $2, _mainres_6_, 0 + jal putint +# was: jal putint, $2 + ori $2, $16, 0 +# was: ori $2, _mainres_6_, 0 + addi $29, $29, 20 + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/reduce.fo b/W1/fasto/tests/reduce.fo new file mode 100644 index 0000000..23b9a44 --- /dev/null +++ b/W1/fasto/tests/reduce.fo @@ -0,0 +1,5 @@ +fun int incr(int a, int b) = a + b + +fun int main() = + let n = reduce(incr, 0, {1, 2, 3}) in + write(n) diff --git a/W1/fasto/tests/reduce.in b/W1/fasto/tests/reduce.in new file mode 100644 index 0000000..e69de29 diff --git a/W1/fasto/tests/reduce.out b/W1/fasto/tests/reduce.out new file mode 100644 index 0000000..80af6ca --- /dev/null +++ b/W1/fasto/tests/reduce.out @@ -0,0 +1 @@ +6 diff --git a/W1/fasto/tests/replicate.asm b/W1/fasto/tests/replicate.asm new file mode 100644 index 0000000..a6af3d4 --- /dev/null +++ b/W1/fasto/tests/replicate.asm @@ -0,0 +1,257 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function main +main: + sw $31, -4($29) + sw $21, -28($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -32 + ori $2, $0, 7 +# was: ori _size_reg_3_, $0, 7 + bgez $2, _safe_lab_4_ +# was: bgez _size_reg_3_, _safe_lab_4_ + ori $5, $0, 4 +# was: ori $5, $0, 4 + la $6, _Msg_IllegalArraySize_ +# was: la $6, _Msg_IllegalArraySize_ + j _RuntimeError_ +_safe_lab_4_: + ori $7, $0, 0 +# was: ori _elem_reg_5_, $0, 0 + ori $3, $28, 0 +# was: ori _letBind_2_, $28, 0 + addi $4, $2, 3 +# was: addi _tmp_11_, _size_reg_3_, 3 + sra $4, $4, 2 +# was: sra _tmp_11_, _tmp_11_, 2 + sll $4, $4, 2 +# was: sll _tmp_11_, _tmp_11_, 2 + addi $4, $4, 4 +# was: addi _tmp_11_, _tmp_11_, 4 + add $28, $28, $4 +# was: add $28, $28, _tmp_11_ + sw $2, 0($3) +# was: sw _size_reg_3_, 0(_letBind_2_) + addi $4, $3, 4 +# was: addi _addr_reg_6_, _letBind_2_, 4 + ori $5, $0, 0 +# was: ori _i_reg_7_, $0, 0 +_loop_beg_8_: + sub $6, $5, $2 +# was: sub _tmp_reg_10_, _i_reg_7_, _size_reg_3_ + bgez $6, _loop_end_9_ +# was: bgez _tmp_reg_10_, _loop_end_9_ + sb $7, 0($4) +# was: sb _elem_reg_5_, 0(_addr_reg_6_) + addi $4, $4, 1 +# was: addi _addr_reg_6_, _addr_reg_6_, 1 + addi $5, $5, 1 +# was: addi _i_reg_7_, _i_reg_7_, 1 + j _loop_beg_8_ +_loop_end_9_: +# ori _arr_reg_13_,_letBind_2_,0 + lw $16, 0($3) +# was: lw _size_reg_12_, 0(_arr_reg_13_) + ori $17, $28, 0 +# was: ori _mainres_1_, $28, 0 + addi $2, $16, 3 +# was: addi _tmp_24_, _size_reg_12_, 3 + sra $2, $2, 2 +# was: sra _tmp_24_, _tmp_24_, 2 + sll $2, $2, 2 +# was: sll _tmp_24_, _tmp_24_, 2 + addi $2, $2, 4 +# was: addi _tmp_24_, _tmp_24_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_24_ + sw $16, 0($17) +# was: sw _size_reg_12_, 0(_mainres_1_) + addi $19, $17, 4 +# was: addi _addr_reg_16_, _mainres_1_, 4 + ori $18, $0, 0 +# was: ori _i_reg_17_, $0, 0 + addi $20, $3, 4 +# was: addi _elem_reg_14_, _arr_reg_13_, 4 +_loop_beg_18_: + sub $2, $18, $16 +# was: sub _tmp_reg_20_, _i_reg_17_, _size_reg_12_ + bgez $2, _loop_end_19_ +# was: bgez _tmp_reg_20_, _loop_end_19_ + lb $21, 0($20) +# was: lb _res_reg_15_, 0(_elem_reg_14_) + addi $20, $20, 1 +# was: addi _elem_reg_14_, _elem_reg_14_, 1 +# ori _tmp_22_,_res_reg_15_,0 +# ori _fun_arg_res_21_,_tmp_22_,0 + la $2, _true +# was: la $2, _true + bne $21, $0, _wBoolF_23_ +# was: bne _fun_arg_res_21_, $0, _wBoolF_23_ + la $2, _false +# was: la $2, _false +_wBoolF_23_: + jal putstring +# was: jal putstring, $2 +# ori _res_reg_15_,_fun_arg_res_21_,0 + sb $21, 0($19) +# was: sb _res_reg_15_, 0(_addr_reg_16_) + addi $19, $19, 1 +# was: addi _addr_reg_16_, _addr_reg_16_, 1 + addi $18, $18, 1 +# was: addi _i_reg_17_, _i_reg_17_, 1 + j _loop_beg_18_ +_loop_end_19_: + ori $2, $17, 0 +# was: ori $2, _mainres_1_, 0 + addi $29, $29, 32 + lw $21, -28($29) + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/replicate.fo b/W1/fasto/tests/replicate.fo new file mode 100644 index 0000000..1d47242 --- /dev/null +++ b/W1/fasto/tests/replicate.fo @@ -0,0 +1,5 @@ +fun bool writeBool(bool b) = write(b) + +fun [bool] main() = + let fs = replicate(7, false) in + map(writeBool, fs) diff --git a/W1/fasto/tests/replicate.in b/W1/fasto/tests/replicate.in new file mode 100644 index 0000000..e69de29 diff --git a/W1/fasto/tests/replicate.out b/W1/fasto/tests/replicate.out new file mode 100644 index 0000000..28f6ac4 --- /dev/null +++ b/W1/fasto/tests/replicate.out @@ -0,0 +1,7 @@ +false +false +false +false +false +false +false diff --git a/W1/fasto/tests/scan.asm b/W1/fasto/tests/scan.asm new file mode 100644 index 0000000..665ad98 --- /dev/null +++ b/W1/fasto/tests/scan.asm @@ -0,0 +1,280 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function main +main: + sw $31, -4($29) + sw $21, -28($29) + sw $20, -24($29) + sw $19, -20($29) + sw $18, -16($29) + sw $17, -12($29) + sw $16, -8($29) + addi $29, $29, -32 + ori $4, $0, 3 +# was: ori _size_reg_3_, $0, 3 + ori $3, $28, 0 +# was: ori _letBind_2_, $28, 0 + sll $2, $4, 2 +# was: sll _tmp_6_, _size_reg_3_, 2 + addi $2, $2, 4 +# was: addi _tmp_6_, _tmp_6_, 4 + add $28, $28, $2 +# was: add $28, $28, _tmp_6_ + sw $4, 0($3) +# was: sw _size_reg_3_, 0(_letBind_2_) + addi $4, $3, 4 +# was: addi _addr_reg_4_, _letBind_2_, 4 + ori $2, $0, 1 +# was: ori _tmp_reg_5_, $0, 1 + sw $2, 0($4) +# was: sw _tmp_reg_5_, 0(_addr_reg_4_) + addi $4, $4, 4 +# was: addi _addr_reg_4_, _addr_reg_4_, 4 + ori $2, $0, 2 +# was: ori _tmp_reg_5_, $0, 2 + sw $2, 0($4) +# was: sw _tmp_reg_5_, 0(_addr_reg_4_) + addi $4, $4, 4 +# was: addi _addr_reg_4_, _addr_reg_4_, 4 + ori $2, $0, 3 +# was: ori _tmp_reg_5_, $0, 3 + sw $2, 0($4) +# was: sw _tmp_reg_5_, 0(_addr_reg_4_) + addi $4, $4, 4 +# was: addi _addr_reg_4_, _addr_reg_4_, 4 +# ori _inp_reg_9_,_letBind_2_,0 + ori $8, $0, 0 +# was: ori _acc_reg_13_, $0, 0 + lw $4, 0($3) +# was: lw _size_reg_10_, 0(_inp_reg_9_) + addi $3, $3, 4 +# was: addi _inp_reg_9_, _inp_reg_9_, 4 + ori $2, $28, 0 +# was: ori _letBind_7_, $28, 0 + sll $5, $4, 2 +# was: sll _tmp_16_, _size_reg_10_, 2 + addi $5, $5, 4 +# was: addi _tmp_16_, _tmp_16_, 4 + add $28, $28, $5 +# was: add $28, $28, _tmp_16_ + sw $4, 0($2) +# was: sw _size_reg_10_, 0(_letBind_7_) + addi $6, $2, 4 +# was: addi _res_reg_8_, _letBind_7_, 4 + ori $5, $0, 0 +# was: ori _ind_var_11_, $0, 0 +_loop_beg_14_: + sub $7, $5, $4 +# was: sub _tmp_reg_12_, _ind_var_11_, _size_reg_10_ + bgez $7, _loop_end_15_ +# was: bgez _tmp_reg_12_, _loop_end_15_ + lw $7, 0($3) +# was: lw _tmp_reg_12_, 0(_inp_reg_9_) +# ori _plus_L_18_,_acc_reg_13_,0 +# ori _plus_R_19_,_tmp_reg_12_,0 + add $8, $8, $7 +# was: add _fun_arg_res_17_, _plus_L_18_, _plus_R_19_ +# ori _acc_reg_13_,_fun_arg_res_17_,0 + sw $8, 0($6) +# was: sw _acc_reg_13_, 0(_res_reg_8_) + addi $6, $6, 4 +# was: addi _res_reg_8_, _res_reg_8_, 4 + addi $3, $3, 4 +# was: addi _inp_reg_9_, _inp_reg_9_, 4 + addi $5, $5, 1 +# was: addi _ind_var_11_, _ind_var_11_, 1 + j _loop_beg_14_ +_loop_end_15_: +# ori _arr_reg_21_,_letBind_7_,0 + lw $17, 0($2) +# was: lw _size_reg_20_, 0(_arr_reg_21_) + ori $16, $28, 0 +# was: ori _mainres_1_, $28, 0 + sll $3, $17, 2 +# was: sll _tmp_31_, _size_reg_20_, 2 + addi $3, $3, 4 +# was: addi _tmp_31_, _tmp_31_, 4 + add $28, $28, $3 +# was: add $28, $28, _tmp_31_ + sw $17, 0($16) +# was: sw _size_reg_20_, 0(_mainres_1_) + addi $18, $16, 4 +# was: addi _addr_reg_24_, _mainres_1_, 4 + ori $19, $0, 0 +# was: ori _i_reg_25_, $0, 0 + addi $20, $2, 4 +# was: addi _elem_reg_22_, _arr_reg_21_, 4 +_loop_beg_26_: + sub $2, $19, $17 +# was: sub _tmp_reg_28_, _i_reg_25_, _size_reg_20_ + bgez $2, _loop_end_27_ +# was: bgez _tmp_reg_28_, _loop_end_27_ + lw $21, 0($20) +# was: lw _res_reg_23_, 0(_elem_reg_22_) + addi $20, $20, 4 +# was: addi _elem_reg_22_, _elem_reg_22_, 4 +# ori _tmp_30_,_res_reg_23_,0 +# ori _fun_arg_res_29_,_tmp_30_,0 + ori $2, $21, 0 +# was: ori $2, _fun_arg_res_29_, 0 + jal putint +# was: jal putint, $2 +# ori _res_reg_23_,_fun_arg_res_29_,0 + sw $21, 0($18) +# was: sw _res_reg_23_, 0(_addr_reg_24_) + addi $18, $18, 4 +# was: addi _addr_reg_24_, _addr_reg_24_, 4 + addi $19, $19, 1 +# was: addi _i_reg_25_, _i_reg_25_, 1 + j _loop_beg_26_ +_loop_end_27_: + ori $2, $16, 0 +# was: ori $2, _mainres_1_, 0 + addi $29, $29, 32 + lw $21, -28($29) + lw $20, -24($29) + lw $19, -20($29) + lw $18, -16($29) + lw $17, -12($29) + lw $16, -8($29) + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/scan.fo b/W1/fasto/tests/scan.fo new file mode 100644 index 0000000..64553f0 --- /dev/null +++ b/W1/fasto/tests/scan.fo @@ -0,0 +1,8 @@ +fun int incr(int a, int b) = a + b + +fun int writeInt(int n) = write(n) + +fun [int] main() = + let a = {1, 2, 3} in + let b = scan(incr, 0, a) in + map(writeInt, b) diff --git a/W1/fasto/tests/scan.in b/W1/fasto/tests/scan.in new file mode 100644 index 0000000..e69de29 diff --git a/W1/fasto/tests/scan.out b/W1/fasto/tests/scan.out new file mode 100644 index 0000000..d0b145d --- /dev/null +++ b/W1/fasto/tests/scan.out @@ -0,0 +1 @@ +1 3 6 diff --git a/W1/fasto/tests/short_circuit.asm b/W1/fasto/tests/short_circuit.asm new file mode 100644 index 0000000..a777142 --- /dev/null +++ b/W1/fasto/tests/short_circuit.asm @@ -0,0 +1,193 @@ + .text 0x00400000 + .globl main + la $28, _heap_ + la $4, _true +# was: la _true_addr, _true + ori $3, $0, 4 +# was: ori _true_init, $0, 4 + sw $3, 0($4) +# was: sw _true_init, 0(_true_addr) + la $3, _false +# was: la _false_addr, _false + ori $4, $0, 5 +# was: ori _false_init, $0, 5 + sw $4, 0($3) +# was: sw _false_init, 0(_false_addr) + jal main +_stop_: + ori $2, $0, 10 + syscall +# Function no_way +no_way: + sw $31, -4($29) + addi $29, $29, -8 + jal no_way +# was: jal no_way, +# ori _no_wayres_1_,$2,0 +# ori $2,_no_wayres_1_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +# Function main +main: + sw $31, -4($29) + addi $29, $29, -8 + ori $3, $0, 0 +# was: ori _tmp_4_, $0, 0 +# ori _letBind_3_,_tmp_4_,0 + la $2, _true +# was: la $2, _true + bne $3, $0, _wBoolF_5_ +# was: bne _letBind_3_, $0, _wBoolF_5_ + la $2, _false +# was: la $2, _false +_wBoolF_5_: + jal putstring +# was: jal putstring, $2 + ori $3, $0, 1 +# was: ori _tmp_7_, $0, 1 + bne $3, $0, _endLabel_8_ +# was: bne _tmp_7_, $0, _endLabel_8_ + jal no_way +# was: jal no_way, + ori $3, $2, 0 +# was: ori _tmp_7_, $2, 0 +_endLabel_8_: +# ori _letBind_6_,_tmp_7_,0 + la $2, _true +# was: la $2, _true + bne $3, $0, _wBoolF_9_ +# was: bne _letBind_6_, $0, _wBoolF_9_ + la $2, _false +# was: la $2, _false +_wBoolF_9_: + jal putstring +# was: jal putstring, $2 + ori $2, $0, 1 +# was: ori _mainres_2_, $0, 1 +# ori $2,_mainres_2_,0 + addi $29, $29, 8 + lw $31, -4($29) + jr $31 +ord: + jr $31 +chr: + andi $2, $2, 255 + jr $31 +putint: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 1 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getint: + ori $2, $0, 5 + syscall + jr $31 +putchar: + addi $29, $29, -8 + sw $2, 0($29) + sw $4, 4($29) + ori $4, $2, 0 + ori $2, $0, 11 + syscall + ori $2, $0, 4 + la $4, _space_ + syscall + lw $2, 0($29) + lw $4, 4($29) + addi $29, $29, 8 + jr $31 +getchar: + addi $29, $29, -8 + sw $4, 0($29) + sw $5, 4($29) + ori $2, $0, 12 + syscall + ori $5, $2, 0 + ori $2, $0, 4 + la $4, _cr_ + syscall + ori $2, $5, 0 + lw $4, 0($29) + lw $5, 4($29) + addi $29, $29, 8 + jr $31 +putstring: + addi $29, $29, -16 + sw $2, 0($29) + sw $4, 4($29) + sw $5, 8($29) + sw $6, 12($29) + lw $4, 0($2) + addi $5, $2, 4 + add $6, $5, $4 + ori $2, $0, 11 +putstring_begin: + sub $4, $5, $6 + bgez $4, putstring_done + lb $4, 0($5) + syscall + addi $5, $5, 1 + j putstring_begin +putstring_done: + lw $2, 0($29) + lw $4, 4($29) + lw $5, 8($29) + lw $6, 12($29) + addi $29, $29, 16 + jr $31 +_RuntimeError_: + la $4, _ErrMsg_ + ori $2, $0, 4 + syscall + ori $4, $5, 0 + ori $2, $0, 1 + syscall + la $4, _colon_space_ + ori $2, $0, 4 + syscall + ori $4, $6, 0 + ori $2, $0, 4 + syscall + la $4, _cr_ + ori $2, $0, 4 + syscall + j _stop_ + .data +# Fixed strings for I/O +_ErrMsg_: + .asciiz "Runtime error at line " +_colon_space_: + .asciiz ": " +_cr_: + .asciiz "\n" +_space_: + .asciiz " " +# Message strings for specific errors +_Msg_IllegalArraySize_: + .asciiz "negative array size" +_Msg_IllegalIndex_: + .asciiz "array index out of bounds" +_Msg_DivZero_: + .asciiz "division by zero" +# String Literals + .align 2 +_true: + .space 4 + .asciiz "true" + .align 2 +_false: + .space 4 + .asciiz "false" + .align 2 +_heap_: + .space 100000 \ No newline at end of file diff --git a/W1/fasto/tests/short_circuit.fo b/W1/fasto/tests/short_circuit.fo new file mode 100644 index 0000000..9b9d355 --- /dev/null +++ b/W1/fasto/tests/short_circuit.fo @@ -0,0 +1,6 @@ +fun bool no_way() = no_way() + +fun bool main() = + let a = write(false && no_way()) in + let b = write(true || no_way()) in + true diff --git a/W1/fasto/tests/short_circuit.in b/W1/fasto/tests/short_circuit.in new file mode 100644 index 0000000..e69de29 diff --git a/W1/fasto/tests/short_circuit.out b/W1/fasto/tests/short_circuit.out new file mode 100644 index 0000000..efa9e8f --- /dev/null +++ b/W1/fasto/tests/short_circuit.out @@ -0,0 +1 @@ +falsetrue diff --git a/W1/fasto/tools/emacs/README.md b/W1/fasto/tools/emacs/README.md new file mode 100644 index 0000000..6129717 --- /dev/null +++ b/W1/fasto/tools/emacs/README.md @@ -0,0 +1,8 @@ +# Emacs mode for Fasto + +This Emacs mode provides: + + + syntax highlighting, and + + automatic indentation + +for Fasto programs. See the file itself for installation instructions. diff --git a/W1/fasto/tools/emacs/fasto-mode.el b/W1/fasto/tools/emacs/fasto-mode.el new file mode 100644 index 0000000..64b4b39 --- /dev/null +++ b/W1/fasto/tools/emacs/fasto-mode.el @@ -0,0 +1,362 @@ +;;; fasto-mode.el --- major mode for editing Fasto source files + +;; Copyright (C) DIKU 2014-2017, University of Copenhagen +;; Based on futhark-mode.el + +;;; Commentary: +;; This mode provides syntax highlighting and automatic indentation for +;; Fasto source files. +;; +;; This mode provides the following features for Fasto source files: +;; +;; + syntax highlighting +;; + automatic indentation +;; +;; To load fasto-mode automatically on Emacs startup, make sure this +;; file is in your load path and then require the mode, e.g. something +;; like this: +;; +;; (add-to-list 'load-path "path/to/fasto/tools/emacs") +;; (require 'fasto-mode) +;; +;; This will also tell your Emacs that ".fo" files are to be handled by +;; fasto-mode. +;; +;; Define your local keybindings in `fasto-mode-map', and add startup +;; functions to `fasto-mode-hook'. +;; +;; Report bugs to Niels. + + +;;; Basics + +(require 'cl) ; `some' + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.fo\\'" . fasto-mode)) + +(defvar fasto-mode-hook nil + "Hook for fasto-mode. Is run whenever the mode is entered.") + +(defvar fasto-mode-map + (make-keymap) + "Keymap for fasto-mode.") + +(defconst fasto-keywords + '("if" "then" "else" "let" "in" "fun" "fn" "op") + "All Fasto keywords.") + +(defconst fasto-builtin-functions + '("iota" "replicate" "map" "reduce" "scan" "read" "write" "not") + "All Fasto builtin SOACs, functions and non-symbolic operators.") + +(defconst fasto-builtin-operators + '("+" "-" "==" "<" "~" "&&" "||") + "All Fasto builtin symbolic operators.") + +(defconst fasto-builtin-types + '("int" "bool" "char") + "All Fasto builtin primitive types.") + +(defconst fasto-booleans + '("true" "false") + "All Fasto booleans.") + +(defconst fasto-type + (concat "\\[*" "\\<" (regexp-opt fasto-builtin-types 'nil) "\\>" "\\]*") + "A regex describing a Fasto type.") + +(defconst fasto-var + (concat "\\(?:" "[_'[:alnum:]]+" "\\)") + "A regex describing a Fasto variable.") + + +;;; Highlighting + +(let ( + (ws "[[:space:]\n]*") + (ws1 "[[:space:]\n]+") + ) + (defvar fasto-font-lock + `( + + ;; Function declarations. + (,(concat "fun" ws1 fasto-type ws1 "\\(" fasto-var "\\)") + . '(1 font-lock-function-name-face)) + + ;; Function parameters. + (,(concat "\\(?:" "(" "\\|" "," "\\)" ws + fasto-type ws1 "\\(" fasto-var "\\)") + . '(1 font-lock-variable-name-face)) + + ;; Let declarations. + (,(concat "let" ws1 + "\\(" fasto-var "\\)") + . '(1 font-lock-variable-name-face)) + + ;; Keywords. + (,(regexp-opt fasto-keywords 'words) + . font-lock-keyword-face) + + ;; Types. + (,fasto-type + . font-lock-type-face) + + ;; Builtins. + ;;; Functions. + (,(regexp-opt fasto-builtin-functions 'words) + . font-lock-builtin-face) + ;;; Operators. + (,(regexp-opt fasto-builtin-operators) + . font-lock-builtin-face) + + ;; Constants. + ;;; Booleans. + (,(regexp-opt fasto-booleans 'words) + . font-lock-constant-face) + + ) + "Highlighting expressions for Fasto.") + ) + +(defvar fasto-mode-syntax-table + (let ((st (make-syntax-table))) + ;; Define the // line comment syntax. + (modify-syntax-entry ?/ ". 123" st) + (modify-syntax-entry ?\n ">" st) + ;; Make apostrophe and underscore be part of variable names. + ;; Technically, they should probably be part of the symbol class, + ;; but it works out better for some of the regexpes if they are part + ;; of the word class. + (modify-syntax-entry ?' "w" st) + (modify-syntax-entry ?_ "w" st) + (modify-syntax-entry ?\\ "_" st) + st) + "Syntax table used in `fasto-mode'.") + + +;;; Indentation + +(defvar fasto-indent-level 2 + "The basic indent level for fasto-mode.") + +(defun fasto-indent-line () + "Indent current line as Fasto code." + (let ((savep (> (current-column) (current-indentation))) + (indent (or (fasto-calculate-indentation) + (current-indentation)))) + (if savep ; The cursor is beyond leading whitespace. + (save-excursion (indent-line-to indent)) + (indent-line-to indent)))) + +(defun fasto-calculate-indentation () + "Calculate the indentation for the current line. +In general, prefer as little indentation as possible." + (let ((parse-sexp-lookup-properties t) + (parse-sexp-ignore-comments t)) + + (save-excursion + (fasto-beginning-of-line-text) + + ;; The following code is fickle and deceptive. Don't change it + ;; unless you kind of know what you're doing! + (or + + ;; Align comment to next non-comment line. + (and (looking-at comment-start) + (forward-comment (count-lines (point-min) (point))) + (current-column)) + + ;; Align global function definitions to column 0. + (and (fasto-looking-at-word "fun") + 0) + + ;; Align closing parentheses and commas to the matching opening + ;; parenthesis. + (save-excursion + (and (looking-at (regexp-opt '(")" "]" ","))) + (ignore-errors + (backward-up-list 1) + (current-column)))) + + ;; Align "in" or "let" to the closest previous "let". + (save-excursion + (and (or (fasto-looking-at-word "in") + (fasto-looking-at-word "let")) + (let ((m + (save-excursion + (fasto-keyword-backward "let")) + )) + (and (not (eq nil m)) + (goto-char m) + (current-column))))) + + ;; Otherwise, if the previous code line ends with "in" align to + ;; the matching "let" column. + (save-excursion + (and (fasto-backward-part) + (looking-at "\\"))) + +(defun fasto-keyword-backward (word) + "Go to a keyword WORD before the current position. +Set mark and return t if found; return nil otherwise." + (let (;; Only look in the current paren-delimited code if present. + (startp (point)) + (topp (or (save-excursion (ignore-errors + (backward-up-list 1) + (point))) + (max + (or (save-excursion (fasto-keyword-backward-raw "fun")) + 0) + (or (save-excursion (fasto-keyword-backward-raw "entry")) + 0)))) + (result nil)) + + (while (and (not result) + (fasto-backward-part) + (>= (point) topp)) + + (if (fasto-looking-at-word word) + (setq result (point)))) + + (or result + (progn + (goto-char startp) + nil)))) + +(defun fasto-keyword-backward-raw (word) + "Go to a keyword WORD before the current position. +Ignore any program structure." + (let ((pstart (point))) + (while (and (fasto-backward-part) + (not (fasto-looking-at-word word)))) + (and (fasto-looking-at-word word) + (point)))) + + +;;; Actual mode declaration + +(define-derived-mode fasto-mode fundamental-mode "Fasto" + "Major mode for editing Fasto source files." + :syntax-table fasto-mode-syntax-table + (set (make-local-variable 'font-lock-defaults) '(fasto-font-lock)) + (set (make-local-variable 'indent-line-function) 'fasto-indent-line) + (set (make-local-variable 'indent-region-function) nil) + (set (make-local-variable 'comment-start) "//") + (set (make-local-variable 'comment-padding) " ")) + +(provide 'fasto-mode) + +;;; fasto-mode.el ends here diff --git a/W1/fasto/tools/vim/README.txt b/W1/fasto/tools/vim/README.txt new file mode 100644 index 0000000..7306fb4 --- /dev/null +++ b/W1/fasto/tools/vim/README.txt @@ -0,0 +1,13 @@ +Vim syntax highlighting for Fasto. +Created by Oleksandr Shturmov on November 1, 2014. + +To install: + +1. Copy fasto.vim into your ~/.vim/syntax/ (create the directory if it doesn't +already exist). + +2. Add the following line to your ~/.vimrc. This will make sure that any .fo +file is recognised as a fasto file. It is important that fasto.vim is present +in ~/.vim/syntax/ for syntax highlighting to work. + +au BufNewFile,BufRead *.fo setlocal ft=fasto diff --git a/W1/fasto/tools/vim/fasto.vim b/W1/fasto/tools/vim/fasto.vim new file mode 100644 index 0000000..e955c3d --- /dev/null +++ b/W1/fasto/tools/vim/fasto.vim @@ -0,0 +1,22 @@ +" Vim syntax file for Fasto. +" Created by Oleksandr Shturmov on November 1, 2014. + +if exists("b:current_syntax") + finish +end + +syn keyword fastoKeyword fun fn op if then else let in +syn keyword fastoType int char bool +syn keyword fastoFunction read write iota replicate map reduce scan + +syn match fastoString "\"\([ -!#-&(-[\]-~]\|\\[\x0-\x7f]\)*\"" + +syn match fastoComment "//.*$" + +highlight link fastoKeyword Keyword +highlight link fastoType Type +highlight link fastoFunction Function + +highlight link fastoString String + +highlight link fastoComment Comment diff --git a/W1/report/fasto.sty b/W1/report/fasto.sty new file mode 100644 index 0000000..b7a9307 --- /dev/null +++ b/W1/report/fasto.sty @@ -0,0 +1,50 @@ +\usepackage{xcolor} +\usepackage{listings} +\usepackage{tcolorbox} +\tcbuselibrary{listings} + +\definecolor{basicColor}{HTML}{5C6166} + +\definecolor{backgroundColor}{HTML}{FCFCFC} +\definecolor{keywordColor}{HTML}{FA8D3E} +\definecolor{stringColor}{HTML}{86B300} +\definecolor{typeColor}{HTML}{399EE6} +\definecolor{numberColor}{HTML}{A37ACC} + +\lstdefinelanguage{Fasto}{ + alsoletter=0123456789, + keywords={[0]fun,let,in,if,else,then}, + keywords={[1]int,char,bool}, + keywords={[2]@invariant,0,1,2,3,4,5,6,7,8,9}, + sensitive=true, + comment=[l]{//}, + comment=[s]{/*}{*/}, + string=[b]", +} + +\lstdefinelanguage{FSharp}{ + alsoletter=0123456789->|, + keywords={[0]let,rec,|,->,match,for,in,with}, + keywords={[1]int,char,bool,INT,EXP,SymTab,CONSTANT,VARIABLE,OPERATE,LET_IN, OVER,BPLUS,BMINUS,BTIMES,RSUM,RPROD,RMAX,RARGMAX}, + keywords={[2]@invariant,0,1,2,3,4,5,6,7,8,9}, + sensitive=true, + comment=[l]{//}, + comment=[s]{/*}{*/}, + string=[b]", +} + +\lstset{ + basicstyle=\color{basicColor}\footnotesize\ttfamily, + keywordstyle=[0]\color{keywordColor}, + keywordstyle=[1]\color{typeColor}, + keywordstyle=[2]\color{numberColor}, + stringstyle=\color{stringColor}, + backgroundcolor=\color{backgroundColor}, + frame=single, framerule=1pt, + numbers=left, + stepnumber=1, + showstringspaces=false, + tabsize=1, + breaklines=true, + breakatwhitespace=true +} diff --git a/W1/report/main.aux b/W1/report/main.aux index 9d58a80..8e79d8e 100644 --- a/W1/report/main.aux +++ b/W1/report/main.aux @@ -1,5 +1,10 @@ \relax \@writefile{toc}{\contentsline {section}{\numberline {Task 1}}{1}{}\protected@file@percent } \@writefile{toc}{\contentsline {section}{\numberline {Task 2}}{1}{}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {Task 3}}{1}{}\protected@file@percent } -\gdef \@abspage@last{1} +\@writefile{toc}{\contentsline {subsection}{\numberline {a)}Completeness and Correctness}{1}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {b)}Effeciency}{1}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {c)}Code Sharing/Elegance}{1}{}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {Task 3}}{2}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {a)}The \texttt {mul} function}{2}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {b)}The \texttt {dif} array}{2}{}\protected@file@percent } +\gdef \@abspage@last{2} diff --git a/W1/report/main.fdb_latexmk b/W1/report/main.fdb_latexmk index 8095965..3037c02 100644 --- a/W1/report/main.fdb_latexmk +++ b/W1/report/main.fdb_latexmk @@ -1,19 +1,181 @@ # Fdb version 3 -["pdflatex"] 1651237923 "/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/main.tex" "main.pdf" "main" 1651237923 - "/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/main.tex" 1651237922 364 e3b792744da3753f628354d9558911dc "" - "/usr/share/texmf-dist/fonts/map/fontname/texfonts.map" 1647844622 3524 cb3e574dea2d1052e39280babc910dc8 "" - "/usr/share/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm" 1647844622 1324 c910af8c371558dc20f2d7822f66fe64 "" - "/usr/share/texmf-dist/fonts/tfm/public/cm/cmr12.tfm" 1647844622 1288 655e228510b4c2a1abe905c368440826 "" - "/usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb" 1647844622 32080 340ef9bf63678554ee606688e7b5339d "" +["lualatex"] 1651328147 "/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/report/main.tex" "main.pdf" "main" 1651328149 + "/home/nikolaj/.local/share/fonts/AntikorMono/AntikorMono-Medium.ttf" 1611081972 103940 8e55892035a16215c54dd867754fccc1 "" + "/home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/antikormono-medium.luc" 1651323665 104754 23ebedc62154e273369ad441e4fed323 "" + "/home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-bold.luc" 1650282221 128371 e7304f80c7b50597b0633dcda00e60a9 "" + "/home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.luc" 1650282220 127288 6309a12a9fa2902a726598dfef4db5a5 "" + "/home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman12-bold.luc" 1650283882 128260 0cb73513006fafa01bb14effa930136e "" + "/home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman12-regular.luc" 1650282221 127631 287ab9e4525229c0e9d55529c34ca704 "" + "/home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman5-regular.luc" 1650282947 125928 77b87069a223d22532f2ecd3464329ff "" + "/home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman7-regular.luc" 1650282946 128336 ad98c6b5a083d412c7d7fbb411623378 "" + "/home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman8-regular.luc" 1650282226 128107 a6e5f63d68c9e0e82c3eac00f927eb1a "" + "/home/nikolaj/.texlive/texmf-var/luatex-cache/generic/names/luaotfload-lookup-cache.luc" 1651324362 949 9ecbdc9cca7e688ea7ef82a41f357e7d "" + "/home/nikolaj/.texlive/texmf-var/luatex-cache/generic/names/luaotfload-names.luc.gz" 1651323659 341600 1597a54d96fec9bc135c0799b8b573f7 "" + "/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/report/main.tex" 1651328147 4845 61aad2f0febf6b560548fe1b0206bacb "" + "/usr/share/fonts/OTF/lmroman10-regular.otf" 1593426288 111536 ae9d1b331000d544f47e5223081b7b54 "" + "/usr/share/fonts/OTF/lmroman12-bold.otf" 1593426288 110496 b9c8767d4cc3bf3f4b21f676bf89aa78 "" + "/usr/share/fonts/OTF/lmroman8-regular.otf" 1593426288 111948 cee9e390fd6d23cfb4d6871ba2a9ee5b "" + "/usr/share/texmf-dist/fonts/tfm/public/cm/cmex10.tfm" 1647844622 992 662f679a0b3d2d53c1b94050fdaa3f50 "" + "/usr/share/texmf-dist/fonts/tfm/public/cm/cmmi10.tfm" 1647844622 1528 abec98dbc43e172678c11b3b9031252a "" + "/usr/share/texmf-dist/fonts/tfm/public/cm/cmmi5.tfm" 1647844622 1508 3b32edd0d68f6498a5a375e78f9edc5e "" + "/usr/share/texmf-dist/fonts/tfm/public/cm/cmmi7.tfm" 1647844622 1528 e2423ae06dc7dee599cceb79d1c9dc32 "" + "/usr/share/texmf-dist/fonts/tfm/public/cm/cmr10.tfm" 1647844622 1296 45809c5a464d5f32c8f98ba97c1bb47f "" + "/usr/share/texmf-dist/fonts/tfm/public/cm/cmr5.tfm" 1647844622 1220 ad296dff3c8796c18053ab7b9f86ad7c "" + "/usr/share/texmf-dist/fonts/tfm/public/cm/cmr7.tfm" 1647844622 1300 53d07721103816e093902637bc167021 "" + "/usr/share/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm" 1647844622 1124 6c73e740cf17375f03eec0ee63599741 "" + "/usr/share/texmf-dist/fonts/tfm/public/cm/cmsy5.tfm" 1647844622 1112 14d5d5f6bd3c949edecb5b872f295553 "" + "/usr/share/texmf-dist/fonts/tfm/public/cm/cmsy7.tfm" 1647844622 1120 2b3f9b25605010c69bc328bea6ac000f "" + "/usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb" 1647844622 36299 5f9df58c2139e7edcf37c8fca4bd384d "" "/usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb" 1647844622 35752 024fb6c41858982481f6968b5fc26508 "" + "/usr/share/texmf-dist/tex/context/base/mkii/supp-pdf.mkii" 1647844622 71627 94eb9990bed73c364d7f53f960cc8c5b "" + "/usr/share/texmf-dist/tex/generic/iftex/iftex.sty" 1647844622 7237 bdd120a32c8fdb4b433cf9ca2e7cd98a "" + "/usr/share/texmf-dist/tex/generic/iftex/ifvtex.sty" 1647844622 1057 525c2192b5febbd8c1f662c9468335bb "" + "/usr/share/texmf-dist/tex/generic/infwarerr/infwarerr.sty" 1647844622 8356 7bbb2c2373aa810be568c29e333da8ed "" + "/usr/share/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty" 1647844622 17859 4409f8f50cd365c68e684407e5350b1b "" + "/usr/share/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.lua" 1647844622 9447 5e9f52f1871707a5d27dea360afbe4cb "" + "/usr/share/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty" 1647844622 20089 80423eac55aa175305d35b49e04fe23b "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex" 1647844622 992 855ff26741653ab54814101ca36e153c "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex" 1647844622 43820 1fef971b75380574ab35a0d37fd92608 "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex" 1647844622 19324 f4e4c6403dd0f1605fd20ed22fa79dea "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex" 1647844622 6038 ccb406740cc3f03bbfb58ad504fe8c27 "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex" 1647844622 6944 e12f8f7a7364ddf66f93ba30fb3a3742 "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex" 1647844622 4883 42daaf41e27c3735286e23e48d2d7af9 "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex" 1647844622 2544 8c06d2a7f0f469616ac9e13db6d2f842 "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex" 1647844622 44195 5e390c414de027626ca5e2df888fa68d "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex" 1647844622 17311 2ef6b2e29e2fc6a2fc8d6d652176e257 "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex" 1647844622 21302 788a79944eb22192a4929e46963a3067 "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex" 1647844622 9690 01feb7cde25d4293ef36eef45123eb80 "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex" 1647844622 33335 dd1fa4814d4e51f18be97d88bf0da60c "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex" 1647844622 2965 4c2b1f4e0826925746439038172e5d6f "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex" 1647844622 5196 2cc249e0ee7e03da5f5f6589257b1e5b "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex" 1647844622 20726 d4c8db1e2e53b72721d29916314a22ea "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex" 1647844622 35249 abd4adf948f960299a4b3d27c5dddf46 "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex" 1647844622 21989 fdc867d05d228316de137a9fc5ec3bbe "" + "/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex" 1647844622 8893 e851de2175338fdf7c17f3e091d94618 "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfint.code.tex" 1647844622 3063 8c415c68a0f3394e45cfeca0b65f6ee6 "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex" 1647844622 521 8e224a7af69b7fee4451d1bf76b46654 "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex" 1647844622 13391 84d29568c13bdce4133ab4a214711112 "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex" 1647844622 104935 184ed87524e76d4957860df4ce0cd1c3 "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex" 1647844622 10165 cec5fa73d49da442e56efc2d605ef154 "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex" 1647844622 28178 41c17713108e0795aac6fef3d275fbca "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex" 1647844622 9989 c55967bf45126ff9b061fa2ca0c4694f "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex" 1647844622 3865 ac538ab80c5cf82b345016e474786549 "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex" 1647844622 3177 27d85c44fbfe09ff3b2cf2879e3ea434 "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex" 1647844622 11024 0179538121bc2dba172013a3ef89519f "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex" 1647844622 7854 4176998eeefd8745ac6d2d4bd9c98451 "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex" 1647844622 3379 781797a101f647bab82741a99944a229 "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex" 1647844622 92405 f515f31275db273f97b9d8f52e1b0736 "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex" 1647844622 37376 11cd75aac3da1c1b152b2848f30adc14 "" + "/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex" 1647844622 8471 c2883569d03f69e8e1cabfef4999cfd7 "" + "/usr/share/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex" 1647844622 16121 346f9013d34804439f7436ff6786cef7 "" + "/usr/share/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex" 1647844622 44784 cedaa399d15f95e68e22906e2cc09ef8 "" + "/usr/share/texmf-dist/tex/generic/pgf/pgf.revision.tex" 1647844622 465 d68603f8b820ea4a08cce534944db581 "" + "/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg" 1647844622 926 2963ea0dcf6cc6c0a770b69ec46a477b "" + "/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def" 1647844622 5546 f3f24d7898386cb7daac70bdd2c4d6dc "" + "/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def" 1647844622 13244 6674e4de0678d77c2d7465acc4ea20d7 "" + "/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex" 1647844622 61163 9b2eefc24e021323e0fc140e9826d016 "" + "/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex" 1647844622 1896 b8e0ca0ac371d74c0ca05583f6313c91 "" + "/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex" 1647844622 7778 53c8b5623d80238f6a20aa1df1868e63 "" + "/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex" 1647844622 37060 797782f0eb50075c9bc952374d9a659a "" + "/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex" 1647844622 37431 9abe862035de1b29c7a677f3205e3d9f "" + "/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex" 1647844622 4494 af17fb7efeafe423710479858e42fa7e "" + "/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex" 1647844622 7251 fb18c67117e09c64de82267e12cd8aa4 "" + "/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex" 1647844622 29274 e15c5b7157d21523bd9c9f1dfa146b8e "" + "/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def" 1647844622 6825 a2b0ea5b539dda0625e99dd15785ab59 "" + "/usr/share/texmf-dist/tex/generic/unicode-data/CaseFolding.txt" 1647844622 84688 8e67e575f505f0ec3d23bc8a0961894e "" + "/usr/share/texmf-dist/tex/generic/unicode-data/PropList.txt" 1647844622 130164 82b7580d6edaca727c23d8bf9ec00aa5 "" + "/usr/share/texmf-dist/tex/generic/unicode-data/ScriptExtensions.txt" 1647844622 21969 531ffba1234ef2c233f4ffa1bdc9c58f "" + "/usr/share/texmf-dist/tex/generic/unicode-data/Scripts.txt" 1647844622 181635 b1d22e9d6073db71dc94e5f0c2f1ab6b "" + "/usr/share/texmf-dist/tex/generic/unicode-data/SpecialCasing.txt" 1647844622 16830 24748f42075a36b6d7521d0867a90717 "" + "/usr/share/texmf-dist/tex/generic/unicode-data/UnicodeData.txt" 1647844622 1897793 c98cbeae07758b826ef080c65b9d4d61 "" + "/usr/share/texmf-dist/tex/generic/unicode-data/WordBreakProperty.txt" 1647844622 107025 7c1847e08aecbf5069b4bb31cf508810 "" "/usr/share/texmf-dist/tex/latex/base/article.cls" 1647844622 20144 8a7de377ae7a11ee924a7499611f5a9d "" + "/usr/share/texmf-dist/tex/latex/base/fontenc.sty" 1647844622 4946 461cc78f6f26901410d9f1d725079cc6 "" + "/usr/share/texmf-dist/tex/latex/base/ltluatex.lua" 1647844622 19214 9fefc6dff80101966499ea0d8ae2e503 "" "/usr/share/texmf-dist/tex/latex/base/size10.clo" 1647844622 8448 96f18c76bf608a36ee6fbf021ac1dd32 "" - "/usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def" 1647844622 29921 d0acc05a38bd4aa3af2017f0b7c137ce "" - "/usr/share/texmf-dist/web2c/texmf.cnf" 1647844622 39911 2da6c67557ec033436fe5418a70a8a61 "" + "/usr/share/texmf-dist/tex/latex/base/ts1cmr.fd" 1647844622 2430 06a89bcded389391906798ea7a3f3aaa "" + "/usr/share/texmf-dist/tex/latex/environ/environ.sty" 1647807149 4378 f429f0da968c278653359293040a8f52 "" + "/usr/share/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty" 1647844622 13886 d1306dcf79a944f6988e688c1785f9ce "" + "/usr/share/texmf-dist/tex/latex/etoolbox/etoolbox.sty" 1647844622 46845 3b58f70c6e861a13d927bff09d35ecbc "" + "/usr/share/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty" 1647844622 150585 e7858b29d466f38afac90db54bb48055 "" + "/usr/share/texmf-dist/tex/latex/fontspec/fontspec.cfg" 1647844622 549 c4adac819276241fea8eb79c5ab7b99e "" + "/usr/share/texmf-dist/tex/latex/fontspec/fontspec.lua" 1647844622 3021 d020be140dbb56718a42324548f9a72e "" + "/usr/share/texmf-dist/tex/latex/fontspec/fontspec.sty" 1647844622 1656 7e824878bad4df5a3e8bba4e463d9126 "" + "/usr/share/texmf-dist/tex/latex/geometry/geometry.sty" 1647844622 41601 9cf6c5257b1bc7af01a58859749dd37a "" + "/usr/share/texmf-dist/tex/latex/graphics-cfg/color.cfg" 1647844622 1213 620bba36b25224fa9b7e1ccb4ecb76fd "" + "/usr/share/texmf-dist/tex/latex/graphics-cfg/graphics.cfg" 1647844622 1224 978390e9c2234eab29404bc21b268d1e "" + "/usr/share/texmf-dist/tex/latex/graphics-def/luatex.def" 1647844622 19010 055822b35577472bb450b4662bbf28d9 "" + "/usr/share/texmf-dist/tex/latex/graphics/graphics.sty" 1647844622 18399 7e40f80366dffb22c0e7b70517db5cb4 "" + "/usr/share/texmf-dist/tex/latex/graphics/graphicx.sty" 1647844622 7996 a8fb260d598dcaf305a7ae7b9c3e3229 "" + "/usr/share/texmf-dist/tex/latex/graphics/keyval.sty" 1647844622 2671 4de6781a30211fe0ea4c672e4a2a8166 "" + "/usr/share/texmf-dist/tex/latex/graphics/trig.sty" 1647844622 4009 187ea2dc3194cd5a76cd99a8d7a6c4d0 "" + "/usr/share/texmf-dist/tex/latex/l3backend/l3backend-luatex.def" 1647844622 30292 5e0b0f0ef907fab549ffef3627107d14 "" + "/usr/share/texmf-dist/tex/latex/l3kernel/expl3.lua" 1647844622 15627 866398a1358608205cb87da529bd41e8 "" + "/usr/share/texmf-dist/tex/latex/l3kernel/expl3.sty" 1647844622 6107 e082261f9677386795d8bf6b6254fa9d "" + "/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty" 1647844622 6758 7d9d899cbbfc962fbc4bb93f4c69eec2 "" + "/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg" 1647844622 678 4792914a8f45be57bb98413425e4c7af "" + "/usr/share/texmf-dist/tex/latex/latexconfig/lualatexquotejobname.lua" 1647844622 1031 977f79ff10b802fc398926378bec58e9 "" + "/usr/share/texmf-dist/tex/latex/listings/listings.cfg" 1647844622 1830 e31effa752c61538383451ae21332364 "" + "/usr/share/texmf-dist/tex/latex/listings/listings.sty" 1647844622 80964 64e57373f36316e4a09b517cbf1aba2e "" + "/usr/share/texmf-dist/tex/latex/listings/lstmisc.sty" 1647844622 77022 ee25ce086f4a79d8cf73bac6f94c02a5 "" + "/usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty" 1647844622 1090 bae35ef70b3168089ef166db3e66f5b2 "" + "/usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty" 1647844622 410 615550c46f918fcbee37641b02a862d9 "" + "/usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty" 1647844622 21013 f4ff83d25bb56552493b030f27c075ae "" + "/usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty" 1647844622 989 c49c8ae06d96f8b15869da7428047b1e "" + "/usr/share/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty" 1647844622 443 8c872229db56122037e86bcda49e14f3 "" + "/usr/share/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty" 1647844622 325 f9f16d12354225b7dd52a3321f085955 "" + "/usr/share/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex" 1647807149 3414 35cdad46dacfbdf3277e05e06e9510c8 "" + "/usr/share/texmf-dist/tex/latex/tcolorbox/tcblistingscore.code.tex" 1647807149 13913 e8b437b63409c475089ab65612dac561 "" + "/usr/share/texmf-dist/tex/latex/tcolorbox/tcbprocessing.code.tex" 1647807149 2591 0ecc2aaa440bf2ab038f0776bf9dccdb "" + "/usr/share/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty" 1647807149 90399 93200a4832e517564b5aa5dc46e12177 "" + "/usr/share/texmf-dist/tex/latex/tools/shellesc.sty" 1647844622 4118 0f286eca74ee36b7743ff20320e5479f "" + "/usr/share/texmf-dist/tex/latex/tools/verbatim.sty" 1647844622 7392 39729ae6a807e217edf1442cf8fab2c2 "" + "/usr/share/texmf-dist/tex/latex/trimspaces/trimspaces.sty" 1647807149 1380 971a51b00a14503ddf754cab24c3f209 "" + "/usr/share/texmf-dist/tex/latex/xcolor/xcolor.sty" 1647844622 56029 3f7889dab51d620aa43177c391b7b190 "" + "/usr/share/texmf-dist/tex/luatex/lua-uni-algos/lua-uni-normalize.lua" 1647844622 21269 eb4154856f0afe9e8d886dbf6922dcc6 "" + "/usr/share/texmf-dist/tex/luatex/lua-uni-algos/lua-uni-parse.lua" 1647844622 2115 596f0e8384e97c26c78a8e88c65a7843 "" + "/usr/share/texmf-dist/tex/luatex/lualibs/lualibs-basic-merged.lua" 1647844622 131865 7823724834e59b4ec715d8bb8cbaeb54 "" + "/usr/share/texmf-dist/tex/luatex/lualibs/lualibs-basic.lua" 1647844622 2718 ab2094ad7c4dbeee0586e66867657528 "" + "/usr/share/texmf-dist/tex/luatex/lualibs/lualibs-compat.lua" 1647844622 603 398583cb619d20952d67edcedae41608 "" + "/usr/share/texmf-dist/tex/luatex/lualibs/lualibs-extended-merged.lua" 1647844622 111260 42b0c7151f556bf3efa50f07f49b8db0 "" + "/usr/share/texmf-dist/tex/luatex/lualibs/lualibs-extended.lua" 1647844622 4859 0a4cc7ac69f1ddc17187973389446292 "" + "/usr/share/texmf-dist/tex/luatex/lualibs/lualibs.lua" 1647844622 3780 a9bd8ce659ead1f89cff36820bd2de52 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/fontloader-2022-02-24.lua" 1647844622 879568 4dc8ce07471f8af7aa98d835df654768 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/fontloader-basics-gen.lua" 1647844622 12745 4bc43036e9796fccb0b8869f4b05bf2e "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua" 1647844622 32597 56ff5ca809e974b5630cdce6d287982d "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-case.lua" 1647844622 6809 6c20d5dc2b2b4227f873e7df0fd25316 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-colors.lua" 1647844622 15954 5989cddee9b5371697c559ec201e27e7 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua" 1647844622 31223 5b294133cd45a4a6f4b94388dbfc2964 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua" 1647844622 134114 315be26e69005984329b81aa331e1365 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-embolden.lua" 1647844622 1004 04466a99226e5724ef9287ec1a28263a "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-fallback.lua" 1647844622 4047 e218dc2d291d024f2d1b45da766f6cfc "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua" 1647844622 33149 26ff83b26be22a1962db807b51a362dc "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-define.lua" 1647844622 18970 16079aa19c3862e2e8f6b8cb91cf037a "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-plug.lua" 1647844622 42240 09076cf26ee8160a8eb667c6be500069 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-var-cff2.lua" 1647844622 14279 1ddc491d739900212c540b4ec73e9eff "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-var-t2-writer.lua" 1647844622 4050 7fe81398f3e2a4a9477ba45f396d5563 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-var-ttf.lua" 1647844622 20038 e49220e9e6fd5a9f9536cbc4eca8c1bb "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua" 1647844622 19746 8acaf9e42a9c9fa1c398a0944d1a4d50 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua" 1647844622 20268 000b624f54d934aff044862b7a64d4e2 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua" 1647844622 8840 e9f98d4904d245facab3932c505ea0f8 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-log.lua" 1647844622 11323 22964216fb42c7b07623fc43da5149ac "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua" 1647844622 275 b19c9cc34cf1d676c39f872cfb41aef6 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-multiscript.lua" 1647844622 15068 3f88fec616eb7b3f56fc5932a0f1e4d8 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-notdef.lua" 1647844622 12224 c06af0d71ab75a68f3445ecc6fa4e7b3 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-parsers.lua" 1647844622 31007 a7eb408eae165d6a61d11a705cab1b98 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-resolvers.lua" 1647844622 10984 7fd3c8d3d5a76c89227110177e7979f3 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-scripts.lua" 1647844622 2506 b987b6592183d5cc5ec858d5792cc381 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-status.lua" 1647844622 6317 e7fa94f6b0c4ea27bbd6cc0185b5713d "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-suppress.lua" 1647844622 2582 ec8f80689df7ba440286d00bcf6ed680 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-szss.lua" 1647844622 6309 5d97cb13052848afe1aba7e7ebc1469c "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-tounicode.lua" 1647844622 7528 fb7b0f47a74b414177bea5f982abf1de "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-unicode.lua" 1647844622 7589 65c7651d19fe06ec17196c22c533f768 "" + "/usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload.lua" 1647844622 13565 30cc2d8cecf79afb1abb4d5c12eb919a "" "/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map" 1650359669 4408072 42ceaa83bae76aebad711d3f3dd7f55f "" - "/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1650359660 2924504 ea4c5c72b0c4652da661684b3e043938 "" - "main.aux" 1651237923 311 d89453a43fde1809b6531a97b3ddf7d3 "pdflatex" - "main.tex" 1651237922 364 e3b792744da3753f628354d9558911dc "" + "/var/lib/texmf/web2c/luahbtex/lualatex.fmt" 1650359651 4560029 6f055e85cef5c428835ecbb71417852a "" + "fasto.sty" 1651327814 1408 f24e408340d3c27e1c067bd58ca99f46 "" + "main.aux" 1651328148 881 f815c05d54331d8fa283368519c5f327 "lualatex" + "main.tex" 1651328147 4845 61aad2f0febf6b560548fe1b0206bacb "" (generated) "main.aux" "main.log" diff --git a/W1/report/main.fls b/W1/report/main.fls index d157e28..94b1a7f 100644 --- a/W1/report/main.fls +++ b/W1/report/main.fls @@ -1,43 +1,264 @@ -PWD /home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1 -INPUT /usr/share/texmf-dist/web2c/texmf.cnf -INPUT /var/lib/texmf/web2c/pdftex/pdflatex.fmt -INPUT /home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/main.tex +PWD /home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/report +INPUT /var/lib/texmf/web2c/luahbtex/lualatex.fmt +INPUT /home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/report/main.tex OUTPUT main.log -INPUT /usr/share/texmf-dist/tex/latex/base/article.cls -INPUT /usr/share/texmf-dist/tex/latex/base/article.cls -INPUT /usr/share/texmf-dist/tex/latex/base/article.cls -INPUT /usr/share/texmf-dist/tex/latex/base/article.cls -INPUT /usr/share/texmf-dist/tex/latex/base/article.cls -INPUT /usr/share/texmf-dist/tex/latex/base/article.cls -INPUT /usr/share/texmf-dist/tex/latex/base/article.cls -INPUT /usr/share/texmf-dist/tex/latex/base/article.cls +INPUT /usr/share/texmf-dist/tex/latex/latexconfig/lualatexquotejobname.lua +INPUT /usr/share/texmf-dist/tex/latex/base/ltluatex.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua +INPUT /usr/share/texmf-dist/tex/luatex/lualibs/lualibs.lua +INPUT /usr/share/texmf-dist/tex/luatex/lualibs/lualibs-basic.lua +INPUT /usr/share/texmf-dist/tex/luatex/lualibs/lualibs-basic-merged.lua +INPUT /usr/share/texmf-dist/tex/luatex/lualibs/lualibs-compat.lua +INPUT /usr/share/texmf-dist/tex/luatex/lualibs/lualibs-extended.lua +INPUT /usr/share/texmf-dist/tex/luatex/lualibs/lualibs-extended-merged.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-log.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/fontloader-basics-gen.lua +OUTPUT /home/nikolaj/.texlive/texmf-var/m_t_x_t_e_s_t.tmp +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-parsers.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-status.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/fontloader-2022-02-24.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-fallback.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-multiscript.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-scripts.lua +INPUT /usr/share/texmf-dist/tex/generic/unicode-data/ScriptExtensions.txt +INPUT /usr/share/texmf-dist/tex/generic/unicode-data/Scripts.txt +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-unicode.lua +INPUT /usr/share/texmf-dist/tex/generic/unicode-data/CaseFolding.txt +INPUT /usr/share/texmf-dist/tex/generic/unicode-data/UnicodeData.txt +INPUT /usr/share/texmf-dist/tex/generic/unicode-data/UnicodeData.txt +INPUT /usr/share/texmf-dist/tex/generic/unicode-data/PropList.txt +INPUT /usr/share/texmf-dist/tex/generic/unicode-data/WordBreakProperty.txt +INPUT /usr/share/texmf-dist/tex/generic/unicode-data/SpecialCasing.txt +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-colors.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-resolvers.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua +INPUT /usr/share/texmf-dist/tex/luatex/lua-uni-algos/lua-uni-normalize.lua +INPUT /usr/share/texmf-dist/tex/luatex/lua-uni-algos/lua-uni-parse.lua +INPUT /usr/share/texmf-dist/tex/generic/unicode-data/UnicodeData.txt +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-define.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-var-cff2.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-var-t2-writer.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-var-ttf.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-plug.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-embolden.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-notdef.lua +INPUT /usr/share/texmf-dist/tex/generic/unicode-data/UnicodeData.txt +INPUT /usr/share/texmf-dist/tex/generic/unicode-data/PropList.txt +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-suppress.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-szss.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-tounicode.lua +INPUT /usr/share/texmf-dist/tex/luatex/luaotfload/luaotfload-case.lua +INPUT /usr/share/texmf-dist/tex/latex/l3kernel/expl3.lua INPUT /usr/share/texmf-dist/tex/latex/base/article.cls INPUT /usr/share/texmf-dist/tex/latex/base/article.cls INPUT /usr/share/texmf-dist/tex/latex/base/article.cls INPUT /usr/share/texmf-dist/tex/latex/base/size10.clo INPUT /usr/share/texmf-dist/tex/latex/base/size10.clo -INPUT /usr/share/texmf-dist/tex/latex/base/size10.clo -INPUT /usr/share/texmf-dist/tex/latex/base/size10.clo -INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def -INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def -INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def -INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def -INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def -INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def -INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def -INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def -INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def -INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def -INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def +INPUT /home/nikolaj/.texlive/texmf-var/luatex-cache/generic/names/luaotfload-names.luc.gz +INPUT /home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.luc +INPUT /usr/share/texmf-dist/tex/latex/listings/listings.sty +INPUT /usr/share/texmf-dist/tex/latex/listings/listings.sty +INPUT /usr/share/texmf-dist/tex/latex/listings/listings.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics/keyval.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics/keyval.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics/keyval.sty +INPUT /usr/share/texmf-dist/tex/latex/listings/lstmisc.sty +INPUT /usr/share/texmf-dist/tex/latex/listings/lstmisc.sty +INPUT /usr/share/texmf-dist/tex/latex/listings/listings.cfg +INPUT /usr/share/texmf-dist/tex/latex/listings/listings.cfg +INPUT /usr/share/texmf-dist/tex/latex/fontspec/fontspec.sty +INPUT /usr/share/texmf-dist/tex/latex/fontspec/fontspec.sty +INPUT /usr/share/texmf-dist/tex/latex/fontspec/fontspec.sty +INPUT /usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty +INPUT /usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty +INPUT /usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty +INPUT /usr/share/texmf-dist/tex/latex/l3kernel/expl3.sty +INPUT /usr/share/texmf-dist/tex/latex/l3kernel/expl3.sty +INPUT /usr/share/texmf-dist/tex/latex/l3kernel/expl3.sty +INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-luatex.def +INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-luatex.def +INPUT /usr/share/texmf-dist/tex/latex/l3backend/l3backend-luatex.def +INPUT /usr/share/texmf-dist/tex/latex/fontspec/fontspec.lua +INPUT /usr/share/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty +INPUT /usr/share/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty +INPUT /usr/share/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty +INPUT /usr/share/texmf-dist/tex/latex/base/fontenc.sty +INPUT /usr/share/texmf-dist/tex/latex/base/fontenc.sty +INPUT /usr/share/texmf-dist/tex/latex/base/fontenc.sty +INPUT /usr/share/texmf-dist/tex/latex/fontspec/fontspec.cfg +INPUT /usr/share/texmf-dist/tex/latex/fontspec/fontspec.cfg +INPUT /home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-bold.luc +INPUT /usr/share/texmf-dist/tex/latex/geometry/geometry.sty +INPUT /usr/share/texmf-dist/tex/latex/geometry/geometry.sty +INPUT /usr/share/texmf-dist/tex/latex/geometry/geometry.sty +INPUT /usr/share/texmf-dist/tex/generic/iftex/ifvtex.sty +INPUT /usr/share/texmf-dist/tex/generic/iftex/ifvtex.sty +INPUT /usr/share/texmf-dist/tex/generic/iftex/ifvtex.sty +INPUT /usr/share/texmf-dist/tex/generic/iftex/iftex.sty +INPUT /usr/share/texmf-dist/tex/generic/iftex/iftex.sty +INPUT /usr/share/texmf-dist/tex/generic/iftex/iftex.sty +INPUT ./fasto.sty +INPUT ./fasto.sty +INPUT /usr/share/texmf-dist/tex/latex/xcolor/xcolor.sty +INPUT /usr/share/texmf-dist/tex/latex/xcolor/xcolor.sty +INPUT /usr/share/texmf-dist/tex/latex/xcolor/xcolor.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics-cfg/color.cfg +INPUT /usr/share/texmf-dist/tex/latex/graphics-cfg/color.cfg +INPUT /usr/share/texmf-dist/tex/latex/graphics-def/luatex.def +INPUT /usr/share/texmf-dist/tex/latex/graphics-def/luatex.def +INPUT /usr/share/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty +INPUT /usr/share/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty +INPUT /usr/share/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty +INPUT /usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def +INPUT /usr/share/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/pgf.revision.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/pgf.revision.tex +INPUT /usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics/graphicx.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics/graphicx.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics/graphicx.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics/graphics.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics/graphics.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics/graphics.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics/trig.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics/trig.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics/trig.sty +INPUT /usr/share/texmf-dist/tex/latex/graphics-cfg/graphics.cfg +INPUT /usr/share/texmf-dist/tex/latex/graphics-cfg/graphics.cfg +INPUT /usr/share/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty +INPUT /usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg +INPUT /usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def +INPUT /usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def +INPUT /usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def +INPUT /usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/math/pgfint.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex +INPUT /usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty +INPUT /usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty +INPUT /usr/share/texmf-dist/tex/latex/tools/verbatim.sty +INPUT /usr/share/texmf-dist/tex/latex/tools/verbatim.sty +INPUT /usr/share/texmf-dist/tex/latex/tools/verbatim.sty +INPUT /usr/share/texmf-dist/tex/latex/environ/environ.sty +INPUT /usr/share/texmf-dist/tex/latex/environ/environ.sty +INPUT /usr/share/texmf-dist/tex/latex/environ/environ.sty +INPUT /usr/share/texmf-dist/tex/latex/trimspaces/trimspaces.sty +INPUT /usr/share/texmf-dist/tex/latex/trimspaces/trimspaces.sty +INPUT /usr/share/texmf-dist/tex/latex/trimspaces/trimspaces.sty +INPUT /usr/share/texmf-dist/tex/latex/etoolbox/etoolbox.sty +INPUT /usr/share/texmf-dist/tex/latex/etoolbox/etoolbox.sty +INPUT /usr/share/texmf-dist/tex/latex/etoolbox/etoolbox.sty +INPUT /usr/share/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex +INPUT /usr/share/texmf-dist/tex/latex/tcolorbox/tcblistingscore.code.tex +INPUT /usr/share/texmf-dist/tex/latex/tcolorbox/tcbprocessing.code.tex +INPUT /usr/share/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty +INPUT /usr/share/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty +INPUT /usr/share/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty +INPUT /usr/share/texmf-dist/tex/generic/infwarerr/infwarerr.sty +INPUT /usr/share/texmf-dist/tex/generic/infwarerr/infwarerr.sty +INPUT /usr/share/texmf-dist/tex/generic/infwarerr/infwarerr.sty +INPUT /usr/share/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty +INPUT /usr/share/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty +INPUT /usr/share/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty +INPUT /usr/share/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.lua +INPUT /usr/share/texmf-dist/tex/latex/tools/shellesc.sty +INPUT /usr/share/texmf-dist/tex/latex/tools/shellesc.sty +INPUT /usr/share/texmf-dist/tex/latex/tools/shellesc.sty +INPUT /home/nikolaj/.texlive/texmf-var/luatex-cache/generic/names/luaotfload-lookup-cache.luc +INPUT /home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/antikormono-medium.luc +INPUT ./main.aux INPUT ./main.aux -INPUT main.aux -INPUT main.aux OUTPUT main.aux -INPUT /usr/share/texmf-dist/fonts/map/fontname/texfonts.map -INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmr12.tfm -INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm +INPUT /usr/share/texmf-dist/tex/latex/base/ts1cmr.fd +INPUT /usr/share/texmf-dist/tex/latex/base/ts1cmr.fd +INPUT /usr/share/texmf-dist/tex/context/base/mkii/supp-pdf.mkii +INPUT /usr/share/texmf-dist/tex/context/base/mkii/supp-pdf.mkii +INPUT /usr/share/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty +INPUT /usr/share/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty +INPUT /usr/share/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty +INPUT /usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg +INPUT /usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg +INPUT /home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman12-regular.luc +INPUT /home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman12-bold.luc +INPUT /home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman8-regular.luc +INPUT /home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman7-regular.luc +INPUT /home/nikolaj/.texlive/texmf-var/luatex-cache/generic/fonts/otl/lmroman5-regular.luc +INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmmi10.tfm +INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmmi7.tfm +INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmmi5.tfm +INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm +INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmsy7.tfm +INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmsy5.tfm +INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmex10.tfm +INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmr10.tfm +INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmr7.tfm +INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmr5.tfm OUTPUT main.pdf INPUT /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map -INPUT main.aux -INPUT /usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb +INPUT ./main.aux +INPUT /usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb INPUT /usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb diff --git a/W1/report/main.listing b/W1/report/main.listing new file mode 100644 index 0000000..0e09df5 --- /dev/null +++ b/W1/report/main.listing @@ -0,0 +1,18 @@ +fun int mul(int x, int y) = + if y == 0 then 0 + else if y < 0 then mul(x, y+1) - x + else mul(x, y-1) + x + +fun int readInt(int i) = read(int) + +fun int squareSum(int x, int y) = x + mul(y, y) + +fun int main() = + let n = read(int) in + if n == 0 then let a = write("Incorrect Input!") in 0 + else if n < 0 then let a = write("Incorrect Input!") in 0 + else + let arr = map(readInt, iota(n)) in + let dif = map(fn int (int x) => if x == 0 then arr[x] else arr[x] - arr[x-1], iota(n)) in + write(reduce(squareSum, 0, dif)) + diff --git a/W1/report/main.log b/W1/report/main.log index 8640f28..c6469ff 100644 --- a/W1/report/main.log +++ b/W1/report/main.log @@ -1,64 +1,554 @@ -This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021/Arch Linux) (preloaded format=pdflatex 2022.4.19) 29 APR 2022 15:12 -entering extended mode - restricted \write18 enabled. +This is LuaHBTeX, Version 1.13.2 (TeX Live 2021/Arch Linux) (format=lualatex 2022.4.19) 30 APR 2022 16:15 + restricted system commands enabled. file:line:error style messages enabled. - %&-line parsing enabled. -**/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/main.tex -(/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/main.tex +**/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/report/main.tex +(/home/nikolaj/Code/Datalogi/2022B4-IPS/IPS_W-assignments/W1/report/main.tex LaTeX2e <2021-11-15> patch level 1 -L3 programming layer <2022-02-24> (/usr/share/texmf-dist/tex/latex/base/article.cls +Lua module: luaotfload 2022-03-18 3.21 Lua based OpenType font support +Lua module: lualibs 2021-05-20 2.74 ConTeXt Lua standard libraries. +Lua module: lualibs-extended 2021-05-20 2.74 ConTeXt Lua libraries -- extended collection. +luaotfload | conf : Root cache directory is "/home/nikolaj/.texlive/texmf-var/luatex-cache/generic/names". +luaotfload | init : Loading fontloader "fontloader-2022-02-24.lua" from kpse-resolved path "/usr/share/texmf-dist/tex/luatex/luaotfload/fontloader-2022-02-24.lua". +Lua-only attribute luaotfload@noligature = 1 +luaotfload | init : Context OpenType loader version 3.119 +Inserting `luaotfload.node_processor' at position 1 in `pre_linebreak_filter'. +Inserting `luaotfload.node_processor' at position 1 in `hpack_filter'. +Inserting `luaotfload.glyph_stream' at position 1 in `glyph_stream_provider'. +Inserting `luaotfload.define_font' at position 1 in `define_font'. +Lua-only attribute luaotfload_color_attribute = 2 +luaotfload | conf : Root cache directory is "/home/nikolaj/.texlive/texmf-var/luatex-cache/generic/names". +Inserting `luaotfload.harf.strip_prefix' at position 1 in `find_opentype_file'. +Inserting `luaotfload.harf.strip_prefix' at position 1 in `find_truetype_file'. +Removing `luaotfload.glyph_stream' from `glyph_stream_provider'. +Inserting `luaotfload.harf.glyphstream' at position 1 in `glyph_stream_provider'. +Inserting `luaotfload.harf.finalize_vlist' at position 1 in `post_linebreak_filter'. +Inserting `luaotfload.harf.finalize_hlist' at position 2 in `hpack_filter'. +Inserting `luaotfload.cleanup_files' at position 1 in `wrapup_run'. +Inserting `luaotfload.harf.finalize_unicode' at position 1 in `finish_pdffile'. +Inserting `luaotfload.glyphinfo' at position 1 in `glyph_info'. +Lua-only attribute luaotfload.letterspace_done = 3 +Inserting `luaotfload.aux.set_sscale_dimens' at position 1 in `luaotfload.patch_font'. +Inserting `luaotfload.aux.set_font_index' at position 2 in `luaotfload.patch_font'. +Inserting `luaotfload.aux.patch_cambria_domh' at position 3 in `luaotfload.patch_font'. +Inserting `luaotfload.aux.fixup_fontdata' at position 1 in `luaotfload.patch_font_unsafe'. +Inserting `luaotfload.aux.set_capheight' at position 4 in `luaotfload.patch_font'. +Inserting `luaotfload.aux.set_xheight' at position 5 in `luaotfload.patch_font'. +Inserting `luaotfload.rewrite_fontname' at position 6 in `luaotfload.patch_font'. L3 programming layer <2022-02-24> +Inserting `tracingstacklevels' at position 1 in `input_level_string'. (/usr/share/texmf-dist/tex/latex/base/article.cls Document Class: article 2021/10/04 v1.4n Standard LaTeX document class (/usr/share/texmf-dist/tex/latex/base/size10.clo File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option) -) -\c@part=\count185 -\c@section=\count186 -\c@subsection=\count187 -\c@subsubsection=\count188 -\c@paragraph=\count189 -\c@subparagraph=\count190 -\c@figure=\count191 -\c@table=\count192 +luaotfload | db : Font names database loaded from /home/nikolaj/.texlive/texmf-var/luatex-cache/generic/names/luaotfload-names.luc.gz) +\c@part=\count183 +\c@section=\count184 +\c@subsection=\count185 +\c@subsubsection=\count186 +\c@paragraph=\count187 +\c@subparagraph=\count188 +\c@figure=\count189 +\c@table=\count190 \abovecaptionskip=\skip47 \belowcaptionskip=\skip48 -\bibindent=\dimen138 -) (/usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def -File: l3backend-pdftex.def 2022-02-07 L3 backend support: PDF output (pdfTeX) -\l__color_backend_stack_int=\count193 -\l__pdf_internal_box=\box50 -) (./main.aux) -\openout1 = `main.aux'. +\bibindent=\dimen137 +) (/usr/share/texmf-dist/tex/latex/listings/listings.sty (/usr/share/texmf-dist/tex/latex/graphics/keyval.sty +Package: keyval 2014/10/28 v1.15 key=value parser (DPC) +\KV@toks@=\toks16 +) +\lst@mode=\count191 +\lst@gtempboxa=\box50 +\lst@token=\toks17 +\lst@length=\count192 +\lst@currlwidth=\dimen138 +\lst@column=\count193 +\lst@pos=\count194 +\lst@lostspace=\dimen139 +\lst@width=\dimen140 +\lst@newlines=\count195 +\lst@lineno=\count196 +\lst@maxwidth=\dimen141 + (/usr/share/texmf-dist/tex/latex/listings/lstmisc.sty +File: lstmisc.sty 2020/03/24 1.8d (Carsten Heinz) +\c@lstnumber=\count197 +\lst@skipnumbers=\count198 +\lst@framebox=\box51 +) (/usr/share/texmf-dist/tex/latex/listings/listings.cfg +File: listings.cfg 2020/03/24 1.8d listings configuration +)) +Package: listings 2020/03/24 1.8d (Carsten Heinz) + (/usr/share/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/share/texmf-dist/tex/latex/l3kernel/expl3.sty +Package: expl3 2022-02-24 L3 programming layer (loader) + (/usr/share/texmf-dist/tex/latex/l3backend/l3backend-luatex.def +File: l3backend-luatex.def 2022-02-07 L3 backend support: PDF output (LuaTeX) +\l__color_backend_stack_int=\count199 +\l__pdf_internal_box=\box52 +)) +Package: xparse 2022-01-12 L3 Experimental document command parser +) +Package: fontspec 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX +Lua module: fontspec 2022/01/15 2.8a Font selection for XeLaTeX and LuaLaTeX (/usr/share/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty +Package: fontspec-luatex 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX +\l__fontspec_script_int=\count266 +\l__fontspec_language_int=\count267 +\l__fontspec_strnum_int=\count268 +\l__fontspec_tmp_int=\count269 +\l__fontspec_tmpa_int=\count270 +\l__fontspec_tmpb_int=\count271 +\l__fontspec_tmpc_int=\count272 +\l__fontspec_em_int=\count273 +\l__fontspec_emdef_int=\count274 +\l__fontspec_strong_int=\count275 +\l__fontspec_strongdef_int=\count276 +\l__fontspec_tmpa_dim=\dimen142 +\l__fontspec_tmpb_dim=\dimen143 +\l__fontspec_tmpc_dim=\dimen144 + (/usr/share/texmf-dist/tex/latex/base/fontenc.sty +Package: fontenc 2021/04/29 v2.0v Standard LaTeX package +) (/usr/share/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/share/texmf-dist/tex/latex/geometry/geometry.sty +Package: geometry 2020/01/02 v5.9 Page Geometry + (/usr/share/texmf-dist/tex/generic/iftex/ifvtex.sty +Package: ifvtex 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead. + (/usr/share/texmf-dist/tex/generic/iftex/iftex.sty +Package: iftex 2022/02/03 v1.0f TeX engine tests +)) +\Gm@cnth=\count277 +\Gm@cntv=\count278 +\c@Gm@tempcnt=\count279 +\Gm@bindingoffset=\dimen145 +\Gm@wd@mp=\dimen146 +\Gm@odd@mp=\dimen147 +\Gm@even@mp=\dimen148 +\Gm@layoutwidth=\dimen149 +\Gm@layoutheight=\dimen150 +\Gm@layouthoffset=\dimen151 +\Gm@layoutvoffset=\dimen152 +\Gm@dimlist=\toks18 +) (./fasto.sty (/usr/share/texmf-dist/tex/latex/xcolor/xcolor.sty +Package: xcolor 2021/10/31 v2.13 LaTeX color extensions (UK) + (/usr/share/texmf-dist/tex/latex/graphics-cfg/color.cfg +File: color.cfg 2016/01/02 v1.6 sample color configuration +) +Package xcolor Info: Driver file: luatex.def on input line 227. + (/usr/share/texmf-dist/tex/latex/graphics-def/luatex.def +File: luatex.def 2021/06/01 v1.2c Graphics/color driver for luatex +) +Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1352. +Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1356. +Package xcolor Info: Model `RGB' extended on input line 1368. +Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1370. +Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1371. +Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1372. +Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1373. +Package xcolor Info: Model `Gray' substituted by `gray' on input line 1374. +Package xcolor Info: Model `wave' substituted by `hsb' on input line 1375. +) (/usr/share/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty +Package: tcolorbox 2022/01/07 version 5.0.2 text color boxes + (/usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty (/usr/share/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty (/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex +\pgfutil@everybye=\toks19 +\pgfutil@tempdima=\dimen153 +\pgfutil@tempdimb=\dimen154 + (/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex)) (/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def +\pgfutil@abb=\box53 +) (/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex (/usr/share/texmf-dist/tex/generic/pgf/pgf.revision.tex) +Package: pgfrcs 2021/05/15 v3.1.9a (3.1.9a) +)) +Package: pgf 2021/05/15 v3.1.9a (3.1.9a) + (/usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty (/usr/share/texmf-dist/tex/latex/graphics/graphicx.sty +Package: graphicx 2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR) + (/usr/share/texmf-dist/tex/latex/graphics/graphics.sty +Package: graphics 2021/03/04 v1.4d Standard LaTeX Graphics (DPC,SPQR) + (/usr/share/texmf-dist/tex/latex/graphics/trig.sty +Package: trig 2021/08/11 v1.11 sin cos tan (DPC) +) (/usr/share/texmf-dist/tex/latex/graphics-cfg/graphics.cfg +File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration +) +Package graphics Info: Driver file: luatex.def on input line 107. +) +\Gin@req@height=\dimen155 +\Gin@req@width=\dimen156 +) (/usr/share/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty (/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex +Package: pgfsys 2021/05/15 v3.1.9a (3.1.9a) + (/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex +\pgfkeys@pathtoks=\toks20 +\pgfkeys@temptoks=\toks21 + (/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex +\pgfkeys@tmptoks=\toks22 +)) +\pgf@x=\dimen157 +\pgf@y=\dimen158 +\pgf@xa=\dimen159 +\pgf@ya=\dimen160 +\pgf@xb=\dimen161 +\pgf@yb=\dimen162 +\pgf@xc=\dimen163 +\pgf@yc=\dimen164 +\pgf@xd=\dimen165 +\pgf@yd=\dimen166 +\w@pgf@writea=\write3 +\r@pgf@reada=\read2 +\c@pgf@counta=\count280 +\c@pgf@countb=\count281 +\c@pgf@countc=\count282 +\c@pgf@countd=\count283 +\t@pgf@toka=\toks23 +\t@pgf@tokb=\toks24 +\t@pgf@tokc=\toks25 +\pgf@sys@id@count=\count284 + (/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg +File: pgf.cfg 2021/05/15 v3.1.9a (3.1.9a) +) +Driver file for pgf: pgfsys-luatex.def + (/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def +File: pgfsys-luatex.def 2021/05/15 v3.1.9a (3.1.9a) + (/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def +File: pgfsys-common-pdf.def 2021/05/15 v3.1.9a (3.1.9a) +))) (/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex +File: pgfsyssoftpath.code.tex 2021/05/15 v3.1.9a (3.1.9a) +\pgfsyssoftpath@smallbuffer@items=\count285 +\pgfsyssoftpath@bigbuffer@items=\count286 +) (/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex +File: pgfsysprotocol.code.tex 2021/05/15 v3.1.9a (3.1.9a) +)) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex +Package: pgfcore 2021/05/15 v3.1.9a (3.1.9a) + (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex +\pgfmath@dimen=\dimen167 +\pgfmath@count=\count287 +\pgfmath@box=\box54 +\pgfmath@toks=\toks26 +\pgfmath@stack@operand=\toks27 +\pgfmath@stack@operation=\toks28 +) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex))) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex +\c@pgfmathroundto@lastzeros=\count288 +)) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfint.code.tex) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex +File: pgfcorepoints.code.tex 2021/05/15 v3.1.9a (3.1.9a) +\pgf@picminx=\dimen168 +\pgf@picmaxx=\dimen169 +\pgf@picminy=\dimen170 +\pgf@picmaxy=\dimen171 +\pgf@pathminx=\dimen172 +\pgf@pathmaxx=\dimen173 +\pgf@pathminy=\dimen174 +\pgf@pathmaxy=\dimen175 +\pgf@xx=\dimen176 +\pgf@xy=\dimen177 +\pgf@yx=\dimen178 +\pgf@yy=\dimen179 +\pgf@zx=\dimen180 +\pgf@zy=\dimen181 +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex +File: pgfcorepathconstruct.code.tex 2021/05/15 v3.1.9a (3.1.9a) +\pgf@path@lastx=\dimen182 +\pgf@path@lasty=\dimen183 +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex +File: pgfcorepathusage.code.tex 2021/05/15 v3.1.9a (3.1.9a) +\pgf@shorten@end@additional=\dimen184 +\pgf@shorten@start@additional=\dimen185 +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex +File: pgfcorescopes.code.tex 2021/05/15 v3.1.9a (3.1.9a) +\pgfpic=\box55 +\pgf@hbox=\box56 +\pgf@layerbox@main=\box57 +\pgf@picture@serial@count=\count289 +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex +File: pgfcoregraphicstate.code.tex 2021/05/15 v3.1.9a (3.1.9a) +\pgflinewidth=\dimen186 +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex +File: pgfcoretransformations.code.tex 2021/05/15 v3.1.9a (3.1.9a) +\pgf@pt@x=\dimen187 +\pgf@pt@y=\dimen188 +\pgf@pt@temp=\dimen189 +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex +File: pgfcorequick.code.tex 2021/05/15 v3.1.9a (3.1.9a) +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex +File: pgfcoreobjects.code.tex 2021/05/15 v3.1.9a (3.1.9a) +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex +File: pgfcorepathprocessing.code.tex 2021/05/15 v3.1.9a (3.1.9a) +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex +File: pgfcorearrows.code.tex 2021/05/15 v3.1.9a (3.1.9a) +\pgfarrowsep=\dimen190 +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex +File: pgfcoreshade.code.tex 2021/05/15 v3.1.9a (3.1.9a) +\pgf@max=\dimen191 +\pgf@sys@shading@range@num=\count290 +\pgf@shadingcount=\count291 +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex +File: pgfcoreimage.code.tex 2021/05/15 v3.1.9a (3.1.9a) + (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex +File: pgfcoreexternal.code.tex 2021/05/15 v3.1.9a (3.1.9a) +\pgfexternal@startupbox=\box58 +)) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex +File: pgfcorelayers.code.tex 2021/05/15 v3.1.9a (3.1.9a) +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex +File: pgfcoretransparency.code.tex 2021/05/15 v3.1.9a (3.1.9a) +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex +File: pgfcorepatterns.code.tex 2021/05/15 v3.1.9a (3.1.9a) +) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex +File: pgfcorerdf.code.tex 2021/05/15 v3.1.9a (3.1.9a) +))) (/usr/share/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex +File: pgfmoduleshapes.code.tex 2021/05/15 v3.1.9a (3.1.9a) +\pgfnodeparttextbox=\box59 +) (/usr/share/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex +File: pgfmoduleplot.code.tex 2021/05/15 v3.1.9a (3.1.9a) +) (/usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty +Package: pgfcomp-version-0-65 2021/05/15 v3.1.9a (3.1.9a) +\pgf@nodesepstart=\dimen192 +\pgf@nodesepend=\dimen193 +) (/usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty +Package: pgfcomp-version-1-18 2021/05/15 v3.1.9a (3.1.9a) +)) (/usr/share/texmf-dist/tex/latex/tools/verbatim.sty +Package: verbatim 2020-07-07 v1.5u LaTeX2e package for verbatim enhancements +\every@verbatim=\toks29 +\verbatim@line=\toks30 +\verbatim@in@stream=\read3 +) (/usr/share/texmf-dist/tex/latex/environ/environ.sty +Package: environ 2014/05/04 v0.3 A new way to define environments + (/usr/share/texmf-dist/tex/latex/trimspaces/trimspaces.sty +Package: trimspaces 2009/09/17 v1.1 Trim spaces around a token list +) +\@envbody=\toks31 +) (/usr/share/texmf-dist/tex/latex/etoolbox/etoolbox.sty +Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW) +\etb@tempcnta=\count292 +) +\tcb@titlebox=\box60 +\tcb@upperbox=\box61 +\tcb@lowerbox=\box62 +\tcb@phantombox=\box63 +\c@tcbbreakpart=\count293 +\c@tcblayer=\count294 +\c@tcolorbox@number=\count295 +\tcb@temp=\box64 +\tcb@temp=\box65 +\tcb@temp=\box66 +\tcb@temp=\box67 +) (/usr/share/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex +Library (tcolorbox): 'tcblistings.code.tex' version '5.0.2' +(/usr/share/texmf-dist/tex/latex/tcolorbox/tcblistingscore.code.tex +Library (tcolorbox): 'tcblistingscore.code.tex' version '5.0.2' +(/usr/share/texmf-dist/tex/latex/tcolorbox/tcbprocessing.code.tex +Library (tcolorbox): 'tcbprocessing.code.tex' version '5.0.2' +(/usr/share/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty +Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO) + (/usr/share/texmf-dist/tex/generic/infwarerr/infwarerr.sty +Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO) +) (/usr/share/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty +Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO) +) +Package pdftexcmds Info: \pdf@primitive is available. +Package pdftexcmds Info: \pdf@ifprimitive is available. +Package pdftexcmds Info: \pdfdraftmode found. +\pdftexcmds@toks=\toks32 +) (/usr/share/texmf-dist/tex/latex/tools/shellesc.sty +Package: shellesc 2019/11/08 v1.0c unified shell escape interface for LaTeX +Package shellesc Info: Restricted shell escape enabled on input line 77. +)) +\c@tcblisting=\count296 +))) +luaotfload | cache : Lookup cache loaded from /home/nikolaj/.texlive/texmf-var/luatex-cache/generic/names/luaotfload-lookup-cache.luc. -LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 5. -LaTeX Font Info: ... okay on input line 5. -LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 5. -LaTeX Font Info: ... okay on input line 5. -LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 5. -LaTeX Font Info: ... okay on input line 5. -LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 5. -LaTeX Font Info: ... okay on input line 5. -LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 5. -LaTeX Font Info: ... okay on input line 5. -LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 5. -LaTeX Font Info: ... okay on input line 5. -LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 5. -LaTeX Font Info: ... okay on input line 5. - [1 +Package fontspec Info: Could not resolve font "AntikorMonoMedium/BI" (it +(fontspec) probably doesn't exist). -{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./main.aux) ) -Here is how much of TeX's memory you used: - 404 strings out of 478276 - 7535 string characters out of 5853013 - 298976 words of memory out of 5000000 - 18691 multiletter control sequences out of 15000+600000 - 469864 words of font info for 30 fonts, out of 8000000 for 9000 - 1141 hyphenation exceptions out of 8191 - 34i,5n,38p,193b,107s stack positions out of 5000i,500n,10000p,200000b,80000s - -Output written on main.pdf (1 page, 28488 bytes). -PDF statistics: - 18 PDF objects out of 1000 (max. 8388607) - 10 compressed objects within 1 object stream - 0 named destinations out of 1000 (max. 500000) - 1 words of extra memory for PDF output out of 10000 (max. 10000000) + +Package fontspec Info: Could not resolve font "AntikorMonoMedium/B" (it +(fontspec) probably doesn't exist). + + +Package fontspec Info: Could not resolve font "AntikorMonoMedium/I" (it +(fontspec) probably doesn't exist). + + +Package fontspec Info: Font family 'AntikorMonoMedium(0)' created for font +(fontspec) 'Antikor Mono Medium' with options +(fontspec) [WordSpace={1,0,0},HyphenChar=None,PunctuationSpace=WordSpace,Scale=0.9]. +(fontspec) +(fontspec) This font family consists of the following NFSS +(fontspec) series/shapes: +(fontspec) +(fontspec) - 'normal' (m/n) with NFSS spec.: +(fontspec) <->s*[0.9]"AntikorMonoMedium:mode=node;script=latn;language=dflt;" +(fontspec) - 'small caps' (m/sc) with NFSS spec.: +(fontspec) <->s*[0.9]"AntikorMonoMedium:mode=node;script=latn;language=dflt;+smcp;" +(fontspec) and font adjustment code: +(fontspec) \fontdimen 2\font =1\fontdimen 2\font \fontdimen 3\font +(fontspec) =0\fontdimen 3\font \fontdimen 4\font =0\fontdimen +(fontspec) 4\font \fontdimen 7\font =0\fontdimen 2\font +(fontspec) \tex_hyphenchar:D \font =-1\scan_stop: + + (./main.aux) +\openout1 = main.aux + +LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 16. +LaTeX Font Info: ... okay on input line 16. +LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 16. +LaTeX Font Info: ... okay on input line 16. +LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 16. +LaTeX Font Info: ... okay on input line 16. +LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 16. +LaTeX Font Info: ... okay on input line 16. +LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 16. +LaTeX Font Info: Trying to load font information for TS1+cmr on input line 16. + (/usr/share/texmf-dist/tex/latex/base/ts1cmr.fd +File: ts1cmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions +) +LaTeX Font Info: ... okay on input line 16. +LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 16. +LaTeX Font Info: ... okay on input line 16. +LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 16. +LaTeX Font Info: ... okay on input line 16. +LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 16. +LaTeX Font Info: ... okay on input line 16. +\c@lstlisting=\count297 + +Package fontspec Info: Adjusting the maths setup (use [no-math] to avoid +(fontspec) this). + +\symlegacymaths=\mathgroup4 +LaTeX Font Info: Overwriting symbol font `legacymaths' in version `bold' +(Font) OT1/cmr/m/n --> OT1/cmr/bx/n on input line 16. +LaTeX Font Info: Redeclaring math accent \acute on input line 16. +LaTeX Font Info: Redeclaring math accent \grave on input line 16. +LaTeX Font Info: Redeclaring math accent \ddot on input line 16. +LaTeX Font Info: Redeclaring math accent \tilde on input line 16. +LaTeX Font Info: Redeclaring math accent \bar on input line 16. +LaTeX Font Info: Redeclaring math accent \breve on input line 16. +LaTeX Font Info: Redeclaring math accent \check on input line 16. +LaTeX Font Info: Redeclaring math accent \hat on input line 16. +LaTeX Font Info: Redeclaring math accent \dot on input line 16. +LaTeX Font Info: Redeclaring math accent \mathring on input line 16. +LaTeX Font Info: Redeclaring math symbol \colon on input line 16. +LaTeX Font Info: Redeclaring math symbol \Gamma on input line 16. +LaTeX Font Info: Redeclaring math symbol \Delta on input line 16. +LaTeX Font Info: Redeclaring math symbol \Theta on input line 16. +LaTeX Font Info: Redeclaring math symbol \Lambda on input line 16. +LaTeX Font Info: Redeclaring math symbol \Xi on input line 16. +LaTeX Font Info: Redeclaring math symbol \Pi on input line 16. +LaTeX Font Info: Redeclaring math symbol \Sigma on input line 16. +LaTeX Font Info: Redeclaring math symbol \Upsilon on input line 16. +LaTeX Font Info: Redeclaring math symbol \Phi on input line 16. +LaTeX Font Info: Redeclaring math symbol \Psi on input line 16. +LaTeX Font Info: Redeclaring math symbol \Omega on input line 16. +LaTeX Font Info: Redeclaring math symbol \mathdollar on input line 16. +LaTeX Font Info: Redeclaring symbol font `operators' on input line 16. +LaTeX Font Info: Encoding `OT1' has changed to `TU' for symbol font +(Font) `operators' in the math version `normal' on input line 16. +LaTeX Font Info: Overwriting symbol font `operators' in version `normal' +(Font) OT1/cmr/m/n --> TU/lmr/m/n on input line 16. +LaTeX Font Info: Encoding `OT1' has changed to `TU' for symbol font +(Font) `operators' in the math version `bold' on input line 16. +LaTeX Font Info: Overwriting symbol font `operators' in version `bold' +(Font) OT1/cmr/bx/n --> TU/lmr/m/n on input line 16. +LaTeX Font Info: Overwriting symbol font `operators' in version `normal' +(Font) TU/lmr/m/n --> TU/lmr/m/n on input line 16. +LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal' +(Font) OT1/cmr/m/it --> TU/lmr/m/it on input line 16. +LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal' +(Font) OT1/cmr/bx/n --> TU/lmr/b/n on input line 16. +LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal' +(Font) OT1/cmss/m/n --> TU/lmss/m/n on input line 16. +LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal' +(Font) OT1/cmtt/m/n --> TU/AntikorMonoMedium(0)/m/n on input line 16. +LaTeX Font Info: Overwriting symbol font `operators' in version `bold' +(Font) TU/lmr/m/n --> TU/lmr/b/n on input line 16. +LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold' +(Font) OT1/cmr/bx/it --> TU/lmr/b/it on input line 16. +LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold' +(Font) OT1/cmss/bx/n --> TU/lmss/b/n on input line 16. +LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold' +(Font) OT1/cmtt/m/n --> TU/AntikorMonoMedium(0)/b/n on input line 16. + +*geometry* driver: auto-detecting +*geometry* detected driver: luatex +*geometry* verbose mode - [ preamble ] result: +* driver: luatex +* paper: a4paper +* layout: +* layoutoffset:(h,v)=(0.0pt,0.0pt) +* modes: +* h-part:(L,W,R)=(72.26999pt, 452.9679pt, 72.26999pt) +* v-part:(T,H,B)=(72.26999pt, 700.50687pt, 72.26999pt) +* \paperwidth=597.50787pt +* \paperheight=845.04684pt +* \textwidth=452.9679pt +* \textheight=700.50687pt +* \oddsidemargin=0.0pt +* \evensidemargin=0.0pt +* \topmargin=-37.0pt +* \headheight=12.0pt +* \headsep=25.0pt +* \topskip=10.0pt +* \footskip=30.0pt +* \marginparwidth=57.0pt +* \marginparsep=11.0pt +* \columnsep=10.0pt +* \skip\footins=9.0pt plus 4.0pt minus 2.0pt +* \hoffset=0.0pt +* \voffset=0.0pt +* \mag=1000 +* \@twocolumnfalse +* \@twosidefalse +* \@mparswitchfalse +* \@reversemarginfalse +* (1in=72.27pt=25.4mm, 1cm=28.453pt) + +(/usr/share/texmf-dist/tex/context/base/mkii/supp-pdf.mkii +[Loading MPS to PDF converter (version 2006.09.02).] +\scratchcounter=\count298 +\scratchdimen=\dimen194 +\scratchbox=\box68 +\nofMPsegments=\count299 +\nofMParguments=\count300 +\everyMPshowfont=\toks33 +\MPscratchCnt=\count301 +\MPscratchDim=\dimen195 +\MPnumerator=\count302 +\makeMPintoPDFobject=\count303 +\everyMPtoPDFconversion=\toks34 +) (/usr/share/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty +Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf +Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 485. + (/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg +File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live +)) +LaTeX Font Info: Font shape `TU/AntikorMonoMedium(0)/m/n' will be +(Font) scaled to size 7.19995pt on input line 34. +LaTeX Font Info: Font shape `TU/AntikorMonoMedium(0)/m/n' will be +(Font) scaled to size 8.99994pt on input line 51. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <7> on input line 51. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <5> on input line 51. + + +LaTeX Font Warning: Font shape `TU/AntikorMonoMedium(0)/b/n' undefined +(Font) using `TU/AntikorMonoMedium(0)/m/n' instead on input line 58. + +LaTeX Font Info: Font shape `TU/AntikorMonoMedium(0)/m/n' will be +(Font) scaled to size 10.79993pt on input line 58. +[1 + +{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] +LaTeX Font Info: Font shape `TU/AntikorMonoMedium(0)/b/n' will be +(Font) scaled to size 10.79993pt on input line 95. + [2] (./main.aux) + +LaTeX Font Warning: Some font shapes were not available, defaults substituted. + +) + +Here is how much of LuaTeX's memory you used: + 16638 strings out of 477800 + 381554,794899 words of node,token memory allocated + 418 words of node memory still in use: + 3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 5 attribute, 49 glue_spec, 5 attribute_list, 2 write nodes + avail lists: 1:1,2:5181,3:150,4:6758,5:6284,6:108,7:12154,8:5,9:17620,10:19,11:558 + 36798 multiletter control sequences out of 65536+600000 + 40 fonts using 3303703 bytes + 104i,6n,101p,525b,733s stack positions out of 5000i,500n,10000p,200000b,80000s + +Output written on main.pdf (2 pages, 50646 bytes). + +PDF statistics: 50 PDF objects out of 1000 (max. 8388607) + 31 compressed objects within 1 object stream + 0 named destinations out of 1000 (max. 131072) + 16 words of extra memory for PDF output out of 10000 (max. 100000000) diff --git a/W1/report/main.pdf b/W1/report/main.pdf index 610c170..1bc2313 100644 Binary files a/W1/report/main.pdf and b/W1/report/main.pdf differ diff --git a/W1/report/main.pyg b/W1/report/main.pyg new file mode 100644 index 0000000..3553bd3 --- /dev/null +++ b/W1/report/main.pyg @@ -0,0 +1 @@ + e diff --git a/W1/report/main.synctex.gz b/W1/report/main.synctex.gz index e4fa6df..20bc348 100644 Binary files a/W1/report/main.synctex.gz and b/W1/report/main.synctex.gz differ diff --git a/W1/report/main.tex b/W1/report/main.tex index 66cedc8..e6241a8 100644 --- a/W1/report/main.tex +++ b/W1/report/main.tex @@ -1,6 +1,17 @@ \documentclass[a4paper]{article} +\usepackage{listings} +\usepackage{fontspec} +\usepackage[margin=1in]{geometry} + +\input{fasto.sty} \renewcommand{\thesection}{Task \arabic{section}} +\renewcommand{\thesubsection}{\alph{subsection})} + +\setmonofont[Scale=0.9]{Antikor Mono Medium} + +\setlength{\parskip}{5pt} +\setlength{\parindent}{0pt} \begin{document} \section{} @@ -8,9 +19,116 @@ \item I am a DIKU Computer Science BSc, general profile \item I have little to no proficiency with F\# \item I have mininal knowledge of assembly programming - \item + \item I'm very interested in the topic of compilers \end{enumerate} \section{} + +\subsection{Completeness and Correctness} +All the requested features have been implemented fully. All 10 possible expressions are accounted for, which can be seen by testing each individually, or together. + +The program has shown to give the correct answers in all test cases. + +Both completeness and correctness can be shown in these tests, all of which return correct results: + +\begin{lstlisting} + Welcome to the calculator! Type "exit" to stop. + Input an expression : 1+2+3+4-(5+6) + Evaluation result : INT -1 + Input an expression : let x=7 in (x*8+9) + Evaluation result : INT 65 + Input an expression : sum x=1 to 10 of (prod y=x to 10 of y) + Evaluation result : INT 9864100 + Input an expression : max x = 0 to 10 of 5*x-x*x + Evaluation result : INT 6 + Input an expression : argmax x = 0 to 10 of 5*x-x*x + Evaluation result : INT 2 +\end{lstlisting} + +\subsection{Effeciency} +The program runs efficiently and with no obvious uses of excessive memory. + +Any singular expression, apart from the \texttt{OVER} expressions runs in constant time, ignoring any expressions it contains. This means that any expression that contains $n$ non-\texttt{OVER} expressions runs in linear time, $O(n)$. + +The \texttt{OVER} expressions contain a loop, meaning they run in linear time by themselves. + +\subsection{Code Sharing/Elegance} +The code is made readable and with mininal code duplication. The \texttt{OPERATE} and \texttt{OVER} expressions have code run before the specific expression is determined, which reduced duplication. + +\subsection*{The full \texttt{eval} code} + +\begin{lstlisting}[language=FSharp] +let rec eval (vtab : SymTab) (e : EXP) : VALUE = + match e with + | CONSTANT n -> n + | VARIABLE v -> + lookup v vtab + | OPERATE (op, e1, e2) -> + let (INT exp1) = eval vtab e1 + let (INT exp2) = eval vtab e2 + match op with + | BPLUS -> INT (exp1 + exp2) + | BMINUS -> INT (exp1 - exp2) + | BTIMES -> INT (exp1 * exp2) + | LET_IN (var, e1, e2) -> + let exp1 = eval vtab e1 + let vtab = bind var exp1 vtab + eval vtab e2 + | OVER (rop, var, e1, e2, e3) -> + let (INT exp1) = eval vtab e1 + let (INT exp2) = eval vtab e2 + let results = [ + for i in exp1..exp2 -> + let vtab = bind var (INT i) vtab + eval vtab e3 + ] + match rop with + | RSUM -> List.fold (fun (INT acc) (INT elem) -> INT (acc + elem)) (INT 0) results + | RPROD -> List.fold (fun (INT acc) (INT elem) -> INT (acc * elem)) (INT 1) results + | RMAX -> List.fold (fun (INT acc) (INT elem) -> INT (max acc elem)) results[0] results + | RARGMAX -> + let max_elem = List.fold (fun (INT acc) (INT elem) -> INT (max acc elem)) results[0] results + INT ((List.findIndex ((=) max_elem) results) + exp1) +\end{lstlisting} + \section{} +\subsection{The \texttt{mul} function} +\begin{lstlisting}[language=Fasto] +fun int mul(int x, int y) = + if y == 0 then 0 + else if y < 0 then mul(x, y+1) - x + else mul(x, y-1) + x +\end{lstlisting} + +The \texttt{mul} functions is recursive. The base level, when \texttt{y} is 0, 0 is returned. In all other cases, \texttt{y} is moved 1 step closer to 0, and \texttt{x} is either added or subtracked from the final result. + +\subsection{The \texttt{dif} array} +\begin{lstlisting}[language=Fasto, firstnumber=16] +let dif = map(fn int (int x) => if x == 0 then arr[x] else arr[x] - arr[x-1], iota(n)) in +\end{lstlisting} + +The \texttt{dif} array is constructed using an anonymous function in a \texttt{map} function call. + +\subsection*{The full Fasto code} +\begin{lstlisting}[language=Fasto] +fun int mul(int x, int y) = + if y == 0 then 0 + else if y < 0 then mul(x, y+1) - x + else mul(x, y-1) + x + +fun int readInt(int i) = read(int) + +fun int squareSum(int x, int y) = x + mul(y, y) + +fun int main() = + let n = read(int) in + if n == 0 then let a = write("Incorrect Input!") in 0 + else if n < 0 then let a = write("Incorrect Input!") in 0 + else + let arr = map(readInt, iota(n)) in + let dif = map(fn int (int x) => if x == 0 then arr[x] else arr[x] - arr[x-1], iota(n)) in + write(reduce(squareSum, 0, dif)) + +\end{lstlisting} + \end{document} \ No newline at end of file