microsoft / z3guide Goto Github PK
View Code? Open in Web Editor NEWTutorials and courses for Z3
Home Page: https://microsoft.github.io/z3guide
License: MIT License
Tutorials and courses for Z3
Home Page: https://microsoft.github.io/z3guide
License: MIT License
rehype-sanitize might be useful
ensure that the content is properly handled by a screen reader, in particular that changes to the output div are properly announced (use something like aria-live)
create a new logo for the site and for potential "merch" and such
https://www.figma.com/file/8DIxJUBYNPj9AqOxifgoPQ/Z3-Designs?node-id=0%3A1
Currently thinking about the design from https://infinum.github.io/eightshift-docs/, minus the sections below intro. So just one big background, a big title, some text description, and two buttons that get you to Tutorial and Playground, respectively.
It should be able to be done through pure CSS.
TODOs:
Example of commit messages:
feature:semantic-release
or major:semantic-release
website/docs/*.md
files, change all instances of```
<some code>
```
to
```z3
<some code>
```
docs/intro.md
. Please fix those manually. For example:(echo starting Z3...) ;; missing quotations around "starting Z3..."
and
(assert ( a 10)) ;; should have been `(assert (> a 10))`
Missing wrap and copy buttons.
using github action/cache to cache pre-computed z3 runs in build
Having the version number on the website somewhere (at least on the playground) would be helpful for users who run into bugs and want to report them.
This example shows no output in pre-built mode:
The (set-logic HORN) seems not to be respected from Z3_eval_smtlib2_string.
Ensure that the page can be navigated with a keyboard, specifically that the interactive snippet editor can be keyboard operated (add short cuts for run, make sure one can escape from the snippet)
For changes not in website/docs
:
main
and delete the temporary branchdescribe record update construct for algebraic datatypes
Develop schema for cross referencing material from the tutorial.
So far there is a way to cross reference SMTLIB in some format. For example.
SMTLIB2 standard Integers
Other categories of cross references are:
What is a good schema for the static content and way to integrate dynamic content?
Preliminary way:
Note
Information the user should notice even if skimming.
[!TIP]
Optional information to help a user be more successful.
[!IMPORTANT]
Essential information required for user success.
[!CAUTION]
Negative potential consequences of an action.
[!WARNING]
Dangerous certain consequences of an action.
The last point about cross-referencing user interaction is more ambitious and should be aligned with developing methods to integrate learning feedback. Given the state of z3guide, what is the long- and short-term plan for integrating such signals?
What are the technical enablers? (let me zoogl3 this, or link to github discussions, create discussions, cross-link discussions?)
Once a snippet is edited, add button to reset to original code
Now that we eval
every z3-js
snippet, the door to potential security attacks is opened.
A possible scenario I could think of is that someone forks this repo, changes some z3-js
content to be malicious, and hosts it on a public github page. Visitors of that page could have their information stolen through such malicious content.
Pretty sure the official docusaurus website has some mechanism against it as there are executable and editable JS blocks too.
TODO:
Click the first "discuss" button at https://microsoft.github.io/z3guide/programming/Z3%20from%20Python/advanced
(notice URL)
There are several issues with the top-level organization.
Attempting to run Z3 in the browser (currently without webworkers). Code in #42 .
According to @NikolajBjorner it seems that there have been major changes to the JS API since June 14, which involves the names of several files (e.g. wrapper.js
was gone) and the signature of init
(it used to accept one argument, which is the result of initZ3
, now none).
@bakkot It would be super helpful if you could provide us with some examples of:
with the current (4.9.1) npm release.
Currently the reference documentation is built on releases and available as a zip file from the release hive.
https://github.com/Z3Prover/z3/releases/download/z3-4.9.1/z3doc.zip
Then I manually download this and unzip the contents into z3prover.github.io/api/html
It is a repository under https://github.com/z3prover
Commit and push
The process for uploading artifacts should be reasonably similar for releases.
Even a self-contained GitHub action that builds documentation by itself and pushes to the right place (could be microsoft.github.io/z3guide if this is better) would be great and perhaps easier to maintain than complicating the release.yml Azure pipeline.
Once the SMTLIB tutorial is interactive, the format of the site may very well transition to a wider scope.
The indexing used here
https://github.com/facebook/docusaurus/blob/main/website/docusaurus.config.js
allows for multiple sections.
For z3 the main sections are:
Other notes:
Resources, such as Slides are linked at bottom of page.
The tutorial should link with a slide share.
At this point https://z3prover.github.io/slides.
The directory is not indexed so currently have to know names of slides "tuv22.html" and "q.html" and "setts.html"
Sources are: https://github.com/z3prover/ (under z3prover.github.io).
Avoid inline html as possible
Use (dreaded) markdown syntax for tables
integrate also other tutotiral material
integrate tutorial material based on case studies, such as:
have a way to assemble pointers to other self-contained examples. A static set of links could bit-rot. Is there a good dynamic approach (let me zoggl3 that for you?)
assemble and allow for adding links to youtube material.
add a mode for running Java script examples
run python code samples
integration with documentation generation.
Overall:
Several code snippets from our tutorial would not work in the web interface cited above. According to @NikolajBjorner z3-wasm does produce different outputs than the z3 executables.
Code snippet example:
(set-option :print-success true)
(set-option :produce-unsat-cores true) ; enable generation of unsat cores
(set-option :produce-models true) ; enable model generation
(set-option :produce-proofs true) ; enable proof generation
(declare-const x Int)
(set-option :produce-proofs false) ; error, cannot change this option after a declaration or assertion
(echo "before reset")
(reset)
(set-option :produce-proofs false) ; ok
Moving the conversation from #19 .
The possible solutions we face:
The second argumen of visit should be a logger; we should use that in order to get proper logging in the builds
It would be more efficient to immediately show the pre-computed output (that's one less button and it's useful information). We have it let's show it.
I recommend doing this in remark at rendering time by generating a new code node; that later gets rendered by docusaurus. As a bonus, it should be the copy/wrap icons.
Also, drop "Output:", it feels more like noise at this point.
Move all remark plugin settings to configuration
The settings should allow to run the remark tool against another command line tool --> support an array of tool descriptions.
I encountered some issues with getting the TypeScript bindings to work in Node.js. The idea is to break down a given code snippet (in the smt2 format) by line and obtain the output through Z3.eval_smtlib2_string
. My main reference is this z3-wasm webpage, which uses our official WASM build. The way inputs are processed is detailed in their main.js
file.
Note that this website runs z3-wasm in the browser from the client side, while we want to run z3-wasm with Node.js from the server side. Therefore, their logic for running Z3 does not work in our scenario -- I had RuntimeError
s complaining about the inability to find z3-built.wasm
. My implementation for running Z3 (currently commented out) can be found in website/src/remark/render-code-blocks.mjs
in PR #18 .
I also noticed that several code snippets from our tutorial would not work in the web interface cited above. I wonder if this is a bug with the WASM build, or if there are additional API calls we should use instead for such code snippets. An example of snippet that does not work in the web interface:
(set-option print-success true)
(set-option produce-unsat-cores true) ; enable generation of unsat cores
(set-option produce-models true) ; enable model generation
(set-option produce-proofs true) ; enable proof generation
(declare-const x Int)
(set-option produce-proofs false) ; error, cannot change this option after a declaration or assertion
(echo before reset)
(reset)
(set-option produce-proofs false) ; ok
I got a bunch of syntax errors when I ran it in that web interface.
@NikolajBjorner We would like some help from Kevin on the following issues:
There is a new release of z3 out today.
It doesn't seem to get picked up by the build.
It has some npm version dependencies as well that have changed.
With this release we should be able to remove some of the no-build tags.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.