-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in FigureOutNativeType #2095
Labels
crash
Dafny crashes on this input, or generates malformed code that can not be executed
kind: bug
Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
part: resolver
Resolution and typechecking
Comments
cpitclaudel
added a commit
that referenced
this issue
May 4, 2022
* 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).
cpitclaudel
added a commit
that referenced
this issue
May 4, 2022
* 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).
cpitclaudel
added a commit
that referenced
this issue
May 6, 2022
* 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).
cpitclaudel
added a commit
that referenced
this issue
May 7, 2022
* 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).
amaurremi
added a commit
that referenced
this issue
May 12, 2022
* 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]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
crash
Dafny crashes on this input, or generates malformed code that can not be executed
kind: bug
Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
part: resolver
Resolution and typechecking
produces
I'll have a patch ready soon.
The text was updated successfully, but these errors were encountered: