summaryrefslogtreecommitdiff
path: root/Source/Dafny/Compiler.cs
Commit message (Collapse)AuthorAge
* Allow modifies clauses for a "Main" method annotated with {:main} attribute.Gravatar qunyanm2016-03-31
|
* Allow users to annontate a method as main with {:main} attribute. It’s an ↵Gravatar qunyanm2016-03-28
| | | | | | | | | error if more than one method is so annotated. For that method, the usual restrictions for "main" apply, but it is allowed to take ghost arguments, and it is allowed to have preconditions. This lets the programmer add some explicit assumptions about the outside world, modeled, for example, via ghost parameters.
* Fix issue 140. Move the initializion of _this before the TAIL_CALL_START label.Gravatar qunyanm2016-02-26
|
* Implement 'extern' declaration modifier.Gravatar Richard L. Ford2016-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'extern' declaration modifier provides a more convenient way of interfacing Dafny code with C# source files and .Net DLLs. We support an 'extern' keyword on a module, class, function method, or method (cannot extern ghost). We check the CompileNames of all modules to make sure there are no duplicate names. Every Dafny-generated C# class is marked partial, so it can potentially be extended. The extern keyword could be accompanied by an optional string naming the corresponding C# method/class to connect to. If not given the name of the method/class is used. An 'extern' keyword implies an {:axiom} attribute for functions and methods, so their ensures clauses are assumed to be true without proof. In addition to the .dfy files, the user may supply C# files (.cs) and dynamic linked libraries (.dll) on command line. These will be passed onto the C# compiler, the .cs files as sources, and the .dll files as references. As part of this change the grammar was refactored some. New productions are - TopDecls - a list of top-level declarations. - TopDecl - a single top-level declaration - DeclModifiers - a list of declaration modifiers which are either 'abstract', 'ghost', 'static', 'protected', or 'extern'. They can be in any order and we diagnose duplicates. In addition, since they are not all allowed in all contexts, we check and give diagnostics if an DeclModifier appears where it is not allowed.
* Fix issue 116. Add the missing @ for the generated c# code.Gravatar qunyanm2016-01-05
|
* Fix issue 113. Make sure the tempVar name used in ToString() method doesn'tGravatar qunyanm2015-12-03
| | | | collide with the names of its formals.
* Fix issue 108. Use idGenerator to create a new collection name for eachGravatar qunyanm2015-11-18
| | | | occurrence of Set/MapComprehension when translating it to c#.
* Fix issue 107. Instead of writing out StaticReceiverExpr as null valuedGravatar qunyanm2015-11-17
| | | | LiteralExpr, write out its type instead.
* Fix issue 94. Allow tuple-based assignment in statement contexts.Gravatar qunyanm2015-11-14
|
* Fixed compilation of equality between reference typesGravatar leino2015-11-11
|
* Fix issue89. Copy the out param to a local before use it in an anonymousGravatar qunyanm2015-11-04
| | | | | | method that is generated by LetExpr. Change the compiler so that each stmt writes to its own buffer before add it to the program's buffer so that we can insert the above mentioned copy instruction before the stmt.
* Implemented resolution, verification, and (poorly performing) compilation of ↵Gravatar leino2015-10-05
| | | | | | | existential if guards. Fixed bugs in ghost checks involving comprehensions and attributes. Added SubstituteBoundedPool method.
* MergeGravatar leino2015-09-28
|\
* | Changed computation of ghosts until pass 2 of resolution.Gravatar leino2015-09-28
| | | | | | | | | | | | | | Other clean-up in resolution passes, like: Include everything of type "char" into bounds that are discovered, and likewise for reference types. Allow more set comprehensions, determining if they are finite based on their argument type. Changed CalcExpr.SubExpressions to not include computed expressions.
| * merged IronDafny updates. two unit tests related to traits do not pass if ↵Gravatar Michael Lowell Roberts2015-09-21
|/ | | | ENABLE_IRONDAFNY is defined but this isn't critical and will be addressed shortly.
* Minor refactoringGravatar Rustan Leino2015-08-20
|
* Fixed compilation that involve enumeration over native-type newtype values.Gravatar Rustan Leino2015-08-20
|
* MergeGravatar Rustan Leino2015-08-20
|\
* | Refactored and improved bounds discoveryGravatar Rustan Leino2015-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.
| * Review preceding commit with RustanGravatar Clément Pit--Claudel2015-08-17
| |
| * 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.
* | Bug fixes and improvements in pretty printingGravatar leino2015-08-11
|/
* Fixed a contract error provoked by one of the tests.Gravatar Bryan Parno2015-07-02
|
* Compile function methods into C# in a more efficient manner,Gravatar Bryan Parno2015-07-01
| | | | at least for some common expressions.
* Update the hash code for datatypes to use the djb2 hash algorithm,Gravatar Bryan Parno2015-06-08
| | | | | rather than xor. The latter produces pessimal performance if the datatype contains duplicate data.
* Fix some issues when compiling generic types and generic function method callsGravatar Bryan Parno2015-06-08
|
* Changes to ComputeFreeVariables--bug fix as well as beautificationGravatar Rustan Leino2015-05-29
|
* Fix issue #67. Check SupportsEquality before determining whether to emit EqualsGravatar qunyanm2015-04-13
| | | | or == for equality testing.
* Revised look-up and compilation of inherited trait members (static ↵Gravatar leino2015-04-07
| | | | functions/methods don't work yet)
* Fixed missing case in previous check-inGravatar leino2015-04-05
|
* Fixed compilation of static members in traitsGravatar leino2015-04-05
|
* Fixed some bugs in override axioms (but still missing support for classes ↵Gravatar leino2015-04-05
| | | | | | | with type parameters). Resolve ClassDecl.TraitsTyp as types. Moved declaration of TraitParent and NoTraitAtAll to prelude.
* Fix issue #62. Check for modifies clause and constructors in the enclosingGravatar qunyanm2015-03-31
| | | | class when determining whether a method named Main() is the program entry.
* Allow let-such-that expression to be compiled, provided that they provably ↵Gravatar leino2015-03-13
| | | | have a unique value
* Fixed bug in resolution of illegal programs.Gravatar leino2015-03-10
| | | | Fixed comments in some test cases.
* Generate unique IDs hierarchically, to reduce changes to IDs when the ↵Gravatar leino2015-01-28
| | | | program is modified (to help with fine-grained caching)
* Did some refactoring to improve the name generation.Gravatar wuestholz2015-01-28
|
* Did some refactoring to improve the name generation.Gravatar wuestholz2015-01-27
|
* Did some refactoring to improve the name generation.Gravatar wuestholz2015-01-27
|
* Did some refactoring to improve the name generation.Gravatar wuestholz2015-01-27
|
* Add nativeType attribute for newtype declarations. Change Compiler.cs to ↵Gravatar chrishaw2014-12-09
| | | | | | | | | | | | | | | | | | | | | | | | use native C# representation of small integer newtypes. Examples: newtype{:nativeType "byte"} byte = i:int | 0 <= i < 0x100 newtype{:nativeType "sbyte"} sbyte = i:int | -0x80 <= i < 0x80 newtype{:nativeType "ushort"} uint16 = i:int | 0 <= i < 0x10000 newtype{:nativeType "short"} int16 = i:int | -0x8000 <= i < 0x8000 newtype{:nativeType "uint"} uint32 = i:int | 0 <= i < 0x100000000 newtype{:nativeType "int"} int32 = i:int | -0x80000000 <= i < 0x80000000 newtype{:nativeType "ulong"} uint64 = i:int | 0 <= i < 0x10000000000000000 newtype{:nativeType "long"} int64 = i:int | -0x8000000000000000 <= i < 0x8000000000000000 newtype month = i:int | 0 <= i < 12 // use smallest compatible C# type if possible (byte in this case), otherwise BigInteger newtype{:nativeType} month = i:int | 0 <= i < 12 // same as {:nativeType true} newtype{:nativeType true} month = i:int | 0 <= i < 12 // use smallest compatible C# type if possible (byte in this case), otherwise error newtype{:nativeType false} month = i:int | 0 <= i < 12 // use BigInteger newtype{:nativeType "uint"} month = i:int | 0 <= i < 12 // use C# uint type if possible, otherwise error newtype{:nativeType} even20 = i:int | 0 <= i < 20 && (i % 2 == 0) // nativeTypes need not be contiguous newtype{:nativeType} even10 = i:even20 | i < 10 // nativeTypes can inherit constraints from other nativeTypes
* fixed a minor bug: null checking.Gravatar Reza Ahmadi2014-12-03
|
* added multiple trait inheritance.Gravatar Reza Ahmadi2014-12-03
| | | | - a class can now extend more than one traits
* - fixed a bug in merging fields that come from a parent traitGravatar Reza Ahmadi2014-12-02
| | | | - added one more test
* Bug fixes in the compilation of forall statements.Gravatar leino2014-11-13
|
* Now the parser parses "Type" rather than "IToken" for a traitGravatar Reza Ahmadi2014-11-05
|
* Extracted a separate class to generate fresh variable names.Gravatar wuestholz2014-11-06
|
* Refactored the generation of unique IDs for temporary variable names.Gravatar wuestholz2014-11-05
|
* Added initial support for dirty while statements.Gravatar chmaria2014-11-01
|