From b9a588742879acb401f354fb2ae14b11e3b12dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=B8ving?= Date: Wed, 22 Feb 2023 12:47:36 +0100 Subject: [PATCH 1/6] Clarify installation of .NET and evaluation in the README --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0efff5f..0b25025 100644 --- a/README.md +++ b/README.md @@ -19,16 +19,19 @@ F#/FsLexYacc ## Getting started -Building this project requires .NET 7.0. Installation +Building this project requires .NET 7.0. For installation, follow the description matching your platform: - **Windows:** Installation instructions for this, can be found [here](https://dotnet.microsoft.com/en-us/download). - **macOS:** Building on macOS requires the `dotnet-sdk` package. This can be installed using [Homebrew](https://brew.sh) and running `brew install dotnet-sdk` - **Linux:** There are many ways to install on Linux, but a good starting point might be [this](https://fsharp.org/use/linux/). +To check that you have an up-to-date version run `dotnet --version` to display the version number, which should be something starting with 7. If it does not, consider updating your installation, and if that doesn't work, try uninstalling your current version and installing from scratch. + +Next step is getting the code, which is done by cloning this repository and using `cd` to change directory to the newly cloned folder. To do this, make sure that you have your SSH keys setup correctly (instructions for [GitLab](https://docs.gitlab.com/ee/user/ssh.html)). ## Running the code -To run the program do: +To run the program, navigate to the directory of you cloned repository and do: ```bash dotnet run @@ -78,6 +81,6 @@ It is recommended to update the binaries in `dev/` regularly. You do this by run ## Evaluation -Every time you push to git, the program is ready to be evaluated automatically by your teachers. +Every time you push your Git repository, your code is ready to be evaluated automatically by your teachers. -The results as they are produced, can be seen (at GitLab) in the `result` branch. +When your project has been evaluated, the results can be seen (at GitLab) in the `result` branch. From 75eafeb514d0f384a9a558c1bd1960317bab3b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=B8ving?= Date: Wed, 22 Feb 2023 12:49:20 +0100 Subject: [PATCH 2/6] Grammar fixes in the README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0b25025..6b4079b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # F# Starter -This folder contains the skeleton of a parser along with the input and output types for each analysis given in the assignment. It also contain an example of a "calculator" program in F# that reads an arithmetic expression from the command line and print the result of evaluating such expression for initial testing. +This folder contains the skeleton of a parser along with the input and output types for each analysis given in the assignment. It also contains an example of a "calculator" program in F# that reads an arithmetic expression from the command line and print the result of evaluating such expression for initial testing. ## Files @@ -9,7 +9,7 @@ F#/FsLexYacc * [Parser.fsp](Parser.fsp): The parser for arithmetic expressions * [Types.fs](Types.fs): Global types that are used in many analysis * [AST.fs](AST.fs): Types for AST of arithmetic expressions -* [Program.fs](Program.fs): The entrypoint for the program +* [Program.fs](Program.fs): The entry point for the program * [Security.fs](Security.fs): File for the security analysis * [SignAnalysis.fs](SignAnalysis.fs): File for the sign analysis * [ProgramVerification.fs](ProgramVerification.fs): File for program verification @@ -27,11 +27,11 @@ Building this project requires .NET 7.0. For installation, follow the descriptio To check that you have an up-to-date version run `dotnet --version` to display the version number, which should be something starting with 7. If it does not, consider updating your installation, and if that doesn't work, try uninstalling your current version and installing from scratch. -Next step is getting the code, which is done by cloning this repository and using `cd` to change directory to the newly cloned folder. To do this, make sure that you have your SSH keys setup correctly (instructions for [GitLab](https://docs.gitlab.com/ee/user/ssh.html)). +The next step is getting the code, which is done by cloning this repository and using `cd` to change directory to the newly cloned folder. To do this, make sure that you have your SSH keys set up correctly (instructions for [GitLab](https://docs.gitlab.com/ee/user/ssh.html)). ## Running the code -To run the program, navigate to the directory of you cloned repository and do: +To run the program, navigate to the directory of your cloned repository and do: ```bash dotnet run @@ -47,7 +47,7 @@ dotnet run calc "1 + 52 * 23" ## Interactive UI -When you get further, the analysis can be explored in the interactive tool. Run the program in `dev/` folder matching you operating system. +When you get further, the analysis can be explored in the interactive tool. Run the program in the `dev/` folder matching your operating system. ```bash # Windows From d04c1782045f5c653d8b0bc94d7dd0c0838a7e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=B8ving?= Date: Thu, 23 Feb 2023 10:46:22 +0100 Subject: [PATCH 3/6] Add extension recommendations for VSCode --- .vscode/extensions.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..3834218 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "mnxn.fsharp-fsl-fsy", + "ionide.ionide-fsharp" + ] +} From b4fbf43ceafa7d1721029af7ff27edb5fcc4e96c Mon Sep 17 00:00:00 2001 From: Christoph Matheja Date: Mon, 27 Feb 2023 19:40:41 +0100 Subject: [PATCH 4/6] Added TODO markers where to get started. (#2) --- Graph.fs | 3 +-- Interpreter.fs | 3 +-- ProgramVerification.fs | 3 +-- Security.fs | 3 +-- SignAnalysis.fs | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Graph.fs b/Graph.fs index 3fe511e..4be692b 100644 --- a/Graph.fs +++ b/Graph.fs @@ -12,6 +12,5 @@ type Input = { determinism: Determinism } type Output = { dot: string } -// Start you implementation here let analysis (src: string) (input: Input) : Output = - failwith "Graph analysis not yet implemented" + failwith "Graph analysis not yet implemented" // TODO: start here diff --git a/Interpreter.fs b/Interpreter.fs index 99a6330..f14bfe2 100644 --- a/Interpreter.fs +++ b/Interpreter.fs @@ -28,6 +28,5 @@ type ProgramTrace = type Output = List -// Start you implementation here let analysis (src: string) (input: Input) : Output = - failwith "Interpreter not yet implemented" + failwith "Interpreter not yet implemented" // TODO: start here diff --git a/ProgramVerification.fs b/ProgramVerification.fs index a84e3b3..9b8330f 100644 --- a/ProgramVerification.fs +++ b/ProgramVerification.fs @@ -10,6 +10,5 @@ type Input = { post_condition: string } type Output = { pre_condition: string } -// Start you implementation here let analysis (src: string) (input: Input) : Output = - failwith "Program verification analysis not yet implemented" + failwith "Program verification analysis not yet implemented" // TODO: start here diff --git a/Security.fs b/Security.fs index 38388d8..dfb0b0f 100644 --- a/Security.fs +++ b/Security.fs @@ -23,6 +23,5 @@ type Output = violations: Flow list } -// "Start you implementation here" let analysis (src: string) (input: Input) : Output = - failwith "Security analysis not yet implemented" + failwith "Security analysis not yet implemented" // TODO: start here diff --git a/SignAnalysis.fs b/SignAnalysis.fs index 444d1dd..863ced2 100644 --- a/SignAnalysis.fs +++ b/SignAnalysis.fs @@ -27,6 +27,5 @@ type Output = nodes: Map> } -// Start you implementation here let analysis (src: string) (input: Input) : Output = - failwith "Sign analysis not yet implemented" + failwith "Sign analysis not yet implemented" // TODO: start here From 86c2552cc383853584a107d0b345a636edfb3857 Mon Sep 17 00:00:00 2001 From: Christoph Matheja Date: Wed, 1 Mar 2023 16:43:08 +0100 Subject: [PATCH 5/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b4079b..ce4ed22 100644 --- a/README.md +++ b/README.md @@ -83,4 +83,4 @@ It is recommended to update the binaries in `dev/` regularly. You do this by run Every time you push your Git repository, your code is ready to be evaluated automatically by your teachers. -When your project has been evaluated, the results can be seen (at GitLab) in the `result` branch. +When your project has been evaluated, the results can be seen (at GitLab) in the "result" branch. From 8e5a051b309314d572ac54312e17d91962972958 Mon Sep 17 00:00:00 2001 From: Alberto Lluch Lafuente Date: Wed, 1 Mar 2023 17:46:07 +0100 Subject: [PATCH 6/6] Update Program.fs Added stub for task 1 (parser) --- Program.fs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Program.fs b/Program.fs index 865cb71..1f730fb 100644 --- a/Program.fs +++ b/Program.fs @@ -1,4 +1,4 @@ -open FSharp.Text.Lexing +open FSharp.Text.Lexing open System open Newtonsoft.Json open AST @@ -48,6 +48,11 @@ let main (args) = Console.WriteLine("{0}", evaluate ast) | Error e -> Console.Error.WriteLine("Parse error: {0}", e) + 0 + | [ "parse"; src ] -> + let output:string = Parse.analysis src + Console.WriteLine("{0}", output) + 0 | [ "graph"; src; input ] -> let input = JsonConvert.DeserializeObject input @@ -82,6 +87,7 @@ let main (args) = | _ -> let commands = [ "calc " + "parse " "graph " "interpreter " "pv "