From 3da4e59084be26b8a63e91d570622ff3430d66c0 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 14 Nov 2017 10:57:45 +0100 Subject: Add skeleton 8 --- .gitignore | 2 ++ assignment-8/skeleton8.icl | 67 ++++++++++++++++++++++++++++++++++++++ assignment-8/skeleton8.prj.default | 59 +++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 assignment-8/skeleton8.icl create mode 100644 assignment-8/skeleton8.prj.default diff --git a/.gitignore b/.gitignore index 8fc9c95..5bd3ac1 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ a.out *-data/ assignment-5/skeleton5 assignment-6/multiplechoice +assignment-8/skeleton8 +assignment-8/skeleton8.prj # TeX *-blx.bib diff --git a/assignment-8/skeleton8.icl b/assignment-8/skeleton8.icl new file mode 100644 index 0000000..0c68ac9 --- /dev/null +++ b/assignment-8/skeleton8.icl @@ -0,0 +1,67 @@ +module skeleton8 + +/** + * Advanved Progrmming 2017, Assignment 8 + * Pieter Koopman, pieter@cs.ru.nl + */ + +from iTasks import class iTask, class toPrompt, class Publishable, instance Publishable Task, + instance toPrompt String, instance Functor Task, + class TApplicative, instance TApplicative Task, + generic gEq, generic gDefault, generic JSONDecode, generic JSONEncode, generic gText, generic gEditor, + :: JSONNode, :: TextFormat, :: Editor, :: TaskValue(..), :: Stability, :: Task, :: Action, + :: TaskCont(..), :: ViewOption(..), :: UpdateOption(..), + -||-, -||, ||-, >>*, always, hasValue, updateInformation, viewInformation, startEngine +import qualified iTasks +import qualified iTasks.WF.Combinators.Overloaded as WF +import Data.Functor, Control.Applicative, Control.Monad +import Data.Tuple, StdClass, StdList, StdMaybe, StdString +import StdGeneric, StdBool +from StdFunc import o +import qualified Data.List as List +import qualified Data.Map as Map + +:: Expression + = New [Int] + | Elem Int + | Variable Ident + | Size Set + | (+.) infixl 6 Expression Expression + | (-.) infixl 6 Expression Expression + | (*.) infixl 7 Expression Expression + | (=.) infixl 2 Ident Expression + +:: Logical + = TRUE | FALSE + | (In) infix 4 Elem Set + | (==.) infix 4 Expression Expression + | (<=.) infix 4 Expression Expression + | Not Logical + | (||.) infixr 2 Logical Logical + | (&&.) infixr 3 Logical Logical + +:: Stmt + = If Logical Stmt Stmt + | For Ident Set Stmt + | Expression Expression + | Logical Logical + +:: Set :== Expression +:: Elem :== Expression +:: Ident :== String + +// === State + + +// === semantics + + +// === simulation +(>>>=) :== 'iTasks'.tbind +(>>>|) a b :== 'iTasks'.tbind a (\_ -> b) +treturn :== 'iTasks'.return +ActionOk :== 'iTasks'.ActionOk +ActionQuit :== 'iTasks'.ActionQuit +ActionNew :== 'iTasks'.ActionNew + +Start = () diff --git a/assignment-8/skeleton8.prj.default b/assignment-8/skeleton8.prj.default new file mode 100644 index 0000000..cf32d2f --- /dev/null +++ b/assignment-8/skeleton8.prj.default @@ -0,0 +1,59 @@ +Version: 1.4 +Global + ProjectRoot: . + Target: iTasks + Exec: {Project}/skeleton8 + CodeGen + CheckStacks: False + CheckIndexes: True + Application + HeapSize: 167772160 + StackSize: 1048576 + ExtraMemory: 81920 + IntialHeapSize: 204800 + HeapSizeMultiplier: 4096 + ShowExecutionTime: False + ShowGC: False + ShowStackSize: False + MarkingCollector: False + DisableRTSFlags: False + StandardRuntimeEnv: True + Profile + Memory: False + MemoryMinimumHeapSize: 0 + Time: False + Stack: False + Dynamics: True + DescExL: False + Output + Output: ShowConstructors + Font: Monaco + FontSize: 9 + WriteStdErr: False + Link + LinkMethod: Static + GenerateRelocations: False + GenerateSymbolTable: False + GenerateLinkMap: False + LinkResources: False + ResourceSource: + GenerateDLL: False + ExportedNames: + Paths + Path: {Project} + Precompile: + Postlink: +MainModule + Name: skeleton8 + Dir: {Project} + Compiler + NeverMemoryProfile: False + NeverTimeProfile: False + StrictnessAnalysis: True + ListTypes: StrictExportTypes + ListAttributes: True + Warnings: True + Verbose: True + ReadableABC: False + ReuseUniqueNodes: True + Fusion: False -- cgit v1.2.3