{"id":20706926,"url":"https://github.com/code-help-tutor/vc-gen","last_synced_at":"2025-12-24T02:14:39.242Z","repository":{"id":234136903,"uuid":"784578584","full_name":"code-help-tutor/vc-gen","owner":"code-help-tutor","description":"vc 代写代做 编程辅导, code help, CS tutor, WeChat: cstutorcs Email: tutorcs@163.com","archived":false,"fork":false,"pushed_at":"2024-04-10T06:04:40.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T05:19:08.682Z","etag":null,"topics":["vc"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/code-help-tutor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-10T06:04:34.000Z","updated_at":"2024-04-10T06:04:44.000Z","dependencies_parsed_at":"2024-04-18T09:31:00.292Z","dependency_job_id":null,"html_url":"https://github.com/code-help-tutor/vc-gen","commit_stats":null,"previous_names":["code-help-tutor/vc-gen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/code-help-tutor/vc-gen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-help-tutor%2Fvc-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-help-tutor%2Fvc-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-help-tutor%2Fvc-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-help-tutor%2Fvc-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/code-help-tutor","download_url":"https://codeload.github.com/code-help-tutor/vc-gen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-help-tutor%2Fvc-gen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27992997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["vc"],"created_at":"2024-11-17T01:24:16.364Z","updated_at":"2025-12-24T02:14:39.207Z","avatar_url":"https://github.com/code-help-tutor.png","language":"Haskell","readme":"# VC Generation\n\nIn this assignment, you will implement a verifier based on the weakest-\nprecondition/VCGen methodology as discussed in class. We will work with programs\nthat are written in a JavaScript like syntax (EcmaScript) and translate them\ninto our imperative language Nano.\n\n## Install Z3\n\nThis assignment will use Z3 to solve logical formulas. In order to use Z3\nfrom code, you will need to install the developer version of Z3 (not just the\nexecutable). Since we're using [Haskell's Z3 bindings](https://hackage.haskell.org/package/z3),\nwe need to use a specific version of Z3, namely `4.8.x`. Any other version will\ngive you compilation errors.\n\n### Package Manager (Linux)\n\nUse your package manager to install the z3 developer version. Here's an example\nfor Ubuntu.\n\n```sh\n$ sudo apt install libz3-dev\n```\n\nMake sure that you install the correct version!\n\n### Manually\n\nGo to the [Z3 releases](https://github.com/Z3Prover/z3/releases/tag/z3-4.8.17)\npage and pick the release for your OS and architecture.\n\n#### Binary\n\nFrom this release, copy the `z3` binary into your path.\n - `/usr/local/bin`, for Linux, MacOS.\n - `\\Windows\\System32\\bin`, for Windows.\n\nMake sure you can now run the binary from any other directory. You may need\nto open a new terminal for this to work. If this gives you a version number,\nthen proceed!\n\n```sh\n$ z3 --version\n```\n\n#### Headers\n\nMove the include files (directory `include`) into a directory for include\nfiles. For example `/usr/local/include`, for Linux and MacOS. You can pick any\ndirectory for Windows. Then, modify the `stack.yaml` file in this directory and\nadd the path to `extra-include-dirs`. For example:\n\n```yaml\nextra-include-dirs: [/usr/local/include]\n```\n\n#### Library\n\nCopy the library files (all remaining files in the `bin` directory) and copy\nthem to your library path. For example `/usr/local/lib` for Linux, MacOS, or any\ndirectory for Windows. Again, you need to update your `stack.yaml` to add the\nlibrary path:\n\n```yaml\nextra-lib-dirs: [/usr/local/lib]\n```\n\n## Running and testing\n\nThis code again features a test bench, which you may run in the same fashion\nwith `stack`. The tests again aim to direct you through to code base of this\nassignment and we strongly suggest you follow this!\n\nThis assignment also features an executable which may be ran with the following\ncommand.\n\n```\n$ stack run -- -f \u003cpath-to-file\u003e\n```\n\nThis will run the verifier on a single file. Again, you are allowed to make\nmodification to `Main` if you wish to get more debug information.\n\n## Assignment\n\nThe assignment consists of two main parts. First you will write a weakest-\nprecondition verifier. After this, you will use this verifier to prove\nproperties about a set of small programs.\n\n### Nano DSL\n\nTo get a grasp of what Nano DSL looks like, you can look at any of the programs\nin the `programs` folder. One of the main things to note is that we interpret\nsome function calls as Nano statements.\n\nStatement `assume(F)` encodes an assumption that formula F holds. \nStatement `assert(F)` encodes an obligation to show that formula F holds. \nIn particular a Hoare triple {P} s {Q} can be translated into the following\nexpression.\n\n```js\nassume(P); s; assert(Q)\n```\n\nStatements `invariant(P)` places the given invariant `P` as (part of) the\ninvariant of the closest scoping while.\n\nStatements `requires(P)` and `ensures(P)` respecitvely set a pre or post \ncondition on the function signature.\n\nStatements `modifies(x)` says that the inner variable will be modified by\nthe function call.\n\nExpressions `forall(x, P)` and `exists(x, P)` quantify `x` over `P` and may\nbe used wherever logic is involved (i.e. all of these prior mentioned calls).\n\n**Aside:** Embedding a new language (Nano) into an existing language\n(Haskell) is a common and important [technique](http://wiki.haskell.org/Embedded_domain_specific_language)\nin programming language research. The embedded language is often called a Domain\nSpecific Language (DSL). We're using an approached called `deep embedding`.\n\n### Verifier\n\nTo get a working verifier, you will have to implement roughly the following\nsteps.\n\n1. Substition of logical formulas\n2. Conversion of ECMAScript into Nano\n3. Generation of Verification Conditions from a Nano program\n\nRegarding the ECMAScript conversion, you may find the documentation of the\nparser [here](https://hackage.haskell.org/package/language-ecmascript-0.17.0.1/docs/Language-ECMAScript3-Syntax.html).\nMake sure to check out the nano programs to form a better understanding of what\nthe embedding looks like.\n\nFor your verifier, it is just as important that your code rejects bad programs\nas it is to proof good programs. As such, we feature a bunch of programs to\nachieve both goals. Programs in the `programs/pos` directory should pass\nverification, while programs in the `programs/neg` directory should fail\nverification.\n\n### Verification\n\nYou will have to verify all the tests in `programs/verify`. As you are probably\nalready aware of at this point, we need to provide invariants to prove properties\nwhen loops are involved.\n\nYou may add invariants to the files in this folder in order to verify them.\nWe do check that you do not modify the code in any other way.\n\n**Tip** Instead of writing \n\n```js\ninvariant(P \u0026\u0026 Q \u0026\u0026 R)\n```\n\nyou can write \n\n```js\ninvariant(P);\ninvariant(Q);\ninvariant(R);\n```\n\n## Grading\n\nYour final grade corresponds directly to the one awarded to you by the test\ninfrastructure. Do make sure your submission correctly executes on our online\nenvironment.\n\nIf there are issues with the submission system, don't panic! We will handle this\non a case-by-case basis.\n\nIf your uploaded submission somehow fail tests that work locally, ping\nus and we will have a look!\n\nIf the online environment suddenly fails to work moments before the deadline,\ndon't hesitate to send us your submission through different means (e.g. email).\n\n## Plagiarism\n\nWe have a strict zero tolerance policy against plagiarism. Sadly, we find cases\nevery year... This is not fun for you, nor us. Please, refrain from copying \nand/or sharing your code with other groups.\n\nSince this is a group assignment, we expect that most of you will work together\nvia Git. Do make sure to make your repository **private**! Sharing your code in\nthis manner is sadly still plagiarism, even if unintentional.# vc gen\n\n# 程序代做代写 CS编程辅导\n\n# WeChat: cstutorcs\n\n# Email: tutorcs@163.com\n\n# CS Tutor\n\n# Code Help\n\n# Programming Help\n\n# Computer Science Tutor\n\n# QQ: 749389476\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-help-tutor%2Fvc-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-help-tutor%2Fvc-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-help-tutor%2Fvc-gen/lists"}