-Files:
-Typechecker.hs: Simple modification of the bnfc-generated Testsyntax which calls the type-checking functions.
-
-Typecheck.hs: Contains the type-checking functions typeCheckExp, typeCheckVar and typeCheckStm and some utility functions, responsible for the entire type-checking process.
-
-Abssyntax.hs, Parsyntax.y, Lexsyntax.x,ErrM.hs,Printsyntax.hs,Skelsyntax.hs: The files generated by bnfc, only modification is the removal of the Bool type in Abssyntx.hs so haskell's internal type can be used.
-
-
-typing rules
-++++++++++++
-
-
-(v is used for values, e for expressions, s for statements, c is the context)
-
-
-[Eq, NEq, Plus, Minus, Times, Div, Lt, ELt, Gt, EGt]
-
-<e1 o e2,c> => <v,c''> <= <e1,c> => <v1,c'> <e2,c'> => <v2,c''> v is the result of using operator o on v1 and v2
-
-
-[Assignment]
-
-<i := e,c> => c'[i -> v] <= <e,c> => <v,c'>
-
-Assign the value v to i in the first scope i is found in.
-
-[ENeg]
-
-<e,c> => <-v,c'> <= <e,c> => <v,c'>