-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move resolution of UnaryOpExpr to resolver (#2096)
* refactor(translator): Move resolution of UnaryOpExpr to resolver * Source/Dafny/AST/DafnyAst.cs: (ResolvedOpcode): New enum. (ResolvedOp): New property (computed on demand, cached). (ResolveOp): New function to force the computation of ResolvedOp. * Source/Dafny/Compilers/SinglePassCompiler.cs: (UnaryOpCodeMap): New map from resolved unary operators to compiler-level resolved unary operators (compilers treat all cardinalities in the same way). (TrExpr): Simplify `UnaryOpExpr` case using `UnaryOpCodeMap`. * Source/Dafny/Resolver.cs: (FigureOutNativeType): Simplify `UnaryOpExpr` case and fix GH-2095. (CheckTypeInference_Visitor.VisitOneExpr): Force resolution of unary operators. * Source/Dafny/Resolver/BoundsDiscovery.cs: (DiscoverAllBounds_Aux_SingleVar): Simply `UnaryOpExpr` case. * Source/Dafny/Triggers/TriggerExtensions.cs: (ShallowEq(BinaryExpr, BinaryExpr)): Remove redundant contracts. (ShallowEq(UnaryOpExpr, UnaryOpExpr)): Compare resolved operators. * Source/Dafny/Verifier/Translator.ExpressionTranslator.cs: (TrExpr): Simply `UnaryOpExpr` case. * Source/Dafny/Verifier/Translator.cs: (TrSplitExpr): Use `ResolvedOp` (should be a no-op because we're already in Bool context). * Update Source/Dafny/AST/DafnyAst.cs * Update Source/Dafny/Resolver.cs Co-authored-by: Marianna Rapoport <[email protected]> Co-authored-by: Marianna Rapoport <[email protected]>
- Loading branch information
1 parent
82a1ec3
commit 1647032
Showing
8 changed files
with
96 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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