summaryrefslogtreecommitdiff
path: root/Source/Dafny/Rewriter.cs
Commit message (Collapse)AuthorAge
* Removed Contract.Requires from method overrides (preconditions of overrides ↵Gravatar Rustan Leino2016-01-06
| | | | | | | | are inherited from the overridden method and Code Contracts will copy those preconditions to make sure the right run-time checking happens; when Code Contracts finds preconditions on overrides, it emits warnings).
* Fix issue 111. Create a new BoundVar for each CasePattern of MatchCaseExpr whenGravatar qunyanm2015-11-30
| | | | trying to substitute the nested CasePattern with the BoundVar.
* MergeGravatar leino2015-11-27
|\
* | autocontracts: Don't add modifies clause to ghost methodsGravatar leino2015-11-27
| |
| * Fix issue 103. Emit the quantifiers for ForallStmt before AutoTrigger so thatGravatar qunyanm2015-11-25
|/ | | | the auto-triggers can be computed for ForallStmt.
* Introduced new datatype update syntax: D.(f := E)Gravatar leino2015-10-23
| | | | | The old syntax, D[f := E], is still supported for a short while, but generates a warning about that syntax being deprecated. The new syntax also supports multiple updates: D.(f := E0, g := E1, h := E2)
* Parsing and pretty printing of the new "existential guards" of the two kinds ↵Gravatar leino2015-10-03
| | | | of "if" statements.
* Make quantifier splitting a two step processGravatar Clément Pit--Claudel2015-08-23
| | | | This fixes a bug that affected Monad.dfy
* Make `old` a special case for trigger generation.Gravatar Clément Pit--Claudel2015-08-21
| | | | | | Old is particular, because in old(g(f(x))), the triggers are old(g(x)) and old(f(x)). This has a number of implications; see the new tests files for more information.
* Factor out some AST visiting codeGravatar Clément Pit--Claudel2015-08-19
|
* Merge.Gravatar Clément Pit--Claudel2015-08-19
|\ | | | | | | | | Changes that were needed included preventing the InductionRewriter from iterating on a SplitQuantifier and using the new error reporting engine.
* | Small cleanups, fixes, and refactoringsGravatar Clément Pit--Claudel2015-08-18
| | | | | | | | | | In particular, start detecting loops between terms that don't look like each other at the Dafny level, such as {a[x]} and {x in a} (when a is a multiset)
* | Start committing split quantifiersGravatar Clément Pit--Claudel2015-08-14
| | | | | | | | | | | | | | | | | | This requires rewriting the parts of the AST that contain these quantifiers. We unfortunately don't have facilities to do such rewrites at the moment (and there are loops in the AST, so it would be hard to write such a facility). As a workaround, this commit introduces a field in quantifier expressions, SplitQuantifiers. Code that manipulate triggers is expected to look for this field, and ignore the other fields if that one is found.
* | Start committing generated triggers when /autoTriggers is 1Gravatar Clément Pit--Claudel2015-08-14
| |
* | Draft out a more advanced version of trigger generationGravatar Clément Pit--Claudel2015-08-19
| | | | | | | | This new version will include a cleaner pipeline, and trigger splitting.
* | Refactor the error reporting codeGravatar Clément Pit--Claudel2015-08-18
| | | | | | | | | | The new error reporting system has a simpler interface, isn't tied to the resolver, and contains error source information.
| * Change the induction heuristic for lemmas to also look in precondition for ↵Gravatar leino2015-08-12
| | | | | | | | | | | | clues about which parameters to include. As a result, improved many test cases (see, e.g., dafny4/NipkowKlein-chapter7.dfy!) and beautified some others.
| * Bug fixes and improvements in pretty printingGravatar leino2015-08-11
| |
| * Removed the unused type ThisSurrogateGravatar leino2015-08-11
| |
| * Moved discovery of induction variables into a Rewriter.Gravatar leino2015-08-11
|/ | | | | Generate warnings for malformed :induction arguments. Removed the functionality that allowed induction on 'this'.
* fix for apparent typo in Rewriter.csGravatar Michael Lowell Roberts2015-07-20
|
* Merge my autoTriggers work into the master branchGravatar Clément Pit--Claudel2015-07-17
|\ | | | | | | | | This contains trigger related things under the autoTriggers flag (disabled by default), and some bug-fixes and cleanups that are already enabled.
* | Register the trigger generator as a a rewriter in the Resolver.Gravatar Clément Pit--Claudel2015-07-13
| |
* | Make attributes enumerable.Gravatar Clément Pit--Claudel2015-07-13
| | | | | | | | Use an extension method to properly deal with null attributes
| * Fix identifiers in nested match patterns not showing in the IDE bug. RememberGravatar qunyanm2015-06-29
|/ | | | | BoundVars that are combined in rewriting of the nested match patterns so they show up in the IDE correctly.
* Fix various bugs in nested match patterns listed in issue #83Gravatar qunyanm2015-06-19
|
* Added {:auto_generated} trigger, which indicates that a declaration was not ↵Gravatar Rustan Leino2015-06-02
| | | | explicitly mentioned in the input. This lets the Dafny IDE know not to add hovertext for these declarations.
* Add an infinite set collection type.Gravatar qunyanm2015-05-29
|
* Allow MatchExpr and MatchStmt to have nested patterns. Such asGravatar qunyanm2015-05-14
| | | | | | | | | | | | | | | | | | function last<T>(xs: List<T>): T requires xs != Nil { match xs case Cons(y, Nil) => y case Cons(y, Cons(z, zs)) => last(Cons(z, zs)) } And function minus(x: Nat, y: Nat): Nat { match (x, y) case (Zero, _) => Zero case (Suc(_), Zero) => x case (Suc(a), Suc(b)) => minus(a, b) }
* Fix issue #71. When substitute the forall's variables for those of theGravatar qunyanm2015-04-16
| | | | fn in fixupRevealLemma substitute the types as well.
* Eliminate redundant checks of newtype and opaque function well-formedness ↵Gravatar chrishaw2015-04-02
| | | | from included files
* Fix issue #55 and #64. When performing type argument substitution for functionGravatar qunyanm2015-03-16
| | | | | | F's corresponding F_FULL, make sure the function is indeed the FullVesion before the substitution. Also keep the TypeArgsSubst for the enclosingClass in the typeMap.
* This changeset changes the default visibility of a function/predicate body ↵Gravatar leino2015-03-09
| | | | | | | | | | outside the module that declares it. The body is now visible across the module boundary. To contain the knowledge of the body inside the module, mark the function/predicate as 'protected'. Semantics of 'protected': * The definition (i.e., body) of a 'protected' function is not visible outside the defining module * The idea is that inside the defining module, a 'protected' function may or may not be opaque. However, this will be easier to support once opaque/reveal are language primitives. Therefore, for the time being, {:opaque} is not allowed to be applied to 'protected' functions. * In order to extend the definition of a predicate in a refinement module, the predicate must be 'protected' * The 'protected' status of a function must be preserved in refinement modules
* Fixed an encoding bug for newtypes (this fixes Issue #50)Gravatar Rustan Leino2015-01-27
|
* Switched use of List(IToken) in UserDefinedType to NameSegment/ExprDotName, ↵Gravatar leino2015-01-23
| | | | | | | so use the new name resolution machinery that handles modules and type parameters Included some inadvertently left-out test cases in dafny0/Modules0.dfy Fixed comparable-types tests
* Fixed bug in opaque functions with type parametersGravatar leino2015-01-07
|
* Language change: All functions and methods declared lexically outside any ↵Gravatar leino2014-12-12
| | | | | | | | | | class are now automatically static, and fields are no longer allowed to be declared there. Stated differently, all heap state must now be declared inside an explicitly declared class, and functions and methods declared outside any class can be viewed as belonging to the module. The motivating benefit of this change is to no longer need the 'static' keyword when declaring a module of functions and methods.
* Finished up refactoring of the new name segment parsing, AST, and resolution.Gravatar leino2014-12-07
| | | | Removed now defunct IdentifierSequence from the AST.
* Snapshot, to be continuedGravatar leino2014-12-02
|
* Make autoreqs of free requires not freeGravatar Bryan Parno2014-10-27
|
* Allow autoReq in methods to generate auto-requirements on requiresGravatar Bryan Parno2014-10-27
|
* Don't process opaque functions more than once when generating auto-reqsGravatar Bryan Parno2014-10-27
|
* Fix fixup to opaque-function revealer to deal with zero-argument lemmasGravatar Bryan Parno2014-10-27
|
* Fix autoreq handling of quantifiersGravatar Bryan Parno2014-10-27
|
* Added an attribute :timeLimitMultiplier for setting relative time outs.Gravatar Bryan Parno2014-10-27
|
* Add an option to allow automatically generated requirements to be printedGravatar Bryan Parno2014-10-27
| | | | to a file, making them easier to inspect and manipulate.
* Added types "char" and "string" (the latter being a synonym for "seq<char>").Gravatar leino2014-10-20
| | | | | | Added string literals with various escapes--a subset of those supported in C# and similar languages, including the C# verbatim strings. Previously, the "print" statement and custom attributes could support expression-or-string arguments; there is no longer a need to special-case these, so these arguments are now just expressions. Fixed lack of operator resolution in custom attributes.
* MergeGravatar Dan Rosén2014-08-11
|\
* | Add higher-order-functions and some other goodiesGravatar Dan Rosén2014-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The reads clause now needs to be self framing. * The requires clause now needs to be framed by the reads clause. * There are one-shot lambdas, with a single arrow, but they will probably be removed. * There is a {:heapQuantifier} attribute to quantifiers, but they will probably be removed. * Add smart handling of type variables * Add < and > for datatype & type parameter
| * Fixed bug Issue 37: expand type synonyms in more (hopefully all) places in ↵Gravatar leino2014-08-02
|/ | | | the resolver and translator