Repository navigation
s2: clauses, loop checks, quantifiers; printer fixpoint on all sources - #19
Merged
Merged
Conversation
… fixpoint on every source Ast.Def and Ast.Spec carry their contract clauses (an extern has none): requires, ensures, returns, decreases, invariant with an expression, proof using, proof by induction, proof lean (Ast.Clause). Ast.Check is a loop invariant or measure in a block; Ast.Quant is forall/exists x: T => e. The parser reads them as s1/parse.srs:147-184, 494, 544-548; the printer writes clauses one step in, then = at the start of a line. Names walks clause expressions with result as a local and proof using as uses. The printer fixes two forms that did not parse back: a while whose condition is a match writes do on its own line, and else starts a new line when either branch takes more than one line (Ast.multiLine). Printing every parsed source, parsing the printed text and printing again gives the same text for all 171 sources that parse (s2 itself included). tests/s2/parse: tests/contracts.srs parses and prints; an if with a block branch. Parsing every source: 171 of 176; the rest are 4 s1 parse errors (s2 rejects them too) and one int type arg (s1 rejects it later). Mutants: spec clauses dropped, no quantifiers, else placement from the else branch only, match not multi-line: each changes the output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FRONT rung 4c: contract clauses, loop checks and quantifiers. FRONT now covers every s1 syntax form that s1 accepts.
Ast.DefandAst.Speccarry their clauses: requires, ensures, returns, decreases, invariant,proof using,proof by induction,proof lean. An extern has none.Ast.Checkis a loop invariant or measure;Ast.Quantis forall/exists.resultas a local.Two printer fixes for forms that did not parse back:
doafter a match condition goes on its own line, andelsegoes on a new line when either branch spans several lines.Fixpoint oracle: for all 171 sources that parse (s2 itself included), print, parse the printed text, and print again gives the same text.
Parse probe: 171 of 176. The other 5: four s1 parse errors (s2 rejects them too) and one int type arg (s1 rejects it later). Four mutants each change the output. Local tests/run.sh: 185 ok, 0 FAIL.