From 7f9f755e4a4a35d5da472d0058a528f418062156 Mon Sep 17 00:00:00 2001 From: Mikael Mayer Date: Thu, 8 Aug 2024 07:45:01 -0500 Subject: [PATCH 01/10] Feat: Translate Dafny tests to Rust tests This PR detects all tests and creates adequate equivalent Rust tests in the same file, by calling methods via top-level functions and translating `{:test}` attributes to the equivalent `#[test]` in Rust. Moreover, it translates the `{:test}` annotation on modules to the equivalent `#[cfg(test)]` in Rust, so that it makes it possible to exclude entire modules when not in test mode. I wrote a test that verifies that tests can be executed and that the resulting source code emits `#[cfg(test)]` --- ...afnyToRustCompilerCoverage_RASTCoverage.cs | 212 +- .../Backends/CSharp/CsharpCodeGenerator.cs | 4 +- .../Backends/Cplusplus/CppCodeGenerator.cs | 2 +- Source/DafnyCore/Backends/Dafny/AST.dfy | 1 + Source/DafnyCore/Backends/Dafny/ASTBuilder.cs | 15 +- .../Backends/Dafny/DafnyCodeGenerator.cs | 13 +- .../Backends/GoLang/GoCodeGenerator.cs | 2 +- .../Backends/Java/JavaCodeGenerator.cs | 2 +- .../JavaScript/JavaScriptCodeGenerator.cs | 2 +- .../Backends/Python/PythonCodeGenerator.cs | 2 +- .../Backends/Rust/Dafny-compiler-rust.dfy | 37 +- .../SinglePassCodeGenerator.cs | 4 +- Source/DafnyCore/GeneratedFromDafny/DAST.cs | 27 +- Source/DafnyCore/GeneratedFromDafny/DCOMP.cs | 6791 +++++++++-------- Source/DafnyCore/GeneratedFromDafny/RAST.cs | 1059 +-- .../LitTests/LitTest/comp/rust/cargotest.dfy | 22 + .../LitTest/comp/rust/cargotestoutput.check | 1 + Source/XUnitExtensions/Lit/ShellLitCommand.cs | 6 + docs/dev/news/5666.feat | 0 19 files changed, 4164 insertions(+), 4038 deletions(-) create mode 100644 Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy create mode 100644 Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotestoutput.check create mode 100644 docs/dev/news/5666.feat diff --git a/Source/DafnyCore.Test/GeneratedFromDafny/DafnyToRustCompilerCoverage_RASTCoverage.cs b/Source/DafnyCore.Test/GeneratedFromDafny/DafnyToRustCompilerCoverage_RASTCoverage.cs index db6a2b35422..4d488b19d0f 100644 --- a/Source/DafnyCore.Test/GeneratedFromDafny/DafnyToRustCompilerCoverage_RASTCoverage.cs +++ b/Source/DafnyCore.Test/GeneratedFromDafny/DafnyToRustCompilerCoverage_RASTCoverage.cs @@ -24,120 +24,120 @@ public static RAST._IExpr DafnyIntLiteral(Dafny.ISequence s) { } public static void TestOptimizeToString() { - RAST._IExpr _1095_x; - _1095_x = RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")); - RAST._IExpr _1096_y; - _1096_y = RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("y")); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&"), RAST.Expr.create_Call(RAST.Expr.create_Select(_1095_x, Dafny.Sequence.UnicodeFromString("clone")), Dafny.Sequence.FromElements()), DAST.Format.UnaryOpFormat.create_NoFormat())).Optimize(), RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&"), _1095_x, DAST.Format.UnaryOpFormat.create_NoFormat()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&"), RAST.Expr.create_Call(RAST.Expr.create_Select(_1095_x, Dafny.Sequence.UnicodeFromString("clone")), Dafny.Sequence.FromElements(_1096_y)), DAST.Format.UnaryOpFormat.create_NoFormat())); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!"), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=="), _1095_x, _1096_y, DAST.Format.BinaryOpFormat.create_NoFormat()), DAST.Format.UnaryOpFormat.create_CombineFormat())).Optimize(), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("!="), _1095_x, _1096_y, DAST.Format.BinaryOpFormat.create_NoFormat()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!"), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<"), _1095_x, _1096_y, DAST.Format.BinaryOpFormat.create_NoFormat()), DAST.Format.UnaryOpFormat.create_CombineFormat())).Optimize(), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(">="), _1095_x, _1096_y, DAST.Format.BinaryOpFormat.create_NoFormat()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!"), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<"), _1095_x, _1096_y, DAST.Format.BinaryOpFormat.create_ReverseFormat()), DAST.Format.UnaryOpFormat.create_CombineFormat())).Optimize(), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<="), _1096_y, _1095_x, DAST.Format.BinaryOpFormat.create_NoFormat()))); + RAST._IExpr _1096_x; + _1096_x = RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")); + RAST._IExpr _1097_y; + _1097_y = RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("y")); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&"), RAST.Expr.create_Call(RAST.Expr.create_Select(_1096_x, Dafny.Sequence.UnicodeFromString("clone")), Dafny.Sequence.FromElements()), DAST.Format.UnaryOpFormat.create_NoFormat())).Optimize(), RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&"), _1096_x, DAST.Format.UnaryOpFormat.create_NoFormat()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&"), RAST.Expr.create_Call(RAST.Expr.create_Select(_1096_x, Dafny.Sequence.UnicodeFromString("clone")), Dafny.Sequence.FromElements(_1097_y)), DAST.Format.UnaryOpFormat.create_NoFormat())); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!"), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=="), _1096_x, _1097_y, DAST.Format.BinaryOpFormat.create_NoFormat()), DAST.Format.UnaryOpFormat.create_CombineFormat())).Optimize(), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("!="), _1096_x, _1097_y, DAST.Format.BinaryOpFormat.create_NoFormat()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!"), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<"), _1096_x, _1097_y, DAST.Format.BinaryOpFormat.create_NoFormat()), DAST.Format.UnaryOpFormat.create_CombineFormat())).Optimize(), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(">="), _1096_x, _1097_y, DAST.Format.BinaryOpFormat.create_NoFormat()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!"), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<"), _1096_x, _1097_y, DAST.Format.BinaryOpFormat.create_ReverseFormat()), DAST.Format.UnaryOpFormat.create_CombineFormat())).Optimize(), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<="), _1097_y, _1096_x, DAST.Format.BinaryOpFormat.create_NoFormat()))); DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((DafnyToRustCompilerCoverage.RASTCoverage.__default.ConversionNum(RAST.Type.create_I128(), DafnyToRustCompilerCoverage.RASTCoverage.__default.DafnyIntLiteral(Dafny.Sequence.UnicodeFromString("1")))).Optimize(), RAST.Expr.create_LiteralInt(Dafny.Sequence.UnicodeFromString("1")))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(DafnyToRustCompilerCoverage.RASTCoverage.__default.ConversionNum(RAST.Type.create_I128(), _1095_x)); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("z"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_None()), RAST.Expr.create_StmtExpr(RAST.__default.AssignVar(Dafny.Sequence.UnicodeFromString("z"), _1096_y), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("return"))))).Optimize(), RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("z"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_Some(_1096_y)), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("return"))))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("z"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_None()), RAST.Expr.create_StmtExpr(RAST.__default.AssignVar(Dafny.Sequence.UnicodeFromString("w"), _1096_y), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("return"))))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(_1095_x); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(_1095_x, _1095_x)); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_Match(_1095_x, Dafny.Sequence.FromElements()), _1095_x)); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_StructBuild(_1095_x, Dafny.Sequence.FromElements()), _1095_x)); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_Tuple(Dafny.Sequence.FromElements()), _1095_x)); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&"), _1095_x, DAST.Format.UnaryOpFormat.create_NoFormat()), _1095_x)); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("&&"), _1095_x, _1095_x, DAST.Format.BinaryOpFormat.create_NoFormat()), _1095_x)); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_TypeAscription(_1095_x, RAST.Type.create_I128()), _1095_x)); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_LiteralInt(Dafny.Sequence.UnicodeFromString("1")), _1095_x)); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_LiteralString(Dafny.Sequence.UnicodeFromString("2"), true, false), _1095_x)); - DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_LiteralString(Dafny.Sequence.UnicodeFromString("3"), false, true), _1095_x)); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("z"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_None()), RAST.Expr.create_StmtExpr(RAST.__default.AssignVar(Dafny.Sequence.UnicodeFromString("z"), _1096_y), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("return"))))).Optimize(), RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("z"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_Some(_1096_y)), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("return"))))); - Dafny.ISequence _1097_coverageExpression; - _1097_coverageExpression = Dafny.Sequence.FromElements(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("abc")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Expr.create_Match(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), Dafny.Sequence.FromElements(RAST.MatchCase.create(Dafny.Sequence.UnicodeFromString("abc"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))))), RAST.Expr.create_StmtExpr(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("panic!()")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("a"))), RAST.Expr.create_Block(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("abc"))), RAST.Expr.create_StructBuild(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("dummy")), Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(Dafny.Sequence.UnicodeFromString("foo"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("bar"))))), RAST.Expr.create_StructBuild(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("dummy")), Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(Dafny.Sequence.UnicodeFromString("foo"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("bar"))), RAST.AssignIdentifier.create(Dafny.Sequence.UnicodeFromString("foo2"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("bar"))))), RAST.Expr.create_Tuple(Dafny.Sequence.FromElements(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")))), RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("-"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), DAST.Format.UnaryOpFormat.create_NoFormat()), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("+"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("y")), DAST.Format.BinaryOpFormat.create_NoFormat()), RAST.Expr.create_TypeAscription(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Type.create_I128()), RAST.Expr.create_LiteralInt(Dafny.Sequence.UnicodeFromString("322")), RAST.Expr.create_LiteralString(Dafny.Sequence.UnicodeFromString("abc"), true, false), RAST.Expr.create_LiteralString(Dafny.Sequence.UnicodeFromString("abc"), false, true), RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("abc"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_None()), RAST.Expr.create_DeclareVar(RAST.DeclareType.create_CONST(), Dafny.Sequence.UnicodeFromString("abc"), Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")))), RAST.__default.AssignVar(Dafny.Sequence.UnicodeFromString("abc"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))), RAST.Expr.create_IfExpr(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))), RAST.Expr.create_Loop(Std.Wrappers.Option.create_Some(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))), RAST.Expr.create_For(Dafny.Sequence.UnicodeFromString("abc"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))), RAST.Expr.create_Labelled(Dafny.Sequence.UnicodeFromString("abc"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))), RAST.Expr.create_Break(Std.Wrappers.Option>.create_None()), RAST.Expr.create_Break(Std.Wrappers.Option>.create_Some(Dafny.Sequence.UnicodeFromString("l"))), RAST.Expr.create_Continue(Std.Wrappers.Option>.create_None()), RAST.Expr.create_Continue(Std.Wrappers.Option>.create_Some(Dafny.Sequence.UnicodeFromString("l"))), RAST.Expr.create_Return(Std.Wrappers.Option.create_None()), RAST.Expr.create_Return(Std.Wrappers.Option.create_Some(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")))), RAST.Expr.create_Call(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), Dafny.Sequence.FromElements()), RAST.Expr.create_Call(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), Dafny.Sequence.FromElements(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("y")))), RAST.Expr.create_CallType(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), Dafny.Sequence.FromElements(RAST.Type.create_I128(), RAST.Type.create_U32())), RAST.Expr.create_Select(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), Dafny.Sequence.UnicodeFromString("abc")), RAST.Expr.create_MemberSelect(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), Dafny.Sequence.UnicodeFromString("abc"))); - BigInteger _hi4 = new BigInteger((_1097_coverageExpression).Count); - for (BigInteger _1098_i = BigInteger.Zero; _1098_i < _hi4; _1098_i++) { - RAST._IExpr _1099_c; - _1099_c = (_1097_coverageExpression).Select(_1098_i); - RAST._IPrintingInfo _1100___v0; - _1100___v0 = (_1099_c).printingInfo; - RAST._IExpr _1101___v1; - _1101___v1 = (_1099_c).Optimize(); - Dafny.IMap> _1102___v2; - _1102___v2 = Dafny.Map>.FromElements(new Dafny.Pair>(_1099_c, (_1099_c)._ToString(Dafny.Sequence.UnicodeFromString("")))); - RAST._IExpr _1103___v3; - _1103___v3 = (RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("abc"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_None()), _1099_c)).Optimize(); - RAST._IExpr _1104___v4; - _1104___v4 = (RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("abc"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_None()), RAST.Expr.create_StmtExpr(RAST.__default.AssignVar(Dafny.Sequence.UnicodeFromString("abc"), _1099_c), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString(""))))).Optimize(); - RAST._IExpr _1105___v5; - _1105___v5 = (RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&"), _1099_c, DAST.Format.UnaryOpFormat.create_NoFormat())).Optimize(); - RAST._IExpr _1106___v6; - _1106___v6 = (RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!"), _1099_c, DAST.Format.UnaryOpFormat.create_NoFormat())).Optimize(); - RAST._IExpr _1107___v7; - _1107___v7 = (DafnyToRustCompilerCoverage.RASTCoverage.__default.ConversionNum(RAST.Type.create_U8(), _1099_c)).Optimize(); - RAST._IExpr _1108___v8; - _1108___v8 = (DafnyToRustCompilerCoverage.RASTCoverage.__default.ConversionNum(RAST.Type.create_U8(), RAST.Expr.create_Call(_1099_c, Dafny.Sequence.FromElements()))).Optimize(); - RAST._IExpr _1109___v9; - _1109___v9 = (DafnyToRustCompilerCoverage.RASTCoverage.__default.ConversionNum(RAST.Type.create_U8(), RAST.Expr.create_Call(RAST.Expr.create_MemberSelect(_1099_c, Dafny.Sequence.UnicodeFromString("int!")), Dafny.Sequence.FromElements()))).Optimize(); - RAST._IExpr _1110___v10; - _1110___v10 = (DafnyToRustCompilerCoverage.RASTCoverage.__default.ConversionNum(RAST.Type.create_U8(), RAST.Expr.create_Call(RAST.Expr.create_MemberSelect(RAST.Expr.create_MemberSelect(_1099_c, Dafny.Sequence.UnicodeFromString("dafny_runtime")), Dafny.Sequence.UnicodeFromString("int!")), Dafny.Sequence.FromElements()))).Optimize(); - RAST._IExpr _1111___v11; - _1111___v11 = (DafnyToRustCompilerCoverage.RASTCoverage.__default.ConversionNum(RAST.Type.create_U8(), RAST.Expr.create_Call(RAST.Expr.create_MemberSelect(RAST.Expr.create_MemberSelect(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("")), Dafny.Sequence.UnicodeFromString("dafny_runtime")), Dafny.Sequence.UnicodeFromString("int!")), Dafny.Sequence.FromElements(_1099_c)))).Optimize(); - Std.Wrappers._IOption> _1112___v12; - _1112___v12 = (_1099_c).RightMostIdentifier(); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(DafnyToRustCompilerCoverage.RASTCoverage.__default.ConversionNum(RAST.Type.create_I128(), _1096_x)); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("z"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_None()), RAST.Expr.create_StmtExpr(RAST.__default.AssignVar(Dafny.Sequence.UnicodeFromString("z"), _1097_y), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("return"))))).Optimize(), RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("z"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_Some(_1097_y)), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("return"))))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("z"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_None()), RAST.Expr.create_StmtExpr(RAST.__default.AssignVar(Dafny.Sequence.UnicodeFromString("w"), _1097_y), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("return"))))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(_1096_x); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(_1096_x, _1096_x)); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_Match(_1096_x, Dafny.Sequence.FromElements()), _1096_x)); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_StructBuild(_1096_x, Dafny.Sequence.FromElements()), _1096_x)); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_Tuple(Dafny.Sequence.FromElements()), _1096_x)); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&"), _1096_x, DAST.Format.UnaryOpFormat.create_NoFormat()), _1096_x)); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("&&"), _1096_x, _1096_x, DAST.Format.BinaryOpFormat.create_NoFormat()), _1096_x)); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_TypeAscription(_1096_x, RAST.Type.create_I128()), _1096_x)); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_LiteralInt(Dafny.Sequence.UnicodeFromString("1")), _1096_x)); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_LiteralString(Dafny.Sequence.UnicodeFromString("2"), true, false), _1096_x)); + DafnyToRustCompilerCoverage.RASTCoverage.__default.TestNoOptimize(RAST.Expr.create_StmtExpr(RAST.Expr.create_LiteralString(Dafny.Sequence.UnicodeFromString("3"), false, true), _1096_x)); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("z"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_None()), RAST.Expr.create_StmtExpr(RAST.__default.AssignVar(Dafny.Sequence.UnicodeFromString("z"), _1097_y), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("return"))))).Optimize(), RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("z"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_Some(_1097_y)), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("return"))))); + Dafny.ISequence _1098_coverageExpression; + _1098_coverageExpression = Dafny.Sequence.FromElements(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("abc")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Expr.create_Match(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), Dafny.Sequence.FromElements(RAST.MatchCase.create(Dafny.Sequence.UnicodeFromString("abc"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))))), RAST.Expr.create_StmtExpr(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("panic!()")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("a"))), RAST.Expr.create_Block(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("abc"))), RAST.Expr.create_StructBuild(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("dummy")), Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(Dafny.Sequence.UnicodeFromString("foo"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("bar"))))), RAST.Expr.create_StructBuild(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("dummy")), Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(Dafny.Sequence.UnicodeFromString("foo"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("bar"))), RAST.AssignIdentifier.create(Dafny.Sequence.UnicodeFromString("foo2"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("bar"))))), RAST.Expr.create_Tuple(Dafny.Sequence.FromElements(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")))), RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("-"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), DAST.Format.UnaryOpFormat.create_NoFormat()), RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("+"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("y")), DAST.Format.BinaryOpFormat.create_NoFormat()), RAST.Expr.create_TypeAscription(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Type.create_I128()), RAST.Expr.create_LiteralInt(Dafny.Sequence.UnicodeFromString("322")), RAST.Expr.create_LiteralString(Dafny.Sequence.UnicodeFromString("abc"), true, false), RAST.Expr.create_LiteralString(Dafny.Sequence.UnicodeFromString("abc"), false, true), RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("abc"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_None()), RAST.Expr.create_DeclareVar(RAST.DeclareType.create_CONST(), Dafny.Sequence.UnicodeFromString("abc"), Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")))), RAST.__default.AssignVar(Dafny.Sequence.UnicodeFromString("abc"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))), RAST.Expr.create_IfExpr(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))), RAST.Expr.create_Loop(Std.Wrappers.Option.create_Some(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))), RAST.Expr.create_For(Dafny.Sequence.UnicodeFromString("abc"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))), RAST.Expr.create_Labelled(Dafny.Sequence.UnicodeFromString("abc"), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x"))), RAST.Expr.create_Break(Std.Wrappers.Option>.create_None()), RAST.Expr.create_Break(Std.Wrappers.Option>.create_Some(Dafny.Sequence.UnicodeFromString("l"))), RAST.Expr.create_Continue(Std.Wrappers.Option>.create_None()), RAST.Expr.create_Continue(Std.Wrappers.Option>.create_Some(Dafny.Sequence.UnicodeFromString("l"))), RAST.Expr.create_Return(Std.Wrappers.Option.create_None()), RAST.Expr.create_Return(Std.Wrappers.Option.create_Some(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")))), RAST.Expr.create_Call(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), Dafny.Sequence.FromElements()), RAST.Expr.create_Call(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), Dafny.Sequence.FromElements(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("y")))), RAST.Expr.create_CallType(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), Dafny.Sequence.FromElements(RAST.Type.create_I128(), RAST.Type.create_U32())), RAST.Expr.create_Select(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), Dafny.Sequence.UnicodeFromString("abc")), RAST.Expr.create_MemberSelect(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")), Dafny.Sequence.UnicodeFromString("abc"))); + BigInteger _hi4 = new BigInteger((_1098_coverageExpression).Count); + for (BigInteger _1099_i = BigInteger.Zero; _1099_i < _hi4; _1099_i++) { + RAST._IExpr _1100_c; + _1100_c = (_1098_coverageExpression).Select(_1099_i); + RAST._IPrintingInfo _1101___v0; + _1101___v0 = (_1100_c).printingInfo; + RAST._IExpr _1102___v1; + _1102___v1 = (_1100_c).Optimize(); + Dafny.IMap> _1103___v2; + _1103___v2 = Dafny.Map>.FromElements(new Dafny.Pair>(_1100_c, (_1100_c)._ToString(Dafny.Sequence.UnicodeFromString("")))); + RAST._IExpr _1104___v3; + _1104___v3 = (RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("abc"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_None()), _1100_c)).Optimize(); + RAST._IExpr _1105___v4; + _1105___v4 = (RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("abc"), Std.Wrappers.Option.create_Some(RAST.Type.create_I128()), Std.Wrappers.Option.create_None()), RAST.Expr.create_StmtExpr(RAST.__default.AssignVar(Dafny.Sequence.UnicodeFromString("abc"), _1100_c), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString(""))))).Optimize(); + RAST._IExpr _1106___v5; + _1106___v5 = (RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&"), _1100_c, DAST.Format.UnaryOpFormat.create_NoFormat())).Optimize(); + RAST._IExpr _1107___v6; + _1107___v6 = (RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!"), _1100_c, DAST.Format.UnaryOpFormat.create_NoFormat())).Optimize(); + RAST._IExpr _1108___v7; + _1108___v7 = (DafnyToRustCompilerCoverage.RASTCoverage.__default.ConversionNum(RAST.Type.create_U8(), _1100_c)).Optimize(); + RAST._IExpr _1109___v8; + _1109___v8 = (DafnyToRustCompilerCoverage.RASTCoverage.__default.ConversionNum(RAST.Type.create_U8(), RAST.Expr.create_Call(_1100_c, Dafny.Sequence.FromElements()))).Optimize(); + RAST._IExpr _1110___v9; + _1110___v9 = (DafnyToRustCompilerCoverage.RASTCoverage.__default.ConversionNum(RAST.Type.create_U8(), RAST.Expr.create_Call(RAST.Expr.create_MemberSelect(_1100_c, Dafny.Sequence.UnicodeFromString("int!")), Dafny.Sequence.FromElements()))).Optimize(); + RAST._IExpr _1111___v10; + _1111___v10 = (DafnyToRustCompilerCoverage.RASTCoverage.__default.ConversionNum(RAST.Type.create_U8(), RAST.Expr.create_Call(RAST.Expr.create_MemberSelect(RAST.Expr.create_MemberSelect(_1100_c, Dafny.Sequence.UnicodeFromString("dafny_runtime")), Dafny.Sequence.UnicodeFromString("int!")), Dafny.Sequence.FromElements()))).Optimize(); + RAST._IExpr _1112___v11; + _1112___v11 = (DafnyToRustCompilerCoverage.RASTCoverage.__default.ConversionNum(RAST.Type.create_U8(), RAST.Expr.create_Call(RAST.Expr.create_MemberSelect(RAST.Expr.create_MemberSelect(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("")), Dafny.Sequence.UnicodeFromString("dafny_runtime")), Dafny.Sequence.UnicodeFromString("int!")), Dafny.Sequence.FromElements(_1100_c)))).Optimize(); + Std.Wrappers._IOption> _1113___v12; + _1113___v12 = (_1100_c).RightMostIdentifier(); } } public static void TestPrintingInfo() { - RAST._IExpr _1113_x; - _1113_x = RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")); - RAST._IExpr _1114_y; - _1114_y = RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("y")); - DAST.Format._IBinaryOpFormat _1115_bnf; - _1115_bnf = DAST.Format.BinaryOpFormat.create_NoFormat(); + RAST._IExpr _1114_x; + _1114_x = RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("x")); + RAST._IExpr _1115_y; + _1115_y = RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("y")); + DAST.Format._IBinaryOpFormat _1116_bnf; + _1116_bnf = DAST.Format.BinaryOpFormat.create_NoFormat(); DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(((RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("x"))).printingInfo).is_UnknownPrecedence); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((_1113_x).printingInfo, RAST.PrintingInfo.create_Precedence(BigInteger.One))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((_1114_x).printingInfo, RAST.PrintingInfo.create_Precedence(BigInteger.One))); DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_LiteralInt(Dafny.Sequence.UnicodeFromString("3"))).printingInfo, RAST.PrintingInfo.create_Precedence(BigInteger.One))); DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_LiteralString(Dafny.Sequence.UnicodeFromString("abc"), true, false)).printingInfo, RAST.PrintingInfo.create_Precedence(BigInteger.One))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("?"), _1113_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_SuffixPrecedence(new BigInteger(5)))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("-"), _1113_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_Precedence(new BigInteger(6)))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("*"), _1113_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_Precedence(new BigInteger(6)))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!"), _1113_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_Precedence(new BigInteger(6)))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&"), _1113_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_Precedence(new BigInteger(6)))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&mut"), _1113_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_Precedence(new BigInteger(6)))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!!"), _1113_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_UnknownPrecedence())); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_Select(_1113_x, Dafny.Sequence.UnicodeFromString("name"))).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(2), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_MemberSelect(_1113_x, Dafny.Sequence.UnicodeFromString("name"))).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(2), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_Call(_1113_x, Dafny.Sequence.FromElements())).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(2), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_TypeAscription(_1113_x, RAST.Type.create_I128())).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(10), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("*"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(20), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("/"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(20), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("%"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(20), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("+"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(30), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("-"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(30), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<<"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(40), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(">>"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(40), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("&"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(50), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("^"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(60), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("|"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(70), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(80), RAST.Associativity.create_RequiresParentheses()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("!="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(80), RAST.Associativity.create_RequiresParentheses()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(80), RAST.Associativity.create_RequiresParentheses()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(">"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(80), RAST.Associativity.create_RequiresParentheses()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(80), RAST.Associativity.create_RequiresParentheses()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(">="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(80), RAST.Associativity.create_RequiresParentheses()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("&&"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(90), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("||"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(100), RAST.Associativity.create_LeftToRight()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(".."), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RequiresParentheses()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("..="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RequiresParentheses()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("+="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("-="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("*="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("/="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("%="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("&="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("|="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("^="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<<="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(">>="), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); - DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("?!?"), _1113_x, _1114_y, _1115_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(BigInteger.Zero, RAST.Associativity.create_RequiresParentheses()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("?"), _1114_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_SuffixPrecedence(new BigInteger(5)))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("-"), _1114_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_Precedence(new BigInteger(6)))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("*"), _1114_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_Precedence(new BigInteger(6)))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!"), _1114_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_Precedence(new BigInteger(6)))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&"), _1114_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_Precedence(new BigInteger(6)))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("&mut"), _1114_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_Precedence(new BigInteger(6)))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!!"), _1114_x, DAST.Format.UnaryOpFormat.create_NoFormat())).printingInfo, RAST.PrintingInfo.create_UnknownPrecedence())); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_Select(_1114_x, Dafny.Sequence.UnicodeFromString("name"))).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(2), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_MemberSelect(_1114_x, Dafny.Sequence.UnicodeFromString("name"))).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(2), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_Call(_1114_x, Dafny.Sequence.FromElements())).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(2), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_TypeAscription(_1114_x, RAST.Type.create_I128())).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(10), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("*"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(20), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("/"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(20), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("%"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(20), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("+"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(30), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("-"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(30), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<<"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(40), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(">>"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(40), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("&"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(50), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("^"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(60), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("|"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(70), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(80), RAST.Associativity.create_RequiresParentheses()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("!="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(80), RAST.Associativity.create_RequiresParentheses()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(80), RAST.Associativity.create_RequiresParentheses()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(">"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(80), RAST.Associativity.create_RequiresParentheses()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(80), RAST.Associativity.create_RequiresParentheses()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(">="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(80), RAST.Associativity.create_RequiresParentheses()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("&&"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(90), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("||"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(100), RAST.Associativity.create_LeftToRight()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(".."), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RequiresParentheses()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("..="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RequiresParentheses()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("+="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("-="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("*="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("/="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("%="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("&="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("|="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("^="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<<="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(">>="), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(110), RAST.Associativity.create_RightToLeft()))); + DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("?!?"), _1114_x, _1115_y, _1116_bnf)).printingInfo, RAST.PrintingInfo.create_PrecedenceAssociativity(BigInteger.Zero, RAST.Associativity.create_RequiresParentheses()))); DafnyToRustCompilerCoverage.RASTCoverage.__default.AssertCoverage(object.Equals((RAST.Expr.create_Break(Std.Wrappers.Option>.create_None())).printingInfo, RAST.PrintingInfo.create_UnknownPrecedence())); } public static void TestExpr() diff --git a/Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs b/Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs index 076c247c6de..bc724ee0258 100644 --- a/Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs +++ b/Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs @@ -163,7 +163,7 @@ protected override void EmitBuiltInDecls(SystemModuleManager systemModuleManager wr.WriteLine("#if ISDAFNYRUNTIMELIB"); } - var dafnyNamespace = CreateModule("Dafny", false, null, null, wr); + var dafnyNamespace = CreateModule("Dafny", false, null, null, null, wr); EmitInitNewArrays(systemModuleManager, dafnyNamespace); if (Synthesize) { CsharpSynthesizer.EmitMultiMatcher(dafnyNamespace); @@ -269,7 +269,7 @@ string IdProtectModule(string moduleName) { } protected override ConcreteSyntaxTree CreateModule(string moduleName, bool isDefault, ModuleDefinition externModule, - string libraryName /*?*/, ConcreteSyntaxTree wr) { + string libraryName /*?*/, Attributes moduleAttributes, ConcreteSyntaxTree wr) { moduleName = IdProtectModule(moduleName); return wr.NewBlock($"namespace {moduleName}", " // end of " + $"namespace {moduleName}"); } diff --git a/Source/DafnyCore/Backends/Cplusplus/CppCodeGenerator.cs b/Source/DafnyCore/Backends/Cplusplus/CppCodeGenerator.cs index be83d5f912b..d4b60cd1d5d 100644 --- a/Source/DafnyCore/Backends/Cplusplus/CppCodeGenerator.cs +++ b/Source/DafnyCore/Backends/Cplusplus/CppCodeGenerator.cs @@ -160,7 +160,7 @@ protected override ConcreteSyntaxTree CreateStaticMain(IClassWriter cw, string a } protected override ConcreteSyntaxTree CreateModule(string moduleName, bool isDefault, ModuleDefinition externModule, - string libraryName /*?*/, ConcreteSyntaxTree wr) { + string libraryName /*?*/, Attributes moduleAttributes, ConcreteSyntaxTree wr) { var s = $"namespace {IdProtect(moduleName)} "; string footer = "// end of " + s + " declarations"; this.modDeclWr = this.modDeclsWr.NewBlock(s, footer); diff --git a/Source/DafnyCore/Backends/Dafny/AST.dfy b/Source/DafnyCore/Backends/Dafny/AST.dfy index 410ec735605..19873738eb1 100644 --- a/Source/DafnyCore/Backends/Dafny/AST.dfy +++ b/Source/DafnyCore/Backends/Dafny/AST.dfy @@ -178,6 +178,7 @@ module {:extern "DAST"} DAST { datatype Formal = Formal(name: Name, typ: Type, attributes: seq) datatype Method = Method( + attributes: seq, isStatic: bool, hasBody: bool, outVarsAreUninitFieldsToAssign: bool, // For constructors diff --git a/Source/DafnyCore/Backends/Dafny/ASTBuilder.cs b/Source/DafnyCore/Backends/Dafny/ASTBuilder.cs index 0c4396a9d33..d7794135b2c 100644 --- a/Source/DafnyCore/Backends/Dafny/ASTBuilder.cs +++ b/Source/DafnyCore/Backends/Dafny/ASTBuilder.cs @@ -362,15 +362,14 @@ interface ClassLike { void AddField(DAST.Formal item, _IOption defaultValue); - public MethodBuilder Method( - bool isStatic, bool hasBody, bool outVarsAreUninitFieldsToAssign, bool wasFunction, + public MethodBuilder Method(bool isStatic, bool hasBody, bool outVarsAreUninitFieldsToAssign, bool wasFunction, ISequence> overridingPath, + ISequence<_IAttribute> attributes, string name, - List typeArgs, + List typeArgs, Sequence params_, - List outTypes, List> outVars - ) { - return new MethodBuilder(this, isStatic, hasBody, outVarsAreUninitFieldsToAssign, wasFunction, overridingPath, name, typeArgs, params_, outTypes, outVars); + List outTypes, List> outVars) { + return new MethodBuilder(this, isStatic, hasBody, outVarsAreUninitFieldsToAssign, wasFunction, overridingPath, attributes, name, typeArgs, params_, outTypes, outVars); } public object Finish(); @@ -389,11 +388,13 @@ class MethodBuilder : StatementContainer { readonly List outTypes; readonly List> outVars; readonly List body = new(); + private ISequence<_IAttribute> attributes; public MethodBuilder( ClassLike parent, bool isStatic, bool hasBody, bool outVarsAreUninitFieldsToAssign, bool wasFunction, ISequence> overridingPath, + ISequence<_IAttribute> attributes, string name, List typeArgs, Sequence params_, @@ -405,6 +406,7 @@ public MethodBuilder( this.outVarsAreUninitFieldsToAssign = outVarsAreUninitFieldsToAssign; this.wasFunction = wasFunction; this.overridingPath = overridingPath; + this.attributes = attributes; this.name = name; this.typeArgs = typeArgs; this.params_ = params_; @@ -431,6 +433,7 @@ public DAST.Method Build() { StatementContainer.RecursivelyBuild(body, builtStatements); return (DAST.Method)DAST.Method.create( + attributes, isStatic, hasBody, outVarsAreUninitFieldsToAssign, diff --git a/Source/DafnyCore/Backends/Dafny/DafnyCodeGenerator.cs b/Source/DafnyCore/Backends/Dafny/DafnyCodeGenerator.cs index 572bd8ad845..12416191146 100644 --- a/Source/DafnyCore/Backends/Dafny/DafnyCodeGenerator.cs +++ b/Source/DafnyCore/Backends/Dafny/DafnyCodeGenerator.cs @@ -120,9 +120,9 @@ protected override ConcreteSyntaxTree CreateStaticMain(IClassWriter cw, string a } protected override ConcreteSyntaxTree CreateModule(string moduleName, bool isDefault, ModuleDefinition externModule, - string libraryName, ConcreteSyntaxTree wr) { + string libraryName, Attributes moduleAttributes, ConcreteSyntaxTree wr) { if (currentBuilder is ModuleContainer moduleBuilder) { - var attributes = (Sequence)Sequence.Empty; + var attributes = (Sequence)ParseAttributes(moduleAttributes); if (externModule != null) { attributes = (Sequence)ParseAttributes(externModule.Attributes); } @@ -519,9 +519,12 @@ public ConcreteSyntaxTree CreateMethod(Method m, List GenType(md.GetType()) ).ToList();*/ } + + var attributes = compiler.ParseAttributes(m.Attributes); var builder = this.builder.Method( m.IsStatic, createBody, m is Constructor, false, overridingTrait != null ? compiler.PathFromTopLevel(overridingTrait) : null, + attributes, m.GetCompileName(compiler.Options), astTypeArgs, params_, outTypes, outVars @@ -554,10 +557,11 @@ public ConcreteSyntaxTree CreateFunction(string name, List)Sequence.Empty, new() { diff --git a/Source/DafnyCore/Backends/GoLang/GoCodeGenerator.cs b/Source/DafnyCore/Backends/GoLang/GoCodeGenerator.cs index 856bd85ce5d..9893891d7fb 100644 --- a/Source/DafnyCore/Backends/GoLang/GoCodeGenerator.cs +++ b/Source/DafnyCore/Backends/GoLang/GoCodeGenerator.cs @@ -181,7 +181,7 @@ private Import CreateImport(string moduleName, bool isDefault, ModuleDefinition protected override ConcreteSyntaxTree CreateModule(string moduleName, bool isDefault, ModuleDefinition externModule, - string libraryName /*?*/, ConcreteSyntaxTree wr) { + string libraryName /*?*/, Attributes moduleAttributes, ConcreteSyntaxTree wr) { if (isDefault) { // Fold the default module into the main module return wr; diff --git a/Source/DafnyCore/Backends/Java/JavaCodeGenerator.cs b/Source/DafnyCore/Backends/Java/JavaCodeGenerator.cs index d4ab8a5d3a0..ab2fefa2355 100644 --- a/Source/DafnyCore/Backends/Java/JavaCodeGenerator.cs +++ b/Source/DafnyCore/Backends/Java/JavaCodeGenerator.cs @@ -380,7 +380,7 @@ string IdProtectModule(string moduleName) { } protected override ConcreteSyntaxTree CreateModule(string moduleName, bool isDefault, ModuleDefinition externModule, - string libraryName /*?*/, ConcreteSyntaxTree wr) { + string libraryName /*?*/, Attributes moduleAttributes, ConcreteSyntaxTree wr) { moduleName = IdProtectModule(moduleName); if (isDefault) { // Fold the default module into the main module diff --git a/Source/DafnyCore/Backends/JavaScript/JavaScriptCodeGenerator.cs b/Source/DafnyCore/Backends/JavaScript/JavaScriptCodeGenerator.cs index e2e71971cf2..005d19f42e1 100644 --- a/Source/DafnyCore/Backends/JavaScript/JavaScriptCodeGenerator.cs +++ b/Source/DafnyCore/Backends/JavaScript/JavaScriptCodeGenerator.cs @@ -64,7 +64,7 @@ protected override ConcreteSyntaxTree CreateStaticMain(IClassWriter cw, string a } protected override ConcreteSyntaxTree CreateModule(string moduleName, bool isDefault, ModuleDefinition externModule, - string libraryName /*?*/, ConcreteSyntaxTree wr) { + string libraryName /*?*/, Attributes moduleAttributes, ConcreteSyntaxTree wr) { moduleName = IdProtect(moduleName); if (externModule == null || libraryName != null) { wr.Write("let {0} = ", moduleName); diff --git a/Source/DafnyCore/Backends/Python/PythonCodeGenerator.cs b/Source/DafnyCore/Backends/Python/PythonCodeGenerator.cs index 81e3a5b7212..3e2a12ca73e 100644 --- a/Source/DafnyCore/Backends/Python/PythonCodeGenerator.cs +++ b/Source/DafnyCore/Backends/Python/PythonCodeGenerator.cs @@ -99,7 +99,7 @@ protected override ConcreteSyntaxTree CreateStaticMain(IClassWriter cw, string a } protected override ConcreteSyntaxTree CreateModule(string moduleName, bool isDefault, ModuleDefinition externModule, - string libraryName, ConcreteSyntaxTree wr) { + string libraryName, Attributes moduleAttributes, ConcreteSyntaxTree wr) { var pythonModuleName = PythonModuleMode ? PythonModuleName + "." : ""; moduleName = PublicModuleIdProtect(moduleName); diff --git a/Source/DafnyCore/Backends/Rust/Dafny-compiler-rust.dfy b/Source/DafnyCore/Backends/Rust/Dafny-compiler-rust.dfy index c9c13cbd022..47f25148add 100644 --- a/Source/DafnyCore/Backends/Rust/Dafny-compiler-rust.dfy +++ b/Source/DafnyCore/Backends/Rust/Dafny-compiler-rust.dfy @@ -21,7 +21,7 @@ module RAST datatype Mod = // Rust modules - | Mod(name: string, body: seq) + | Mod(name: string, attributes: seq, body: seq) | ExternMod(name: string) { function ToString(ind: string): string @@ -30,7 +30,8 @@ module RAST match this { case ExternMod(name) => "pub mod " + name + ";" - case Mod(name, body) => + case Mod(name, attributes, body) => + Attribute.ToStringMultiple(attributes, ind) + "pub mod " + name + " {" + "\n" + ind + IND + SeqToString( body, @@ -1651,6 +1652,10 @@ module {:extern "DCOMP"} DafnyToRustCompiler { } } + predicate HasTestAttribute(attributes: seq) { + exists attribute <- attributes :: attribute.name == "test" && |attribute.args| == 0 + } + method GenModule(mod: Module, containingPath: seq) returns (s: R.Mod) decreases mod, 1 modifies this @@ -1661,7 +1666,11 @@ module {:extern "DCOMP"} DafnyToRustCompiler { } else { assume {:axiom} forall m: ModuleItem <- mod.body.value :: m < mod; var body := GenModuleBody(mod, mod.body.value, containingPath + [Ident.Ident(mod.name)]); - s := R.Mod(modName, body); + var attributes := []; + if HasTestAttribute(mod.attributes) { + attributes := [R.RawAttribute("#[cfg(test)]")]; + } + s := R.Mod(modName, attributes, body); } } @@ -1829,6 +1838,28 @@ module {:extern "DCOMP"} DafnyToRustCompiler { implBody ); s := s + [R.ImplDecl(i)]; + // Add test methods + var testMethods := []; + if datatypeName == "_default" { + for i := 0 to |c.body| { + var m := match c.body[i] case Method(m) => m; + if HasTestAttribute(m.attributes) && |m.params| == 0 { + var fnName := escapeName(m.name); + testMethods := testMethods + [ + R.TopFnDecl( + R.TopFn( + [R.RawAttribute("#[test]")], R.PUB, + R.Fn( + fnName, [], [], None, + "", + Some(R.Identifier("_default").MSel(fnName).Apply([]))) + )) + ]; + } + } + s := s + testMethods; + } + var genSelfPath := GenPath(path); // TODO: If general traits, check whether the trait extends object or not. s := s + [ diff --git a/Source/DafnyCore/Backends/SinglePassCodeGenerator/SinglePassCodeGenerator.cs b/Source/DafnyCore/Backends/SinglePassCodeGenerator/SinglePassCodeGenerator.cs index 798ccae90ca..82d93a2d983 100644 --- a/Source/DafnyCore/Backends/SinglePassCodeGenerator/SinglePassCodeGenerator.cs +++ b/Source/DafnyCore/Backends/SinglePassCodeGenerator/SinglePassCodeGenerator.cs @@ -180,7 +180,7 @@ protected void CheckSystemModulePopulatedToCommonLimits(SystemModuleManager syst /// protected abstract ConcreteSyntaxTree CreateStaticMain(IClassWriter wr, string argsParameterName); protected abstract ConcreteSyntaxTree CreateModule(string moduleName, bool isDefault, ModuleDefinition externModule, - string libraryName /*?*/, ConcreteSyntaxTree wr); + string libraryName /*?*/, Attributes moduleAttributes, ConcreteSyntaxTree wr); /// /// Indicates the current program depends on the given module without creating it. /// Called when a module is out of scope for compilation, such as when using --library. @@ -1545,7 +1545,7 @@ private void EmitModule(Program program, ConcreteSyntaxTree programNode, ModuleD return; } - var wr = CreateModule(module.GetCompileName(Options), module.IsDefaultModule, externModule, libraryName, programNode); + var wr = CreateModule(module.GetCompileName(Options), module.IsDefaultModule, externModule, libraryName, module.Attributes, programNode); var v = new CheckHasNoAssumes_Visitor(this, wr); Contract.Assert(enclosingModule == null); enclosingModule = module; diff --git a/Source/DafnyCore/GeneratedFromDafny/DAST.cs b/Source/DafnyCore/GeneratedFromDafny/DAST.cs index 3e5da1aea22..c1155a432cb 100644 --- a/Source/DafnyCore/GeneratedFromDafny/DAST.cs +++ b/Source/DafnyCore/GeneratedFromDafny/DAST.cs @@ -3333,6 +3333,7 @@ public Dafny.ISequence dtor_attributes { public interface _IMethod { bool is_Method { get; } + Dafny.ISequence dtor_attributes { get; } bool dtor_isStatic { get; } bool dtor_hasBody { get; } bool dtor_outVarsAreUninitFieldsToAssign { get; } @@ -3347,6 +3348,7 @@ public interface _IMethod { _IMethod DowncastClone(); } public class Method : _IMethod { + public readonly Dafny.ISequence _attributes; public readonly bool _isStatic; public readonly bool _hasBody; public readonly bool _outVarsAreUninitFieldsToAssign; @@ -3358,7 +3360,8 @@ public class Method : _IMethod { public readonly Dafny.ISequence _body; public readonly Dafny.ISequence _outTypes; public readonly Std.Wrappers._IOption>> _outVars; - public Method(bool isStatic, bool hasBody, bool outVarsAreUninitFieldsToAssign, bool wasFunction, Std.Wrappers._IOption>> overridingPath, Dafny.ISequence name, Dafny.ISequence typeParams, Dafny.ISequence @params, Dafny.ISequence body, Dafny.ISequence outTypes, Std.Wrappers._IOption>> outVars) { + public Method(Dafny.ISequence attributes, bool isStatic, bool hasBody, bool outVarsAreUninitFieldsToAssign, bool wasFunction, Std.Wrappers._IOption>> overridingPath, Dafny.ISequence name, Dafny.ISequence typeParams, Dafny.ISequence @params, Dafny.ISequence body, Dafny.ISequence outTypes, Std.Wrappers._IOption>> outVars) { + this._attributes = attributes; this._isStatic = isStatic; this._hasBody = hasBody; this._outVarsAreUninitFieldsToAssign = outVarsAreUninitFieldsToAssign; @@ -3373,15 +3376,16 @@ public Method(bool isStatic, bool hasBody, bool outVarsAreUninitFieldsToAssign, } public _IMethod DowncastClone() { if (this is _IMethod dt) { return dt; } - return new Method(_isStatic, _hasBody, _outVarsAreUninitFieldsToAssign, _wasFunction, _overridingPath, _name, _typeParams, _params, _body, _outTypes, _outVars); + return new Method(_attributes, _isStatic, _hasBody, _outVarsAreUninitFieldsToAssign, _wasFunction, _overridingPath, _name, _typeParams, _params, _body, _outTypes, _outVars); } public override bool Equals(object other) { var oth = other as DAST.Method; - return oth != null && this._isStatic == oth._isStatic && this._hasBody == oth._hasBody && this._outVarsAreUninitFieldsToAssign == oth._outVarsAreUninitFieldsToAssign && this._wasFunction == oth._wasFunction && object.Equals(this._overridingPath, oth._overridingPath) && object.Equals(this._name, oth._name) && object.Equals(this._typeParams, oth._typeParams) && object.Equals(this._params, oth._params) && object.Equals(this._body, oth._body) && object.Equals(this._outTypes, oth._outTypes) && object.Equals(this._outVars, oth._outVars); + return oth != null && object.Equals(this._attributes, oth._attributes) && this._isStatic == oth._isStatic && this._hasBody == oth._hasBody && this._outVarsAreUninitFieldsToAssign == oth._outVarsAreUninitFieldsToAssign && this._wasFunction == oth._wasFunction && object.Equals(this._overridingPath, oth._overridingPath) && object.Equals(this._name, oth._name) && object.Equals(this._typeParams, oth._typeParams) && object.Equals(this._params, oth._params) && object.Equals(this._body, oth._body) && object.Equals(this._outTypes, oth._outTypes) && object.Equals(this._outVars, oth._outVars); } public override int GetHashCode() { ulong hash = 5381; hash = ((hash << 5) + hash) + 0; + hash = ((hash << 5) + hash) + ((ulong)Dafny.Helpers.GetHashCode(this._attributes)); hash = ((hash << 5) + hash) + ((ulong)Dafny.Helpers.GetHashCode(this._isStatic)); hash = ((hash << 5) + hash) + ((ulong)Dafny.Helpers.GetHashCode(this._hasBody)); hash = ((hash << 5) + hash) + ((ulong)Dafny.Helpers.GetHashCode(this._outVarsAreUninitFieldsToAssign)); @@ -3398,6 +3402,8 @@ public override int GetHashCode() { public override string ToString() { string s = "DAST.Method.Method"; s += "("; + s += Dafny.Helpers.ToString(this._attributes); + s += ", "; s += Dafny.Helpers.ToString(this._isStatic); s += ", "; s += Dafny.Helpers.ToString(this._hasBody); @@ -3422,7 +3428,7 @@ public override string ToString() { s += ")"; return s; } - private static readonly DAST._IMethod theDefault = create(false, false, false, false, Std.Wrappers.Option>>.Default(), Dafny.Sequence.Empty, Dafny.Sequence.Empty, Dafny.Sequence.Empty, Dafny.Sequence.Empty, Dafny.Sequence.Empty, Std.Wrappers.Option>>.Default()); + private static readonly DAST._IMethod theDefault = create(Dafny.Sequence.Empty, false, false, false, false, Std.Wrappers.Option>>.Default(), Dafny.Sequence.Empty, Dafny.Sequence.Empty, Dafny.Sequence.Empty, Dafny.Sequence.Empty, Dafny.Sequence.Empty, Std.Wrappers.Option>>.Default()); public static DAST._IMethod Default() { return theDefault; } @@ -3430,13 +3436,18 @@ public static DAST._IMethod Default() { public static Dafny.TypeDescriptor _TypeDescriptor() { return _TYPE; } - public static _IMethod create(bool isStatic, bool hasBody, bool outVarsAreUninitFieldsToAssign, bool wasFunction, Std.Wrappers._IOption>> overridingPath, Dafny.ISequence name, Dafny.ISequence typeParams, Dafny.ISequence @params, Dafny.ISequence body, Dafny.ISequence outTypes, Std.Wrappers._IOption>> outVars) { - return new Method(isStatic, hasBody, outVarsAreUninitFieldsToAssign, wasFunction, overridingPath, name, typeParams, @params, body, outTypes, outVars); + public static _IMethod create(Dafny.ISequence attributes, bool isStatic, bool hasBody, bool outVarsAreUninitFieldsToAssign, bool wasFunction, Std.Wrappers._IOption>> overridingPath, Dafny.ISequence name, Dafny.ISequence typeParams, Dafny.ISequence @params, Dafny.ISequence body, Dafny.ISequence outTypes, Std.Wrappers._IOption>> outVars) { + return new Method(attributes, isStatic, hasBody, outVarsAreUninitFieldsToAssign, wasFunction, overridingPath, name, typeParams, @params, body, outTypes, outVars); } - public static _IMethod create_Method(bool isStatic, bool hasBody, bool outVarsAreUninitFieldsToAssign, bool wasFunction, Std.Wrappers._IOption>> overridingPath, Dafny.ISequence name, Dafny.ISequence typeParams, Dafny.ISequence @params, Dafny.ISequence body, Dafny.ISequence outTypes, Std.Wrappers._IOption>> outVars) { - return create(isStatic, hasBody, outVarsAreUninitFieldsToAssign, wasFunction, overridingPath, name, typeParams, @params, body, outTypes, outVars); + public static _IMethod create_Method(Dafny.ISequence attributes, bool isStatic, bool hasBody, bool outVarsAreUninitFieldsToAssign, bool wasFunction, Std.Wrappers._IOption>> overridingPath, Dafny.ISequence name, Dafny.ISequence typeParams, Dafny.ISequence @params, Dafny.ISequence body, Dafny.ISequence outTypes, Std.Wrappers._IOption>> outVars) { + return create(attributes, isStatic, hasBody, outVarsAreUninitFieldsToAssign, wasFunction, overridingPath, name, typeParams, @params, body, outTypes, outVars); } public bool is_Method { get { return true; } } + public Dafny.ISequence dtor_attributes { + get { + return this._attributes; + } + } public bool dtor_isStatic { get { return this._isStatic; diff --git a/Source/DafnyCore/GeneratedFromDafny/DCOMP.cs b/Source/DafnyCore/GeneratedFromDafny/DCOMP.cs index c43b40450cc..ea4d89a67c6 100644 --- a/Source/DafnyCore/GeneratedFromDafny/DCOMP.cs +++ b/Source/DafnyCore/GeneratedFromDafny/DCOMP.cs @@ -42,34 +42,34 @@ public static bool has__special(Dafny.ISequence i) { } } public static Dafny.ISequence idiomatic__rust(Dafny.ISequence i) { - Dafny.ISequence _1116___accumulator = Dafny.Sequence.FromElements(); + Dafny.ISequence _1117___accumulator = Dafny.Sequence.FromElements(); TAIL_CALL_START: ; if ((new BigInteger((i).Count)).Sign == 0) { - return Dafny.Sequence.Concat(_1116___accumulator, Dafny.Sequence.UnicodeFromString("")); + return Dafny.Sequence.Concat(_1117___accumulator, Dafny.Sequence.UnicodeFromString("")); } else if (((i).Select(BigInteger.Zero)) == (new Dafny.Rune('_'))) { - _1116___accumulator = Dafny.Sequence.Concat(_1116___accumulator, Dafny.Sequence.UnicodeFromString("_")); + _1117___accumulator = Dafny.Sequence.Concat(_1117___accumulator, Dafny.Sequence.UnicodeFromString("_")); Dafny.ISequence _in123 = (i).Drop(new BigInteger(2)); i = _in123; goto TAIL_CALL_START; } else { - _1116___accumulator = Dafny.Sequence.Concat(_1116___accumulator, Dafny.Sequence.FromElements((i).Select(BigInteger.Zero))); + _1117___accumulator = Dafny.Sequence.Concat(_1117___accumulator, Dafny.Sequence.FromElements((i).Select(BigInteger.Zero))); Dafny.ISequence _in124 = (i).Drop(BigInteger.One); i = _in124; goto TAIL_CALL_START; } } public static Dafny.ISequence replaceDots(Dafny.ISequence i) { - Dafny.ISequence _1117___accumulator = Dafny.Sequence.FromElements(); + Dafny.ISequence _1118___accumulator = Dafny.Sequence.FromElements(); TAIL_CALL_START: ; if ((new BigInteger((i).Count)).Sign == 0) { - return Dafny.Sequence.Concat(_1117___accumulator, Dafny.Sequence.UnicodeFromString("")); + return Dafny.Sequence.Concat(_1118___accumulator, Dafny.Sequence.UnicodeFromString("")); } else if (((i).Select(BigInteger.Zero)) == (new Dafny.Rune('.'))) { - _1117___accumulator = Dafny.Sequence.Concat(_1117___accumulator, Dafny.Sequence.UnicodeFromString("_d")); + _1118___accumulator = Dafny.Sequence.Concat(_1118___accumulator, Dafny.Sequence.UnicodeFromString("_d")); Dafny.ISequence _in125 = (i).Drop(BigInteger.One); i = _in125; goto TAIL_CALL_START; } else { - _1117___accumulator = Dafny.Sequence.Concat(_1117___accumulator, Dafny.Sequence.FromElements((i).Select(BigInteger.Zero))); + _1118___accumulator = Dafny.Sequence.Concat(_1118___accumulator, Dafny.Sequence.FromElements((i).Select(BigInteger.Zero))); Dafny.ISequence _in126 = (i).Drop(BigInteger.One); i = _in126; goto TAIL_CALL_START; @@ -104,22 +104,22 @@ public static bool is__idiomatic__rust__id(Dafny.ISequence i) { } else if (DCOMP.__default.is__dafny__generated__id(i)) { return i; } else { - Dafny.ISequence _1118_r = DCOMP.__default.replaceDots(i); - return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("r#_"), _1118_r); + Dafny.ISequence _1119_r = DCOMP.__default.replaceDots(i); + return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("r#_"), _1119_r); } } public static Dafny.ISequence escapeField(Dafny.ISequence f) { - Dafny.ISequence _1119_r = (f); - if ((DCOMP.__default.reserved__fields).Contains(_1119_r)) { - return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("r#_"), _1119_r); + Dafny.ISequence _1120_r = (f); + if ((DCOMP.__default.reserved__fields).Contains(_1120_r)) { + return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("r#_"), _1120_r); } else { return DCOMP.__default.escapeName(f); } } public static Dafny.ISequence escapeDtor(Dafny.ISequence f) { - Dafny.ISequence _1120_r = (f); - if ((DCOMP.__default.reserved__fields).Contains(_1120_r)) { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1120_r, Dafny.Sequence.UnicodeFromString(": r#_")), _1120_r); + Dafny.ISequence _1121_r = (f); + if ((DCOMP.__default.reserved__fields).Contains(_1121_r)) { + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1121_r, Dafny.Sequence.UnicodeFromString(": r#_")), _1121_r); } else { return DCOMP.__default.escapeName(f); } @@ -136,22 +136,22 @@ public static bool is__idiomatic__rust__id(Dafny.ISequence i) { if ((new BigInteger((rs).Count)).Sign == 0) { return Std.Wrappers.Option.create_None(); } else { - Std.Wrappers._IOption _1121_res = ((System.Func>)(() => { + Std.Wrappers._IOption _1122_res = ((System.Func>)(() => { DAST._IType _source51 = (rs).Select(BigInteger.Zero); { if (_source51.is_UserDefined) { - DAST._IResolvedType _1122_resolvedType = _source51.dtor_resolved; - return DCOMP.__default.TraitTypeContainingMethod(_1122_resolvedType, dafnyName); + DAST._IResolvedType _1123_resolvedType = _source51.dtor_resolved; + return DCOMP.__default.TraitTypeContainingMethod(_1123_resolvedType, dafnyName); } } { return Std.Wrappers.Option.create_None(); } }))(); - Std.Wrappers._IOption _source52 = _1121_res; + Std.Wrappers._IOption _source52 = _1122_res; { if (_source52.is_Some) { - return _1121_res; + return _1122_res; } } { @@ -162,16 +162,16 @@ public static bool is__idiomatic__rust__id(Dafny.ISequence i) { public static Std.Wrappers._IOption TraitTypeContainingMethod(DAST._IResolvedType r, Dafny.ISequence dafnyName) { DAST._IResolvedType _let_tmp_rhs53 = r; - Dafny.ISequence> _1123_path = _let_tmp_rhs53.dtor_path; - Dafny.ISequence _1124_typeArgs = _let_tmp_rhs53.dtor_typeArgs; - DAST._IResolvedTypeBase _1125_kind = _let_tmp_rhs53.dtor_kind; - Dafny.ISequence _1126_attributes = _let_tmp_rhs53.dtor_attributes; - Dafny.ISequence> _1127_properMethods = _let_tmp_rhs53.dtor_properMethods; - Dafny.ISequence _1128_extendedTypes = _let_tmp_rhs53.dtor_extendedTypes; - if ((_1127_properMethods).Contains(dafnyName)) { + Dafny.ISequence> _1124_path = _let_tmp_rhs53.dtor_path; + Dafny.ISequence _1125_typeArgs = _let_tmp_rhs53.dtor_typeArgs; + DAST._IResolvedTypeBase _1126_kind = _let_tmp_rhs53.dtor_kind; + Dafny.ISequence _1127_attributes = _let_tmp_rhs53.dtor_attributes; + Dafny.ISequence> _1128_properMethods = _let_tmp_rhs53.dtor_properMethods; + Dafny.ISequence _1129_extendedTypes = _let_tmp_rhs53.dtor_extendedTypes; + if ((_1128_properMethods).Contains(dafnyName)) { return Std.Wrappers.Option.create_Some(r); } else { - return DCOMP.__default.TraitTypeContainingMethodAux(_1128_extendedTypes, dafnyName); + return DCOMP.__default.TraitTypeContainingMethodAux(_1129_extendedTypes, dafnyName); } } public static Dafny.ISet> reserved__rust { get { @@ -422,18 +422,18 @@ public Dafny.ISequence> dtor_names { } } public DCOMP._IEnvironment ToOwned() { - DCOMP._IEnvironment _1129_dt__update__tmp_h0 = this; - Dafny.IMap,RAST._IType> _1130_dt__update_htypes_h0 = ((System.Func,RAST._IType>>)(() => { + DCOMP._IEnvironment _1130_dt__update__tmp_h0 = this; + Dafny.IMap,RAST._IType> _1131_dt__update_htypes_h0 = ((System.Func,RAST._IType>>)(() => { var _coll6 = new System.Collections.Generic.List,RAST._IType>>(); foreach (Dafny.ISequence _compr_6 in ((this).dtor_types).Keys.Elements) { - Dafny.ISequence _1131_k = (Dafny.ISequence)_compr_6; - if (((this).dtor_types).Contains(_1131_k)) { - _coll6.Add(new Dafny.Pair,RAST._IType>(_1131_k, (Dafny.Map, RAST._IType>.Select((this).dtor_types,_1131_k)).ToOwned())); + Dafny.ISequence _1132_k = (Dafny.ISequence)_compr_6; + if (((this).dtor_types).Contains(_1132_k)) { + _coll6.Add(new Dafny.Pair,RAST._IType>(_1132_k, (Dafny.Map, RAST._IType>.Select((this).dtor_types,_1132_k)).ToOwned())); } } return Dafny.Map,RAST._IType>.FromCollection(_coll6); }))(); - return DCOMP.Environment.create((_1129_dt__update__tmp_h0).dtor_names, _1130_dt__update_htypes_h0); + return DCOMP.Environment.create((_1130_dt__update__tmp_h0).dtor_names, _1131_dt__update_htypes_h0); } public static DCOMP._IEnvironment Empty() { return DCOMP.Environment.create(Dafny.Sequence>.FromElements(), Dafny.Map, RAST._IType>.FromElements()); @@ -465,8 +465,8 @@ public DCOMP._IEnvironment merge(DCOMP._IEnvironment other) { return DCOMP.Environment.create(Dafny.Sequence>.Concat((this).dtor_names, (other).dtor_names), Dafny.Map, RAST._IType>.Merge((this).dtor_types, (other).dtor_types)); } public DCOMP._IEnvironment RemoveAssigned(Dafny.ISequence name) { - BigInteger _1132_indexInEnv = Std.Collections.Seq.__default.IndexOf>((this).dtor_names, name); - return DCOMP.Environment.create(Dafny.Sequence>.Concat(((this).dtor_names).Subsequence(BigInteger.Zero, _1132_indexInEnv), ((this).dtor_names).Drop((_1132_indexInEnv) + (BigInteger.One))), Dafny.Map, RAST._IType>.Subtract((this).dtor_types, Dafny.Set>.FromElements(name))); + BigInteger _1133_indexInEnv = Std.Collections.Seq.__default.IndexOf>((this).dtor_names, name); + return DCOMP.Environment.create(Dafny.Sequence>.Concat(((this).dtor_names).Subsequence(BigInteger.Zero, _1133_indexInEnv), ((this).dtor_names).Drop((_1133_indexInEnv) + (BigInteger.One))), Dafny.Map, RAST._IType>.Subtract((this).dtor_types, Dafny.Set>.FromElements(name))); } } @@ -762,19 +762,30 @@ public void __ctor(bool unicodeChars, DCOMP._IObjectType objectType) (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.UnicodeFromString("Raw pointers need to be wrapped in a newtype so that their equality has the semantics of Dafny (e.g. a class pointer and a trait pointer are equal), not Rust.")); } } + public bool HasTestAttribute(Dafny.ISequence attributes) { + return Dafny.Helpers.Id, bool>>((_1134_attributes) => Dafny.Helpers.Quantifier((_1134_attributes).UniqueElements, false, (((_exists_var_1) => { + DAST._IAttribute _1135_attribute = (DAST._IAttribute)_exists_var_1; + return ((_1134_attributes).Contains(_1135_attribute)) && ((((_1135_attribute).dtor_name).Equals(Dafny.Sequence.UnicodeFromString("test"))) && ((new BigInteger(((_1135_attribute).dtor_args).Count)).Sign == 0)); + }))))(attributes); + } public RAST._IMod GenModule(DAST._IModule mod, Dafny.ISequence> containingPath) { RAST._IMod s = RAST.Mod.Default(); - Dafny.ISequence _1133_modName; - _1133_modName = DCOMP.__default.escapeName((mod).dtor_name); + Dafny.ISequence _1136_modName; + _1136_modName = DCOMP.__default.escapeName((mod).dtor_name); if (((mod).dtor_body).is_None) { - s = RAST.Mod.create_ExternMod(_1133_modName); + s = RAST.Mod.create_ExternMod(_1136_modName); } else { - Dafny.ISequence _1134_body; + Dafny.ISequence _1137_body; Dafny.ISequence _out15; _out15 = (this).GenModuleBody(((mod).dtor_body).dtor_value, Dafny.Sequence>.Concat(containingPath, Dafny.Sequence>.FromElements((mod).dtor_name))); - _1134_body = _out15; - s = RAST.Mod.create_Mod(_1133_modName, _1134_body); + _1137_body = _out15; + Dafny.ISequence> _1138_attributes; + _1138_attributes = Dafny.Sequence>.FromElements(); + if ((this).HasTestAttribute((mod).dtor_attributes)) { + _1138_attributes = Dafny.Sequence>.FromElements(Dafny.Sequence.UnicodeFromString("#[cfg(test)]")); + } + s = RAST.Mod.create_Mod(_1136_modName, _1138_attributes, _1137_body); } return s; } @@ -783,64 +794,64 @@ public RAST._IMod GenModule(DAST._IModule mod, Dafny.ISequence s = Dafny.Sequence.Empty; s = Dafny.Sequence.FromElements(); BigInteger _hi5 = new BigInteger((body).Count); - for (BigInteger _1135_i = BigInteger.Zero; _1135_i < _hi5; _1135_i++) { - Dafny.ISequence _1136_generated = Dafny.Sequence.Empty; - DAST._IModuleItem _source53 = (body).Select(_1135_i); + for (BigInteger _1139_i = BigInteger.Zero; _1139_i < _hi5; _1139_i++) { + Dafny.ISequence _1140_generated = Dafny.Sequence.Empty; + DAST._IModuleItem _source53 = (body).Select(_1139_i); { if (_source53.is_Module) { - DAST._IModule _1137_m = _source53.dtor_Module_a0; - RAST._IMod _1138_mm; + DAST._IModule _1141_m = _source53.dtor_Module_a0; + RAST._IMod _1142_mm; RAST._IMod _out16; - _out16 = (this).GenModule(_1137_m, containingPath); - _1138_mm = _out16; - _1136_generated = Dafny.Sequence.FromElements(RAST.ModDecl.create_ModDecl(_1138_mm)); + _out16 = (this).GenModule(_1141_m, containingPath); + _1142_mm = _out16; + _1140_generated = Dafny.Sequence.FromElements(RAST.ModDecl.create_ModDecl(_1142_mm)); goto after_match1; } } { if (_source53.is_Class) { - DAST._IClass _1139_c = _source53.dtor_Class_a0; + DAST._IClass _1143_c = _source53.dtor_Class_a0; Dafny.ISequence _out17; - _out17 = (this).GenClass(_1139_c, Dafny.Sequence>.Concat(containingPath, Dafny.Sequence>.FromElements((_1139_c).dtor_name))); - _1136_generated = _out17; + _out17 = (this).GenClass(_1143_c, Dafny.Sequence>.Concat(containingPath, Dafny.Sequence>.FromElements((_1143_c).dtor_name))); + _1140_generated = _out17; goto after_match1; } } { if (_source53.is_Trait) { - DAST._ITrait _1140_t = _source53.dtor_Trait_a0; + DAST._ITrait _1144_t = _source53.dtor_Trait_a0; Dafny.ISequence _out18; - _out18 = (this).GenTrait(_1140_t, containingPath); - _1136_generated = _out18; + _out18 = (this).GenTrait(_1144_t, containingPath); + _1140_generated = _out18; goto after_match1; } } { if (_source53.is_Newtype) { - DAST._INewtype _1141_n = _source53.dtor_Newtype_a0; + DAST._INewtype _1145_n = _source53.dtor_Newtype_a0; Dafny.ISequence _out19; - _out19 = (this).GenNewtype(_1141_n); - _1136_generated = _out19; + _out19 = (this).GenNewtype(_1145_n); + _1140_generated = _out19; goto after_match1; } } { if (_source53.is_SynonymType) { - DAST._ISynonymType _1142_s = _source53.dtor_SynonymType_a0; + DAST._ISynonymType _1146_s = _source53.dtor_SynonymType_a0; Dafny.ISequence _out20; - _out20 = (this).GenSynonymType(_1142_s); - _1136_generated = _out20; + _out20 = (this).GenSynonymType(_1146_s); + _1140_generated = _out20; goto after_match1; } } { - DAST._IDatatype _1143_d = _source53.dtor_Datatype_a0; + DAST._IDatatype _1147_d = _source53.dtor_Datatype_a0; Dafny.ISequence _out21; - _out21 = (this).GenDatatype(_1143_d); - _1136_generated = _out21; + _out21 = (this).GenDatatype(_1147_d); + _1140_generated = _out21; } after_match1: ; - s = Dafny.Sequence.Concat(s, _1136_generated); + s = Dafny.Sequence.Concat(s, _1140_generated); } return s; } @@ -849,16 +860,16 @@ public void GenTypeParam(DAST._ITypeArgDecl tp, out DAST._IType typeArg, out RAS typeArg = DAST.Type.Default(); typeParam = RAST.TypeParamDecl.Default(); typeArg = DAST.Type.create_TypeArg((tp).dtor_name); - Dafny.ISequence _1144_genTpConstraint; + Dafny.ISequence _1148_genTpConstraint; if (((tp).dtor_bounds).Contains(DAST.TypeArgBound.create_SupportsEquality())) { - _1144_genTpConstraint = Dafny.Sequence.FromElements(RAST.__default.DafnyTypeEq); + _1148_genTpConstraint = Dafny.Sequence.FromElements(RAST.__default.DafnyTypeEq); } else { - _1144_genTpConstraint = Dafny.Sequence.FromElements(RAST.__default.DafnyType); + _1148_genTpConstraint = Dafny.Sequence.FromElements(RAST.__default.DafnyType); } if (((tp).dtor_bounds).Contains(DAST.TypeArgBound.create_SupportsDefault())) { - _1144_genTpConstraint = Dafny.Sequence.Concat(_1144_genTpConstraint, Dafny.Sequence.FromElements(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("default"))).MSel(Dafny.Sequence.UnicodeFromString("Default")))); + _1148_genTpConstraint = Dafny.Sequence.Concat(_1148_genTpConstraint, Dafny.Sequence.FromElements(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("default"))).MSel(Dafny.Sequence.UnicodeFromString("Default")))); } - typeParam = RAST.TypeParamDecl.create(DCOMP.__default.escapeName(((tp).dtor_name)), _1144_genTpConstraint); + typeParam = RAST.TypeParamDecl.create(DCOMP.__default.escapeName(((tp).dtor_name)), _1148_genTpConstraint); } public void GenTypeParameters(Dafny.ISequence @params, out Dafny.ISequence typeParamsSeq, out Dafny.ISequence typeParams, out Dafny.ISequence constrainedTypeParams, out Dafny.ISequence whereConstraints) { @@ -872,23 +883,23 @@ public void GenTypeParameters(Dafny.ISequence @params, out D whereConstraints = Dafny.Sequence.UnicodeFromString(""); if ((new BigInteger((@params).Count)).Sign == 1) { BigInteger _hi6 = new BigInteger((@params).Count); - for (BigInteger _1145_tpI = BigInteger.Zero; _1145_tpI < _hi6; _1145_tpI++) { - DAST._ITypeArgDecl _1146_tp; - _1146_tp = (@params).Select(_1145_tpI); - DAST._IType _1147_typeArg; - RAST._ITypeParamDecl _1148_typeParam; + for (BigInteger _1149_tpI = BigInteger.Zero; _1149_tpI < _hi6; _1149_tpI++) { + DAST._ITypeArgDecl _1150_tp; + _1150_tp = (@params).Select(_1149_tpI); + DAST._IType _1151_typeArg; + RAST._ITypeParamDecl _1152_typeParam; DAST._IType _out22; RAST._ITypeParamDecl _out23; - (this).GenTypeParam(_1146_tp, out _out22, out _out23); - _1147_typeArg = _out22; - _1148_typeParam = _out23; - RAST._IType _1149_rType; + (this).GenTypeParam(_1150_tp, out _out22, out _out23); + _1151_typeArg = _out22; + _1152_typeParam = _out23; + RAST._IType _1153_rType; RAST._IType _out24; - _out24 = (this).GenType(_1147_typeArg, DCOMP.GenTypeContext.@default()); - _1149_rType = _out24; - typeParamsSeq = Dafny.Sequence.Concat(typeParamsSeq, Dafny.Sequence.FromElements(_1147_typeArg)); - typeParams = Dafny.Sequence.Concat(typeParams, Dafny.Sequence.FromElements(_1149_rType)); - constrainedTypeParams = Dafny.Sequence.Concat(constrainedTypeParams, Dafny.Sequence.FromElements(_1148_typeParam)); + _out24 = (this).GenType(_1151_typeArg, DCOMP.GenTypeContext.@default()); + _1153_rType = _out24; + typeParamsSeq = Dafny.Sequence.Concat(typeParamsSeq, Dafny.Sequence.FromElements(_1151_typeArg)); + typeParams = Dafny.Sequence.Concat(typeParams, Dafny.Sequence.FromElements(_1153_rType)); + constrainedTypeParams = Dafny.Sequence.Concat(constrainedTypeParams, Dafny.Sequence.FromElements(_1152_typeParam)); } } } @@ -903,447 +914,467 @@ public bool IsSameResolvedType(DAST._IResolvedType r1, DAST._IResolvedType r2) public Dafny.ISequence GenClass(DAST._IClass c, Dafny.ISequence> path) { Dafny.ISequence s = Dafny.Sequence.Empty; - Dafny.ISequence _1150_typeParamsSeq; - Dafny.ISequence _1151_rTypeParams; - Dafny.ISequence _1152_rTypeParamsDecls; - Dafny.ISequence _1153_whereConstraints; + Dafny.ISequence _1154_typeParamsSeq; + Dafny.ISequence _1155_rTypeParams; + Dafny.ISequence _1156_rTypeParamsDecls; + Dafny.ISequence _1157_whereConstraints; Dafny.ISequence _out25; Dafny.ISequence _out26; Dafny.ISequence _out27; Dafny.ISequence _out28; (this).GenTypeParameters((c).dtor_typeParams, out _out25, out _out26, out _out27, out _out28); - _1150_typeParamsSeq = _out25; - _1151_rTypeParams = _out26; - _1152_rTypeParamsDecls = _out27; - _1153_whereConstraints = _out28; - Dafny.ISequence _1154_constrainedTypeParams; - _1154_constrainedTypeParams = RAST.TypeParamDecl.ToStringMultiple(_1152_rTypeParamsDecls, Dafny.Sequence.Concat(RAST.__default.IND, RAST.__default.IND)); - Dafny.ISequence _1155_fields; - _1155_fields = Dafny.Sequence.FromElements(); - Dafny.ISequence _1156_fieldInits; - _1156_fieldInits = Dafny.Sequence.FromElements(); + _1154_typeParamsSeq = _out25; + _1155_rTypeParams = _out26; + _1156_rTypeParamsDecls = _out27; + _1157_whereConstraints = _out28; + Dafny.ISequence _1158_constrainedTypeParams; + _1158_constrainedTypeParams = RAST.TypeParamDecl.ToStringMultiple(_1156_rTypeParamsDecls, Dafny.Sequence.Concat(RAST.__default.IND, RAST.__default.IND)); + Dafny.ISequence _1159_fields; + _1159_fields = Dafny.Sequence.FromElements(); + Dafny.ISequence _1160_fieldInits; + _1160_fieldInits = Dafny.Sequence.FromElements(); BigInteger _hi7 = new BigInteger(((c).dtor_fields).Count); - for (BigInteger _1157_fieldI = BigInteger.Zero; _1157_fieldI < _hi7; _1157_fieldI++) { - DAST._IField _1158_field; - _1158_field = ((c).dtor_fields).Select(_1157_fieldI); - RAST._IType _1159_fieldType; + for (BigInteger _1161_fieldI = BigInteger.Zero; _1161_fieldI < _hi7; _1161_fieldI++) { + DAST._IField _1162_field; + _1162_field = ((c).dtor_fields).Select(_1161_fieldI); + RAST._IType _1163_fieldType; RAST._IType _out29; - _out29 = (this).GenType(((_1158_field).dtor_formal).dtor_typ, DCOMP.GenTypeContext.@default()); - _1159_fieldType = _out29; - Dafny.ISequence _1160_fieldRustName; - _1160_fieldRustName = DCOMP.__default.escapeName(((_1158_field).dtor_formal).dtor_name); - _1155_fields = Dafny.Sequence.Concat(_1155_fields, Dafny.Sequence.FromElements(RAST.Field.create(RAST.Visibility.create_PUB(), RAST.Formal.create(_1160_fieldRustName, _1159_fieldType)))); - Std.Wrappers._IOption _source54 = (_1158_field).dtor_defaultValue; + _out29 = (this).GenType(((_1162_field).dtor_formal).dtor_typ, DCOMP.GenTypeContext.@default()); + _1163_fieldType = _out29; + Dafny.ISequence _1164_fieldRustName; + _1164_fieldRustName = DCOMP.__default.escapeName(((_1162_field).dtor_formal).dtor_name); + _1159_fields = Dafny.Sequence.Concat(_1159_fields, Dafny.Sequence.FromElements(RAST.Field.create(RAST.Visibility.create_PUB(), RAST.Formal.create(_1164_fieldRustName, _1163_fieldType)))); + Std.Wrappers._IOption _source54 = (_1162_field).dtor_defaultValue; { if (_source54.is_Some) { - DAST._IExpression _1161_e = _source54.dtor_value; + DAST._IExpression _1165_e = _source54.dtor_value; { - RAST._IExpr _1162_expr; - DCOMP._IOwnership _1163___v48; - Dafny.ISet> _1164___v49; + RAST._IExpr _1166_expr; + DCOMP._IOwnership _1167___v48; + Dafny.ISet> _1168___v49; RAST._IExpr _out30; DCOMP._IOwnership _out31; Dafny.ISet> _out32; - (this).GenExpr(_1161_e, DCOMP.SelfInfo.create_NoSelf(), DCOMP.Environment.Empty(), DCOMP.Ownership.create_OwnershipOwned(), out _out30, out _out31, out _out32); - _1162_expr = _out30; - _1163___v48 = _out31; - _1164___v49 = _out32; - _1156_fieldInits = Dafny.Sequence.Concat(_1156_fieldInits, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(_1160_fieldRustName, _1162_expr))); + (this).GenExpr(_1165_e, DCOMP.SelfInfo.create_NoSelf(), DCOMP.Environment.Empty(), DCOMP.Ownership.create_OwnershipOwned(), out _out30, out _out31, out _out32); + _1166_expr = _out30; + _1167___v48 = _out31; + _1168___v49 = _out32; + _1160_fieldInits = Dafny.Sequence.Concat(_1160_fieldInits, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(_1164_fieldRustName, _1166_expr))); } goto after_match2; } } { { - RAST._IExpr _1165_default; - _1165_default = RAST.__default.std__Default__default; - if ((_1159_fieldType).IsObjectOrPointer()) { - _1165_default = (_1159_fieldType).ToNullExpr(); + RAST._IExpr _1169_default; + _1169_default = RAST.__default.std__Default__default; + if ((_1163_fieldType).IsObjectOrPointer()) { + _1169_default = (_1163_fieldType).ToNullExpr(); } - _1156_fieldInits = Dafny.Sequence.Concat(_1156_fieldInits, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(_1160_fieldRustName, _1165_default))); + _1160_fieldInits = Dafny.Sequence.Concat(_1160_fieldInits, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(_1164_fieldRustName, _1169_default))); } } after_match2: ; } BigInteger _hi8 = new BigInteger(((c).dtor_typeParams).Count); - for (BigInteger _1166_typeParamI = BigInteger.Zero; _1166_typeParamI < _hi8; _1166_typeParamI++) { - DAST._IType _1167_typeArg; - RAST._ITypeParamDecl _1168_typeParam; + for (BigInteger _1170_typeParamI = BigInteger.Zero; _1170_typeParamI < _hi8; _1170_typeParamI++) { + DAST._IType _1171_typeArg; + RAST._ITypeParamDecl _1172_typeParam; DAST._IType _out33; RAST._ITypeParamDecl _out34; - (this).GenTypeParam(((c).dtor_typeParams).Select(_1166_typeParamI), out _out33, out _out34); - _1167_typeArg = _out33; - _1168_typeParam = _out34; - RAST._IType _1169_rTypeArg; + (this).GenTypeParam(((c).dtor_typeParams).Select(_1170_typeParamI), out _out33, out _out34); + _1171_typeArg = _out33; + _1172_typeParam = _out34; + RAST._IType _1173_rTypeArg; RAST._IType _out35; - _out35 = (this).GenType(_1167_typeArg, DCOMP.GenTypeContext.@default()); - _1169_rTypeArg = _out35; - _1155_fields = Dafny.Sequence.Concat(_1155_fields, Dafny.Sequence.FromElements(RAST.Field.create(RAST.Visibility.create_PRIV(), RAST.Formal.create(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("_phantom_type_param_"), Std.Strings.__default.OfNat(_1166_typeParamI)), RAST.Type.create_TypeApp(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("marker"))).MSel(Dafny.Sequence.UnicodeFromString("PhantomData")), Dafny.Sequence.FromElements(_1169_rTypeArg)))))); - _1156_fieldInits = Dafny.Sequence.Concat(_1156_fieldInits, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("_phantom_type_param_"), Std.Strings.__default.OfNat(_1166_typeParamI)), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("::std::marker::PhantomData"))))); - } - Dafny.ISequence _1170_datatypeName; - _1170_datatypeName = DCOMP.__default.escapeName((c).dtor_name); - RAST._IStruct _1171_struct; - _1171_struct = RAST.Struct.create(Dafny.Sequence>.FromElements(), _1170_datatypeName, _1152_rTypeParamsDecls, RAST.Fields.create_NamedFields(_1155_fields)); - s = Dafny.Sequence.FromElements(RAST.ModDecl.create_StructDecl(_1171_struct)); - Dafny.ISequence _1172_implBodyRaw; - Dafny.IMap>,Dafny.ISequence> _1173_traitBodies; + _out35 = (this).GenType(_1171_typeArg, DCOMP.GenTypeContext.@default()); + _1173_rTypeArg = _out35; + _1159_fields = Dafny.Sequence.Concat(_1159_fields, Dafny.Sequence.FromElements(RAST.Field.create(RAST.Visibility.create_PRIV(), RAST.Formal.create(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("_phantom_type_param_"), Std.Strings.__default.OfNat(_1170_typeParamI)), RAST.Type.create_TypeApp(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("marker"))).MSel(Dafny.Sequence.UnicodeFromString("PhantomData")), Dafny.Sequence.FromElements(_1173_rTypeArg)))))); + _1160_fieldInits = Dafny.Sequence.Concat(_1160_fieldInits, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("_phantom_type_param_"), Std.Strings.__default.OfNat(_1170_typeParamI)), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("::std::marker::PhantomData"))))); + } + Dafny.ISequence _1174_datatypeName; + _1174_datatypeName = DCOMP.__default.escapeName((c).dtor_name); + RAST._IStruct _1175_struct; + _1175_struct = RAST.Struct.create(Dafny.Sequence>.FromElements(), _1174_datatypeName, _1156_rTypeParamsDecls, RAST.Fields.create_NamedFields(_1159_fields)); + s = Dafny.Sequence.FromElements(RAST.ModDecl.create_StructDecl(_1175_struct)); + Dafny.ISequence _1176_implBodyRaw; + Dafny.IMap>,Dafny.ISequence> _1177_traitBodies; Dafny.ISequence _out36; Dafny.IMap>,Dafny.ISequence> _out37; - (this).GenClassImplBody((c).dtor_body, false, DAST.Type.create_UserDefined(DAST.ResolvedType.create(path, Dafny.Sequence.FromElements(), DAST.ResolvedTypeBase.create_Class(), (c).dtor_attributes, Dafny.Sequence>.FromElements(), Dafny.Sequence.FromElements())), _1150_typeParamsSeq, out _out36, out _out37); - _1172_implBodyRaw = _out36; - _1173_traitBodies = _out37; - Dafny.ISequence _1174_implBody; - _1174_implBody = Dafny.Sequence.Concat(Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PUB(), RAST.Fn.create((this).allocate__fn, Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(), Std.Wrappers.Option.create_Some((this).Object(RAST.Type.create_SelfOwned())), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some((((RAST.__default.dafny__runtime).MSel((this).allocate)).ApplyType1(RAST.Type.create_SelfOwned())).Apply(Dafny.Sequence.FromElements()))))), _1172_implBodyRaw); - RAST._IImpl _1175_i; - _1175_i = RAST.Impl.create_Impl(_1152_rTypeParamsDecls, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1170_datatypeName), _1151_rTypeParams), _1153_whereConstraints, _1174_implBody); - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(_1175_i))); - RAST._IType _1176_genSelfPath; + (this).GenClassImplBody((c).dtor_body, false, DAST.Type.create_UserDefined(DAST.ResolvedType.create(path, Dafny.Sequence.FromElements(), DAST.ResolvedTypeBase.create_Class(), (c).dtor_attributes, Dafny.Sequence>.FromElements(), Dafny.Sequence.FromElements())), _1154_typeParamsSeq, out _out36, out _out37); + _1176_implBodyRaw = _out36; + _1177_traitBodies = _out37; + Dafny.ISequence _1178_implBody; + _1178_implBody = Dafny.Sequence.Concat(Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PUB(), RAST.Fn.create((this).allocate__fn, Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(), Std.Wrappers.Option.create_Some((this).Object(RAST.Type.create_SelfOwned())), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some((((RAST.__default.dafny__runtime).MSel((this).allocate)).ApplyType1(RAST.Type.create_SelfOwned())).Apply(Dafny.Sequence.FromElements()))))), _1176_implBodyRaw); + RAST._IImpl _1179_i; + _1179_i = RAST.Impl.create_Impl(_1156_rTypeParamsDecls, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1174_datatypeName), _1155_rTypeParams), _1157_whereConstraints, _1178_implBody); + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(_1179_i))); + Dafny.ISequence _1180_testMethods; + _1180_testMethods = Dafny.Sequence.FromElements(); + if ((_1174_datatypeName).Equals(Dafny.Sequence.UnicodeFromString("_default"))) { + BigInteger _hi9 = new BigInteger(((c).dtor_body).Count); + for (BigInteger _1181_i = BigInteger.Zero; _1181_i < _hi9; _1181_i++) { + DAST._IMethod _1182_m; + DAST._IMethod _source55 = ((c).dtor_body).Select(_1181_i); + { + DAST._IMethod _1183_m = _source55; + _1182_m = _1183_m; + } + after_match3: ; + if (((this).HasTestAttribute((_1182_m).dtor_attributes)) && ((new BigInteger(((_1182_m).dtor_params).Count)).Sign == 0)) { + Dafny.ISequence _1184_fnName; + _1184_fnName = DCOMP.__default.escapeName((_1182_m).dtor_name); + _1180_testMethods = Dafny.Sequence.Concat(_1180_testMethods, Dafny.Sequence.FromElements(RAST.ModDecl.create_TopFnDecl(RAST.TopFnDecl.create(Dafny.Sequence>.FromElements(Dafny.Sequence.UnicodeFromString("#[test]")), RAST.Visibility.create_PUB(), RAST.Fn.create(_1184_fnName, Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(), Std.Wrappers.Option.create_None(), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(((RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("_default"))).MSel(_1184_fnName)).Apply(Dafny.Sequence.FromElements()))))))); + } + } + s = Dafny.Sequence.Concat(s, _1180_testMethods); + } + RAST._IType _1185_genSelfPath; RAST._IType _out38; _out38 = DCOMP.COMP.GenPath(path); - _1176_genSelfPath = _out38; - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1152_rTypeParamsDecls, ((RAST.__default.dafny__runtime__type).MSel((this).Upcast)).Apply(Dafny.Sequence.FromElements(RAST.Type.create_DynType(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("any"))).MSel(Dafny.Sequence.UnicodeFromString("Any"))))), RAST.Type.create_TypeApp(_1176_genSelfPath, _1151_rTypeParams), _1153_whereConstraints, Dafny.Sequence.FromElements(RAST.ImplMember.create_ImplMemberMacro(((RAST.__default.dafny__runtime).MSel((this).UpcastFnMacro)).Apply1(RAST.Expr.create_ExprFromType(RAST.Type.create_DynType(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("any"))).MSel(Dafny.Sequence.UnicodeFromString("Any"))))))))))); - BigInteger _hi9 = new BigInteger(((c).dtor_superClasses).Count); - for (BigInteger _1177_i = BigInteger.Zero; _1177_i < _hi9; _1177_i++) { - DAST._IType _1178_superClass; - _1178_superClass = ((c).dtor_superClasses).Select(_1177_i); - DAST._IType _source55 = _1178_superClass; + _1185_genSelfPath = _out38; + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1156_rTypeParamsDecls, ((RAST.__default.dafny__runtime__type).MSel((this).Upcast)).Apply(Dafny.Sequence.FromElements(RAST.Type.create_DynType(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("any"))).MSel(Dafny.Sequence.UnicodeFromString("Any"))))), RAST.Type.create_TypeApp(_1185_genSelfPath, _1155_rTypeParams), _1157_whereConstraints, Dafny.Sequence.FromElements(RAST.ImplMember.create_ImplMemberMacro(((RAST.__default.dafny__runtime).MSel((this).UpcastFnMacro)).Apply1(RAST.Expr.create_ExprFromType(RAST.Type.create_DynType(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("any"))).MSel(Dafny.Sequence.UnicodeFromString("Any"))))))))))); + BigInteger _hi10 = new BigInteger(((c).dtor_superClasses).Count); + for (BigInteger _1186_i = BigInteger.Zero; _1186_i < _hi10; _1186_i++) { + DAST._IType _1187_superClass; + _1187_superClass = ((c).dtor_superClasses).Select(_1186_i); + DAST._IType _source56 = _1187_superClass; { - if (_source55.is_UserDefined) { - DAST._IResolvedType resolved0 = _source55.dtor_resolved; - Dafny.ISequence> _1179_traitPath = resolved0.dtor_path; - Dafny.ISequence _1180_typeArgs = resolved0.dtor_typeArgs; + if (_source56.is_UserDefined) { + DAST._IResolvedType resolved0 = _source56.dtor_resolved; + Dafny.ISequence> _1188_traitPath = resolved0.dtor_path; + Dafny.ISequence _1189_typeArgs = resolved0.dtor_typeArgs; DAST._IResolvedTypeBase kind0 = resolved0.dtor_kind; if (kind0.is_Trait) { { - RAST._IType _1181_pathStr; + RAST._IType _1190_pathStr; RAST._IType _out39; - _out39 = DCOMP.COMP.GenPath(_1179_traitPath); - _1181_pathStr = _out39; - Dafny.ISequence _1182_typeArgs; + _out39 = DCOMP.COMP.GenPath(_1188_traitPath); + _1190_pathStr = _out39; + Dafny.ISequence _1191_typeArgs; Dafny.ISequence _out40; - _out40 = (this).GenTypeArgs(_1180_typeArgs, DCOMP.GenTypeContext.@default()); - _1182_typeArgs = _out40; - Dafny.ISequence _1183_body; - _1183_body = Dafny.Sequence.FromElements(); - if ((_1173_traitBodies).Contains(_1179_traitPath)) { - _1183_body = Dafny.Map>, Dafny.ISequence>.Select(_1173_traitBodies,_1179_traitPath); + _out40 = (this).GenTypeArgs(_1189_typeArgs, DCOMP.GenTypeContext.@default()); + _1191_typeArgs = _out40; + Dafny.ISequence _1192_body; + _1192_body = Dafny.Sequence.FromElements(); + if ((_1177_traitBodies).Contains(_1188_traitPath)) { + _1192_body = Dafny.Map>, Dafny.ISequence>.Select(_1177_traitBodies,_1188_traitPath); } - RAST._IType _1184_traitType; - _1184_traitType = RAST.Type.create_TypeApp(_1181_pathStr, _1182_typeArgs); - RAST._IModDecl _1185_x; - _1185_x = RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1152_rTypeParamsDecls, _1184_traitType, RAST.Type.create_TypeApp(_1176_genSelfPath, _1151_rTypeParams), _1153_whereConstraints, _1183_body)); - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(_1185_x)); - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1152_rTypeParamsDecls, ((RAST.__default.dafny__runtime__type).MSel((this).Upcast)).Apply(Dafny.Sequence.FromElements(RAST.Type.create_DynType(_1184_traitType))), RAST.Type.create_TypeApp(_1176_genSelfPath, _1151_rTypeParams), _1153_whereConstraints, Dafny.Sequence.FromElements(RAST.ImplMember.create_ImplMemberMacro(((RAST.__default.dafny__runtime).MSel((this).UpcastFnMacro)).Apply1(RAST.Expr.create_ExprFromType(RAST.Type.create_DynType(_1184_traitType))))))))); + RAST._IType _1193_traitType; + _1193_traitType = RAST.Type.create_TypeApp(_1190_pathStr, _1191_typeArgs); + RAST._IModDecl _1194_x; + _1194_x = RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1156_rTypeParamsDecls, _1193_traitType, RAST.Type.create_TypeApp(_1185_genSelfPath, _1155_rTypeParams), _1157_whereConstraints, _1192_body)); + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(_1194_x)); + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1156_rTypeParamsDecls, ((RAST.__default.dafny__runtime__type).MSel((this).Upcast)).Apply(Dafny.Sequence.FromElements(RAST.Type.create_DynType(_1193_traitType))), RAST.Type.create_TypeApp(_1185_genSelfPath, _1155_rTypeParams), _1157_whereConstraints, Dafny.Sequence.FromElements(RAST.ImplMember.create_ImplMemberMacro(((RAST.__default.dafny__runtime).MSel((this).UpcastFnMacro)).Apply1(RAST.Expr.create_ExprFromType(RAST.Type.create_DynType(_1193_traitType))))))))); } - goto after_match3; + goto after_match4; } } } { } - after_match3: ; + after_match4: ; } return s; } public Dafny.ISequence GenTrait(DAST._ITrait t, Dafny.ISequence> containingPath) { Dafny.ISequence s = Dafny.Sequence.Empty; - Dafny.ISequence _1186_typeParamsSeq; - _1186_typeParamsSeq = Dafny.Sequence.FromElements(); - Dafny.ISequence _1187_typeParamDecls; - _1187_typeParamDecls = Dafny.Sequence.FromElements(); - Dafny.ISequence _1188_typeParams; - _1188_typeParams = Dafny.Sequence.FromElements(); + Dafny.ISequence _1195_typeParamsSeq; + _1195_typeParamsSeq = Dafny.Sequence.FromElements(); + Dafny.ISequence _1196_typeParamDecls; + _1196_typeParamDecls = Dafny.Sequence.FromElements(); + Dafny.ISequence _1197_typeParams; + _1197_typeParams = Dafny.Sequence.FromElements(); if ((new BigInteger(((t).dtor_typeParams).Count)).Sign == 1) { - BigInteger _hi10 = new BigInteger(((t).dtor_typeParams).Count); - for (BigInteger _1189_tpI = BigInteger.Zero; _1189_tpI < _hi10; _1189_tpI++) { - DAST._ITypeArgDecl _1190_tp; - _1190_tp = ((t).dtor_typeParams).Select(_1189_tpI); - DAST._IType _1191_typeArg; - RAST._ITypeParamDecl _1192_typeParamDecl; + BigInteger _hi11 = new BigInteger(((t).dtor_typeParams).Count); + for (BigInteger _1198_tpI = BigInteger.Zero; _1198_tpI < _hi11; _1198_tpI++) { + DAST._ITypeArgDecl _1199_tp; + _1199_tp = ((t).dtor_typeParams).Select(_1198_tpI); + DAST._IType _1200_typeArg; + RAST._ITypeParamDecl _1201_typeParamDecl; DAST._IType _out41; RAST._ITypeParamDecl _out42; - (this).GenTypeParam(_1190_tp, out _out41, out _out42); - _1191_typeArg = _out41; - _1192_typeParamDecl = _out42; - _1186_typeParamsSeq = Dafny.Sequence.Concat(_1186_typeParamsSeq, Dafny.Sequence.FromElements(_1191_typeArg)); - _1187_typeParamDecls = Dafny.Sequence.Concat(_1187_typeParamDecls, Dafny.Sequence.FromElements(_1192_typeParamDecl)); - RAST._IType _1193_typeParam; + (this).GenTypeParam(_1199_tp, out _out41, out _out42); + _1200_typeArg = _out41; + _1201_typeParamDecl = _out42; + _1195_typeParamsSeq = Dafny.Sequence.Concat(_1195_typeParamsSeq, Dafny.Sequence.FromElements(_1200_typeArg)); + _1196_typeParamDecls = Dafny.Sequence.Concat(_1196_typeParamDecls, Dafny.Sequence.FromElements(_1201_typeParamDecl)); + RAST._IType _1202_typeParam; RAST._IType _out43; - _out43 = (this).GenType(_1191_typeArg, DCOMP.GenTypeContext.@default()); - _1193_typeParam = _out43; - _1188_typeParams = Dafny.Sequence.Concat(_1188_typeParams, Dafny.Sequence.FromElements(_1193_typeParam)); + _out43 = (this).GenType(_1200_typeArg, DCOMP.GenTypeContext.@default()); + _1202_typeParam = _out43; + _1197_typeParams = Dafny.Sequence.Concat(_1197_typeParams, Dafny.Sequence.FromElements(_1202_typeParam)); } } - Dafny.ISequence> _1194_fullPath; - _1194_fullPath = Dafny.Sequence>.Concat(containingPath, Dafny.Sequence>.FromElements((t).dtor_name)); - Dafny.ISequence _1195_implBody; - Dafny.IMap>,Dafny.ISequence> _1196___v54; + Dafny.ISequence> _1203_fullPath; + _1203_fullPath = Dafny.Sequence>.Concat(containingPath, Dafny.Sequence>.FromElements((t).dtor_name)); + Dafny.ISequence _1204_implBody; + Dafny.IMap>,Dafny.ISequence> _1205___v54; Dafny.ISequence _out44; Dafny.IMap>,Dafny.ISequence> _out45; - (this).GenClassImplBody((t).dtor_body, true, DAST.Type.create_UserDefined(DAST.ResolvedType.create(_1194_fullPath, Dafny.Sequence.FromElements(), DAST.ResolvedTypeBase.create_Trait(), (t).dtor_attributes, Dafny.Sequence>.FromElements(), Dafny.Sequence.FromElements())), _1186_typeParamsSeq, out _out44, out _out45); - _1195_implBody = _out44; - _1196___v54 = _out45; - Dafny.ISequence _1197_parents; - _1197_parents = Dafny.Sequence.FromElements(); - BigInteger _hi11 = new BigInteger(((t).dtor_parents).Count); - for (BigInteger _1198_i = BigInteger.Zero; _1198_i < _hi11; _1198_i++) { - RAST._IType _1199_tpe; + (this).GenClassImplBody((t).dtor_body, true, DAST.Type.create_UserDefined(DAST.ResolvedType.create(_1203_fullPath, Dafny.Sequence.FromElements(), DAST.ResolvedTypeBase.create_Trait(), (t).dtor_attributes, Dafny.Sequence>.FromElements(), Dafny.Sequence.FromElements())), _1195_typeParamsSeq, out _out44, out _out45); + _1204_implBody = _out44; + _1205___v54 = _out45; + Dafny.ISequence _1206_parents; + _1206_parents = Dafny.Sequence.FromElements(); + BigInteger _hi12 = new BigInteger(((t).dtor_parents).Count); + for (BigInteger _1207_i = BigInteger.Zero; _1207_i < _hi12; _1207_i++) { + RAST._IType _1208_tpe; RAST._IType _out46; - _out46 = (this).GenType(((t).dtor_parents).Select(_1198_i), DCOMP.GenTypeContext.ForTraitParents()); - _1199_tpe = _out46; - _1197_parents = Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1197_parents, Dafny.Sequence.FromElements(_1199_tpe)), Dafny.Sequence.FromElements(((RAST.__default.dafny__runtime__type).MSel((this).Upcast)).Apply1(RAST.Type.create_DynType(_1199_tpe)))); + _out46 = (this).GenType(((t).dtor_parents).Select(_1207_i), DCOMP.GenTypeContext.ForTraitParents()); + _1208_tpe = _out46; + _1206_parents = Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1206_parents, Dafny.Sequence.FromElements(_1208_tpe)), Dafny.Sequence.FromElements(((RAST.__default.dafny__runtime__type).MSel((this).Upcast)).Apply1(RAST.Type.create_DynType(_1208_tpe)))); } - s = Dafny.Sequence.FromElements(RAST.ModDecl.create_TraitDecl(RAST.Trait.create(_1187_typeParamDecls, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(DCOMP.__default.escapeName((t).dtor_name)), _1188_typeParams), _1197_parents, _1195_implBody))); + s = Dafny.Sequence.FromElements(RAST.ModDecl.create_TraitDecl(RAST.Trait.create(_1196_typeParamDecls, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(DCOMP.__default.escapeName((t).dtor_name)), _1197_typeParams), _1206_parents, _1204_implBody))); return s; } public Dafny.ISequence GenNewtype(DAST._INewtype c) { Dafny.ISequence s = Dafny.Sequence.Empty; - Dafny.ISequence _1200_typeParamsSeq; - Dafny.ISequence _1201_rTypeParams; - Dafny.ISequence _1202_rTypeParamsDecls; - Dafny.ISequence _1203_whereConstraints; + Dafny.ISequence _1209_typeParamsSeq; + Dafny.ISequence _1210_rTypeParams; + Dafny.ISequence _1211_rTypeParamsDecls; + Dafny.ISequence _1212_whereConstraints; Dafny.ISequence _out47; Dafny.ISequence _out48; Dafny.ISequence _out49; Dafny.ISequence _out50; (this).GenTypeParameters((c).dtor_typeParams, out _out47, out _out48, out _out49, out _out50); - _1200_typeParamsSeq = _out47; - _1201_rTypeParams = _out48; - _1202_rTypeParamsDecls = _out49; - _1203_whereConstraints = _out50; - Dafny.ISequence _1204_constrainedTypeParams; - _1204_constrainedTypeParams = RAST.TypeParamDecl.ToStringMultiple(_1202_rTypeParamsDecls, Dafny.Sequence.Concat(RAST.__default.IND, RAST.__default.IND)); - RAST._IType _1205_underlyingType = RAST.Type.Default(); - Std.Wrappers._IOption _source56 = DCOMP.COMP.NewtypeToRustType((c).dtor_base, (c).dtor_range); + _1209_typeParamsSeq = _out47; + _1210_rTypeParams = _out48; + _1211_rTypeParamsDecls = _out49; + _1212_whereConstraints = _out50; + Dafny.ISequence _1213_constrainedTypeParams; + _1213_constrainedTypeParams = RAST.TypeParamDecl.ToStringMultiple(_1211_rTypeParamsDecls, Dafny.Sequence.Concat(RAST.__default.IND, RAST.__default.IND)); + RAST._IType _1214_underlyingType = RAST.Type.Default(); + Std.Wrappers._IOption _source57 = DCOMP.COMP.NewtypeToRustType((c).dtor_base, (c).dtor_range); { - if (_source56.is_Some) { - RAST._IType _1206_v = _source56.dtor_value; - _1205_underlyingType = _1206_v; - goto after_match4; + if (_source57.is_Some) { + RAST._IType _1215_v = _source57.dtor_value; + _1214_underlyingType = _1215_v; + goto after_match5; } } { RAST._IType _out51; _out51 = (this).GenType((c).dtor_base, DCOMP.GenTypeContext.@default()); - _1205_underlyingType = _out51; - } - after_match4: ; - DAST._IType _1207_resultingType; - _1207_resultingType = DAST.Type.create_UserDefined(DAST.ResolvedType.create(Dafny.Sequence>.FromElements(), Dafny.Sequence.FromElements(), DAST.ResolvedTypeBase.create_Newtype((c).dtor_base, (c).dtor_range, false), (c).dtor_attributes, Dafny.Sequence>.FromElements(), Dafny.Sequence.FromElements())); - Dafny.ISequence _1208_newtypeName; - _1208_newtypeName = DCOMP.__default.escapeName((c).dtor_name); - s = Dafny.Sequence.FromElements(RAST.ModDecl.create_StructDecl(RAST.Struct.create(Dafny.Sequence>.FromElements(Dafny.Sequence.UnicodeFromString("#[derive(Clone, PartialEq)]"), Dafny.Sequence.UnicodeFromString("#[repr(transparent)]")), _1208_newtypeName, _1202_rTypeParamsDecls, RAST.Fields.create_NamelessFields(Dafny.Sequence.FromElements(RAST.NamelessField.create(RAST.Visibility.create_PUB(), _1205_underlyingType)))))); - RAST._IExpr _1209_fnBody; - _1209_fnBody = RAST.Expr.create_Identifier(_1208_newtypeName); - Std.Wrappers._IOption _source57 = (c).dtor_witnessExpr; - { - if (_source57.is_Some) { - DAST._IExpression _1210_e = _source57.dtor_value; + _1214_underlyingType = _out51; + } + after_match5: ; + DAST._IType _1216_resultingType; + _1216_resultingType = DAST.Type.create_UserDefined(DAST.ResolvedType.create(Dafny.Sequence>.FromElements(), Dafny.Sequence.FromElements(), DAST.ResolvedTypeBase.create_Newtype((c).dtor_base, (c).dtor_range, false), (c).dtor_attributes, Dafny.Sequence>.FromElements(), Dafny.Sequence.FromElements())); + Dafny.ISequence _1217_newtypeName; + _1217_newtypeName = DCOMP.__default.escapeName((c).dtor_name); + s = Dafny.Sequence.FromElements(RAST.ModDecl.create_StructDecl(RAST.Struct.create(Dafny.Sequence>.FromElements(Dafny.Sequence.UnicodeFromString("#[derive(Clone, PartialEq)]"), Dafny.Sequence.UnicodeFromString("#[repr(transparent)]")), _1217_newtypeName, _1211_rTypeParamsDecls, RAST.Fields.create_NamelessFields(Dafny.Sequence.FromElements(RAST.NamelessField.create(RAST.Visibility.create_PUB(), _1214_underlyingType)))))); + RAST._IExpr _1218_fnBody; + _1218_fnBody = RAST.Expr.create_Identifier(_1217_newtypeName); + Std.Wrappers._IOption _source58 = (c).dtor_witnessExpr; + { + if (_source58.is_Some) { + DAST._IExpression _1219_e = _source58.dtor_value; { - DAST._IExpression _1211_e; - if (object.Equals((c).dtor_base, _1207_resultingType)) { - _1211_e = _1210_e; + DAST._IExpression _1220_e; + if (object.Equals((c).dtor_base, _1216_resultingType)) { + _1220_e = _1219_e; } else { - _1211_e = DAST.Expression.create_Convert(_1210_e, (c).dtor_base, _1207_resultingType); + _1220_e = DAST.Expression.create_Convert(_1219_e, (c).dtor_base, _1216_resultingType); } - RAST._IExpr _1212_eStr; - DCOMP._IOwnership _1213___v55; - Dafny.ISet> _1214___v56; + RAST._IExpr _1221_eStr; + DCOMP._IOwnership _1222___v55; + Dafny.ISet> _1223___v56; RAST._IExpr _out52; DCOMP._IOwnership _out53; Dafny.ISet> _out54; - (this).GenExpr(_1211_e, DCOMP.SelfInfo.create_NoSelf(), DCOMP.Environment.Empty(), DCOMP.Ownership.create_OwnershipOwned(), out _out52, out _out53, out _out54); - _1212_eStr = _out52; - _1213___v55 = _out53; - _1214___v56 = _out54; - _1209_fnBody = (_1209_fnBody).Apply1(_1212_eStr); + (this).GenExpr(_1220_e, DCOMP.SelfInfo.create_NoSelf(), DCOMP.Environment.Empty(), DCOMP.Ownership.create_OwnershipOwned(), out _out52, out _out53, out _out54); + _1221_eStr = _out52; + _1222___v55 = _out53; + _1223___v56 = _out54; + _1218_fnBody = (_1218_fnBody).Apply1(_1221_eStr); } - goto after_match5; + goto after_match6; } } { { - _1209_fnBody = (_1209_fnBody).Apply1(RAST.__default.std__Default__default); + _1218_fnBody = (_1218_fnBody).Apply1(RAST.__default.std__Default__default); } } - after_match5: ; - RAST._IImplMember _1215_body; - _1215_body = RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("default"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(), Std.Wrappers.Option.create_Some(RAST.Type.create_SelfOwned()), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(_1209_fnBody))); - Std.Wrappers._IOption _source58 = (c).dtor_constraint; + after_match6: ; + RAST._IImplMember _1224_body; + _1224_body = RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("default"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(), Std.Wrappers.Option.create_Some(RAST.Type.create_SelfOwned()), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(_1218_fnBody))); + Std.Wrappers._IOption _source59 = (c).dtor_constraint; { - if (_source58.is_None) { - goto after_match6; + if (_source59.is_None) { + goto after_match7; } } { - DAST._INewtypeConstraint value8 = _source58.dtor_value; - DAST._IFormal _1216_formal = value8.dtor_variable; - Dafny.ISequence _1217_constraintStmts = value8.dtor_constraintStmts; - RAST._IExpr _1218_rStmts; - Dafny.ISet> _1219___v57; - DCOMP._IEnvironment _1220_newEnv; + DAST._INewtypeConstraint value8 = _source59.dtor_value; + DAST._IFormal _1225_formal = value8.dtor_variable; + Dafny.ISequence _1226_constraintStmts = value8.dtor_constraintStmts; + RAST._IExpr _1227_rStmts; + Dafny.ISet> _1228___v57; + DCOMP._IEnvironment _1229_newEnv; RAST._IExpr _out55; Dafny.ISet> _out56; DCOMP._IEnvironment _out57; - (this).GenStmts(_1217_constraintStmts, DCOMP.SelfInfo.create_NoSelf(), DCOMP.Environment.Empty(), false, Std.Wrappers.Option>>.create_None(), out _out55, out _out56, out _out57); - _1218_rStmts = _out55; - _1219___v57 = _out56; - _1220_newEnv = _out57; - Dafny.ISequence _1221_rFormals; + (this).GenStmts(_1226_constraintStmts, DCOMP.SelfInfo.create_NoSelf(), DCOMP.Environment.Empty(), false, Std.Wrappers.Option>>.create_None(), out _out55, out _out56, out _out57); + _1227_rStmts = _out55; + _1228___v57 = _out56; + _1229_newEnv = _out57; + Dafny.ISequence _1230_rFormals; Dafny.ISequence _out58; - _out58 = (this).GenParams(Dafny.Sequence.FromElements(_1216_formal)); - _1221_rFormals = _out58; - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_Impl(_1202_rTypeParamsDecls, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1208_newtypeName), _1201_rTypeParams), _1203_whereConstraints, Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PUB(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("is"), Dafny.Sequence.FromElements(), _1221_rFormals, Std.Wrappers.Option.create_Some(RAST.Type.create_Bool()), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(_1218_rStmts)))))))); + _out58 = (this).GenParams(Dafny.Sequence.FromElements(_1225_formal)); + _1230_rFormals = _out58; + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_Impl(_1211_rTypeParamsDecls, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1217_newtypeName), _1210_rTypeParams), _1212_whereConstraints, Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PUB(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("is"), Dafny.Sequence.FromElements(), _1230_rFormals, Std.Wrappers.Option.create_Some(RAST.Type.create_Bool()), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(_1227_rStmts)))))))); } - after_match6: ; - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1202_rTypeParamsDecls, RAST.__default.DefaultTrait, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1208_newtypeName), _1201_rTypeParams), _1203_whereConstraints, Dafny.Sequence.FromElements(_1215_body))))); - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1202_rTypeParamsDecls, RAST.__default.DafnyPrint, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1208_newtypeName), _1201_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("fmt_print"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed, RAST.Formal.create(Dafny.Sequence.UnicodeFromString("_formatter"), RAST.__default.RawType(Dafny.Sequence.UnicodeFromString("&mut ::std::fmt::Formatter"))), RAST.Formal.create(Dafny.Sequence.UnicodeFromString("in_seq"), RAST.Type.create_Bool())), Std.Wrappers.Option.create_Some(RAST.__default.RawType(Dafny.Sequence.UnicodeFromString("::std::fmt::Result"))), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("::dafny_runtime::DafnyPrint::fmt_print(&self.0, _formatter, in_seq)")))))))))); - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1202_rTypeParamsDecls, RAST.__default.RawType(Dafny.Sequence.UnicodeFromString("::std::ops::Deref")), RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1208_newtypeName), _1201_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_RawImplMember(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("type Target = "), (_1205_underlyingType)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(";"))), RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("deref"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed), Std.Wrappers.Option.create_Some((RAST.__default.SelfBorrowed).MSel(Dafny.Sequence.UnicodeFromString("Target"))), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("&self.0")))))))))); + after_match7: ; + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1211_rTypeParamsDecls, RAST.__default.DefaultTrait, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1217_newtypeName), _1210_rTypeParams), _1212_whereConstraints, Dafny.Sequence.FromElements(_1224_body))))); + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1211_rTypeParamsDecls, RAST.__default.DafnyPrint, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1217_newtypeName), _1210_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("fmt_print"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed, RAST.Formal.create(Dafny.Sequence.UnicodeFromString("_formatter"), RAST.__default.RawType(Dafny.Sequence.UnicodeFromString("&mut ::std::fmt::Formatter"))), RAST.Formal.create(Dafny.Sequence.UnicodeFromString("in_seq"), RAST.Type.create_Bool())), Std.Wrappers.Option.create_Some(RAST.__default.RawType(Dafny.Sequence.UnicodeFromString("::std::fmt::Result"))), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("::dafny_runtime::DafnyPrint::fmt_print(&self.0, _formatter, in_seq)")))))))))); + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1211_rTypeParamsDecls, RAST.__default.RawType(Dafny.Sequence.UnicodeFromString("::std::ops::Deref")), RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1217_newtypeName), _1210_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_RawImplMember(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("type Target = "), (_1214_underlyingType)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(";"))), RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("deref"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed), Std.Wrappers.Option.create_Some((RAST.__default.SelfBorrowed).MSel(Dafny.Sequence.UnicodeFromString("Target"))), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("&self.0")))))))))); return s; } public Dafny.ISequence GenSynonymType(DAST._ISynonymType c) { Dafny.ISequence s = Dafny.Sequence.Empty; - Dafny.ISequence _1222_typeParamsSeq; - Dafny.ISequence _1223_rTypeParams; - Dafny.ISequence _1224_rTypeParamsDecls; - Dafny.ISequence _1225_whereConstraints; + Dafny.ISequence _1231_typeParamsSeq; + Dafny.ISequence _1232_rTypeParams; + Dafny.ISequence _1233_rTypeParamsDecls; + Dafny.ISequence _1234_whereConstraints; Dafny.ISequence _out59; Dafny.ISequence _out60; Dafny.ISequence _out61; Dafny.ISequence _out62; (this).GenTypeParameters((c).dtor_typeParams, out _out59, out _out60, out _out61, out _out62); - _1222_typeParamsSeq = _out59; - _1223_rTypeParams = _out60; - _1224_rTypeParamsDecls = _out61; - _1225_whereConstraints = _out62; - Dafny.ISequence _1226_constrainedTypeParams; - _1226_constrainedTypeParams = RAST.TypeParamDecl.ToStringMultiple(_1224_rTypeParamsDecls, Dafny.Sequence.Concat(RAST.__default.IND, RAST.__default.IND)); - Dafny.ISequence _1227_synonymTypeName; - _1227_synonymTypeName = DCOMP.__default.escapeName((c).dtor_name); - RAST._IType _1228_resultingType; + _1231_typeParamsSeq = _out59; + _1232_rTypeParams = _out60; + _1233_rTypeParamsDecls = _out61; + _1234_whereConstraints = _out62; + Dafny.ISequence _1235_constrainedTypeParams; + _1235_constrainedTypeParams = RAST.TypeParamDecl.ToStringMultiple(_1233_rTypeParamsDecls, Dafny.Sequence.Concat(RAST.__default.IND, RAST.__default.IND)); + Dafny.ISequence _1236_synonymTypeName; + _1236_synonymTypeName = DCOMP.__default.escapeName((c).dtor_name); + RAST._IType _1237_resultingType; RAST._IType _out63; _out63 = (this).GenType((c).dtor_base, DCOMP.GenTypeContext.@default()); - _1228_resultingType = _out63; - s = Dafny.Sequence.FromElements(RAST.ModDecl.create_TypeDecl(RAST.TypeSynonym.create(Dafny.Sequence>.FromElements(), _1227_synonymTypeName, _1224_rTypeParamsDecls, _1228_resultingType))); - Std.Wrappers._IOption _source59 = (c).dtor_witnessExpr; + _1237_resultingType = _out63; + s = Dafny.Sequence.FromElements(RAST.ModDecl.create_TypeDecl(RAST.TypeSynonym.create(Dafny.Sequence>.FromElements(), _1236_synonymTypeName, _1233_rTypeParamsDecls, _1237_resultingType))); + Std.Wrappers._IOption _source60 = (c).dtor_witnessExpr; { - if (_source59.is_Some) { - DAST._IExpression _1229_e = _source59.dtor_value; + if (_source60.is_Some) { + DAST._IExpression _1238_e = _source60.dtor_value; { - RAST._IExpr _1230_rStmts; - Dafny.ISet> _1231___v58; - DCOMP._IEnvironment _1232_newEnv; + RAST._IExpr _1239_rStmts; + Dafny.ISet> _1240___v58; + DCOMP._IEnvironment _1241_newEnv; RAST._IExpr _out64; Dafny.ISet> _out65; DCOMP._IEnvironment _out66; (this).GenStmts((c).dtor_witnessStmts, DCOMP.SelfInfo.create_NoSelf(), DCOMP.Environment.Empty(), false, Std.Wrappers.Option>>.create_None(), out _out64, out _out65, out _out66); - _1230_rStmts = _out64; - _1231___v58 = _out65; - _1232_newEnv = _out66; - RAST._IExpr _1233_rExpr; - DCOMP._IOwnership _1234___v59; - Dafny.ISet> _1235___v60; + _1239_rStmts = _out64; + _1240___v58 = _out65; + _1241_newEnv = _out66; + RAST._IExpr _1242_rExpr; + DCOMP._IOwnership _1243___v59; + Dafny.ISet> _1244___v60; RAST._IExpr _out67; DCOMP._IOwnership _out68; Dafny.ISet> _out69; - (this).GenExpr(_1229_e, DCOMP.SelfInfo.create_NoSelf(), _1232_newEnv, DCOMP.Ownership.create_OwnershipOwned(), out _out67, out _out68, out _out69); - _1233_rExpr = _out67; - _1234___v59 = _out68; - _1235___v60 = _out69; - Dafny.ISequence _1236_constantName; - _1236_constantName = DCOMP.__default.escapeName(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("_init_"), ((c).dtor_name))); - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_TopFnDecl(RAST.TopFnDecl.create(Dafny.Sequence>.FromElements(), RAST.Visibility.create_PUB(), RAST.Fn.create(_1236_constantName, Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(), Std.Wrappers.Option.create_Some(_1228_resultingType), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some((_1230_rStmts).Then(_1233_rExpr))))))); + (this).GenExpr(_1238_e, DCOMP.SelfInfo.create_NoSelf(), _1241_newEnv, DCOMP.Ownership.create_OwnershipOwned(), out _out67, out _out68, out _out69); + _1242_rExpr = _out67; + _1243___v59 = _out68; + _1244___v60 = _out69; + Dafny.ISequence _1245_constantName; + _1245_constantName = DCOMP.__default.escapeName(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("_init_"), ((c).dtor_name))); + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_TopFnDecl(RAST.TopFnDecl.create(Dafny.Sequence>.FromElements(), RAST.Visibility.create_PUB(), RAST.Fn.create(_1245_constantName, Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(), Std.Wrappers.Option.create_Some(_1237_resultingType), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some((_1239_rStmts).Then(_1242_rExpr))))))); } - goto after_match7; + goto after_match8; } } { } - after_match7: ; + after_match8: ; return s; } public bool TypeIsEq(DAST._IType t) { - DAST._IType _source60 = t; + DAST._IType _source61 = t; { - if (_source60.is_UserDefined) { + if (_source61.is_UserDefined) { return true; } } { - if (_source60.is_Tuple) { - Dafny.ISequence _1237_ts = _source60.dtor_Tuple_a0; - return Dafny.Helpers.Id, bool>>((_1238_ts) => Dafny.Helpers.Quantifier((_1238_ts).UniqueElements, true, (((_forall_var_5) => { - DAST._IType _1239_t = (DAST._IType)_forall_var_5; - return !((_1238_ts).Contains(_1239_t)) || ((this).TypeIsEq(_1239_t)); - }))))(_1237_ts); + if (_source61.is_Tuple) { + Dafny.ISequence _1246_ts = _source61.dtor_Tuple_a0; + return Dafny.Helpers.Id, bool>>((_1247_ts) => Dafny.Helpers.Quantifier((_1247_ts).UniqueElements, true, (((_forall_var_5) => { + DAST._IType _1248_t = (DAST._IType)_forall_var_5; + return !((_1247_ts).Contains(_1248_t)) || ((this).TypeIsEq(_1248_t)); + }))))(_1246_ts); } } { - if (_source60.is_Array) { - DAST._IType _1240_t = _source60.dtor_element; - return (this).TypeIsEq(_1240_t); + if (_source61.is_Array) { + DAST._IType _1249_t = _source61.dtor_element; + return (this).TypeIsEq(_1249_t); } } { - if (_source60.is_Seq) { - DAST._IType _1241_t = _source60.dtor_element; - return (this).TypeIsEq(_1241_t); + if (_source61.is_Seq) { + DAST._IType _1250_t = _source61.dtor_element; + return (this).TypeIsEq(_1250_t); } } { - if (_source60.is_Set) { - DAST._IType _1242_t = _source60.dtor_element; - return (this).TypeIsEq(_1242_t); + if (_source61.is_Set) { + DAST._IType _1251_t = _source61.dtor_element; + return (this).TypeIsEq(_1251_t); } } { - if (_source60.is_Multiset) { - DAST._IType _1243_t = _source60.dtor_element; - return (this).TypeIsEq(_1243_t); + if (_source61.is_Multiset) { + DAST._IType _1252_t = _source61.dtor_element; + return (this).TypeIsEq(_1252_t); } } { - if (_source60.is_Map) { - DAST._IType _1244_k = _source60.dtor_key; - DAST._IType _1245_v = _source60.dtor_value; - return ((this).TypeIsEq(_1244_k)) && ((this).TypeIsEq(_1245_v)); + if (_source61.is_Map) { + DAST._IType _1253_k = _source61.dtor_key; + DAST._IType _1254_v = _source61.dtor_value; + return ((this).TypeIsEq(_1253_k)) && ((this).TypeIsEq(_1254_v)); } } { - if (_source60.is_SetBuilder) { - DAST._IType _1246_t = _source60.dtor_element; - return (this).TypeIsEq(_1246_t); + if (_source61.is_SetBuilder) { + DAST._IType _1255_t = _source61.dtor_element; + return (this).TypeIsEq(_1255_t); } } { - if (_source60.is_MapBuilder) { - DAST._IType _1247_k = _source60.dtor_key; - DAST._IType _1248_v = _source60.dtor_value; - return ((this).TypeIsEq(_1247_k)) && ((this).TypeIsEq(_1248_v)); + if (_source61.is_MapBuilder) { + DAST._IType _1256_k = _source61.dtor_key; + DAST._IType _1257_v = _source61.dtor_value; + return ((this).TypeIsEq(_1256_k)) && ((this).TypeIsEq(_1257_v)); } } { - if (_source60.is_Arrow) { + if (_source61.is_Arrow) { return false; } } { - if (_source60.is_Primitive) { + if (_source61.is_Primitive) { return true; } } { - if (_source60.is_Passthrough) { + if (_source61.is_Passthrough) { return true; } } { - if (_source60.is_TypeArg) { - Dafny.ISequence _1249_i = _source60.dtor_TypeArg_a0; + if (_source61.is_TypeArg) { + Dafny.ISequence _1258_i = _source61.dtor_TypeArg_a0; return true; } } @@ -1352,376 +1383,376 @@ public bool TypeIsEq(DAST._IType t) { } } public bool DatatypeIsEq(DAST._IDatatype c) { - return (!((c).dtor_isCo)) && (Dafny.Helpers.Id>((_1250_c) => Dafny.Helpers.Quantifier(((_1250_c).dtor_ctors).UniqueElements, true, (((_forall_var_6) => { - DAST._IDatatypeCtor _1251_ctor = (DAST._IDatatypeCtor)_forall_var_6; - return Dafny.Helpers.Quantifier(((_1251_ctor).dtor_args).UniqueElements, true, (((_forall_var_7) => { - DAST._IDatatypeDtor _1252_arg = (DAST._IDatatypeDtor)_forall_var_7; - return !((((_1250_c).dtor_ctors).Contains(_1251_ctor)) && (((_1251_ctor).dtor_args).Contains(_1252_arg))) || ((this).TypeIsEq(((_1252_arg).dtor_formal).dtor_typ)); + return (!((c).dtor_isCo)) && (Dafny.Helpers.Id>((_1259_c) => Dafny.Helpers.Quantifier(((_1259_c).dtor_ctors).UniqueElements, true, (((_forall_var_6) => { + DAST._IDatatypeCtor _1260_ctor = (DAST._IDatatypeCtor)_forall_var_6; + return Dafny.Helpers.Quantifier(((_1260_ctor).dtor_args).UniqueElements, true, (((_forall_var_7) => { + DAST._IDatatypeDtor _1261_arg = (DAST._IDatatypeDtor)_forall_var_7; + return !((((_1259_c).dtor_ctors).Contains(_1260_ctor)) && (((_1260_ctor).dtor_args).Contains(_1261_arg))) || ((this).TypeIsEq(((_1261_arg).dtor_formal).dtor_typ)); }))); }))))(c)); } public Dafny.ISequence GenDatatype(DAST._IDatatype c) { Dafny.ISequence s = Dafny.Sequence.Empty; - Dafny.ISequence _1253_typeParamsSeq; - Dafny.ISequence _1254_rTypeParams; - Dafny.ISequence _1255_rTypeParamsDecls; - Dafny.ISequence _1256_whereConstraints; + Dafny.ISequence _1262_typeParamsSeq; + Dafny.ISequence _1263_rTypeParams; + Dafny.ISequence _1264_rTypeParamsDecls; + Dafny.ISequence _1265_whereConstraints; Dafny.ISequence _out70; Dafny.ISequence _out71; Dafny.ISequence _out72; Dafny.ISequence _out73; (this).GenTypeParameters((c).dtor_typeParams, out _out70, out _out71, out _out72, out _out73); - _1253_typeParamsSeq = _out70; - _1254_rTypeParams = _out71; - _1255_rTypeParamsDecls = _out72; - _1256_whereConstraints = _out73; - Dafny.ISequence _1257_datatypeName; - _1257_datatypeName = DCOMP.__default.escapeName((c).dtor_name); - Dafny.ISequence _1258_ctors; - _1258_ctors = Dafny.Sequence.FromElements(); - Dafny.ISequence _1259_variances; - _1259_variances = Std.Collections.Seq.__default.Map(((System.Func)((_1260_typeParamDecl) => { - return (_1260_typeParamDecl).dtor_variance; + _1262_typeParamsSeq = _out70; + _1263_rTypeParams = _out71; + _1264_rTypeParamsDecls = _out72; + _1265_whereConstraints = _out73; + Dafny.ISequence _1266_datatypeName; + _1266_datatypeName = DCOMP.__default.escapeName((c).dtor_name); + Dafny.ISequence _1267_ctors; + _1267_ctors = Dafny.Sequence.FromElements(); + Dafny.ISequence _1268_variances; + _1268_variances = Std.Collections.Seq.__default.Map(((System.Func)((_1269_typeParamDecl) => { + return (_1269_typeParamDecl).dtor_variance; })), (c).dtor_typeParams); - BigInteger _hi12 = new BigInteger(((c).dtor_ctors).Count); - for (BigInteger _1261_i = BigInteger.Zero; _1261_i < _hi12; _1261_i++) { - DAST._IDatatypeCtor _1262_ctor; - _1262_ctor = ((c).dtor_ctors).Select(_1261_i); - Dafny.ISequence _1263_ctorArgs; - _1263_ctorArgs = Dafny.Sequence.FromElements(); - bool _1264_isNumeric; - _1264_isNumeric = false; - BigInteger _hi13 = new BigInteger(((_1262_ctor).dtor_args).Count); - for (BigInteger _1265_j = BigInteger.Zero; _1265_j < _hi13; _1265_j++) { - DAST._IDatatypeDtor _1266_dtor; - _1266_dtor = ((_1262_ctor).dtor_args).Select(_1265_j); - RAST._IType _1267_formalType; + BigInteger _hi13 = new BigInteger(((c).dtor_ctors).Count); + for (BigInteger _1270_i = BigInteger.Zero; _1270_i < _hi13; _1270_i++) { + DAST._IDatatypeCtor _1271_ctor; + _1271_ctor = ((c).dtor_ctors).Select(_1270_i); + Dafny.ISequence _1272_ctorArgs; + _1272_ctorArgs = Dafny.Sequence.FromElements(); + bool _1273_isNumeric; + _1273_isNumeric = false; + BigInteger _hi14 = new BigInteger(((_1271_ctor).dtor_args).Count); + for (BigInteger _1274_j = BigInteger.Zero; _1274_j < _hi14; _1274_j++) { + DAST._IDatatypeDtor _1275_dtor; + _1275_dtor = ((_1271_ctor).dtor_args).Select(_1274_j); + RAST._IType _1276_formalType; RAST._IType _out74; - _out74 = (this).GenType(((_1266_dtor).dtor_formal).dtor_typ, DCOMP.GenTypeContext.@default()); - _1267_formalType = _out74; - Dafny.ISequence _1268_formalName; - _1268_formalName = DCOMP.__default.escapeName(((_1266_dtor).dtor_formal).dtor_name); - if (((_1265_j).Sign == 0) && ((Dafny.Sequence.UnicodeFromString("0")).Equals(_1268_formalName))) { - _1264_isNumeric = true; + _out74 = (this).GenType(((_1275_dtor).dtor_formal).dtor_typ, DCOMP.GenTypeContext.@default()); + _1276_formalType = _out74; + Dafny.ISequence _1277_formalName; + _1277_formalName = DCOMP.__default.escapeName(((_1275_dtor).dtor_formal).dtor_name); + if (((_1274_j).Sign == 0) && ((Dafny.Sequence.UnicodeFromString("0")).Equals(_1277_formalName))) { + _1273_isNumeric = true; } - if ((((_1265_j).Sign != 0) && (_1264_isNumeric)) && (!(Std.Strings.__default.OfNat(_1265_j)).Equals(_1268_formalName))) { - (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Formal extern names were supposed to be numeric but got "), _1268_formalName), Dafny.Sequence.UnicodeFromString(" instead of ")), Std.Strings.__default.OfNat(_1265_j))); - _1264_isNumeric = false; + if ((((_1274_j).Sign != 0) && (_1273_isNumeric)) && (!(Std.Strings.__default.OfNat(_1274_j)).Equals(_1277_formalName))) { + (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Formal extern names were supposed to be numeric but got "), _1277_formalName), Dafny.Sequence.UnicodeFromString(" instead of ")), Std.Strings.__default.OfNat(_1274_j))); + _1273_isNumeric = false; } if ((c).dtor_isCo) { - _1263_ctorArgs = Dafny.Sequence.Concat(_1263_ctorArgs, Dafny.Sequence.FromElements(RAST.Field.create(RAST.Visibility.create_PRIV(), RAST.Formal.create(_1268_formalName, RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("LazyFieldWrapper")), Dafny.Sequence.FromElements(_1267_formalType)))))); + _1272_ctorArgs = Dafny.Sequence.Concat(_1272_ctorArgs, Dafny.Sequence.FromElements(RAST.Field.create(RAST.Visibility.create_PRIV(), RAST.Formal.create(_1277_formalName, RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("LazyFieldWrapper")), Dafny.Sequence.FromElements(_1276_formalType)))))); } else { - _1263_ctorArgs = Dafny.Sequence.Concat(_1263_ctorArgs, Dafny.Sequence.FromElements(RAST.Field.create(RAST.Visibility.create_PRIV(), RAST.Formal.create(_1268_formalName, _1267_formalType)))); + _1272_ctorArgs = Dafny.Sequence.Concat(_1272_ctorArgs, Dafny.Sequence.FromElements(RAST.Field.create(RAST.Visibility.create_PRIV(), RAST.Formal.create(_1277_formalName, _1276_formalType)))); } } - RAST._IFields _1269_namedFields; - _1269_namedFields = RAST.Fields.create_NamedFields(_1263_ctorArgs); - if (_1264_isNumeric) { - _1269_namedFields = (_1269_namedFields).ToNamelessFields(); + RAST._IFields _1278_namedFields; + _1278_namedFields = RAST.Fields.create_NamedFields(_1272_ctorArgs); + if (_1273_isNumeric) { + _1278_namedFields = (_1278_namedFields).ToNamelessFields(); } - _1258_ctors = Dafny.Sequence.Concat(_1258_ctors, Dafny.Sequence.FromElements(RAST.EnumCase.create(DCOMP.__default.escapeName((_1262_ctor).dtor_name), _1269_namedFields))); + _1267_ctors = Dafny.Sequence.Concat(_1267_ctors, Dafny.Sequence.FromElements(RAST.EnumCase.create(DCOMP.__default.escapeName((_1271_ctor).dtor_name), _1278_namedFields))); } - Dafny.ISequence> _1270_selfPath; - _1270_selfPath = Dafny.Sequence>.FromElements((c).dtor_name); - Dafny.ISequence _1271_implBodyRaw; - Dafny.IMap>,Dafny.ISequence> _1272_traitBodies; + Dafny.ISequence> _1279_selfPath; + _1279_selfPath = Dafny.Sequence>.FromElements((c).dtor_name); + Dafny.ISequence _1280_implBodyRaw; + Dafny.IMap>,Dafny.ISequence> _1281_traitBodies; Dafny.ISequence _out75; Dafny.IMap>,Dafny.ISequence> _out76; - (this).GenClassImplBody((c).dtor_body, false, DAST.Type.create_UserDefined(DAST.ResolvedType.create(_1270_selfPath, _1253_typeParamsSeq, DAST.ResolvedTypeBase.create_Datatype(_1259_variances), (c).dtor_attributes, Dafny.Sequence>.FromElements(), Dafny.Sequence.FromElements())), _1253_typeParamsSeq, out _out75, out _out76); - _1271_implBodyRaw = _out75; - _1272_traitBodies = _out76; - Dafny.ISequence _1273_implBody; - _1273_implBody = _1271_implBodyRaw; - Dafny.ISet> _1274_emittedFields; - _1274_emittedFields = Dafny.Set>.FromElements(); - BigInteger _hi14 = new BigInteger(((c).dtor_ctors).Count); - for (BigInteger _1275_i = BigInteger.Zero; _1275_i < _hi14; _1275_i++) { - DAST._IDatatypeCtor _1276_ctor; - _1276_ctor = ((c).dtor_ctors).Select(_1275_i); - BigInteger _hi15 = new BigInteger(((_1276_ctor).dtor_args).Count); - for (BigInteger _1277_j = BigInteger.Zero; _1277_j < _hi15; _1277_j++) { - DAST._IDatatypeDtor _1278_dtor; - _1278_dtor = ((_1276_ctor).dtor_args).Select(_1277_j); - Dafny.ISequence _1279_callName; - _1279_callName = Std.Wrappers.Option>.GetOr((_1278_dtor).dtor_callName, DCOMP.__default.escapeName(((_1278_dtor).dtor_formal).dtor_name)); - if (!((_1274_emittedFields).Contains(_1279_callName))) { - _1274_emittedFields = Dafny.Set>.Union(_1274_emittedFields, Dafny.Set>.FromElements(_1279_callName)); - RAST._IType _1280_formalType; + (this).GenClassImplBody((c).dtor_body, false, DAST.Type.create_UserDefined(DAST.ResolvedType.create(_1279_selfPath, _1262_typeParamsSeq, DAST.ResolvedTypeBase.create_Datatype(_1268_variances), (c).dtor_attributes, Dafny.Sequence>.FromElements(), Dafny.Sequence.FromElements())), _1262_typeParamsSeq, out _out75, out _out76); + _1280_implBodyRaw = _out75; + _1281_traitBodies = _out76; + Dafny.ISequence _1282_implBody; + _1282_implBody = _1280_implBodyRaw; + Dafny.ISet> _1283_emittedFields; + _1283_emittedFields = Dafny.Set>.FromElements(); + BigInteger _hi15 = new BigInteger(((c).dtor_ctors).Count); + for (BigInteger _1284_i = BigInteger.Zero; _1284_i < _hi15; _1284_i++) { + DAST._IDatatypeCtor _1285_ctor; + _1285_ctor = ((c).dtor_ctors).Select(_1284_i); + BigInteger _hi16 = new BigInteger(((_1285_ctor).dtor_args).Count); + for (BigInteger _1286_j = BigInteger.Zero; _1286_j < _hi16; _1286_j++) { + DAST._IDatatypeDtor _1287_dtor; + _1287_dtor = ((_1285_ctor).dtor_args).Select(_1286_j); + Dafny.ISequence _1288_callName; + _1288_callName = Std.Wrappers.Option>.GetOr((_1287_dtor).dtor_callName, DCOMP.__default.escapeName(((_1287_dtor).dtor_formal).dtor_name)); + if (!((_1283_emittedFields).Contains(_1288_callName))) { + _1283_emittedFields = Dafny.Set>.Union(_1283_emittedFields, Dafny.Set>.FromElements(_1288_callName)); + RAST._IType _1289_formalType; RAST._IType _out77; - _out77 = (this).GenType(((_1278_dtor).dtor_formal).dtor_typ, DCOMP.GenTypeContext.@default()); - _1280_formalType = _out77; - Dafny.ISequence _1281_cases; - _1281_cases = Dafny.Sequence.FromElements(); - BigInteger _hi16 = new BigInteger(((c).dtor_ctors).Count); - for (BigInteger _1282_k = BigInteger.Zero; _1282_k < _hi16; _1282_k++) { - DAST._IDatatypeCtor _1283_ctor2; - _1283_ctor2 = ((c).dtor_ctors).Select(_1282_k); - Dafny.ISequence _1284_pattern; - _1284_pattern = Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1257_datatypeName, Dafny.Sequence.UnicodeFromString("::")), DCOMP.__default.escapeName((_1283_ctor2).dtor_name)); - Dafny.ISequence _1285_rhs = Dafny.Sequence.Empty; - Std.Wrappers._IOption> _1286_hasMatchingField; - _1286_hasMatchingField = Std.Wrappers.Option>.create_None(); - Dafny.ISequence _1287_patternInner; - _1287_patternInner = Dafny.Sequence.UnicodeFromString(""); - bool _1288_isNumeric; - _1288_isNumeric = false; - BigInteger _hi17 = new BigInteger(((_1283_ctor2).dtor_args).Count); - for (BigInteger _1289_l = BigInteger.Zero; _1289_l < _hi17; _1289_l++) { - DAST._IDatatypeDtor _1290_dtor2; - _1290_dtor2 = ((_1283_ctor2).dtor_args).Select(_1289_l); - Dafny.ISequence _1291_patternName; - _1291_patternName = DCOMP.__default.escapeDtor(((_1290_dtor2).dtor_formal).dtor_name); - Dafny.ISequence _1292_varName; - _1292_varName = DCOMP.__default.escapeField(((_1290_dtor2).dtor_formal).dtor_name); - if (((_1289_l).Sign == 0) && ((_1291_patternName).Equals(Dafny.Sequence.UnicodeFromString("0")))) { - _1288_isNumeric = true; + _out77 = (this).GenType(((_1287_dtor).dtor_formal).dtor_typ, DCOMP.GenTypeContext.@default()); + _1289_formalType = _out77; + Dafny.ISequence _1290_cases; + _1290_cases = Dafny.Sequence.FromElements(); + BigInteger _hi17 = new BigInteger(((c).dtor_ctors).Count); + for (BigInteger _1291_k = BigInteger.Zero; _1291_k < _hi17; _1291_k++) { + DAST._IDatatypeCtor _1292_ctor2; + _1292_ctor2 = ((c).dtor_ctors).Select(_1291_k); + Dafny.ISequence _1293_pattern; + _1293_pattern = Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1266_datatypeName, Dafny.Sequence.UnicodeFromString("::")), DCOMP.__default.escapeName((_1292_ctor2).dtor_name)); + Dafny.ISequence _1294_rhs = Dafny.Sequence.Empty; + Std.Wrappers._IOption> _1295_hasMatchingField; + _1295_hasMatchingField = Std.Wrappers.Option>.create_None(); + Dafny.ISequence _1296_patternInner; + _1296_patternInner = Dafny.Sequence.UnicodeFromString(""); + bool _1297_isNumeric; + _1297_isNumeric = false; + BigInteger _hi18 = new BigInteger(((_1292_ctor2).dtor_args).Count); + for (BigInteger _1298_l = BigInteger.Zero; _1298_l < _hi18; _1298_l++) { + DAST._IDatatypeDtor _1299_dtor2; + _1299_dtor2 = ((_1292_ctor2).dtor_args).Select(_1298_l); + Dafny.ISequence _1300_patternName; + _1300_patternName = DCOMP.__default.escapeDtor(((_1299_dtor2).dtor_formal).dtor_name); + Dafny.ISequence _1301_varName; + _1301_varName = DCOMP.__default.escapeField(((_1299_dtor2).dtor_formal).dtor_name); + if (((_1298_l).Sign == 0) && ((_1300_patternName).Equals(Dafny.Sequence.UnicodeFromString("0")))) { + _1297_isNumeric = true; } - if (_1288_isNumeric) { - _1291_patternName = Std.Wrappers.Option>.GetOr((_1290_dtor2).dtor_callName, Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("v"), Std.Strings.__default.OfNat(_1289_l))); - _1292_varName = _1291_patternName; + if (_1297_isNumeric) { + _1300_patternName = Std.Wrappers.Option>.GetOr((_1299_dtor2).dtor_callName, Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("v"), Std.Strings.__default.OfNat(_1298_l))); + _1301_varName = _1300_patternName; } - if (object.Equals(((_1278_dtor).dtor_formal).dtor_name, ((_1290_dtor2).dtor_formal).dtor_name)) { - _1286_hasMatchingField = Std.Wrappers.Option>.create_Some(_1292_varName); + if (object.Equals(((_1287_dtor).dtor_formal).dtor_name, ((_1299_dtor2).dtor_formal).dtor_name)) { + _1295_hasMatchingField = Std.Wrappers.Option>.create_Some(_1301_varName); } - _1287_patternInner = Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1287_patternInner, _1291_patternName), Dafny.Sequence.UnicodeFromString(", ")); + _1296_patternInner = Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1296_patternInner, _1300_patternName), Dafny.Sequence.UnicodeFromString(", ")); } - if (_1288_isNumeric) { - _1284_pattern = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1284_pattern, Dafny.Sequence.UnicodeFromString("(")), _1287_patternInner), Dafny.Sequence.UnicodeFromString(")")); + if (_1297_isNumeric) { + _1293_pattern = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1293_pattern, Dafny.Sequence.UnicodeFromString("(")), _1296_patternInner), Dafny.Sequence.UnicodeFromString(")")); } else { - _1284_pattern = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1284_pattern, Dafny.Sequence.UnicodeFromString("{")), _1287_patternInner), Dafny.Sequence.UnicodeFromString("}")); + _1293_pattern = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1293_pattern, Dafny.Sequence.UnicodeFromString("{")), _1296_patternInner), Dafny.Sequence.UnicodeFromString("}")); } - if ((_1286_hasMatchingField).is_Some) { + if ((_1295_hasMatchingField).is_Some) { if ((c).dtor_isCo) { - _1285_rhs = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::std::ops::Deref::deref(&"), (_1286_hasMatchingField).dtor_value), Dafny.Sequence.UnicodeFromString(".0)")); + _1294_rhs = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::std::ops::Deref::deref(&"), (_1295_hasMatchingField).dtor_value), Dafny.Sequence.UnicodeFromString(".0)")); } else { - _1285_rhs = Dafny.Sequence.Concat((_1286_hasMatchingField).dtor_value, Dafny.Sequence.UnicodeFromString("")); + _1294_rhs = Dafny.Sequence.Concat((_1295_hasMatchingField).dtor_value, Dafny.Sequence.UnicodeFromString("")); } } else { - _1285_rhs = (this).UnreachablePanicIfVerified(Dafny.Sequence.UnicodeFromString("field does not exist on this variant")); + _1294_rhs = (this).UnreachablePanicIfVerified(Dafny.Sequence.UnicodeFromString("field does not exist on this variant")); } - RAST._IMatchCase _1293_ctorMatch; - _1293_ctorMatch = RAST.MatchCase.create(_1284_pattern, RAST.Expr.create_RawExpr(_1285_rhs)); - _1281_cases = Dafny.Sequence.Concat(_1281_cases, Dafny.Sequence.FromElements(_1293_ctorMatch)); + RAST._IMatchCase _1302_ctorMatch; + _1302_ctorMatch = RAST.MatchCase.create(_1293_pattern, RAST.Expr.create_RawExpr(_1294_rhs)); + _1290_cases = Dafny.Sequence.Concat(_1290_cases, Dafny.Sequence.FromElements(_1302_ctorMatch)); } if ((new BigInteger(((c).dtor_typeParams).Count)).Sign == 1) { - _1281_cases = Dafny.Sequence.Concat(_1281_cases, Dafny.Sequence.FromElements(RAST.MatchCase.create(Dafny.Sequence.Concat(_1257_datatypeName, Dafny.Sequence.UnicodeFromString("::_PhantomVariant(..)")), RAST.Expr.create_RawExpr((this).UnreachablePanicIfVerified(Dafny.Sequence.UnicodeFromString("")))))); + _1290_cases = Dafny.Sequence.Concat(_1290_cases, Dafny.Sequence.FromElements(RAST.MatchCase.create(Dafny.Sequence.Concat(_1266_datatypeName, Dafny.Sequence.UnicodeFromString("::_PhantomVariant(..)")), RAST.Expr.create_RawExpr((this).UnreachablePanicIfVerified(Dafny.Sequence.UnicodeFromString("")))))); } - RAST._IExpr _1294_methodBody; - _1294_methodBody = RAST.Expr.create_Match(RAST.__default.self, _1281_cases); - _1273_implBody = Dafny.Sequence.Concat(_1273_implBody, Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PUB(), RAST.Fn.create(_1279_callName, Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed), Std.Wrappers.Option.create_Some(RAST.Type.create_Borrowed(_1280_formalType)), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(_1294_methodBody))))); - } - } - } - Dafny.ISequence _1295_coerceTypes; - _1295_coerceTypes = Dafny.Sequence.FromElements(); - Dafny.ISequence _1296_rCoerceTypeParams; - _1296_rCoerceTypeParams = Dafny.Sequence.FromElements(); - Dafny.ISequence _1297_coerceArguments; - _1297_coerceArguments = Dafny.Sequence.FromElements(); - Dafny.IMap _1298_coerceMap; - _1298_coerceMap = Dafny.Map.FromElements(); - Dafny.IMap _1299_rCoerceMap; - _1299_rCoerceMap = Dafny.Map.FromElements(); - Dafny.IMap<_System._ITuple2,RAST._IExpr> _1300_coerceMapToArg; - _1300_coerceMapToArg = Dafny.Map<_System._ITuple2, RAST._IExpr>.FromElements(); + RAST._IExpr _1303_methodBody; + _1303_methodBody = RAST.Expr.create_Match(RAST.__default.self, _1290_cases); + _1282_implBody = Dafny.Sequence.Concat(_1282_implBody, Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PUB(), RAST.Fn.create(_1288_callName, Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed), Std.Wrappers.Option.create_Some(RAST.Type.create_Borrowed(_1289_formalType)), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(_1303_methodBody))))); + } + } + } + Dafny.ISequence _1304_coerceTypes; + _1304_coerceTypes = Dafny.Sequence.FromElements(); + Dafny.ISequence _1305_rCoerceTypeParams; + _1305_rCoerceTypeParams = Dafny.Sequence.FromElements(); + Dafny.ISequence _1306_coerceArguments; + _1306_coerceArguments = Dafny.Sequence.FromElements(); + Dafny.IMap _1307_coerceMap; + _1307_coerceMap = Dafny.Map.FromElements(); + Dafny.IMap _1308_rCoerceMap; + _1308_rCoerceMap = Dafny.Map.FromElements(); + Dafny.IMap<_System._ITuple2,RAST._IExpr> _1309_coerceMapToArg; + _1309_coerceMapToArg = Dafny.Map<_System._ITuple2, RAST._IExpr>.FromElements(); if ((new BigInteger(((c).dtor_typeParams).Count)).Sign == 1) { - Dafny.ISequence _1301_types; - _1301_types = Dafny.Sequence.FromElements(); - BigInteger _hi18 = new BigInteger(((c).dtor_typeParams).Count); - for (BigInteger _1302_typeI = BigInteger.Zero; _1302_typeI < _hi18; _1302_typeI++) { - DAST._ITypeArgDecl _1303_typeParam; - _1303_typeParam = ((c).dtor_typeParams).Select(_1302_typeI); - DAST._IType _1304_typeArg; - RAST._ITypeParamDecl _1305_rTypeParamDecl; + Dafny.ISequence _1310_types; + _1310_types = Dafny.Sequence.FromElements(); + BigInteger _hi19 = new BigInteger(((c).dtor_typeParams).Count); + for (BigInteger _1311_typeI = BigInteger.Zero; _1311_typeI < _hi19; _1311_typeI++) { + DAST._ITypeArgDecl _1312_typeParam; + _1312_typeParam = ((c).dtor_typeParams).Select(_1311_typeI); + DAST._IType _1313_typeArg; + RAST._ITypeParamDecl _1314_rTypeParamDecl; DAST._IType _out78; RAST._ITypeParamDecl _out79; - (this).GenTypeParam(_1303_typeParam, out _out78, out _out79); - _1304_typeArg = _out78; - _1305_rTypeParamDecl = _out79; - RAST._IType _1306_rTypeArg; + (this).GenTypeParam(_1312_typeParam, out _out78, out _out79); + _1313_typeArg = _out78; + _1314_rTypeParamDecl = _out79; + RAST._IType _1315_rTypeArg; RAST._IType _out80; - _out80 = (this).GenType(_1304_typeArg, DCOMP.GenTypeContext.@default()); - _1306_rTypeArg = _out80; - _1301_types = Dafny.Sequence.Concat(_1301_types, Dafny.Sequence.FromElements(RAST.Type.create_TypeApp(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("marker"))).MSel(Dafny.Sequence.UnicodeFromString("PhantomData")), Dafny.Sequence.FromElements(_1306_rTypeArg)))); - if (((_1302_typeI) < (new BigInteger((_1259_variances).Count))) && (((_1259_variances).Select(_1302_typeI)).is_Nonvariant)) { - _1295_coerceTypes = Dafny.Sequence.Concat(_1295_coerceTypes, Dafny.Sequence.FromElements(_1306_rTypeArg)); + _out80 = (this).GenType(_1313_typeArg, DCOMP.GenTypeContext.@default()); + _1315_rTypeArg = _out80; + _1310_types = Dafny.Sequence.Concat(_1310_types, Dafny.Sequence.FromElements(RAST.Type.create_TypeApp(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("marker"))).MSel(Dafny.Sequence.UnicodeFromString("PhantomData")), Dafny.Sequence.FromElements(_1315_rTypeArg)))); + if (((_1311_typeI) < (new BigInteger((_1268_variances).Count))) && (((_1268_variances).Select(_1311_typeI)).is_Nonvariant)) { + _1304_coerceTypes = Dafny.Sequence.Concat(_1304_coerceTypes, Dafny.Sequence.FromElements(_1315_rTypeArg)); goto continue0; } - DAST._ITypeArgDecl _1307_coerceTypeParam; - DAST._ITypeArgDecl _1308_dt__update__tmp_h0 = _1303_typeParam; - Dafny.ISequence _1309_dt__update_hname_h0 = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("_T"), Std.Strings.__default.OfNat(_1302_typeI)); - _1307_coerceTypeParam = DAST.TypeArgDecl.create(_1309_dt__update_hname_h0, (_1308_dt__update__tmp_h0).dtor_bounds, (_1308_dt__update__tmp_h0).dtor_variance); - DAST._IType _1310_coerceTypeArg; - RAST._ITypeParamDecl _1311_rCoerceTypeParamDecl; + DAST._ITypeArgDecl _1316_coerceTypeParam; + DAST._ITypeArgDecl _1317_dt__update__tmp_h0 = _1312_typeParam; + Dafny.ISequence _1318_dt__update_hname_h0 = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("_T"), Std.Strings.__default.OfNat(_1311_typeI)); + _1316_coerceTypeParam = DAST.TypeArgDecl.create(_1318_dt__update_hname_h0, (_1317_dt__update__tmp_h0).dtor_bounds, (_1317_dt__update__tmp_h0).dtor_variance); + DAST._IType _1319_coerceTypeArg; + RAST._ITypeParamDecl _1320_rCoerceTypeParamDecl; DAST._IType _out81; RAST._ITypeParamDecl _out82; - (this).GenTypeParam(_1307_coerceTypeParam, out _out81, out _out82); - _1310_coerceTypeArg = _out81; - _1311_rCoerceTypeParamDecl = _out82; - _1298_coerceMap = Dafny.Map.Merge(_1298_coerceMap, Dafny.Map.FromElements(new Dafny.Pair(_1304_typeArg, _1310_coerceTypeArg))); - RAST._IType _1312_rCoerceType; + (this).GenTypeParam(_1316_coerceTypeParam, out _out81, out _out82); + _1319_coerceTypeArg = _out81; + _1320_rCoerceTypeParamDecl = _out82; + _1307_coerceMap = Dafny.Map.Merge(_1307_coerceMap, Dafny.Map.FromElements(new Dafny.Pair(_1313_typeArg, _1319_coerceTypeArg))); + RAST._IType _1321_rCoerceType; RAST._IType _out83; - _out83 = (this).GenType(_1310_coerceTypeArg, DCOMP.GenTypeContext.@default()); - _1312_rCoerceType = _out83; - _1299_rCoerceMap = Dafny.Map.Merge(_1299_rCoerceMap, Dafny.Map.FromElements(new Dafny.Pair(_1306_rTypeArg, _1312_rCoerceType))); - _1295_coerceTypes = Dafny.Sequence.Concat(_1295_coerceTypes, Dafny.Sequence.FromElements(_1312_rCoerceType)); - _1296_rCoerceTypeParams = Dafny.Sequence.Concat(_1296_rCoerceTypeParams, Dafny.Sequence.FromElements(_1311_rCoerceTypeParamDecl)); - Dafny.ISequence _1313_coerceFormal; - _1313_coerceFormal = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("f_"), Std.Strings.__default.OfNat(_1302_typeI)); - _1300_coerceMapToArg = Dafny.Map<_System._ITuple2, RAST._IExpr>.Merge(_1300_coerceMapToArg, Dafny.Map<_System._ITuple2, RAST._IExpr>.FromElements(new Dafny.Pair<_System._ITuple2, RAST._IExpr>(_System.Tuple2.create(_1306_rTypeArg, _1312_rCoerceType), (RAST.Expr.create_Identifier(_1313_coerceFormal)).Clone()))); - _1297_coerceArguments = Dafny.Sequence.Concat(_1297_coerceArguments, Dafny.Sequence.FromElements(RAST.Formal.create(_1313_coerceFormal, RAST.__default.Rc(RAST.Type.create_IntersectionType(RAST.Type.create_ImplType(RAST.Type.create_FnType(Dafny.Sequence.FromElements(_1306_rTypeArg), _1312_rCoerceType)), RAST.__default.StaticTrait))))); + _out83 = (this).GenType(_1319_coerceTypeArg, DCOMP.GenTypeContext.@default()); + _1321_rCoerceType = _out83; + _1308_rCoerceMap = Dafny.Map.Merge(_1308_rCoerceMap, Dafny.Map.FromElements(new Dafny.Pair(_1315_rTypeArg, _1321_rCoerceType))); + _1304_coerceTypes = Dafny.Sequence.Concat(_1304_coerceTypes, Dafny.Sequence.FromElements(_1321_rCoerceType)); + _1305_rCoerceTypeParams = Dafny.Sequence.Concat(_1305_rCoerceTypeParams, Dafny.Sequence.FromElements(_1320_rCoerceTypeParamDecl)); + Dafny.ISequence _1322_coerceFormal; + _1322_coerceFormal = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("f_"), Std.Strings.__default.OfNat(_1311_typeI)); + _1309_coerceMapToArg = Dafny.Map<_System._ITuple2, RAST._IExpr>.Merge(_1309_coerceMapToArg, Dafny.Map<_System._ITuple2, RAST._IExpr>.FromElements(new Dafny.Pair<_System._ITuple2, RAST._IExpr>(_System.Tuple2.create(_1315_rTypeArg, _1321_rCoerceType), (RAST.Expr.create_Identifier(_1322_coerceFormal)).Clone()))); + _1306_coerceArguments = Dafny.Sequence.Concat(_1306_coerceArguments, Dafny.Sequence.FromElements(RAST.Formal.create(_1322_coerceFormal, RAST.__default.Rc(RAST.Type.create_IntersectionType(RAST.Type.create_ImplType(RAST.Type.create_FnType(Dafny.Sequence.FromElements(_1315_rTypeArg), _1321_rCoerceType)), RAST.__default.StaticTrait))))); continue0: ; } after0: ; - _1258_ctors = Dafny.Sequence.Concat(_1258_ctors, Dafny.Sequence.FromElements(RAST.EnumCase.create(Dafny.Sequence.UnicodeFromString("_PhantomVariant"), RAST.Fields.create_NamelessFields(Std.Collections.Seq.__default.Map(((System.Func)((_1314_tpe) => { - return RAST.NamelessField.create(RAST.Visibility.create_PRIV(), _1314_tpe); -})), _1301_types))))); - } - bool _1315_cIsEq; - _1315_cIsEq = (this).DatatypeIsEq(c); - s = Dafny.Sequence.FromElements(RAST.ModDecl.create_EnumDecl(RAST.Enum.create(((_1315_cIsEq) ? (Dafny.Sequence>.FromElements(Dafny.Sequence.UnicodeFromString("#[derive(PartialEq, Clone)]"))) : (Dafny.Sequence>.FromElements(Dafny.Sequence.UnicodeFromString("#[derive(Clone)]")))), _1257_datatypeName, _1255_rTypeParamsDecls, _1258_ctors)), RAST.ModDecl.create_ImplDecl(RAST.Impl.create_Impl(_1255_rTypeParamsDecls, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1257_datatypeName), _1254_rTypeParams), _1256_whereConstraints, _1273_implBody))); - Dafny.ISequence _1316_printImplBodyCases; - _1316_printImplBodyCases = Dafny.Sequence.FromElements(); - Dafny.ISequence _1317_hashImplBodyCases; - _1317_hashImplBodyCases = Dafny.Sequence.FromElements(); - Dafny.ISequence _1318_coerceImplBodyCases; - _1318_coerceImplBodyCases = Dafny.Sequence.FromElements(); - BigInteger _hi19 = new BigInteger(((c).dtor_ctors).Count); - for (BigInteger _1319_i = BigInteger.Zero; _1319_i < _hi19; _1319_i++) { - DAST._IDatatypeCtor _1320_ctor; - _1320_ctor = ((c).dtor_ctors).Select(_1319_i); - Dafny.ISequence _1321_ctorMatch; - _1321_ctorMatch = DCOMP.__default.escapeName((_1320_ctor).dtor_name); - Dafny.ISequence _1322_modulePrefix; + _1267_ctors = Dafny.Sequence.Concat(_1267_ctors, Dafny.Sequence.FromElements(RAST.EnumCase.create(Dafny.Sequence.UnicodeFromString("_PhantomVariant"), RAST.Fields.create_NamelessFields(Std.Collections.Seq.__default.Map(((System.Func)((_1323_tpe) => { + return RAST.NamelessField.create(RAST.Visibility.create_PRIV(), _1323_tpe); +})), _1310_types))))); + } + bool _1324_cIsEq; + _1324_cIsEq = (this).DatatypeIsEq(c); + s = Dafny.Sequence.FromElements(RAST.ModDecl.create_EnumDecl(RAST.Enum.create(((_1324_cIsEq) ? (Dafny.Sequence>.FromElements(Dafny.Sequence.UnicodeFromString("#[derive(PartialEq, Clone)]"))) : (Dafny.Sequence>.FromElements(Dafny.Sequence.UnicodeFromString("#[derive(Clone)]")))), _1266_datatypeName, _1264_rTypeParamsDecls, _1267_ctors)), RAST.ModDecl.create_ImplDecl(RAST.Impl.create_Impl(_1264_rTypeParamsDecls, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1266_datatypeName), _1263_rTypeParams), _1265_whereConstraints, _1282_implBody))); + Dafny.ISequence _1325_printImplBodyCases; + _1325_printImplBodyCases = Dafny.Sequence.FromElements(); + Dafny.ISequence _1326_hashImplBodyCases; + _1326_hashImplBodyCases = Dafny.Sequence.FromElements(); + Dafny.ISequence _1327_coerceImplBodyCases; + _1327_coerceImplBodyCases = Dafny.Sequence.FromElements(); + BigInteger _hi20 = new BigInteger(((c).dtor_ctors).Count); + for (BigInteger _1328_i = BigInteger.Zero; _1328_i < _hi20; _1328_i++) { + DAST._IDatatypeCtor _1329_ctor; + _1329_ctor = ((c).dtor_ctors).Select(_1328_i); + Dafny.ISequence _1330_ctorMatch; + _1330_ctorMatch = DCOMP.__default.escapeName((_1329_ctor).dtor_name); + Dafny.ISequence _1331_modulePrefix; if (((((c).dtor_enclosingModule))).Equals(Dafny.Sequence.UnicodeFromString("_module"))) { - _1322_modulePrefix = Dafny.Sequence.UnicodeFromString(""); + _1331_modulePrefix = Dafny.Sequence.UnicodeFromString(""); } else { - _1322_modulePrefix = Dafny.Sequence.Concat((((c).dtor_enclosingModule)), Dafny.Sequence.UnicodeFromString(".")); - } - Dafny.ISequence _1323_ctorName; - _1323_ctorName = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1322_modulePrefix, ((c).dtor_name)), Dafny.Sequence.UnicodeFromString(".")), ((_1320_ctor).dtor_name)); - if (((new BigInteger((_1323_ctorName).Count)) >= (new BigInteger(13))) && (((_1323_ctorName).Subsequence(BigInteger.Zero, new BigInteger(13))).Equals(Dafny.Sequence.UnicodeFromString("_System.Tuple")))) { - _1323_ctorName = Dafny.Sequence.UnicodeFromString(""); - } - RAST._IExpr _1324_printRhs; - _1324_printRhs = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("write!(_formatter, \""), _1323_ctorName), (((_1320_ctor).dtor_hasAnyArgs) ? (Dafny.Sequence.UnicodeFromString("(\")?")) : (Dafny.Sequence.UnicodeFromString("\")?"))))); - RAST._IExpr _1325_hashRhs; - _1325_hashRhs = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")); - Dafny.ISequence _1326_coerceRhsArgs; - _1326_coerceRhsArgs = Dafny.Sequence.FromElements(); - bool _1327_isNumeric; - _1327_isNumeric = false; - Dafny.ISequence _1328_ctorMatchInner; - _1328_ctorMatchInner = Dafny.Sequence.UnicodeFromString(""); - BigInteger _hi20 = new BigInteger(((_1320_ctor).dtor_args).Count); - for (BigInteger _1329_j = BigInteger.Zero; _1329_j < _hi20; _1329_j++) { - DAST._IDatatypeDtor _1330_dtor; - _1330_dtor = ((_1320_ctor).dtor_args).Select(_1329_j); - Dafny.ISequence _1331_patternName; - _1331_patternName = DCOMP.__default.escapeDtor(((_1330_dtor).dtor_formal).dtor_name); - Dafny.ISequence _1332_fieldName; - _1332_fieldName = DCOMP.__default.escapeField(((_1330_dtor).dtor_formal).dtor_name); - DAST._IType _1333_formalType; - _1333_formalType = ((_1330_dtor).dtor_formal).dtor_typ; - if (((_1329_j).Sign == 0) && ((_1332_fieldName).Equals(Dafny.Sequence.UnicodeFromString("0")))) { - _1327_isNumeric = true; - } - if (_1327_isNumeric) { - _1332_fieldName = Std.Wrappers.Option>.GetOr((_1330_dtor).dtor_callName, Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("v"), Std.Strings.__default.OfNat(_1329_j))); - } - if ((_1333_formalType).is_Arrow) { - _1325_hashRhs = (_1325_hashRhs).Then(((RAST.Expr.create_LiteralInt(Dafny.Sequence.UnicodeFromString("0"))).Sel(Dafny.Sequence.UnicodeFromString("hash"))).Apply1(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("_state")))); + _1331_modulePrefix = Dafny.Sequence.Concat((((c).dtor_enclosingModule)), Dafny.Sequence.UnicodeFromString(".")); + } + Dafny.ISequence _1332_ctorName; + _1332_ctorName = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1331_modulePrefix, ((c).dtor_name)), Dafny.Sequence.UnicodeFromString(".")), ((_1329_ctor).dtor_name)); + if (((new BigInteger((_1332_ctorName).Count)) >= (new BigInteger(13))) && (((_1332_ctorName).Subsequence(BigInteger.Zero, new BigInteger(13))).Equals(Dafny.Sequence.UnicodeFromString("_System.Tuple")))) { + _1332_ctorName = Dafny.Sequence.UnicodeFromString(""); + } + RAST._IExpr _1333_printRhs; + _1333_printRhs = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("write!(_formatter, \""), _1332_ctorName), (((_1329_ctor).dtor_hasAnyArgs) ? (Dafny.Sequence.UnicodeFromString("(\")?")) : (Dafny.Sequence.UnicodeFromString("\")?"))))); + RAST._IExpr _1334_hashRhs; + _1334_hashRhs = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")); + Dafny.ISequence _1335_coerceRhsArgs; + _1335_coerceRhsArgs = Dafny.Sequence.FromElements(); + bool _1336_isNumeric; + _1336_isNumeric = false; + Dafny.ISequence _1337_ctorMatchInner; + _1337_ctorMatchInner = Dafny.Sequence.UnicodeFromString(""); + BigInteger _hi21 = new BigInteger(((_1329_ctor).dtor_args).Count); + for (BigInteger _1338_j = BigInteger.Zero; _1338_j < _hi21; _1338_j++) { + DAST._IDatatypeDtor _1339_dtor; + _1339_dtor = ((_1329_ctor).dtor_args).Select(_1338_j); + Dafny.ISequence _1340_patternName; + _1340_patternName = DCOMP.__default.escapeDtor(((_1339_dtor).dtor_formal).dtor_name); + Dafny.ISequence _1341_fieldName; + _1341_fieldName = DCOMP.__default.escapeField(((_1339_dtor).dtor_formal).dtor_name); + DAST._IType _1342_formalType; + _1342_formalType = ((_1339_dtor).dtor_formal).dtor_typ; + if (((_1338_j).Sign == 0) && ((_1341_fieldName).Equals(Dafny.Sequence.UnicodeFromString("0")))) { + _1336_isNumeric = true; + } + if (_1336_isNumeric) { + _1341_fieldName = Std.Wrappers.Option>.GetOr((_1339_dtor).dtor_callName, Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("v"), Std.Strings.__default.OfNat(_1338_j))); + } + if ((_1342_formalType).is_Arrow) { + _1334_hashRhs = (_1334_hashRhs).Then(((RAST.Expr.create_LiteralInt(Dafny.Sequence.UnicodeFromString("0"))).Sel(Dafny.Sequence.UnicodeFromString("hash"))).Apply1(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("_state")))); } else { - _1325_hashRhs = (_1325_hashRhs).Then(((RAST.Expr.create_Identifier(_1332_fieldName)).Sel(Dafny.Sequence.UnicodeFromString("hash"))).Apply1(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("_state")))); + _1334_hashRhs = (_1334_hashRhs).Then(((RAST.Expr.create_Identifier(_1341_fieldName)).Sel(Dafny.Sequence.UnicodeFromString("hash"))).Apply1(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("_state")))); } - _1328_ctorMatchInner = Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1328_ctorMatchInner, ((_1327_isNumeric) ? (_1332_fieldName) : (_1331_patternName))), Dafny.Sequence.UnicodeFromString(", ")); - if ((_1329_j).Sign == 1) { - _1324_printRhs = (_1324_printRhs).Then(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("write!(_formatter, \", \")?"))); + _1337_ctorMatchInner = Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1337_ctorMatchInner, ((_1336_isNumeric) ? (_1341_fieldName) : (_1340_patternName))), Dafny.Sequence.UnicodeFromString(", ")); + if ((_1338_j).Sign == 1) { + _1333_printRhs = (_1333_printRhs).Then(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("write!(_formatter, \", \")?"))); } - _1324_printRhs = (_1324_printRhs).Then(RAST.Expr.create_RawExpr((((_1333_formalType).is_Arrow) ? (Dafny.Sequence.UnicodeFromString("write!(_formatter, \"\")?")) : (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::DafnyPrint::fmt_print("), _1332_fieldName), Dafny.Sequence.UnicodeFromString(", _formatter, false)?")))))); - RAST._IExpr _1334_coerceRhsArg = RAST.Expr.Default(); - RAST._IType _1335_formalTpe; + _1333_printRhs = (_1333_printRhs).Then(RAST.Expr.create_RawExpr((((_1342_formalType).is_Arrow) ? (Dafny.Sequence.UnicodeFromString("write!(_formatter, \"\")?")) : (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::DafnyPrint::fmt_print("), _1341_fieldName), Dafny.Sequence.UnicodeFromString(", _formatter, false)?")))))); + RAST._IExpr _1343_coerceRhsArg = RAST.Expr.Default(); + RAST._IType _1344_formalTpe; RAST._IType _out84; - _out84 = (this).GenType(_1333_formalType, DCOMP.GenTypeContext.@default()); - _1335_formalTpe = _out84; - DAST._IType _1336_newFormalType; - _1336_newFormalType = (_1333_formalType).Replace(_1298_coerceMap); - RAST._IType _1337_newFormalTpe; - _1337_newFormalTpe = (_1335_formalTpe).Replace(_1299_rCoerceMap); - Std.Wrappers._IResult,RAST._IExpr>>> _1338_upcastConverter; - _1338_upcastConverter = (this).UpcastConversionLambda(_1333_formalType, _1335_formalTpe, _1336_newFormalType, _1337_newFormalTpe, _1300_coerceMapToArg); - if ((_1338_upcastConverter).is_Success) { - RAST._IExpr _1339_coercionFunction; - _1339_coercionFunction = (_1338_upcastConverter).dtor_value; - _1334_coerceRhsArg = (_1339_coercionFunction).Apply1(RAST.Expr.create_Identifier(_1331_patternName)); + _out84 = (this).GenType(_1342_formalType, DCOMP.GenTypeContext.@default()); + _1344_formalTpe = _out84; + DAST._IType _1345_newFormalType; + _1345_newFormalType = (_1342_formalType).Replace(_1307_coerceMap); + RAST._IType _1346_newFormalTpe; + _1346_newFormalTpe = (_1344_formalTpe).Replace(_1308_rCoerceMap); + Std.Wrappers._IResult,RAST._IExpr>>> _1347_upcastConverter; + _1347_upcastConverter = (this).UpcastConversionLambda(_1342_formalType, _1344_formalTpe, _1345_newFormalType, _1346_newFormalTpe, _1309_coerceMapToArg); + if ((_1347_upcastConverter).is_Success) { + RAST._IExpr _1348_coercionFunction; + _1348_coercionFunction = (_1347_upcastConverter).dtor_value; + _1343_coerceRhsArg = (_1348_coercionFunction).Apply1(RAST.Expr.create_Identifier(_1340_patternName)); } else { - (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Could not generate coercion function for contructor "), Std.Strings.__default.OfNat(_1329_j)), Dafny.Sequence.UnicodeFromString(" of ")), _1257_datatypeName)); - _1334_coerceRhsArg = (RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("todo!"))).Apply1(RAST.Expr.create_LiteralString((this.error).dtor_value, false, false)); + (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Could not generate coercion function for contructor "), Std.Strings.__default.OfNat(_1338_j)), Dafny.Sequence.UnicodeFromString(" of ")), _1266_datatypeName)); + _1343_coerceRhsArg = (RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("todo!"))).Apply1(RAST.Expr.create_LiteralString((this.error).dtor_value, false, false)); } - _1326_coerceRhsArgs = Dafny.Sequence.Concat(_1326_coerceRhsArgs, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(_1331_patternName, _1334_coerceRhsArg))); + _1335_coerceRhsArgs = Dafny.Sequence.Concat(_1335_coerceRhsArgs, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(_1340_patternName, _1343_coerceRhsArg))); } - RAST._IExpr _1340_coerceRhs; - _1340_coerceRhs = RAST.Expr.create_StructBuild((RAST.Expr.create_Identifier(_1257_datatypeName)).MSel(DCOMP.__default.escapeName((_1320_ctor).dtor_name)), _1326_coerceRhsArgs); - if (_1327_isNumeric) { - _1321_ctorMatch = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1321_ctorMatch, Dafny.Sequence.UnicodeFromString("(")), _1328_ctorMatchInner), Dafny.Sequence.UnicodeFromString(")")); + RAST._IExpr _1349_coerceRhs; + _1349_coerceRhs = RAST.Expr.create_StructBuild((RAST.Expr.create_Identifier(_1266_datatypeName)).MSel(DCOMP.__default.escapeName((_1329_ctor).dtor_name)), _1335_coerceRhsArgs); + if (_1336_isNumeric) { + _1330_ctorMatch = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1330_ctorMatch, Dafny.Sequence.UnicodeFromString("(")), _1337_ctorMatchInner), Dafny.Sequence.UnicodeFromString(")")); } else { - _1321_ctorMatch = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1321_ctorMatch, Dafny.Sequence.UnicodeFromString("{")), _1328_ctorMatchInner), Dafny.Sequence.UnicodeFromString("}")); + _1330_ctorMatch = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1330_ctorMatch, Dafny.Sequence.UnicodeFromString("{")), _1337_ctorMatchInner), Dafny.Sequence.UnicodeFromString("}")); } - if ((_1320_ctor).dtor_hasAnyArgs) { - _1324_printRhs = (_1324_printRhs).Then(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("write!(_formatter, \")\")?"))); + if ((_1329_ctor).dtor_hasAnyArgs) { + _1333_printRhs = (_1333_printRhs).Then(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("write!(_formatter, \")\")?"))); } - _1324_printRhs = (_1324_printRhs).Then(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("Ok(())"))); - _1316_printImplBodyCases = Dafny.Sequence.Concat(_1316_printImplBodyCases, Dafny.Sequence.FromElements(RAST.MatchCase.create(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1257_datatypeName, Dafny.Sequence.UnicodeFromString("::")), _1321_ctorMatch), RAST.Expr.create_Block(_1324_printRhs)))); - _1317_hashImplBodyCases = Dafny.Sequence.Concat(_1317_hashImplBodyCases, Dafny.Sequence.FromElements(RAST.MatchCase.create(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1257_datatypeName, Dafny.Sequence.UnicodeFromString("::")), _1321_ctorMatch), RAST.Expr.create_Block(_1325_hashRhs)))); - _1318_coerceImplBodyCases = Dafny.Sequence.Concat(_1318_coerceImplBodyCases, Dafny.Sequence.FromElements(RAST.MatchCase.create(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1257_datatypeName, Dafny.Sequence.UnicodeFromString("::")), _1321_ctorMatch), RAST.Expr.create_Block(_1340_coerceRhs)))); + _1333_printRhs = (_1333_printRhs).Then(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("Ok(())"))); + _1325_printImplBodyCases = Dafny.Sequence.Concat(_1325_printImplBodyCases, Dafny.Sequence.FromElements(RAST.MatchCase.create(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1266_datatypeName, Dafny.Sequence.UnicodeFromString("::")), _1330_ctorMatch), RAST.Expr.create_Block(_1333_printRhs)))); + _1326_hashImplBodyCases = Dafny.Sequence.Concat(_1326_hashImplBodyCases, Dafny.Sequence.FromElements(RAST.MatchCase.create(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1266_datatypeName, Dafny.Sequence.UnicodeFromString("::")), _1330_ctorMatch), RAST.Expr.create_Block(_1334_hashRhs)))); + _1327_coerceImplBodyCases = Dafny.Sequence.Concat(_1327_coerceImplBodyCases, Dafny.Sequence.FromElements(RAST.MatchCase.create(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1266_datatypeName, Dafny.Sequence.UnicodeFromString("::")), _1330_ctorMatch), RAST.Expr.create_Block(_1349_coerceRhs)))); } if ((new BigInteger(((c).dtor_typeParams).Count)).Sign == 1) { - Dafny.ISequence _1341_extraCases; - _1341_extraCases = Dafny.Sequence.FromElements(RAST.MatchCase.create(Dafny.Sequence.Concat(_1257_datatypeName, Dafny.Sequence.UnicodeFromString("::_PhantomVariant(..)")), RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("{"), (this).UnreachablePanicIfVerified(Dafny.Sequence.UnicodeFromString(""))), Dafny.Sequence.UnicodeFromString("}"))))); - _1316_printImplBodyCases = Dafny.Sequence.Concat(_1316_printImplBodyCases, _1341_extraCases); - _1317_hashImplBodyCases = Dafny.Sequence.Concat(_1317_hashImplBodyCases, _1341_extraCases); - _1318_coerceImplBodyCases = Dafny.Sequence.Concat(_1318_coerceImplBodyCases, _1341_extraCases); - } - Dafny.ISequence _1342_defaultConstrainedTypeParams; - _1342_defaultConstrainedTypeParams = RAST.TypeParamDecl.AddConstraintsMultiple(_1255_rTypeParamsDecls, Dafny.Sequence.FromElements(RAST.__default.DefaultTrait)); - Dafny.ISequence _1343_rTypeParamsDeclsWithEq; - _1343_rTypeParamsDeclsWithEq = RAST.TypeParamDecl.AddConstraintsMultiple(_1255_rTypeParamsDecls, Dafny.Sequence.FromElements(RAST.__default.Eq)); - Dafny.ISequence _1344_rTypeParamsDeclsWithHash; - _1344_rTypeParamsDeclsWithHash = RAST.TypeParamDecl.AddConstraintsMultiple(_1255_rTypeParamsDecls, Dafny.Sequence.FromElements(RAST.__default.Hash)); - RAST._IExpr _1345_printImplBody; - _1345_printImplBody = RAST.Expr.create_Match(RAST.__default.self, _1316_printImplBodyCases); - RAST._IExpr _1346_hashImplBody; - _1346_hashImplBody = RAST.Expr.create_Match(RAST.__default.self, _1317_hashImplBodyCases); - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1255_rTypeParamsDecls, ((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("fmt"))).MSel(Dafny.Sequence.UnicodeFromString("Debug")), RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1257_datatypeName), _1254_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("fmt"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed, RAST.Formal.create(Dafny.Sequence.UnicodeFromString("f"), RAST.Type.create_BorrowedMut(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("fmt"))).MSel(Dafny.Sequence.UnicodeFromString("Formatter"))))), Std.Wrappers.Option.create_Some(RAST.__default.RawType(Dafny.Sequence.UnicodeFromString("std::fmt::Result"))), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("DafnyPrint"))).MSel(Dafny.Sequence.UnicodeFromString("fmt_print"))).Apply(Dafny.Sequence.FromElements(RAST.__default.self, RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("f")), RAST.Expr.create_LiteralBool(true))))))))), RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1255_rTypeParamsDecls, RAST.__default.DafnyPrint, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1257_datatypeName), _1254_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("fmt_print"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed, RAST.Formal.create(Dafny.Sequence.UnicodeFromString("_formatter"), RAST.Type.create_BorrowedMut(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("fmt"))).MSel(Dafny.Sequence.UnicodeFromString("Formatter")))), RAST.Formal.create(Dafny.Sequence.UnicodeFromString("_in_seq"), RAST.Type.create_Bool())), Std.Wrappers.Option.create_Some(RAST.__default.RawType(Dafny.Sequence.UnicodeFromString("std::fmt::Result"))), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(_1345_printImplBody)))))))); - if ((new BigInteger((_1296_rCoerceTypeParams).Count)).Sign == 1) { - RAST._IExpr _1347_coerceImplBody; - _1347_coerceImplBody = RAST.Expr.create_Match(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("this")), _1318_coerceImplBodyCases); - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_Impl(_1255_rTypeParamsDecls, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1257_datatypeName), _1254_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PUB(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("coerce"), _1296_rCoerceTypeParams, _1297_coerceArguments, Std.Wrappers.Option.create_Some(RAST.__default.Rc(RAST.Type.create_ImplType(RAST.Type.create_FnType(Dafny.Sequence.FromElements(RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1257_datatypeName), _1254_rTypeParams)), RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1257_datatypeName), _1295_coerceTypes))))), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(RAST.__default.RcNew(RAST.Expr.create_Lambda(Dafny.Sequence.FromElements(RAST.Formal.create(Dafny.Sequence.UnicodeFromString("this"), RAST.Type.create_SelfOwned())), Std.Wrappers.Option.create_Some(RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1257_datatypeName), _1295_coerceTypes)), _1347_coerceImplBody)))))))))); - } - if (_1315_cIsEq) { - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1343_rTypeParamsDeclsWithEq, RAST.__default.Eq, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1257_datatypeName), _1254_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements())))); - } - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1344_rTypeParamsDeclsWithHash, RAST.__default.Hash, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1257_datatypeName), _1254_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("hash"), Dafny.Sequence.FromElements(RAST.TypeParamDecl.create(Dafny.Sequence.UnicodeFromString("_H"), Dafny.Sequence.FromElements(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("hash"))).MSel(Dafny.Sequence.UnicodeFromString("Hasher"))))), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed, RAST.Formal.create(Dafny.Sequence.UnicodeFromString("_state"), RAST.Type.create_BorrowedMut(RAST.Type.create_TIdentifier(Dafny.Sequence.UnicodeFromString("_H"))))), Std.Wrappers.Option.create_None(), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(_1346_hashImplBody)))))))); + Dafny.ISequence _1350_extraCases; + _1350_extraCases = Dafny.Sequence.FromElements(RAST.MatchCase.create(Dafny.Sequence.Concat(_1266_datatypeName, Dafny.Sequence.UnicodeFromString("::_PhantomVariant(..)")), RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("{"), (this).UnreachablePanicIfVerified(Dafny.Sequence.UnicodeFromString(""))), Dafny.Sequence.UnicodeFromString("}"))))); + _1325_printImplBodyCases = Dafny.Sequence.Concat(_1325_printImplBodyCases, _1350_extraCases); + _1326_hashImplBodyCases = Dafny.Sequence.Concat(_1326_hashImplBodyCases, _1350_extraCases); + _1327_coerceImplBodyCases = Dafny.Sequence.Concat(_1327_coerceImplBodyCases, _1350_extraCases); + } + Dafny.ISequence _1351_defaultConstrainedTypeParams; + _1351_defaultConstrainedTypeParams = RAST.TypeParamDecl.AddConstraintsMultiple(_1264_rTypeParamsDecls, Dafny.Sequence.FromElements(RAST.__default.DefaultTrait)); + Dafny.ISequence _1352_rTypeParamsDeclsWithEq; + _1352_rTypeParamsDeclsWithEq = RAST.TypeParamDecl.AddConstraintsMultiple(_1264_rTypeParamsDecls, Dafny.Sequence.FromElements(RAST.__default.Eq)); + Dafny.ISequence _1353_rTypeParamsDeclsWithHash; + _1353_rTypeParamsDeclsWithHash = RAST.TypeParamDecl.AddConstraintsMultiple(_1264_rTypeParamsDecls, Dafny.Sequence.FromElements(RAST.__default.Hash)); + RAST._IExpr _1354_printImplBody; + _1354_printImplBody = RAST.Expr.create_Match(RAST.__default.self, _1325_printImplBodyCases); + RAST._IExpr _1355_hashImplBody; + _1355_hashImplBody = RAST.Expr.create_Match(RAST.__default.self, _1326_hashImplBodyCases); + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1264_rTypeParamsDecls, ((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("fmt"))).MSel(Dafny.Sequence.UnicodeFromString("Debug")), RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1266_datatypeName), _1263_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("fmt"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed, RAST.Formal.create(Dafny.Sequence.UnicodeFromString("f"), RAST.Type.create_BorrowedMut(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("fmt"))).MSel(Dafny.Sequence.UnicodeFromString("Formatter"))))), Std.Wrappers.Option.create_Some(RAST.__default.RawType(Dafny.Sequence.UnicodeFromString("std::fmt::Result"))), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("DafnyPrint"))).MSel(Dafny.Sequence.UnicodeFromString("fmt_print"))).Apply(Dafny.Sequence.FromElements(RAST.__default.self, RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("f")), RAST.Expr.create_LiteralBool(true))))))))), RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1264_rTypeParamsDecls, RAST.__default.DafnyPrint, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1266_datatypeName), _1263_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("fmt_print"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed, RAST.Formal.create(Dafny.Sequence.UnicodeFromString("_formatter"), RAST.Type.create_BorrowedMut(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("fmt"))).MSel(Dafny.Sequence.UnicodeFromString("Formatter")))), RAST.Formal.create(Dafny.Sequence.UnicodeFromString("_in_seq"), RAST.Type.create_Bool())), Std.Wrappers.Option.create_Some(RAST.__default.RawType(Dafny.Sequence.UnicodeFromString("std::fmt::Result"))), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(_1354_printImplBody)))))))); + if ((new BigInteger((_1305_rCoerceTypeParams).Count)).Sign == 1) { + RAST._IExpr _1356_coerceImplBody; + _1356_coerceImplBody = RAST.Expr.create_Match(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("this")), _1327_coerceImplBodyCases); + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_Impl(_1264_rTypeParamsDecls, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1266_datatypeName), _1263_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PUB(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("coerce"), _1305_rCoerceTypeParams, _1306_coerceArguments, Std.Wrappers.Option.create_Some(RAST.__default.Rc(RAST.Type.create_ImplType(RAST.Type.create_FnType(Dafny.Sequence.FromElements(RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1266_datatypeName), _1263_rTypeParams)), RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1266_datatypeName), _1304_coerceTypes))))), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(RAST.__default.RcNew(RAST.Expr.create_Lambda(Dafny.Sequence.FromElements(RAST.Formal.create(Dafny.Sequence.UnicodeFromString("this"), RAST.Type.create_SelfOwned())), Std.Wrappers.Option.create_Some(RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1266_datatypeName), _1304_coerceTypes)), _1356_coerceImplBody)))))))))); + } + if (_1324_cIsEq) { + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1352_rTypeParamsDeclsWithEq, RAST.__default.Eq, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1266_datatypeName), _1263_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements())))); + } + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1353_rTypeParamsDeclsWithHash, RAST.__default.Hash, RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1266_datatypeName), _1263_rTypeParams), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("hash"), Dafny.Sequence.FromElements(RAST.TypeParamDecl.create(Dafny.Sequence.UnicodeFromString("_H"), Dafny.Sequence.FromElements(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("hash"))).MSel(Dafny.Sequence.UnicodeFromString("Hasher"))))), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed, RAST.Formal.create(Dafny.Sequence.UnicodeFromString("_state"), RAST.Type.create_BorrowedMut(RAST.Type.create_TIdentifier(Dafny.Sequence.UnicodeFromString("_H"))))), Std.Wrappers.Option.create_None(), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(_1355_hashImplBody)))))))); if ((new BigInteger(((c).dtor_ctors).Count)).Sign == 1) { - RAST._IExpr _1348_structName; - _1348_structName = (RAST.Expr.create_Identifier(_1257_datatypeName)).MSel(DCOMP.__default.escapeName((((c).dtor_ctors).Select(BigInteger.Zero)).dtor_name)); - Dafny.ISequence _1349_structAssignments; - _1349_structAssignments = Dafny.Sequence.FromElements(); - BigInteger _hi21 = new BigInteger(((((c).dtor_ctors).Select(BigInteger.Zero)).dtor_args).Count); - for (BigInteger _1350_i = BigInteger.Zero; _1350_i < _hi21; _1350_i++) { - DAST._IDatatypeDtor _1351_dtor; - _1351_dtor = ((((c).dtor_ctors).Select(BigInteger.Zero)).dtor_args).Select(_1350_i); - _1349_structAssignments = Dafny.Sequence.Concat(_1349_structAssignments, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(DCOMP.__default.escapeName(((_1351_dtor).dtor_formal).dtor_name), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("::std::default::Default::default()"))))); - } - Dafny.ISequence _1352_defaultConstrainedTypeParams; - _1352_defaultConstrainedTypeParams = RAST.TypeParamDecl.AddConstraintsMultiple(_1255_rTypeParamsDecls, Dafny.Sequence.FromElements(RAST.__default.DefaultTrait)); - RAST._IType _1353_fullType; - _1353_fullType = RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1257_datatypeName), _1254_rTypeParams); - if (_1315_cIsEq) { - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1352_defaultConstrainedTypeParams, RAST.__default.DefaultTrait, _1353_fullType, Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("default"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(), Std.Wrappers.Option.create_Some(_1353_fullType), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(RAST.Expr.create_StructBuild(_1348_structName, _1349_structAssignments))))))))); - } - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1255_rTypeParamsDecls, (((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("convert"))).MSel(Dafny.Sequence.UnicodeFromString("AsRef"))).Apply1(_1353_fullType), RAST.Type.create_Borrowed(_1353_fullType), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("as_ref"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed), Std.Wrappers.Option.create_Some(RAST.Type.create_SelfOwned()), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(RAST.__default.self)))))))); + RAST._IExpr _1357_structName; + _1357_structName = (RAST.Expr.create_Identifier(_1266_datatypeName)).MSel(DCOMP.__default.escapeName((((c).dtor_ctors).Select(BigInteger.Zero)).dtor_name)); + Dafny.ISequence _1358_structAssignments; + _1358_structAssignments = Dafny.Sequence.FromElements(); + BigInteger _hi22 = new BigInteger(((((c).dtor_ctors).Select(BigInteger.Zero)).dtor_args).Count); + for (BigInteger _1359_i = BigInteger.Zero; _1359_i < _hi22; _1359_i++) { + DAST._IDatatypeDtor _1360_dtor; + _1360_dtor = ((((c).dtor_ctors).Select(BigInteger.Zero)).dtor_args).Select(_1359_i); + _1358_structAssignments = Dafny.Sequence.Concat(_1358_structAssignments, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(DCOMP.__default.escapeName(((_1360_dtor).dtor_formal).dtor_name), RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("::std::default::Default::default()"))))); + } + Dafny.ISequence _1361_defaultConstrainedTypeParams; + _1361_defaultConstrainedTypeParams = RAST.TypeParamDecl.AddConstraintsMultiple(_1264_rTypeParamsDecls, Dafny.Sequence.FromElements(RAST.__default.DefaultTrait)); + RAST._IType _1362_fullType; + _1362_fullType = RAST.Type.create_TypeApp(RAST.Type.create_TIdentifier(_1266_datatypeName), _1263_rTypeParams); + if (_1324_cIsEq) { + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1361_defaultConstrainedTypeParams, RAST.__default.DefaultTrait, _1362_fullType, Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("default"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(), Std.Wrappers.Option.create_Some(_1362_fullType), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(RAST.Expr.create_StructBuild(_1357_structName, _1358_structAssignments))))))))); + } + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.ModDecl.create_ImplDecl(RAST.Impl.create_ImplFor(_1264_rTypeParamsDecls, (((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("convert"))).MSel(Dafny.Sequence.UnicodeFromString("AsRef"))).Apply1(_1362_fullType), RAST.Type.create_Borrowed(_1362_fullType), Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.FromElements(RAST.ImplMember.create_FnDecl(RAST.Visibility.create_PRIV(), RAST.Fn.create(Dafny.Sequence.UnicodeFromString("as_ref"), Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(RAST.Formal.selfBorrowed), Std.Wrappers.Option.create_Some(RAST.Type.create_SelfOwned()), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(RAST.__default.self)))))))); } return s; } @@ -1739,9 +1770,9 @@ public static RAST._IType GenPath(Dafny.ISequence> p } else { r = RAST.Type.create_TIdentifier(Dafny.Sequence.UnicodeFromString("super")); } - BigInteger _hi22 = new BigInteger((p).Count); - for (BigInteger _1354_i = BigInteger.Zero; _1354_i < _hi22; _1354_i++) { - r = (r).MSel(DCOMP.__default.escapeName(((p).Select(_1354_i)))); + BigInteger _hi23 = new BigInteger((p).Count); + for (BigInteger _1363_i = BigInteger.Zero; _1363_i < _hi23; _1363_i++) { + r = (r).MSel(DCOMP.__default.escapeName(((p).Select(_1363_i)))); } } return r; @@ -1760,9 +1791,9 @@ public static RAST._IExpr GenPathExpr(Dafny.ISequence.UnicodeFromString("super")); } - BigInteger _hi23 = new BigInteger((p).Count); - for (BigInteger _1355_i = BigInteger.Zero; _1355_i < _hi23; _1355_i++) { - r = (r).MSel(DCOMP.__default.escapeName(((p).Select(_1355_i)))); + BigInteger _hi24 = new BigInteger((p).Count); + for (BigInteger _1364_i = BigInteger.Zero; _1364_i < _hi24; _1364_i++) { + r = (r).MSel(DCOMP.__default.escapeName(((p).Select(_1364_i)))); } } return r; @@ -1771,13 +1802,13 @@ public static RAST._IExpr GenPathExpr(Dafny.ISequence s = Dafny.Sequence.Empty; s = Dafny.Sequence.FromElements(); - BigInteger _hi24 = new BigInteger((args).Count); - for (BigInteger _1356_i = BigInteger.Zero; _1356_i < _hi24; _1356_i++) { - RAST._IType _1357_genTp; + BigInteger _hi25 = new BigInteger((args).Count); + for (BigInteger _1365_i = BigInteger.Zero; _1365_i < _hi25; _1365_i++) { + RAST._IType _1366_genTp; RAST._IType _out85; - _out85 = (this).GenType((args).Select(_1356_i), genTypeContext); - _1357_genTp = _out85; - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(_1357_genTp)); + _out85 = (this).GenType((args).Select(_1365_i), genTypeContext); + _1366_genTp = _out85; + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(_1366_genTp)); } return s; } @@ -1787,303 +1818,303 @@ public bool IsRcWrapped(Dafny.ISequence attributes) { public RAST._IType GenType(DAST._IType c, DCOMP._IGenTypeContext genTypeContext) { RAST._IType s = RAST.Type.Default(); - DAST._IType _source61 = c; + DAST._IType _source62 = c; { - if (_source61.is_UserDefined) { - DAST._IResolvedType _1358_resolved = _source61.dtor_resolved; + if (_source62.is_UserDefined) { + DAST._IResolvedType _1367_resolved = _source62.dtor_resolved; { - RAST._IType _1359_t; + RAST._IType _1368_t; RAST._IType _out86; - _out86 = DCOMP.COMP.GenPath((_1358_resolved).dtor_path); - _1359_t = _out86; - Dafny.ISequence _1360_typeArgs; + _out86 = DCOMP.COMP.GenPath((_1367_resolved).dtor_path); + _1368_t = _out86; + Dafny.ISequence _1369_typeArgs; Dafny.ISequence _out87; - _out87 = (this).GenTypeArgs((_1358_resolved).dtor_typeArgs, Dafny.Helpers.Let(genTypeContext, _pat_let9_0 => Dafny.Helpers.Let(_pat_let9_0, _1361_dt__update__tmp_h0 => Dafny.Helpers.Let(false, _pat_let10_0 => Dafny.Helpers.Let(_pat_let10_0, _1362_dt__update_hforTraitParents_h0 => DCOMP.GenTypeContext.create((_1361_dt__update__tmp_h0).dtor_inBinding, (_1361_dt__update__tmp_h0).dtor_inFn, _1362_dt__update_hforTraitParents_h0)))))); - _1360_typeArgs = _out87; - s = RAST.Type.create_TypeApp(_1359_t, _1360_typeArgs); - DAST._IResolvedTypeBase _source62 = (_1358_resolved).dtor_kind; + _out87 = (this).GenTypeArgs((_1367_resolved).dtor_typeArgs, Dafny.Helpers.Let(genTypeContext, _pat_let9_0 => Dafny.Helpers.Let(_pat_let9_0, _1370_dt__update__tmp_h0 => Dafny.Helpers.Let(false, _pat_let10_0 => Dafny.Helpers.Let(_pat_let10_0, _1371_dt__update_hforTraitParents_h0 => DCOMP.GenTypeContext.create((_1370_dt__update__tmp_h0).dtor_inBinding, (_1370_dt__update__tmp_h0).dtor_inFn, _1371_dt__update_hforTraitParents_h0)))))); + _1369_typeArgs = _out87; + s = RAST.Type.create_TypeApp(_1368_t, _1369_typeArgs); + DAST._IResolvedTypeBase _source63 = (_1367_resolved).dtor_kind; { - if (_source62.is_Class) { + if (_source63.is_Class) { { s = (this).Object(s); } - goto after_match9; + goto after_match10; } } { - if (_source62.is_Datatype) { + if (_source63.is_Datatype) { { - if ((this).IsRcWrapped((_1358_resolved).dtor_attributes)) { + if ((this).IsRcWrapped((_1367_resolved).dtor_attributes)) { s = RAST.__default.Rc(s); } } - goto after_match9; + goto after_match10; } } { - if (_source62.is_Trait) { + if (_source63.is_Trait) { { - if (((_1358_resolved).dtor_path).Equals(Dafny.Sequence>.FromElements(Dafny.Sequence.UnicodeFromString("_System"), Dafny.Sequence.UnicodeFromString("object")))) { + if (((_1367_resolved).dtor_path).Equals(Dafny.Sequence>.FromElements(Dafny.Sequence.UnicodeFromString("_System"), Dafny.Sequence.UnicodeFromString("object")))) { s = ((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("any"))).MSel(Dafny.Sequence.UnicodeFromString("Any")); } if (!((genTypeContext).dtor_forTraitParents)) { s = (this).Object(RAST.Type.create_DynType(s)); } } - goto after_match9; + goto after_match10; } } { - DAST._IType _1363_t = _source62.dtor_baseType; - DAST._INewtypeRange _1364_range = _source62.dtor_range; - bool _1365_erased = _source62.dtor_erase; + DAST._IType _1372_t = _source63.dtor_baseType; + DAST._INewtypeRange _1373_range = _source63.dtor_range; + bool _1374_erased = _source63.dtor_erase; { - if (_1365_erased) { - Std.Wrappers._IOption _source63 = DCOMP.COMP.NewtypeToRustType(_1363_t, _1364_range); + if (_1374_erased) { + Std.Wrappers._IOption _source64 = DCOMP.COMP.NewtypeToRustType(_1372_t, _1373_range); { - if (_source63.is_Some) { - RAST._IType _1366_v = _source63.dtor_value; - s = _1366_v; - goto after_match10; + if (_source64.is_Some) { + RAST._IType _1375_v = _source64.dtor_value; + s = _1375_v; + goto after_match11; } } { } - after_match10: ; + after_match11: ; } } } - after_match9: ; + after_match10: ; } - goto after_match8; + goto after_match9; } } { - if (_source61.is_Object) { + if (_source62.is_Object) { { s = ((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("any"))).MSel(Dafny.Sequence.UnicodeFromString("Any")); if (!((genTypeContext).dtor_forTraitParents)) { s = (this).Object(RAST.Type.create_DynType(s)); } } - goto after_match8; + goto after_match9; } } { - if (_source61.is_Tuple) { - Dafny.ISequence _1367_types = _source61.dtor_Tuple_a0; + if (_source62.is_Tuple) { + Dafny.ISequence _1376_types = _source62.dtor_Tuple_a0; { - Dafny.ISequence _1368_args; - _1368_args = Dafny.Sequence.FromElements(); - BigInteger _1369_i; - _1369_i = BigInteger.Zero; - while ((_1369_i) < (new BigInteger((_1367_types).Count))) { - RAST._IType _1370_generated; + Dafny.ISequence _1377_args; + _1377_args = Dafny.Sequence.FromElements(); + BigInteger _1378_i; + _1378_i = BigInteger.Zero; + while ((_1378_i) < (new BigInteger((_1376_types).Count))) { + RAST._IType _1379_generated; RAST._IType _out88; - _out88 = (this).GenType((_1367_types).Select(_1369_i), Dafny.Helpers.Let(genTypeContext, _pat_let11_0 => Dafny.Helpers.Let(_pat_let11_0, _1371_dt__update__tmp_h1 => Dafny.Helpers.Let(false, _pat_let12_0 => Dafny.Helpers.Let(_pat_let12_0, _1372_dt__update_hforTraitParents_h1 => DCOMP.GenTypeContext.create((_1371_dt__update__tmp_h1).dtor_inBinding, (_1371_dt__update__tmp_h1).dtor_inFn, _1372_dt__update_hforTraitParents_h1)))))); - _1370_generated = _out88; - _1368_args = Dafny.Sequence.Concat(_1368_args, Dafny.Sequence.FromElements(_1370_generated)); - _1369_i = (_1369_i) + (BigInteger.One); + _out88 = (this).GenType((_1376_types).Select(_1378_i), Dafny.Helpers.Let(genTypeContext, _pat_let11_0 => Dafny.Helpers.Let(_pat_let11_0, _1380_dt__update__tmp_h1 => Dafny.Helpers.Let(false, _pat_let12_0 => Dafny.Helpers.Let(_pat_let12_0, _1381_dt__update_hforTraitParents_h1 => DCOMP.GenTypeContext.create((_1380_dt__update__tmp_h1).dtor_inBinding, (_1380_dt__update__tmp_h1).dtor_inFn, _1381_dt__update_hforTraitParents_h1)))))); + _1379_generated = _out88; + _1377_args = Dafny.Sequence.Concat(_1377_args, Dafny.Sequence.FromElements(_1379_generated)); + _1378_i = (_1378_i) + (BigInteger.One); } - if ((new BigInteger((_1367_types).Count)) <= (RAST.__default.MAX__TUPLE__SIZE)) { - s = RAST.Type.create_TupleType(_1368_args); + if ((new BigInteger((_1376_types).Count)) <= (RAST.__default.MAX__TUPLE__SIZE)) { + s = RAST.Type.create_TupleType(_1377_args); } else { - s = RAST.__default.SystemTupleType(_1368_args); + s = RAST.__default.SystemTupleType(_1377_args); } } - goto after_match8; + goto after_match9; } } { - if (_source61.is_Array) { - DAST._IType _1373_element = _source61.dtor_element; - BigInteger _1374_dims = _source61.dtor_dims; + if (_source62.is_Array) { + DAST._IType _1382_element = _source62.dtor_element; + BigInteger _1383_dims = _source62.dtor_dims; { - if ((_1374_dims) > (new BigInteger(16))) { + if ((_1383_dims) > (new BigInteger(16))) { s = RAST.__default.RawType(Dafny.Sequence.UnicodeFromString("Array of dimensions greater than 16")); } else { - RAST._IType _1375_elem; + RAST._IType _1384_elem; RAST._IType _out89; - _out89 = (this).GenType(_1373_element, Dafny.Helpers.Let(genTypeContext, _pat_let13_0 => Dafny.Helpers.Let(_pat_let13_0, _1376_dt__update__tmp_h2 => Dafny.Helpers.Let(false, _pat_let14_0 => Dafny.Helpers.Let(_pat_let14_0, _1377_dt__update_hforTraitParents_h2 => DCOMP.GenTypeContext.create((_1376_dt__update__tmp_h2).dtor_inBinding, (_1376_dt__update__tmp_h2).dtor_inFn, _1377_dt__update_hforTraitParents_h2)))))); - _1375_elem = _out89; - if ((_1374_dims) == (BigInteger.One)) { - s = RAST.Type.create_Array(_1375_elem, Std.Wrappers.Option>.create_None()); + _out89 = (this).GenType(_1382_element, Dafny.Helpers.Let(genTypeContext, _pat_let13_0 => Dafny.Helpers.Let(_pat_let13_0, _1385_dt__update__tmp_h2 => Dafny.Helpers.Let(false, _pat_let14_0 => Dafny.Helpers.Let(_pat_let14_0, _1386_dt__update_hforTraitParents_h2 => DCOMP.GenTypeContext.create((_1385_dt__update__tmp_h2).dtor_inBinding, (_1385_dt__update__tmp_h2).dtor_inFn, _1386_dt__update_hforTraitParents_h2)))))); + _1384_elem = _out89; + if ((_1383_dims) == (BigInteger.One)) { + s = RAST.Type.create_Array(_1384_elem, Std.Wrappers.Option>.create_None()); s = (this).Object(s); } else { - Dafny.ISequence _1378_n; - _1378_n = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Array"), Std.Strings.__default.OfNat(_1374_dims)); - s = ((RAST.__default.dafny__runtime__type).MSel(_1378_n)).Apply(Dafny.Sequence.FromElements(_1375_elem)); + Dafny.ISequence _1387_n; + _1387_n = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Array"), Std.Strings.__default.OfNat(_1383_dims)); + s = ((RAST.__default.dafny__runtime__type).MSel(_1387_n)).Apply(Dafny.Sequence.FromElements(_1384_elem)); s = (this).Object(s); } } } - goto after_match8; + goto after_match9; } } { - if (_source61.is_Seq) { - DAST._IType _1379_element = _source61.dtor_element; + if (_source62.is_Seq) { + DAST._IType _1388_element = _source62.dtor_element; { - RAST._IType _1380_elem; + RAST._IType _1389_elem; RAST._IType _out90; - _out90 = (this).GenType(_1379_element, Dafny.Helpers.Let(genTypeContext, _pat_let15_0 => Dafny.Helpers.Let(_pat_let15_0, _1381_dt__update__tmp_h3 => Dafny.Helpers.Let(false, _pat_let16_0 => Dafny.Helpers.Let(_pat_let16_0, _1382_dt__update_hforTraitParents_h3 => DCOMP.GenTypeContext.create((_1381_dt__update__tmp_h3).dtor_inBinding, (_1381_dt__update__tmp_h3).dtor_inFn, _1382_dt__update_hforTraitParents_h3)))))); - _1380_elem = _out90; - s = RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("Sequence")), Dafny.Sequence.FromElements(_1380_elem)); + _out90 = (this).GenType(_1388_element, Dafny.Helpers.Let(genTypeContext, _pat_let15_0 => Dafny.Helpers.Let(_pat_let15_0, _1390_dt__update__tmp_h3 => Dafny.Helpers.Let(false, _pat_let16_0 => Dafny.Helpers.Let(_pat_let16_0, _1391_dt__update_hforTraitParents_h3 => DCOMP.GenTypeContext.create((_1390_dt__update__tmp_h3).dtor_inBinding, (_1390_dt__update__tmp_h3).dtor_inFn, _1391_dt__update_hforTraitParents_h3)))))); + _1389_elem = _out90; + s = RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("Sequence")), Dafny.Sequence.FromElements(_1389_elem)); } - goto after_match8; + goto after_match9; } } { - if (_source61.is_Set) { - DAST._IType _1383_element = _source61.dtor_element; + if (_source62.is_Set) { + DAST._IType _1392_element = _source62.dtor_element; { - RAST._IType _1384_elem; + RAST._IType _1393_elem; RAST._IType _out91; - _out91 = (this).GenType(_1383_element, Dafny.Helpers.Let(genTypeContext, _pat_let17_0 => Dafny.Helpers.Let(_pat_let17_0, _1385_dt__update__tmp_h4 => Dafny.Helpers.Let(false, _pat_let18_0 => Dafny.Helpers.Let(_pat_let18_0, _1386_dt__update_hforTraitParents_h4 => DCOMP.GenTypeContext.create((_1385_dt__update__tmp_h4).dtor_inBinding, (_1385_dt__update__tmp_h4).dtor_inFn, _1386_dt__update_hforTraitParents_h4)))))); - _1384_elem = _out91; - s = RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("Set")), Dafny.Sequence.FromElements(_1384_elem)); + _out91 = (this).GenType(_1392_element, Dafny.Helpers.Let(genTypeContext, _pat_let17_0 => Dafny.Helpers.Let(_pat_let17_0, _1394_dt__update__tmp_h4 => Dafny.Helpers.Let(false, _pat_let18_0 => Dafny.Helpers.Let(_pat_let18_0, _1395_dt__update_hforTraitParents_h4 => DCOMP.GenTypeContext.create((_1394_dt__update__tmp_h4).dtor_inBinding, (_1394_dt__update__tmp_h4).dtor_inFn, _1395_dt__update_hforTraitParents_h4)))))); + _1393_elem = _out91; + s = RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("Set")), Dafny.Sequence.FromElements(_1393_elem)); } - goto after_match8; + goto after_match9; } } { - if (_source61.is_Multiset) { - DAST._IType _1387_element = _source61.dtor_element; + if (_source62.is_Multiset) { + DAST._IType _1396_element = _source62.dtor_element; { - RAST._IType _1388_elem; + RAST._IType _1397_elem; RAST._IType _out92; - _out92 = (this).GenType(_1387_element, Dafny.Helpers.Let(genTypeContext, _pat_let19_0 => Dafny.Helpers.Let(_pat_let19_0, _1389_dt__update__tmp_h5 => Dafny.Helpers.Let(false, _pat_let20_0 => Dafny.Helpers.Let(_pat_let20_0, _1390_dt__update_hforTraitParents_h5 => DCOMP.GenTypeContext.create((_1389_dt__update__tmp_h5).dtor_inBinding, (_1389_dt__update__tmp_h5).dtor_inFn, _1390_dt__update_hforTraitParents_h5)))))); - _1388_elem = _out92; - s = RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("Multiset")), Dafny.Sequence.FromElements(_1388_elem)); + _out92 = (this).GenType(_1396_element, Dafny.Helpers.Let(genTypeContext, _pat_let19_0 => Dafny.Helpers.Let(_pat_let19_0, _1398_dt__update__tmp_h5 => Dafny.Helpers.Let(false, _pat_let20_0 => Dafny.Helpers.Let(_pat_let20_0, _1399_dt__update_hforTraitParents_h5 => DCOMP.GenTypeContext.create((_1398_dt__update__tmp_h5).dtor_inBinding, (_1398_dt__update__tmp_h5).dtor_inFn, _1399_dt__update_hforTraitParents_h5)))))); + _1397_elem = _out92; + s = RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("Multiset")), Dafny.Sequence.FromElements(_1397_elem)); } - goto after_match8; + goto after_match9; } } { - if (_source61.is_Map) { - DAST._IType _1391_key = _source61.dtor_key; - DAST._IType _1392_value = _source61.dtor_value; + if (_source62.is_Map) { + DAST._IType _1400_key = _source62.dtor_key; + DAST._IType _1401_value = _source62.dtor_value; { - RAST._IType _1393_keyType; + RAST._IType _1402_keyType; RAST._IType _out93; - _out93 = (this).GenType(_1391_key, Dafny.Helpers.Let(genTypeContext, _pat_let21_0 => Dafny.Helpers.Let(_pat_let21_0, _1394_dt__update__tmp_h6 => Dafny.Helpers.Let(false, _pat_let22_0 => Dafny.Helpers.Let(_pat_let22_0, _1395_dt__update_hforTraitParents_h6 => DCOMP.GenTypeContext.create((_1394_dt__update__tmp_h6).dtor_inBinding, (_1394_dt__update__tmp_h6).dtor_inFn, _1395_dt__update_hforTraitParents_h6)))))); - _1393_keyType = _out93; - RAST._IType _1396_valueType; + _out93 = (this).GenType(_1400_key, Dafny.Helpers.Let(genTypeContext, _pat_let21_0 => Dafny.Helpers.Let(_pat_let21_0, _1403_dt__update__tmp_h6 => Dafny.Helpers.Let(false, _pat_let22_0 => Dafny.Helpers.Let(_pat_let22_0, _1404_dt__update_hforTraitParents_h6 => DCOMP.GenTypeContext.create((_1403_dt__update__tmp_h6).dtor_inBinding, (_1403_dt__update__tmp_h6).dtor_inFn, _1404_dt__update_hforTraitParents_h6)))))); + _1402_keyType = _out93; + RAST._IType _1405_valueType; RAST._IType _out94; - _out94 = (this).GenType(_1392_value, genTypeContext); - _1396_valueType = _out94; - s = RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("Map")), Dafny.Sequence.FromElements(_1393_keyType, _1396_valueType)); + _out94 = (this).GenType(_1401_value, genTypeContext); + _1405_valueType = _out94; + s = RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("Map")), Dafny.Sequence.FromElements(_1402_keyType, _1405_valueType)); } - goto after_match8; + goto after_match9; } } { - if (_source61.is_MapBuilder) { - DAST._IType _1397_key = _source61.dtor_key; - DAST._IType _1398_value = _source61.dtor_value; + if (_source62.is_MapBuilder) { + DAST._IType _1406_key = _source62.dtor_key; + DAST._IType _1407_value = _source62.dtor_value; { - RAST._IType _1399_keyType; + RAST._IType _1408_keyType; RAST._IType _out95; - _out95 = (this).GenType(_1397_key, Dafny.Helpers.Let(genTypeContext, _pat_let23_0 => Dafny.Helpers.Let(_pat_let23_0, _1400_dt__update__tmp_h7 => Dafny.Helpers.Let(false, _pat_let24_0 => Dafny.Helpers.Let(_pat_let24_0, _1401_dt__update_hforTraitParents_h7 => DCOMP.GenTypeContext.create((_1400_dt__update__tmp_h7).dtor_inBinding, (_1400_dt__update__tmp_h7).dtor_inFn, _1401_dt__update_hforTraitParents_h7)))))); - _1399_keyType = _out95; - RAST._IType _1402_valueType; + _out95 = (this).GenType(_1406_key, Dafny.Helpers.Let(genTypeContext, _pat_let23_0 => Dafny.Helpers.Let(_pat_let23_0, _1409_dt__update__tmp_h7 => Dafny.Helpers.Let(false, _pat_let24_0 => Dafny.Helpers.Let(_pat_let24_0, _1410_dt__update_hforTraitParents_h7 => DCOMP.GenTypeContext.create((_1409_dt__update__tmp_h7).dtor_inBinding, (_1409_dt__update__tmp_h7).dtor_inFn, _1410_dt__update_hforTraitParents_h7)))))); + _1408_keyType = _out95; + RAST._IType _1411_valueType; RAST._IType _out96; - _out96 = (this).GenType(_1398_value, genTypeContext); - _1402_valueType = _out96; - s = RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("MapBuilder")), Dafny.Sequence.FromElements(_1399_keyType, _1402_valueType)); + _out96 = (this).GenType(_1407_value, genTypeContext); + _1411_valueType = _out96; + s = RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("MapBuilder")), Dafny.Sequence.FromElements(_1408_keyType, _1411_valueType)); } - goto after_match8; + goto after_match9; } } { - if (_source61.is_SetBuilder) { - DAST._IType _1403_elem = _source61.dtor_element; + if (_source62.is_SetBuilder) { + DAST._IType _1412_elem = _source62.dtor_element; { - RAST._IType _1404_elemType; + RAST._IType _1413_elemType; RAST._IType _out97; - _out97 = (this).GenType(_1403_elem, Dafny.Helpers.Let(genTypeContext, _pat_let25_0 => Dafny.Helpers.Let(_pat_let25_0, _1405_dt__update__tmp_h8 => Dafny.Helpers.Let(false, _pat_let26_0 => Dafny.Helpers.Let(_pat_let26_0, _1406_dt__update_hforTraitParents_h8 => DCOMP.GenTypeContext.create((_1405_dt__update__tmp_h8).dtor_inBinding, (_1405_dt__update__tmp_h8).dtor_inFn, _1406_dt__update_hforTraitParents_h8)))))); - _1404_elemType = _out97; - s = RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("SetBuilder")), Dafny.Sequence.FromElements(_1404_elemType)); + _out97 = (this).GenType(_1412_elem, Dafny.Helpers.Let(genTypeContext, _pat_let25_0 => Dafny.Helpers.Let(_pat_let25_0, _1414_dt__update__tmp_h8 => Dafny.Helpers.Let(false, _pat_let26_0 => Dafny.Helpers.Let(_pat_let26_0, _1415_dt__update_hforTraitParents_h8 => DCOMP.GenTypeContext.create((_1414_dt__update__tmp_h8).dtor_inBinding, (_1414_dt__update__tmp_h8).dtor_inFn, _1415_dt__update_hforTraitParents_h8)))))); + _1413_elemType = _out97; + s = RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("SetBuilder")), Dafny.Sequence.FromElements(_1413_elemType)); } - goto after_match8; + goto after_match9; } } { - if (_source61.is_Arrow) { - Dafny.ISequence _1407_args = _source61.dtor_args; - DAST._IType _1408_result = _source61.dtor_result; + if (_source62.is_Arrow) { + Dafny.ISequence _1416_args = _source62.dtor_args; + DAST._IType _1417_result = _source62.dtor_result; { - Dafny.ISequence _1409_argTypes; - _1409_argTypes = Dafny.Sequence.FromElements(); - BigInteger _1410_i; - _1410_i = BigInteger.Zero; - while ((_1410_i) < (new BigInteger((_1407_args).Count))) { - RAST._IType _1411_generated; + Dafny.ISequence _1418_argTypes; + _1418_argTypes = Dafny.Sequence.FromElements(); + BigInteger _1419_i; + _1419_i = BigInteger.Zero; + while ((_1419_i) < (new BigInteger((_1416_args).Count))) { + RAST._IType _1420_generated; RAST._IType _out98; - _out98 = (this).GenType((_1407_args).Select(_1410_i), Dafny.Helpers.Let(genTypeContext, _pat_let27_0 => Dafny.Helpers.Let(_pat_let27_0, _1412_dt__update__tmp_h9 => Dafny.Helpers.Let(false, _pat_let28_0 => Dafny.Helpers.Let(_pat_let28_0, _1413_dt__update_hforTraitParents_h9 => Dafny.Helpers.Let(true, _pat_let29_0 => Dafny.Helpers.Let(_pat_let29_0, _1414_dt__update_hinFn_h0 => DCOMP.GenTypeContext.create((_1412_dt__update__tmp_h9).dtor_inBinding, _1414_dt__update_hinFn_h0, _1413_dt__update_hforTraitParents_h9)))))))); - _1411_generated = _out98; - _1409_argTypes = Dafny.Sequence.Concat(_1409_argTypes, Dafny.Sequence.FromElements(RAST.Type.create_Borrowed(_1411_generated))); - _1410_i = (_1410_i) + (BigInteger.One); + _out98 = (this).GenType((_1416_args).Select(_1419_i), Dafny.Helpers.Let(genTypeContext, _pat_let27_0 => Dafny.Helpers.Let(_pat_let27_0, _1421_dt__update__tmp_h9 => Dafny.Helpers.Let(false, _pat_let28_0 => Dafny.Helpers.Let(_pat_let28_0, _1422_dt__update_hforTraitParents_h9 => Dafny.Helpers.Let(true, _pat_let29_0 => Dafny.Helpers.Let(_pat_let29_0, _1423_dt__update_hinFn_h0 => DCOMP.GenTypeContext.create((_1421_dt__update__tmp_h9).dtor_inBinding, _1423_dt__update_hinFn_h0, _1422_dt__update_hforTraitParents_h9)))))))); + _1420_generated = _out98; + _1418_argTypes = Dafny.Sequence.Concat(_1418_argTypes, Dafny.Sequence.FromElements(RAST.Type.create_Borrowed(_1420_generated))); + _1419_i = (_1419_i) + (BigInteger.One); } - RAST._IType _1415_resultType; + RAST._IType _1424_resultType; RAST._IType _out99; - _out99 = (this).GenType(_1408_result, DCOMP.GenTypeContext.create(((genTypeContext).dtor_inFn) || ((genTypeContext).dtor_inBinding), false, false)); - _1415_resultType = _out99; - s = RAST.__default.Rc(RAST.Type.create_DynType(RAST.Type.create_FnType(_1409_argTypes, _1415_resultType))); + _out99 = (this).GenType(_1417_result, DCOMP.GenTypeContext.create(((genTypeContext).dtor_inFn) || ((genTypeContext).dtor_inBinding), false, false)); + _1424_resultType = _out99; + s = RAST.__default.Rc(RAST.Type.create_DynType(RAST.Type.create_FnType(_1418_argTypes, _1424_resultType))); } - goto after_match8; + goto after_match9; } } { - if (_source61.is_TypeArg) { - Dafny.ISequence _h90 = _source61.dtor_TypeArg_a0; - Dafny.ISequence _1416_name = _h90; - s = RAST.Type.create_TIdentifier(DCOMP.__default.escapeName(_1416_name)); - goto after_match8; + if (_source62.is_TypeArg) { + Dafny.ISequence _h90 = _source62.dtor_TypeArg_a0; + Dafny.ISequence _1425_name = _h90; + s = RAST.Type.create_TIdentifier(DCOMP.__default.escapeName(_1425_name)); + goto after_match9; } } { - if (_source61.is_Primitive) { - DAST._IPrimitive _1417_p = _source61.dtor_Primitive_a0; + if (_source62.is_Primitive) { + DAST._IPrimitive _1426_p = _source62.dtor_Primitive_a0; { - DAST._IPrimitive _source64 = _1417_p; + DAST._IPrimitive _source65 = _1426_p; { - if (_source64.is_Int) { + if (_source65.is_Int) { s = (RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("DafnyInt")); - goto after_match11; + goto after_match12; } } { - if (_source64.is_Real) { + if (_source65.is_Real) { s = (RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("BigRational")); - goto after_match11; + goto after_match12; } } { - if (_source64.is_String) { + if (_source65.is_String) { s = RAST.Type.create_TypeApp((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("Sequence")), Dafny.Sequence.FromElements((RAST.__default.dafny__runtime__type).MSel((this).DafnyChar))); - goto after_match11; + goto after_match12; } } { - if (_source64.is_Bool) { + if (_source65.is_Bool) { s = RAST.Type.create_Bool(); - goto after_match11; + goto after_match12; } } { s = (RAST.__default.dafny__runtime__type).MSel((this).DafnyChar); } - after_match11: ; + after_match12: ; } - goto after_match8; + goto after_match9; } } { - Dafny.ISequence _1418_v = _source61.dtor_Passthrough_a0; - s = RAST.__default.RawType(_1418_v); + Dafny.ISequence _1427_v = _source62.dtor_Passthrough_a0; + s = RAST.__default.RawType(_1427_v); } - after_match8: ; + after_match9: ; return s; } public bool EnclosingIsTrait(DAST._IType tpe) { @@ -2095,274 +2126,274 @@ public void GenClassImplBody(Dafny.ISequence body, bool forTrait, traitBodies = Dafny.Map>, Dafny.ISequence>.Empty; s = Dafny.Sequence.FromElements(); traitBodies = Dafny.Map>, Dafny.ISequence>.FromElements(); - BigInteger _hi25 = new BigInteger((body).Count); - for (BigInteger _1419_i = BigInteger.Zero; _1419_i < _hi25; _1419_i++) { - DAST._IMethod _source65 = (body).Select(_1419_i); + BigInteger _hi26 = new BigInteger((body).Count); + for (BigInteger _1428_i = BigInteger.Zero; _1428_i < _hi26; _1428_i++) { + DAST._IMethod _source66 = (body).Select(_1428_i); { - DAST._IMethod _1420_m = _source65; + DAST._IMethod _1429_m = _source66; { - Std.Wrappers._IOption>> _source66 = (_1420_m).dtor_overridingPath; + Std.Wrappers._IOption>> _source67 = (_1429_m).dtor_overridingPath; { - if (_source66.is_Some) { - Dafny.ISequence> _1421_p = _source66.dtor_value; + if (_source67.is_Some) { + Dafny.ISequence> _1430_p = _source67.dtor_value; { - Dafny.ISequence _1422_existing; - _1422_existing = Dafny.Sequence.FromElements(); - if ((traitBodies).Contains(_1421_p)) { - _1422_existing = Dafny.Map>, Dafny.ISequence>.Select(traitBodies,_1421_p); + Dafny.ISequence _1431_existing; + _1431_existing = Dafny.Sequence.FromElements(); + if ((traitBodies).Contains(_1430_p)) { + _1431_existing = Dafny.Map>, Dafny.ISequence>.Select(traitBodies,_1430_p); } - if (((new BigInteger(((_1420_m).dtor_typeParams).Count)).Sign == 1) && ((this).EnclosingIsTrait(enclosingType))) { + if (((new BigInteger(((_1429_m).dtor_typeParams).Count)).Sign == 1) && ((this).EnclosingIsTrait(enclosingType))) { (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.UnicodeFromString("Error: Rust does not support method with generic type parameters in traits")); } - RAST._IImplMember _1423_genMethod; + RAST._IImplMember _1432_genMethod; RAST._IImplMember _out100; - _out100 = (this).GenMethod(_1420_m, true, enclosingType, enclosingTypeParams); - _1423_genMethod = _out100; - _1422_existing = Dafny.Sequence.Concat(_1422_existing, Dafny.Sequence.FromElements(_1423_genMethod)); - traitBodies = Dafny.Map>, Dafny.ISequence>.Merge(traitBodies, Dafny.Map>, Dafny.ISequence>.FromElements(new Dafny.Pair>, Dafny.ISequence>(_1421_p, _1422_existing))); + _out100 = (this).GenMethod(_1429_m, true, enclosingType, enclosingTypeParams); + _1432_genMethod = _out100; + _1431_existing = Dafny.Sequence.Concat(_1431_existing, Dafny.Sequence.FromElements(_1432_genMethod)); + traitBodies = Dafny.Map>, Dafny.ISequence>.Merge(traitBodies, Dafny.Map>, Dafny.ISequence>.FromElements(new Dafny.Pair>, Dafny.ISequence>(_1430_p, _1431_existing))); } - goto after_match13; + goto after_match14; } } { { - RAST._IImplMember _1424_generated; + RAST._IImplMember _1433_generated; RAST._IImplMember _out101; - _out101 = (this).GenMethod(_1420_m, forTrait, enclosingType, enclosingTypeParams); - _1424_generated = _out101; - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(_1424_generated)); + _out101 = (this).GenMethod(_1429_m, forTrait, enclosingType, enclosingTypeParams); + _1433_generated = _out101; + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(_1433_generated)); } } - after_match13: ; + after_match14: ; } } - after_match12: ; + after_match13: ; } } public Dafny.ISequence GenParams(Dafny.ISequence @params) { Dafny.ISequence s = Dafny.Sequence.Empty; s = Dafny.Sequence.FromElements(); - BigInteger _hi26 = new BigInteger((@params).Count); - for (BigInteger _1425_i = BigInteger.Zero; _1425_i < _hi26; _1425_i++) { - DAST._IFormal _1426_param; - _1426_param = (@params).Select(_1425_i); - RAST._IType _1427_paramType; + BigInteger _hi27 = new BigInteger((@params).Count); + for (BigInteger _1434_i = BigInteger.Zero; _1434_i < _hi27; _1434_i++) { + DAST._IFormal _1435_param; + _1435_param = (@params).Select(_1434_i); + RAST._IType _1436_paramType; RAST._IType _out102; - _out102 = (this).GenType((_1426_param).dtor_typ, DCOMP.GenTypeContext.@default()); - _1427_paramType = _out102; - if ((!((_1427_paramType).CanReadWithoutClone())) && (!((_1426_param).dtor_attributes).Contains(DCOMP.__default.AttributeOwned))) { - _1427_paramType = RAST.Type.create_Borrowed(_1427_paramType); + _out102 = (this).GenType((_1435_param).dtor_typ, DCOMP.GenTypeContext.@default()); + _1436_paramType = _out102; + if ((!((_1436_paramType).CanReadWithoutClone())) && (!((_1435_param).dtor_attributes).Contains(DCOMP.__default.AttributeOwned))) { + _1436_paramType = RAST.Type.create_Borrowed(_1436_paramType); } - s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.Formal.create(DCOMP.__default.escapeName((_1426_param).dtor_name), _1427_paramType))); + s = Dafny.Sequence.Concat(s, Dafny.Sequence.FromElements(RAST.Formal.create(DCOMP.__default.escapeName((_1435_param).dtor_name), _1436_paramType))); } return s; } public RAST._IImplMember GenMethod(DAST._IMethod m, bool forTrait, DAST._IType enclosingType, Dafny.ISequence enclosingTypeParams) { RAST._IImplMember s = RAST.ImplMember.Default(); - Dafny.ISequence _1428_params; + Dafny.ISequence _1437_params; Dafny.ISequence _out103; _out103 = (this).GenParams((m).dtor_params); - _1428_params = _out103; - Dafny.ISequence> _1429_paramNames; - _1429_paramNames = Dafny.Sequence>.FromElements(); - Dafny.IMap,RAST._IType> _1430_paramTypes; - _1430_paramTypes = Dafny.Map, RAST._IType>.FromElements(); - BigInteger _hi27 = new BigInteger(((m).dtor_params).Count); - for (BigInteger _1431_paramI = BigInteger.Zero; _1431_paramI < _hi27; _1431_paramI++) { - DAST._IFormal _1432_dafny__formal; - _1432_dafny__formal = ((m).dtor_params).Select(_1431_paramI); - RAST._IFormal _1433_formal; - _1433_formal = (_1428_params).Select(_1431_paramI); - Dafny.ISequence _1434_name; - _1434_name = (_1433_formal).dtor_name; - _1429_paramNames = Dafny.Sequence>.Concat(_1429_paramNames, Dafny.Sequence>.FromElements(_1434_name)); - _1430_paramTypes = Dafny.Map, RAST._IType>.Update(_1430_paramTypes, _1434_name, (_1433_formal).dtor_tpe); - } - Dafny.ISequence _1435_fnName; - _1435_fnName = DCOMP.__default.escapeName((m).dtor_name); - DCOMP._ISelfInfo _1436_selfIdent; - _1436_selfIdent = DCOMP.SelfInfo.create_NoSelf(); + _1437_params = _out103; + Dafny.ISequence> _1438_paramNames; + _1438_paramNames = Dafny.Sequence>.FromElements(); + Dafny.IMap,RAST._IType> _1439_paramTypes; + _1439_paramTypes = Dafny.Map, RAST._IType>.FromElements(); + BigInteger _hi28 = new BigInteger(((m).dtor_params).Count); + for (BigInteger _1440_paramI = BigInteger.Zero; _1440_paramI < _hi28; _1440_paramI++) { + DAST._IFormal _1441_dafny__formal; + _1441_dafny__formal = ((m).dtor_params).Select(_1440_paramI); + RAST._IFormal _1442_formal; + _1442_formal = (_1437_params).Select(_1440_paramI); + Dafny.ISequence _1443_name; + _1443_name = (_1442_formal).dtor_name; + _1438_paramNames = Dafny.Sequence>.Concat(_1438_paramNames, Dafny.Sequence>.FromElements(_1443_name)); + _1439_paramTypes = Dafny.Map, RAST._IType>.Update(_1439_paramTypes, _1443_name, (_1442_formal).dtor_tpe); + } + Dafny.ISequence _1444_fnName; + _1444_fnName = DCOMP.__default.escapeName((m).dtor_name); + DCOMP._ISelfInfo _1445_selfIdent; + _1445_selfIdent = DCOMP.SelfInfo.create_NoSelf(); if (!((m).dtor_isStatic)) { - Dafny.ISequence _1437_selfId; - _1437_selfId = Dafny.Sequence.UnicodeFromString("self"); + Dafny.ISequence _1446_selfId; + _1446_selfId = Dafny.Sequence.UnicodeFromString("self"); if ((m).dtor_outVarsAreUninitFieldsToAssign) { - _1437_selfId = Dafny.Sequence.UnicodeFromString("this"); + _1446_selfId = Dafny.Sequence.UnicodeFromString("this"); } var _pat_let_tv2 = enclosingTypeParams; - DAST._IType _1438_instanceType; - DAST._IType _source67 = enclosingType; + DAST._IType _1447_instanceType; + DAST._IType _source68 = enclosingType; { - if (_source67.is_UserDefined) { - DAST._IResolvedType _1439_r = _source67.dtor_resolved; - _1438_instanceType = DAST.Type.create_UserDefined(Dafny.Helpers.Let(_1439_r, _pat_let30_0 => Dafny.Helpers.Let(_pat_let30_0, _1440_dt__update__tmp_h0 => Dafny.Helpers.Let, DAST._IResolvedType>(_pat_let_tv2, _pat_let31_0 => Dafny.Helpers.Let, DAST._IResolvedType>(_pat_let31_0, _1441_dt__update_htypeArgs_h0 => DAST.ResolvedType.create((_1440_dt__update__tmp_h0).dtor_path, _1441_dt__update_htypeArgs_h0, (_1440_dt__update__tmp_h0).dtor_kind, (_1440_dt__update__tmp_h0).dtor_attributes, (_1440_dt__update__tmp_h0).dtor_properMethods, (_1440_dt__update__tmp_h0).dtor_extendedTypes)))))); - goto after_match14; + if (_source68.is_UserDefined) { + DAST._IResolvedType _1448_r = _source68.dtor_resolved; + _1447_instanceType = DAST.Type.create_UserDefined(Dafny.Helpers.Let(_1448_r, _pat_let30_0 => Dafny.Helpers.Let(_pat_let30_0, _1449_dt__update__tmp_h0 => Dafny.Helpers.Let, DAST._IResolvedType>(_pat_let_tv2, _pat_let31_0 => Dafny.Helpers.Let, DAST._IResolvedType>(_pat_let31_0, _1450_dt__update_htypeArgs_h0 => DAST.ResolvedType.create((_1449_dt__update__tmp_h0).dtor_path, _1450_dt__update_htypeArgs_h0, (_1449_dt__update__tmp_h0).dtor_kind, (_1449_dt__update__tmp_h0).dtor_attributes, (_1449_dt__update__tmp_h0).dtor_properMethods, (_1449_dt__update__tmp_h0).dtor_extendedTypes)))))); + goto after_match15; } } { - _1438_instanceType = enclosingType; + _1447_instanceType = enclosingType; } - after_match14: ; + after_match15: ; if (forTrait) { - RAST._IFormal _1442_selfFormal; + RAST._IFormal _1451_selfFormal; if ((m).dtor_wasFunction) { - _1442_selfFormal = RAST.Formal.selfBorrowed; + _1451_selfFormal = RAST.Formal.selfBorrowed; } else { - _1442_selfFormal = RAST.Formal.selfBorrowedMut; + _1451_selfFormal = RAST.Formal.selfBorrowedMut; } - _1428_params = Dafny.Sequence.Concat(Dafny.Sequence.FromElements(_1442_selfFormal), _1428_params); + _1437_params = Dafny.Sequence.Concat(Dafny.Sequence.FromElements(_1451_selfFormal), _1437_params); } else { - RAST._IType _1443_tpe; + RAST._IType _1452_tpe; RAST._IType _out104; - _out104 = (this).GenType(_1438_instanceType, DCOMP.GenTypeContext.@default()); - _1443_tpe = _out104; - if ((_1437_selfId).Equals(Dafny.Sequence.UnicodeFromString("this"))) { - _1443_tpe = RAST.Type.create_Borrowed(_1443_tpe); - } else if ((_1437_selfId).Equals(Dafny.Sequence.UnicodeFromString("self"))) { - if ((_1443_tpe).IsObjectOrPointer()) { + _out104 = (this).GenType(_1447_instanceType, DCOMP.GenTypeContext.@default()); + _1452_tpe = _out104; + if ((_1446_selfId).Equals(Dafny.Sequence.UnicodeFromString("this"))) { + _1452_tpe = RAST.Type.create_Borrowed(_1452_tpe); + } else if ((_1446_selfId).Equals(Dafny.Sequence.UnicodeFromString("self"))) { + if ((_1452_tpe).IsObjectOrPointer()) { if ((m).dtor_wasFunction) { - _1443_tpe = RAST.__default.SelfBorrowed; + _1452_tpe = RAST.__default.SelfBorrowed; } else { - _1443_tpe = RAST.__default.SelfBorrowedMut; + _1452_tpe = RAST.__default.SelfBorrowedMut; } } else { if ((((enclosingType).is_UserDefined) && ((((enclosingType).dtor_resolved).dtor_kind).is_Datatype)) && ((this).IsRcWrapped(((enclosingType).dtor_resolved).dtor_attributes))) { - _1443_tpe = RAST.Type.create_Borrowed(RAST.__default.Rc(RAST.Type.create_SelfOwned())); + _1452_tpe = RAST.Type.create_Borrowed(RAST.__default.Rc(RAST.Type.create_SelfOwned())); } else { - _1443_tpe = RAST.Type.create_Borrowed(RAST.Type.create_SelfOwned()); + _1452_tpe = RAST.Type.create_Borrowed(RAST.Type.create_SelfOwned()); } } } - _1428_params = Dafny.Sequence.Concat(Dafny.Sequence.FromElements(RAST.Formal.create(_1437_selfId, _1443_tpe)), _1428_params); + _1437_params = Dafny.Sequence.Concat(Dafny.Sequence.FromElements(RAST.Formal.create(_1446_selfId, _1452_tpe)), _1437_params); } - _1436_selfIdent = DCOMP.SelfInfo.create_ThisTyped(_1437_selfId, _1438_instanceType); + _1445_selfIdent = DCOMP.SelfInfo.create_ThisTyped(_1446_selfId, _1447_instanceType); } - Dafny.ISequence _1444_retTypeArgs; - _1444_retTypeArgs = Dafny.Sequence.FromElements(); - BigInteger _1445_typeI; - _1445_typeI = BigInteger.Zero; - while ((_1445_typeI) < (new BigInteger(((m).dtor_outTypes).Count))) { - RAST._IType _1446_typeExpr; + Dafny.ISequence _1453_retTypeArgs; + _1453_retTypeArgs = Dafny.Sequence.FromElements(); + BigInteger _1454_typeI; + _1454_typeI = BigInteger.Zero; + while ((_1454_typeI) < (new BigInteger(((m).dtor_outTypes).Count))) { + RAST._IType _1455_typeExpr; RAST._IType _out105; - _out105 = (this).GenType(((m).dtor_outTypes).Select(_1445_typeI), DCOMP.GenTypeContext.@default()); - _1446_typeExpr = _out105; - _1444_retTypeArgs = Dafny.Sequence.Concat(_1444_retTypeArgs, Dafny.Sequence.FromElements(_1446_typeExpr)); - _1445_typeI = (_1445_typeI) + (BigInteger.One); + _out105 = (this).GenType(((m).dtor_outTypes).Select(_1454_typeI), DCOMP.GenTypeContext.@default()); + _1455_typeExpr = _out105; + _1453_retTypeArgs = Dafny.Sequence.Concat(_1453_retTypeArgs, Dafny.Sequence.FromElements(_1455_typeExpr)); + _1454_typeI = (_1454_typeI) + (BigInteger.One); } - RAST._IVisibility _1447_visibility; + RAST._IVisibility _1456_visibility; if (forTrait) { - _1447_visibility = RAST.Visibility.create_PRIV(); + _1456_visibility = RAST.Visibility.create_PRIV(); } else { - _1447_visibility = RAST.Visibility.create_PUB(); - } - Dafny.ISequence _1448_typeParamsFiltered; - _1448_typeParamsFiltered = Dafny.Sequence.FromElements(); - BigInteger _hi28 = new BigInteger(((m).dtor_typeParams).Count); - for (BigInteger _1449_typeParamI = BigInteger.Zero; _1449_typeParamI < _hi28; _1449_typeParamI++) { - DAST._ITypeArgDecl _1450_typeParam; - _1450_typeParam = ((m).dtor_typeParams).Select(_1449_typeParamI); - if (!((enclosingTypeParams).Contains(DAST.Type.create_TypeArg((_1450_typeParam).dtor_name)))) { - _1448_typeParamsFiltered = Dafny.Sequence.Concat(_1448_typeParamsFiltered, Dafny.Sequence.FromElements(_1450_typeParam)); - } - } - Dafny.ISequence _1451_typeParams; - _1451_typeParams = Dafny.Sequence.FromElements(); - if ((new BigInteger((_1448_typeParamsFiltered).Count)).Sign == 1) { - BigInteger _hi29 = new BigInteger((_1448_typeParamsFiltered).Count); - for (BigInteger _1452_i = BigInteger.Zero; _1452_i < _hi29; _1452_i++) { - DAST._IType _1453_typeArg; - RAST._ITypeParamDecl _1454_rTypeParamDecl; + _1456_visibility = RAST.Visibility.create_PUB(); + } + Dafny.ISequence _1457_typeParamsFiltered; + _1457_typeParamsFiltered = Dafny.Sequence.FromElements(); + BigInteger _hi29 = new BigInteger(((m).dtor_typeParams).Count); + for (BigInteger _1458_typeParamI = BigInteger.Zero; _1458_typeParamI < _hi29; _1458_typeParamI++) { + DAST._ITypeArgDecl _1459_typeParam; + _1459_typeParam = ((m).dtor_typeParams).Select(_1458_typeParamI); + if (!((enclosingTypeParams).Contains(DAST.Type.create_TypeArg((_1459_typeParam).dtor_name)))) { + _1457_typeParamsFiltered = Dafny.Sequence.Concat(_1457_typeParamsFiltered, Dafny.Sequence.FromElements(_1459_typeParam)); + } + } + Dafny.ISequence _1460_typeParams; + _1460_typeParams = Dafny.Sequence.FromElements(); + if ((new BigInteger((_1457_typeParamsFiltered).Count)).Sign == 1) { + BigInteger _hi30 = new BigInteger((_1457_typeParamsFiltered).Count); + for (BigInteger _1461_i = BigInteger.Zero; _1461_i < _hi30; _1461_i++) { + DAST._IType _1462_typeArg; + RAST._ITypeParamDecl _1463_rTypeParamDecl; DAST._IType _out106; RAST._ITypeParamDecl _out107; - (this).GenTypeParam((_1448_typeParamsFiltered).Select(_1452_i), out _out106, out _out107); - _1453_typeArg = _out106; - _1454_rTypeParamDecl = _out107; - RAST._ITypeParamDecl _1455_dt__update__tmp_h1 = _1454_rTypeParamDecl; - Dafny.ISequence _1456_dt__update_hconstraints_h0 = Dafny.Sequence.Concat((_1454_rTypeParamDecl).dtor_constraints, Dafny.Sequence.FromElements(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("default"))).MSel(Dafny.Sequence.UnicodeFromString("Default")))); - _1454_rTypeParamDecl = RAST.TypeParamDecl.create((_1455_dt__update__tmp_h1).dtor_content, _1456_dt__update_hconstraints_h0); - _1451_typeParams = Dafny.Sequence.Concat(_1451_typeParams, Dafny.Sequence.FromElements(_1454_rTypeParamDecl)); - } - } - Std.Wrappers._IOption _1457_fBody = Std.Wrappers.Option.Default(); - DCOMP._IEnvironment _1458_env = DCOMP.Environment.Default(); - RAST._IExpr _1459_preBody; - _1459_preBody = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")); - Dafny.ISequence> _1460_preAssignNames; - _1460_preAssignNames = Dafny.Sequence>.FromElements(); - Dafny.IMap,RAST._IType> _1461_preAssignTypes; - _1461_preAssignTypes = Dafny.Map, RAST._IType>.FromElements(); + (this).GenTypeParam((_1457_typeParamsFiltered).Select(_1461_i), out _out106, out _out107); + _1462_typeArg = _out106; + _1463_rTypeParamDecl = _out107; + RAST._ITypeParamDecl _1464_dt__update__tmp_h1 = _1463_rTypeParamDecl; + Dafny.ISequence _1465_dt__update_hconstraints_h0 = Dafny.Sequence.Concat((_1463_rTypeParamDecl).dtor_constraints, Dafny.Sequence.FromElements(((RAST.__default.std__type).MSel(Dafny.Sequence.UnicodeFromString("default"))).MSel(Dafny.Sequence.UnicodeFromString("Default")))); + _1463_rTypeParamDecl = RAST.TypeParamDecl.create((_1464_dt__update__tmp_h1).dtor_content, _1465_dt__update_hconstraints_h0); + _1460_typeParams = Dafny.Sequence.Concat(_1460_typeParams, Dafny.Sequence.FromElements(_1463_rTypeParamDecl)); + } + } + Std.Wrappers._IOption _1466_fBody = Std.Wrappers.Option.Default(); + DCOMP._IEnvironment _1467_env = DCOMP.Environment.Default(); + RAST._IExpr _1468_preBody; + _1468_preBody = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")); + Dafny.ISequence> _1469_preAssignNames; + _1469_preAssignNames = Dafny.Sequence>.FromElements(); + Dafny.IMap,RAST._IType> _1470_preAssignTypes; + _1470_preAssignTypes = Dafny.Map, RAST._IType>.FromElements(); if ((m).dtor_hasBody) { - Std.Wrappers._IOption>> _1462_earlyReturn; - _1462_earlyReturn = Std.Wrappers.Option>>.create_None(); - Std.Wrappers._IOption>> _source68 = (m).dtor_outVars; + Std.Wrappers._IOption>> _1471_earlyReturn; + _1471_earlyReturn = Std.Wrappers.Option>>.create_None(); + Std.Wrappers._IOption>> _source69 = (m).dtor_outVars; { - if (_source68.is_Some) { - Dafny.ISequence> _1463_outVars = _source68.dtor_value; + if (_source69.is_Some) { + Dafny.ISequence> _1472_outVars = _source69.dtor_value; { if ((m).dtor_outVarsAreUninitFieldsToAssign) { - _1462_earlyReturn = Std.Wrappers.Option>>.create_Some(Dafny.Sequence>.FromElements()); - BigInteger _hi30 = new BigInteger((_1463_outVars).Count); - for (BigInteger _1464_outI = BigInteger.Zero; _1464_outI < _hi30; _1464_outI++) { - Dafny.ISequence _1465_outVar; - _1465_outVar = (_1463_outVars).Select(_1464_outI); - Dafny.ISequence _1466_outName; - _1466_outName = DCOMP.__default.escapeName((_1465_outVar)); - Dafny.ISequence _1467_tracker__name; - _1467_tracker__name = DCOMP.__default.AddAssignedPrefix(_1466_outName); - _1460_preAssignNames = Dafny.Sequence>.Concat(_1460_preAssignNames, Dafny.Sequence>.FromElements(_1467_tracker__name)); - _1461_preAssignTypes = Dafny.Map, RAST._IType>.Update(_1461_preAssignTypes, _1467_tracker__name, RAST.Type.create_Bool()); - _1459_preBody = (_1459_preBody).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), _1467_tracker__name, Std.Wrappers.Option.create_Some(RAST.Type.create_Bool()), Std.Wrappers.Option.create_Some(RAST.Expr.create_LiteralBool(false)))); + _1471_earlyReturn = Std.Wrappers.Option>>.create_Some(Dafny.Sequence>.FromElements()); + BigInteger _hi31 = new BigInteger((_1472_outVars).Count); + for (BigInteger _1473_outI = BigInteger.Zero; _1473_outI < _hi31; _1473_outI++) { + Dafny.ISequence _1474_outVar; + _1474_outVar = (_1472_outVars).Select(_1473_outI); + Dafny.ISequence _1475_outName; + _1475_outName = DCOMP.__default.escapeName((_1474_outVar)); + Dafny.ISequence _1476_tracker__name; + _1476_tracker__name = DCOMP.__default.AddAssignedPrefix(_1475_outName); + _1469_preAssignNames = Dafny.Sequence>.Concat(_1469_preAssignNames, Dafny.Sequence>.FromElements(_1476_tracker__name)); + _1470_preAssignTypes = Dafny.Map, RAST._IType>.Update(_1470_preAssignTypes, _1476_tracker__name, RAST.Type.create_Bool()); + _1468_preBody = (_1468_preBody).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), _1476_tracker__name, Std.Wrappers.Option.create_Some(RAST.Type.create_Bool()), Std.Wrappers.Option.create_Some(RAST.Expr.create_LiteralBool(false)))); } } else { - Dafny.ISequence> _1468_tupleArgs; - _1468_tupleArgs = Dafny.Sequence>.FromElements(); - BigInteger _hi31 = new BigInteger((_1463_outVars).Count); - for (BigInteger _1469_outI = BigInteger.Zero; _1469_outI < _hi31; _1469_outI++) { - Dafny.ISequence _1470_outVar; - _1470_outVar = (_1463_outVars).Select(_1469_outI); - RAST._IType _1471_outType; + Dafny.ISequence> _1477_tupleArgs; + _1477_tupleArgs = Dafny.Sequence>.FromElements(); + BigInteger _hi32 = new BigInteger((_1472_outVars).Count); + for (BigInteger _1478_outI = BigInteger.Zero; _1478_outI < _hi32; _1478_outI++) { + Dafny.ISequence _1479_outVar; + _1479_outVar = (_1472_outVars).Select(_1478_outI); + RAST._IType _1480_outType; RAST._IType _out108; - _out108 = (this).GenType(((m).dtor_outTypes).Select(_1469_outI), DCOMP.GenTypeContext.@default()); - _1471_outType = _out108; - Dafny.ISequence _1472_outName; - _1472_outName = DCOMP.__default.escapeName((_1470_outVar)); - _1429_paramNames = Dafny.Sequence>.Concat(_1429_paramNames, Dafny.Sequence>.FromElements(_1472_outName)); - RAST._IType _1473_outMaybeType; - if ((_1471_outType).CanReadWithoutClone()) { - _1473_outMaybeType = _1471_outType; + _out108 = (this).GenType(((m).dtor_outTypes).Select(_1478_outI), DCOMP.GenTypeContext.@default()); + _1480_outType = _out108; + Dafny.ISequence _1481_outName; + _1481_outName = DCOMP.__default.escapeName((_1479_outVar)); + _1438_paramNames = Dafny.Sequence>.Concat(_1438_paramNames, Dafny.Sequence>.FromElements(_1481_outName)); + RAST._IType _1482_outMaybeType; + if ((_1480_outType).CanReadWithoutClone()) { + _1482_outMaybeType = _1480_outType; } else { - _1473_outMaybeType = RAST.__default.MaybePlaceboType(_1471_outType); + _1482_outMaybeType = RAST.__default.MaybePlaceboType(_1480_outType); } - _1430_paramTypes = Dafny.Map, RAST._IType>.Update(_1430_paramTypes, _1472_outName, _1473_outMaybeType); - _1468_tupleArgs = Dafny.Sequence>.Concat(_1468_tupleArgs, Dafny.Sequence>.FromElements(_1472_outName)); + _1439_paramTypes = Dafny.Map, RAST._IType>.Update(_1439_paramTypes, _1481_outName, _1482_outMaybeType); + _1477_tupleArgs = Dafny.Sequence>.Concat(_1477_tupleArgs, Dafny.Sequence>.FromElements(_1481_outName)); } - _1462_earlyReturn = Std.Wrappers.Option>>.create_Some(_1468_tupleArgs); + _1471_earlyReturn = Std.Wrappers.Option>>.create_Some(_1477_tupleArgs); } } - goto after_match15; + goto after_match16; } } { } - after_match15: ; - _1458_env = DCOMP.Environment.create(Dafny.Sequence>.Concat(_1460_preAssignNames, _1429_paramNames), Dafny.Map, RAST._IType>.Merge(_1461_preAssignTypes, _1430_paramTypes)); - RAST._IExpr _1474_body; - Dafny.ISet> _1475___v69; - DCOMP._IEnvironment _1476___v70; + after_match16: ; + _1467_env = DCOMP.Environment.create(Dafny.Sequence>.Concat(_1469_preAssignNames, _1438_paramNames), Dafny.Map, RAST._IType>.Merge(_1470_preAssignTypes, _1439_paramTypes)); + RAST._IExpr _1483_body; + Dafny.ISet> _1484___v69; + DCOMP._IEnvironment _1485___v70; RAST._IExpr _out109; Dafny.ISet> _out110; DCOMP._IEnvironment _out111; - (this).GenStmts((m).dtor_body, _1436_selfIdent, _1458_env, true, _1462_earlyReturn, out _out109, out _out110, out _out111); - _1474_body = _out109; - _1475___v69 = _out110; - _1476___v70 = _out111; - _1457_fBody = Std.Wrappers.Option.create_Some((_1459_preBody).Then(_1474_body)); + (this).GenStmts((m).dtor_body, _1445_selfIdent, _1467_env, true, _1471_earlyReturn, out _out109, out _out110, out _out111); + _1483_body = _out109; + _1484___v69 = _out110; + _1485___v70 = _out111; + _1466_fBody = Std.Wrappers.Option.create_Some((_1468_preBody).Then(_1483_body)); } else { - _1458_env = DCOMP.Environment.create(_1429_paramNames, _1430_paramTypes); - _1457_fBody = Std.Wrappers.Option.create_None(); + _1467_env = DCOMP.Environment.create(_1438_paramNames, _1439_paramTypes); + _1466_fBody = Std.Wrappers.Option.create_None(); } - s = RAST.ImplMember.create_FnDecl(_1447_visibility, RAST.Fn.create(_1435_fnName, _1451_typeParams, _1428_params, Std.Wrappers.Option.create_Some((((new BigInteger((_1444_retTypeArgs).Count)) == (BigInteger.One)) ? ((_1444_retTypeArgs).Select(BigInteger.Zero)) : (RAST.Type.create_TupleType(_1444_retTypeArgs)))), Dafny.Sequence.UnicodeFromString(""), _1457_fBody)); + s = RAST.ImplMember.create_FnDecl(_1456_visibility, RAST.Fn.create(_1444_fnName, _1460_typeParams, _1437_params, Std.Wrappers.Option.create_Some((((new BigInteger((_1453_retTypeArgs).Count)) == (BigInteger.One)) ? ((_1453_retTypeArgs).Select(BigInteger.Zero)) : (RAST.Type.create_TupleType(_1453_retTypeArgs)))), Dafny.Sequence.UnicodeFromString(""), _1466_fBody)); return s; } public void GenStmts(Dafny.ISequence stmts, DCOMP._ISelfInfo selfIdent, DCOMP._IEnvironment env, bool isLast, Std.Wrappers._IOption>> earlyReturn, out RAST._IExpr generated, out Dafny.ISet> readIdents, out DCOMP._IEnvironment newEnv) @@ -2371,80 +2402,80 @@ public void GenStmts(Dafny.ISequence stmts, DCOMP._ISelfInfo s readIdents = Dafny.Set>.Empty; newEnv = DCOMP.Environment.Default(); generated = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")); - Dafny.ISet> _1477_declarations; - _1477_declarations = Dafny.Set>.FromElements(); + Dafny.ISet> _1486_declarations; + _1486_declarations = Dafny.Set>.FromElements(); readIdents = Dafny.Set>.FromElements(); - BigInteger _1478_i; - _1478_i = BigInteger.Zero; + BigInteger _1487_i; + _1487_i = BigInteger.Zero; newEnv = env; - Dafny.ISequence _1479_stmts; - _1479_stmts = stmts; - while ((_1478_i) < (new BigInteger((_1479_stmts).Count))) { - DAST._IStatement _1480_stmt; - _1480_stmt = (_1479_stmts).Select(_1478_i); - DAST._IStatement _source69 = _1480_stmt; + Dafny.ISequence _1488_stmts; + _1488_stmts = stmts; + while ((_1487_i) < (new BigInteger((_1488_stmts).Count))) { + DAST._IStatement _1489_stmt; + _1489_stmt = (_1488_stmts).Select(_1487_i); + DAST._IStatement _source70 = _1489_stmt; { - if (_source69.is_DeclareVar) { - Dafny.ISequence _1481_name = _source69.dtor_name; - DAST._IType _1482_optType = _source69.dtor_typ; - Std.Wrappers._IOption maybeValue0 = _source69.dtor_maybeValue; + if (_source70.is_DeclareVar) { + Dafny.ISequence _1490_name = _source70.dtor_name; + DAST._IType _1491_optType = _source70.dtor_typ; + Std.Wrappers._IOption maybeValue0 = _source70.dtor_maybeValue; if (maybeValue0.is_None) { - if (((_1478_i) + (BigInteger.One)) < (new BigInteger((_1479_stmts).Count))) { - DAST._IStatement _source70 = (_1479_stmts).Select((_1478_i) + (BigInteger.One)); + if (((_1487_i) + (BigInteger.One)) < (new BigInteger((_1488_stmts).Count))) { + DAST._IStatement _source71 = (_1488_stmts).Select((_1487_i) + (BigInteger.One)); { - if (_source70.is_Assign) { - DAST._IAssignLhs lhs0 = _source70.dtor_lhs; + if (_source71.is_Assign) { + DAST._IAssignLhs lhs0 = _source71.dtor_lhs; if (lhs0.is_Ident) { Dafny.ISequence ident0 = lhs0.dtor_ident; - Dafny.ISequence _1483_name2 = ident0; - DAST._IExpression _1484_rhs = _source70.dtor_value; - if (object.Equals(_1483_name2, _1481_name)) { - _1479_stmts = Dafny.Sequence.Concat(Dafny.Sequence.Concat((_1479_stmts).Subsequence(BigInteger.Zero, _1478_i), Dafny.Sequence.FromElements(DAST.Statement.create_DeclareVar(_1481_name, _1482_optType, Std.Wrappers.Option.create_Some(_1484_rhs)))), (_1479_stmts).Drop((_1478_i) + (new BigInteger(2)))); - _1480_stmt = (_1479_stmts).Select(_1478_i); + Dafny.ISequence _1492_name2 = ident0; + DAST._IExpression _1493_rhs = _source71.dtor_value; + if (object.Equals(_1492_name2, _1490_name)) { + _1488_stmts = Dafny.Sequence.Concat(Dafny.Sequence.Concat((_1488_stmts).Subsequence(BigInteger.Zero, _1487_i), Dafny.Sequence.FromElements(DAST.Statement.create_DeclareVar(_1490_name, _1491_optType, Std.Wrappers.Option.create_Some(_1493_rhs)))), (_1488_stmts).Drop((_1487_i) + (new BigInteger(2)))); + _1489_stmt = (_1488_stmts).Select(_1487_i); } - goto after_match17; + goto after_match18; } } } { } - after_match17: ; + after_match18: ; } - goto after_match16; + goto after_match17; } } } { } - after_match16: ; - RAST._IExpr _1485_stmtExpr; - Dafny.ISet> _1486_recIdents; - DCOMP._IEnvironment _1487_newEnv2; + after_match17: ; + RAST._IExpr _1494_stmtExpr; + Dafny.ISet> _1495_recIdents; + DCOMP._IEnvironment _1496_newEnv2; RAST._IExpr _out112; Dafny.ISet> _out113; DCOMP._IEnvironment _out114; - (this).GenStmt(_1480_stmt, selfIdent, newEnv, (isLast) && ((_1478_i) == ((new BigInteger((_1479_stmts).Count)) - (BigInteger.One))), earlyReturn, out _out112, out _out113, out _out114); - _1485_stmtExpr = _out112; - _1486_recIdents = _out113; - _1487_newEnv2 = _out114; - newEnv = _1487_newEnv2; - DAST._IStatement _source71 = _1480_stmt; + (this).GenStmt(_1489_stmt, selfIdent, newEnv, (isLast) && ((_1487_i) == ((new BigInteger((_1488_stmts).Count)) - (BigInteger.One))), earlyReturn, out _out112, out _out113, out _out114); + _1494_stmtExpr = _out112; + _1495_recIdents = _out113; + _1496_newEnv2 = _out114; + newEnv = _1496_newEnv2; + DAST._IStatement _source72 = _1489_stmt; { - if (_source71.is_DeclareVar) { - Dafny.ISequence _1488_name = _source71.dtor_name; + if (_source72.is_DeclareVar) { + Dafny.ISequence _1497_name = _source72.dtor_name; { - _1477_declarations = Dafny.Set>.Union(_1477_declarations, Dafny.Set>.FromElements(DCOMP.__default.escapeName(_1488_name))); + _1486_declarations = Dafny.Set>.Union(_1486_declarations, Dafny.Set>.FromElements(DCOMP.__default.escapeName(_1497_name))); } - goto after_match18; + goto after_match19; } } { } - after_match18: ; - readIdents = Dafny.Set>.Union(readIdents, Dafny.Set>.Difference(_1486_recIdents, _1477_declarations)); - generated = (generated).Then(_1485_stmtExpr); - _1478_i = (_1478_i) + (BigInteger.One); - if ((_1485_stmtExpr).is_Return) { + after_match19: ; + readIdents = Dafny.Set>.Union(readIdents, Dafny.Set>.Difference(_1495_recIdents, _1486_declarations)); + generated = (generated).Then(_1494_stmtExpr); + _1487_i = (_1487_i) + (BigInteger.One); + if ((_1494_stmtExpr).is_Return) { goto after_0; } continue_0: ; @@ -2458,47 +2489,47 @@ public void GenAssignLhs(DAST._IAssignLhs lhs, RAST._IExpr rhs, DCOMP._ISelfInfo readIdents = Dafny.Set>.Empty; newEnv = DCOMP.Environment.Default(); newEnv = env; - DAST._IAssignLhs _source72 = lhs; + DAST._IAssignLhs _source73 = lhs; { - if (_source72.is_Ident) { - Dafny.ISequence ident1 = _source72.dtor_ident; - Dafny.ISequence _1489_id = ident1; + if (_source73.is_Ident) { + Dafny.ISequence ident1 = _source73.dtor_ident; + Dafny.ISequence _1498_id = ident1; { - Dafny.ISequence _1490_idRust; - _1490_idRust = DCOMP.__default.escapeName(_1489_id); - if (((env).IsBorrowed(_1490_idRust)) || ((env).IsBorrowedMut(_1490_idRust))) { - generated = RAST.__default.AssignVar(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("*"), _1490_idRust), rhs); + Dafny.ISequence _1499_idRust; + _1499_idRust = DCOMP.__default.escapeName(_1498_id); + if (((env).IsBorrowed(_1499_idRust)) || ((env).IsBorrowedMut(_1499_idRust))) { + generated = RAST.__default.AssignVar(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("*"), _1499_idRust), rhs); } else { - generated = RAST.__default.AssignVar(_1490_idRust, rhs); + generated = RAST.__default.AssignVar(_1499_idRust, rhs); } - readIdents = Dafny.Set>.FromElements(_1490_idRust); + readIdents = Dafny.Set>.FromElements(_1499_idRust); needsIIFE = false; } - goto after_match19; + goto after_match20; } } { - if (_source72.is_Select) { - DAST._IExpression _1491_on = _source72.dtor_expr; - Dafny.ISequence _1492_field = _source72.dtor_field; + if (_source73.is_Select) { + DAST._IExpression _1500_on = _source73.dtor_expr; + Dafny.ISequence _1501_field = _source73.dtor_field; { - Dafny.ISequence _1493_fieldName; - _1493_fieldName = DCOMP.__default.escapeName(_1492_field); - RAST._IExpr _1494_onExpr; - DCOMP._IOwnership _1495_onOwned; - Dafny.ISet> _1496_recIdents; + Dafny.ISequence _1502_fieldName; + _1502_fieldName = DCOMP.__default.escapeName(_1501_field); + RAST._IExpr _1503_onExpr; + DCOMP._IOwnership _1504_onOwned; + Dafny.ISet> _1505_recIdents; RAST._IExpr _out115; DCOMP._IOwnership _out116; Dafny.ISet> _out117; - (this).GenExpr(_1491_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out115, out _out116, out _out117); - _1494_onExpr = _out115; - _1495_onOwned = _out116; - _1496_recIdents = _out117; - RAST._IExpr _source73 = _1494_onExpr; + (this).GenExpr(_1500_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out115, out _out116, out _out117); + _1503_onExpr = _out115; + _1504_onOwned = _out116; + _1505_recIdents = _out117; + RAST._IExpr _source74 = _1503_onExpr; { bool disjunctiveMatch10 = false; - if (_source73.is_Call) { - RAST._IExpr obj2 = _source73.dtor_obj; + if (_source74.is_Call) { + RAST._IExpr obj2 = _source74.dtor_obj; if (obj2.is_Select) { RAST._IExpr obj3 = obj2.dtor_obj; if (obj3.is_Identifier) { @@ -2512,16 +2543,16 @@ public void GenAssignLhs(DAST._IAssignLhs lhs, RAST._IExpr rhs, DCOMP._ISelfInfo } } } - if (_source73.is_Identifier) { - Dafny.ISequence name13 = _source73.dtor_name; + if (_source74.is_Identifier) { + Dafny.ISequence name13 = _source74.dtor_name; if (object.Equals(name13, Dafny.Sequence.UnicodeFromString("this"))) { disjunctiveMatch10 = true; } } - if (_source73.is_UnaryOp) { - Dafny.ISequence op14 = _source73.dtor_op1; + if (_source74.is_UnaryOp) { + Dafny.ISequence op14 = _source74.dtor_op1; if (object.Equals(op14, Dafny.Sequence.UnicodeFromString("&"))) { - RAST._IExpr underlying4 = _source73.dtor_underlying; + RAST._IExpr underlying4 = _source74.dtor_underlying; if (underlying4.is_Identifier) { Dafny.ISequence name14 = underlying4.dtor_name; if (object.Equals(name14, Dafny.Sequence.UnicodeFromString("this"))) { @@ -2531,414 +2562,414 @@ public void GenAssignLhs(DAST._IAssignLhs lhs, RAST._IExpr rhs, DCOMP._ISelfInfo } } if (disjunctiveMatch10) { - Dafny.ISequence _1497_isAssignedVar; - _1497_isAssignedVar = DCOMP.__default.AddAssignedPrefix(_1493_fieldName); - if (((newEnv).dtor_names).Contains(_1497_isAssignedVar)) { - generated = ((RAST.__default.dafny__runtime).MSel((this).update__field__uninit__macro)).Apply(Dafny.Sequence.FromElements((this).thisInConstructor, RAST.Expr.create_Identifier(_1493_fieldName), RAST.Expr.create_Identifier(_1497_isAssignedVar), rhs)); - newEnv = (newEnv).RemoveAssigned(_1497_isAssignedVar); + Dafny.ISequence _1506_isAssignedVar; + _1506_isAssignedVar = DCOMP.__default.AddAssignedPrefix(_1502_fieldName); + if (((newEnv).dtor_names).Contains(_1506_isAssignedVar)) { + generated = ((RAST.__default.dafny__runtime).MSel((this).update__field__uninit__macro)).Apply(Dafny.Sequence.FromElements((this).thisInConstructor, RAST.Expr.create_Identifier(_1502_fieldName), RAST.Expr.create_Identifier(_1506_isAssignedVar), rhs)); + newEnv = (newEnv).RemoveAssigned(_1506_isAssignedVar); } else { - (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Unespected field to assign whose isAssignedVar is not in the environment: "), _1497_isAssignedVar)); - generated = RAST.__default.AssignMember(RAST.Expr.create_RawExpr((this.error).dtor_value), _1493_fieldName, rhs); + (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Unespected field to assign whose isAssignedVar is not in the environment: "), _1506_isAssignedVar)); + generated = RAST.__default.AssignMember(RAST.Expr.create_RawExpr((this.error).dtor_value), _1502_fieldName, rhs); } - goto after_match20; + goto after_match21; } } { - if (!object.Equals(_1494_onExpr, RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("self")))) { - _1494_onExpr = ((this).modify__macro).Apply1(_1494_onExpr); + if (!object.Equals(_1503_onExpr, RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("self")))) { + _1503_onExpr = ((this).modify__macro).Apply1(_1503_onExpr); } - generated = RAST.__default.AssignMember(_1494_onExpr, _1493_fieldName, rhs); + generated = RAST.__default.AssignMember(_1503_onExpr, _1502_fieldName, rhs); } - after_match20: ; - readIdents = _1496_recIdents; + after_match21: ; + readIdents = _1505_recIdents; needsIIFE = false; } - goto after_match19; + goto after_match20; } } { - DAST._IExpression _1498_on = _source72.dtor_expr; - Dafny.ISequence _1499_indices = _source72.dtor_indices; + DAST._IExpression _1507_on = _source73.dtor_expr; + Dafny.ISequence _1508_indices = _source73.dtor_indices; { - RAST._IExpr _1500_onExpr; - DCOMP._IOwnership _1501_onOwned; - Dafny.ISet> _1502_recIdents; + RAST._IExpr _1509_onExpr; + DCOMP._IOwnership _1510_onOwned; + Dafny.ISet> _1511_recIdents; RAST._IExpr _out118; DCOMP._IOwnership _out119; Dafny.ISet> _out120; - (this).GenExpr(_1498_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out118, out _out119, out _out120); - _1500_onExpr = _out118; - _1501_onOwned = _out119; - _1502_recIdents = _out120; - readIdents = _1502_recIdents; - _1500_onExpr = ((this).modify__macro).Apply1(_1500_onExpr); - RAST._IExpr _1503_r; - _1503_r = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")); - Dafny.ISequence _1504_indicesExpr; - _1504_indicesExpr = Dafny.Sequence.FromElements(); - BigInteger _hi32 = new BigInteger((_1499_indices).Count); - for (BigInteger _1505_i = BigInteger.Zero; _1505_i < _hi32; _1505_i++) { - RAST._IExpr _1506_idx; - DCOMP._IOwnership _1507___v79; - Dafny.ISet> _1508_recIdentsIdx; + (this).GenExpr(_1507_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out118, out _out119, out _out120); + _1509_onExpr = _out118; + _1510_onOwned = _out119; + _1511_recIdents = _out120; + readIdents = _1511_recIdents; + _1509_onExpr = ((this).modify__macro).Apply1(_1509_onExpr); + RAST._IExpr _1512_r; + _1512_r = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")); + Dafny.ISequence _1513_indicesExpr; + _1513_indicesExpr = Dafny.Sequence.FromElements(); + BigInteger _hi33 = new BigInteger((_1508_indices).Count); + for (BigInteger _1514_i = BigInteger.Zero; _1514_i < _hi33; _1514_i++) { + RAST._IExpr _1515_idx; + DCOMP._IOwnership _1516___v79; + Dafny.ISet> _1517_recIdentsIdx; RAST._IExpr _out121; DCOMP._IOwnership _out122; Dafny.ISet> _out123; - (this).GenExpr((_1499_indices).Select(_1505_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out121, out _out122, out _out123); - _1506_idx = _out121; - _1507___v79 = _out122; - _1508_recIdentsIdx = _out123; - Dafny.ISequence _1509_varName; - _1509_varName = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("__idx"), Std.Strings.__default.OfNat(_1505_i)); - _1504_indicesExpr = Dafny.Sequence.Concat(_1504_indicesExpr, Dafny.Sequence.FromElements(RAST.Expr.create_Identifier(_1509_varName))); - _1503_r = (_1503_r).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_CONST(), _1509_varName, Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(RAST.__default.IntoUsize(_1506_idx)))); - readIdents = Dafny.Set>.Union(readIdents, _1508_recIdentsIdx); - } - if ((new BigInteger((_1499_indices).Count)) > (BigInteger.One)) { - _1500_onExpr = (_1500_onExpr).Sel(Dafny.Sequence.UnicodeFromString("data")); - } - RAST._IExpr _1510_rhs; - _1510_rhs = rhs; + (this).GenExpr((_1508_indices).Select(_1514_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out121, out _out122, out _out123); + _1515_idx = _out121; + _1516___v79 = _out122; + _1517_recIdentsIdx = _out123; + Dafny.ISequence _1518_varName; + _1518_varName = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("__idx"), Std.Strings.__default.OfNat(_1514_i)); + _1513_indicesExpr = Dafny.Sequence.Concat(_1513_indicesExpr, Dafny.Sequence.FromElements(RAST.Expr.create_Identifier(_1518_varName))); + _1512_r = (_1512_r).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_CONST(), _1518_varName, Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(RAST.__default.IntoUsize(_1515_idx)))); + readIdents = Dafny.Set>.Union(readIdents, _1517_recIdentsIdx); + } + if ((new BigInteger((_1508_indices).Count)) > (BigInteger.One)) { + _1509_onExpr = (_1509_onExpr).Sel(Dafny.Sequence.UnicodeFromString("data")); + } + RAST._IExpr _1519_rhs; + _1519_rhs = rhs; var _pat_let_tv3 = env; - if (((_1500_onExpr).IsLhsIdentifier()) && (Dafny.Helpers.Let, bool>((_1500_onExpr).LhsIdentifierName(), _pat_let32_0 => Dafny.Helpers.Let, bool>(_pat_let32_0, _1511_name => (true) && (Dafny.Helpers.Let, bool>((_pat_let_tv3).GetType(_1511_name), _pat_let33_0 => Dafny.Helpers.Let, bool>(_pat_let33_0, _1512_tpe => ((_1512_tpe).is_Some) && (((_1512_tpe).dtor_value).IsUninitArray())))))))) { - _1510_rhs = RAST.__default.MaybeUninitNew(_1510_rhs); + if (((_1509_onExpr).IsLhsIdentifier()) && (Dafny.Helpers.Let, bool>((_1509_onExpr).LhsIdentifierName(), _pat_let32_0 => Dafny.Helpers.Let, bool>(_pat_let32_0, _1520_name => (true) && (Dafny.Helpers.Let, bool>((_pat_let_tv3).GetType(_1520_name), _pat_let33_0 => Dafny.Helpers.Let, bool>(_pat_let33_0, _1521_tpe => ((_1521_tpe).is_Some) && (((_1521_tpe).dtor_value).IsUninitArray())))))))) { + _1519_rhs = RAST.__default.MaybeUninitNew(_1519_rhs); } - generated = (_1503_r).Then(RAST.Expr.create_Assign(Std.Wrappers.Option.create_Some(RAST.AssignLhs.create_Index(_1500_onExpr, _1504_indicesExpr)), _1510_rhs)); + generated = (_1512_r).Then(RAST.Expr.create_Assign(Std.Wrappers.Option.create_Some(RAST.AssignLhs.create_Index(_1509_onExpr, _1513_indicesExpr)), _1519_rhs)); needsIIFE = true; } } - after_match19: ; + after_match20: ; } public void GenStmt(DAST._IStatement stmt, DCOMP._ISelfInfo selfIdent, DCOMP._IEnvironment env, bool isLast, Std.Wrappers._IOption>> earlyReturn, out RAST._IExpr generated, out Dafny.ISet> readIdents, out DCOMP._IEnvironment newEnv) { generated = RAST.Expr.Default(); readIdents = Dafny.Set>.Empty; newEnv = DCOMP.Environment.Default(); - DAST._IStatement _source74 = stmt; + DAST._IStatement _source75 = stmt; { - if (_source74.is_ConstructorNewSeparator) { - Dafny.ISequence _1513_fields = _source74.dtor_fields; + if (_source75.is_ConstructorNewSeparator) { + Dafny.ISequence _1522_fields = _source75.dtor_fields; { generated = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")); readIdents = Dafny.Set>.FromElements(); newEnv = env; - BigInteger _hi33 = new BigInteger((_1513_fields).Count); - for (BigInteger _1514_i = BigInteger.Zero; _1514_i < _hi33; _1514_i++) { - DAST._IFormal _1515_field; - _1515_field = (_1513_fields).Select(_1514_i); - Dafny.ISequence _1516_fieldName; - _1516_fieldName = DCOMP.__default.escapeName((_1515_field).dtor_name); - RAST._IType _1517_fieldTyp; + BigInteger _hi34 = new BigInteger((_1522_fields).Count); + for (BigInteger _1523_i = BigInteger.Zero; _1523_i < _hi34; _1523_i++) { + DAST._IFormal _1524_field; + _1524_field = (_1522_fields).Select(_1523_i); + Dafny.ISequence _1525_fieldName; + _1525_fieldName = DCOMP.__default.escapeName((_1524_field).dtor_name); + RAST._IType _1526_fieldTyp; RAST._IType _out124; - _out124 = (this).GenType((_1515_field).dtor_typ, DCOMP.GenTypeContext.@default()); - _1517_fieldTyp = _out124; - Dafny.ISequence _1518_isAssignedVar; - _1518_isAssignedVar = DCOMP.__default.AddAssignedPrefix(_1516_fieldName); - if (((newEnv).dtor_names).Contains(_1518_isAssignedVar)) { - RAST._IExpr _1519_rhs; - DCOMP._IOwnership _1520___v80; - Dafny.ISet> _1521___v81; + _out124 = (this).GenType((_1524_field).dtor_typ, DCOMP.GenTypeContext.@default()); + _1526_fieldTyp = _out124; + Dafny.ISequence _1527_isAssignedVar; + _1527_isAssignedVar = DCOMP.__default.AddAssignedPrefix(_1525_fieldName); + if (((newEnv).dtor_names).Contains(_1527_isAssignedVar)) { + RAST._IExpr _1528_rhs; + DCOMP._IOwnership _1529___v80; + Dafny.ISet> _1530___v81; RAST._IExpr _out125; DCOMP._IOwnership _out126; Dafny.ISet> _out127; - (this).GenExpr(DAST.Expression.create_InitializationValue((_1515_field).dtor_typ), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out125, out _out126, out _out127); - _1519_rhs = _out125; - _1520___v80 = _out126; - _1521___v81 = _out127; - readIdents = Dafny.Set>.Union(readIdents, Dafny.Set>.FromElements(_1518_isAssignedVar)); - generated = (generated).Then(((RAST.__default.dafny__runtime).MSel((this).update__field__if__uninit__macro)).Apply(Dafny.Sequence.FromElements(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("this")), RAST.Expr.create_Identifier(_1516_fieldName), RAST.Expr.create_Identifier(_1518_isAssignedVar), _1519_rhs))); - newEnv = (newEnv).RemoveAssigned(_1518_isAssignedVar); + (this).GenExpr(DAST.Expression.create_InitializationValue((_1524_field).dtor_typ), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out125, out _out126, out _out127); + _1528_rhs = _out125; + _1529___v80 = _out126; + _1530___v81 = _out127; + readIdents = Dafny.Set>.Union(readIdents, Dafny.Set>.FromElements(_1527_isAssignedVar)); + generated = (generated).Then(((RAST.__default.dafny__runtime).MSel((this).update__field__if__uninit__macro)).Apply(Dafny.Sequence.FromElements(RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("this")), RAST.Expr.create_Identifier(_1525_fieldName), RAST.Expr.create_Identifier(_1527_isAssignedVar), _1528_rhs))); + newEnv = (newEnv).RemoveAssigned(_1527_isAssignedVar); } } } - goto after_match21; + goto after_match22; } } { - if (_source74.is_DeclareVar) { - Dafny.ISequence _1522_name = _source74.dtor_name; - DAST._IType _1523_typ = _source74.dtor_typ; - Std.Wrappers._IOption maybeValue1 = _source74.dtor_maybeValue; + if (_source75.is_DeclareVar) { + Dafny.ISequence _1531_name = _source75.dtor_name; + DAST._IType _1532_typ = _source75.dtor_typ; + Std.Wrappers._IOption maybeValue1 = _source75.dtor_maybeValue; if (maybeValue1.is_Some) { - DAST._IExpression _1524_expression = maybeValue1.dtor_value; + DAST._IExpression _1533_expression = maybeValue1.dtor_value; { - RAST._IType _1525_tpe; + RAST._IType _1534_tpe; RAST._IType _out128; - _out128 = (this).GenType(_1523_typ, DCOMP.GenTypeContext.InBinding()); - _1525_tpe = _out128; - Dafny.ISequence _1526_varName; - _1526_varName = DCOMP.__default.escapeName(_1522_name); - bool _1527_hasCopySemantics; - _1527_hasCopySemantics = (_1525_tpe).CanReadWithoutClone(); - if (((_1524_expression).is_InitializationValue) && (!(_1527_hasCopySemantics))) { - generated = RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), _1526_varName, Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("MaybePlacebo"))).ApplyType1(_1525_tpe)).MSel(Dafny.Sequence.UnicodeFromString("new"))).Apply(Dafny.Sequence.FromElements()))); + _out128 = (this).GenType(_1532_typ, DCOMP.GenTypeContext.InBinding()); + _1534_tpe = _out128; + Dafny.ISequence _1535_varName; + _1535_varName = DCOMP.__default.escapeName(_1531_name); + bool _1536_hasCopySemantics; + _1536_hasCopySemantics = (_1534_tpe).CanReadWithoutClone(); + if (((_1533_expression).is_InitializationValue) && (!(_1536_hasCopySemantics))) { + generated = RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), _1535_varName, Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("MaybePlacebo"))).ApplyType1(_1534_tpe)).MSel(Dafny.Sequence.UnicodeFromString("new"))).Apply(Dafny.Sequence.FromElements()))); readIdents = Dafny.Set>.FromElements(); - newEnv = (env).AddAssigned(_1526_varName, RAST.__default.MaybePlaceboType(_1525_tpe)); + newEnv = (env).AddAssigned(_1535_varName, RAST.__default.MaybePlaceboType(_1534_tpe)); } else { - RAST._IExpr _1528_expr = RAST.Expr.Default(); - Dafny.ISet> _1529_recIdents = Dafny.Set>.Empty; - if (((_1524_expression).is_InitializationValue) && ((_1525_tpe).IsObjectOrPointer())) { - _1528_expr = (_1525_tpe).ToNullExpr(); - _1529_recIdents = Dafny.Set>.FromElements(); + RAST._IExpr _1537_expr = RAST.Expr.Default(); + Dafny.ISet> _1538_recIdents = Dafny.Set>.Empty; + if (((_1533_expression).is_InitializationValue) && ((_1534_tpe).IsObjectOrPointer())) { + _1537_expr = (_1534_tpe).ToNullExpr(); + _1538_recIdents = Dafny.Set>.FromElements(); } else { - DCOMP._IOwnership _1530_exprOwnership = DCOMP.Ownership.Default(); + DCOMP._IOwnership _1539_exprOwnership = DCOMP.Ownership.Default(); RAST._IExpr _out129; DCOMP._IOwnership _out130; Dafny.ISet> _out131; - (this).GenExpr(_1524_expression, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out129, out _out130, out _out131); - _1528_expr = _out129; - _1530_exprOwnership = _out130; - _1529_recIdents = _out131; + (this).GenExpr(_1533_expression, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out129, out _out130, out _out131); + _1537_expr = _out129; + _1539_exprOwnership = _out130; + _1538_recIdents = _out131; } - readIdents = _1529_recIdents; - if ((_1524_expression).is_NewUninitArray) { - _1525_tpe = (_1525_tpe).TypeAtInitialization(); + readIdents = _1538_recIdents; + if ((_1533_expression).is_NewUninitArray) { + _1534_tpe = (_1534_tpe).TypeAtInitialization(); } else { - _1525_tpe = _1525_tpe; + _1534_tpe = _1534_tpe; } - generated = RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), DCOMP.__default.escapeName(_1522_name), Std.Wrappers.Option.create_Some(_1525_tpe), Std.Wrappers.Option.create_Some(_1528_expr)); - newEnv = (env).AddAssigned(DCOMP.__default.escapeName(_1522_name), _1525_tpe); + generated = RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), DCOMP.__default.escapeName(_1531_name), Std.Wrappers.Option.create_Some(_1534_tpe), Std.Wrappers.Option.create_Some(_1537_expr)); + newEnv = (env).AddAssigned(DCOMP.__default.escapeName(_1531_name), _1534_tpe); } } - goto after_match21; + goto after_match22; } } } { - if (_source74.is_DeclareVar) { - Dafny.ISequence _1531_name = _source74.dtor_name; - DAST._IType _1532_typ = _source74.dtor_typ; - Std.Wrappers._IOption maybeValue2 = _source74.dtor_maybeValue; + if (_source75.is_DeclareVar) { + Dafny.ISequence _1540_name = _source75.dtor_name; + DAST._IType _1541_typ = _source75.dtor_typ; + Std.Wrappers._IOption maybeValue2 = _source75.dtor_maybeValue; if (maybeValue2.is_None) { { - DAST._IStatement _1533_newStmt; - _1533_newStmt = DAST.Statement.create_DeclareVar(_1531_name, _1532_typ, Std.Wrappers.Option.create_Some(DAST.Expression.create_InitializationValue(_1532_typ))); + DAST._IStatement _1542_newStmt; + _1542_newStmt = DAST.Statement.create_DeclareVar(_1540_name, _1541_typ, Std.Wrappers.Option.create_Some(DAST.Expression.create_InitializationValue(_1541_typ))); RAST._IExpr _out132; Dafny.ISet> _out133; DCOMP._IEnvironment _out134; - (this).GenStmt(_1533_newStmt, selfIdent, env, isLast, earlyReturn, out _out132, out _out133, out _out134); + (this).GenStmt(_1542_newStmt, selfIdent, env, isLast, earlyReturn, out _out132, out _out133, out _out134); generated = _out132; readIdents = _out133; newEnv = _out134; } - goto after_match21; + goto after_match22; } } } { - if (_source74.is_Assign) { - DAST._IAssignLhs _1534_lhs = _source74.dtor_lhs; - DAST._IExpression _1535_expression = _source74.dtor_value; + if (_source75.is_Assign) { + DAST._IAssignLhs _1543_lhs = _source75.dtor_lhs; + DAST._IExpression _1544_expression = _source75.dtor_value; { - RAST._IExpr _1536_exprGen; - DCOMP._IOwnership _1537___v82; - Dafny.ISet> _1538_exprIdents; + RAST._IExpr _1545_exprGen; + DCOMP._IOwnership _1546___v82; + Dafny.ISet> _1547_exprIdents; RAST._IExpr _out135; DCOMP._IOwnership _out136; Dafny.ISet> _out137; - (this).GenExpr(_1535_expression, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out135, out _out136, out _out137); - _1536_exprGen = _out135; - _1537___v82 = _out136; - _1538_exprIdents = _out137; - if ((_1534_lhs).is_Ident) { - Dafny.ISequence _1539_rustId; - _1539_rustId = DCOMP.__default.escapeName(((_1534_lhs).dtor_ident)); - Std.Wrappers._IOption _1540_tpe; - _1540_tpe = (env).GetType(_1539_rustId); - if (((_1540_tpe).is_Some) && ((((_1540_tpe).dtor_value).ExtractMaybePlacebo()).is_Some)) { - _1536_exprGen = RAST.__default.MaybePlacebo(_1536_exprGen); + (this).GenExpr(_1544_expression, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out135, out _out136, out _out137); + _1545_exprGen = _out135; + _1546___v82 = _out136; + _1547_exprIdents = _out137; + if ((_1543_lhs).is_Ident) { + Dafny.ISequence _1548_rustId; + _1548_rustId = DCOMP.__default.escapeName(((_1543_lhs).dtor_ident)); + Std.Wrappers._IOption _1549_tpe; + _1549_tpe = (env).GetType(_1548_rustId); + if (((_1549_tpe).is_Some) && ((((_1549_tpe).dtor_value).ExtractMaybePlacebo()).is_Some)) { + _1545_exprGen = RAST.__default.MaybePlacebo(_1545_exprGen); } } - if (((_1534_lhs).is_Index) && (((_1534_lhs).dtor_expr).is_Ident)) { - Dafny.ISequence _1541_rustId; - _1541_rustId = DCOMP.__default.escapeName(((_1534_lhs).dtor_expr).dtor_name); - Std.Wrappers._IOption _1542_tpe; - _1542_tpe = (env).GetType(_1541_rustId); - if (((_1542_tpe).is_Some) && ((((_1542_tpe).dtor_value).ExtractMaybeUninitArrayElement()).is_Some)) { - _1536_exprGen = RAST.__default.MaybeUninitNew(_1536_exprGen); + if (((_1543_lhs).is_Index) && (((_1543_lhs).dtor_expr).is_Ident)) { + Dafny.ISequence _1550_rustId; + _1550_rustId = DCOMP.__default.escapeName(((_1543_lhs).dtor_expr).dtor_name); + Std.Wrappers._IOption _1551_tpe; + _1551_tpe = (env).GetType(_1550_rustId); + if (((_1551_tpe).is_Some) && ((((_1551_tpe).dtor_value).ExtractMaybeUninitArrayElement()).is_Some)) { + _1545_exprGen = RAST.__default.MaybeUninitNew(_1545_exprGen); } } - RAST._IExpr _1543_lhsGen; - bool _1544_needsIIFE; - Dafny.ISet> _1545_recIdents; - DCOMP._IEnvironment _1546_resEnv; + RAST._IExpr _1552_lhsGen; + bool _1553_needsIIFE; + Dafny.ISet> _1554_recIdents; + DCOMP._IEnvironment _1555_resEnv; RAST._IExpr _out138; bool _out139; Dafny.ISet> _out140; DCOMP._IEnvironment _out141; - (this).GenAssignLhs(_1534_lhs, _1536_exprGen, selfIdent, env, out _out138, out _out139, out _out140, out _out141); - _1543_lhsGen = _out138; - _1544_needsIIFE = _out139; - _1545_recIdents = _out140; - _1546_resEnv = _out141; - generated = _1543_lhsGen; - newEnv = _1546_resEnv; - if (_1544_needsIIFE) { + (this).GenAssignLhs(_1543_lhs, _1545_exprGen, selfIdent, env, out _out138, out _out139, out _out140, out _out141); + _1552_lhsGen = _out138; + _1553_needsIIFE = _out139; + _1554_recIdents = _out140; + _1555_resEnv = _out141; + generated = _1552_lhsGen; + newEnv = _1555_resEnv; + if (_1553_needsIIFE) { generated = RAST.Expr.create_Block(generated); } - readIdents = Dafny.Set>.Union(_1545_recIdents, _1538_exprIdents); + readIdents = Dafny.Set>.Union(_1554_recIdents, _1547_exprIdents); } - goto after_match21; + goto after_match22; } } { - if (_source74.is_If) { - DAST._IExpression _1547_cond = _source74.dtor_cond; - Dafny.ISequence _1548_thnDafny = _source74.dtor_thn; - Dafny.ISequence _1549_elsDafny = _source74.dtor_els; + if (_source75.is_If) { + DAST._IExpression _1556_cond = _source75.dtor_cond; + Dafny.ISequence _1557_thnDafny = _source75.dtor_thn; + Dafny.ISequence _1558_elsDafny = _source75.dtor_els; { - RAST._IExpr _1550_cond; - DCOMP._IOwnership _1551___v83; - Dafny.ISet> _1552_recIdents; + RAST._IExpr _1559_cond; + DCOMP._IOwnership _1560___v83; + Dafny.ISet> _1561_recIdents; RAST._IExpr _out142; DCOMP._IOwnership _out143; Dafny.ISet> _out144; - (this).GenExpr(_1547_cond, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out142, out _out143, out _out144); - _1550_cond = _out142; - _1551___v83 = _out143; - _1552_recIdents = _out144; - Dafny.ISequence _1553_condString; - _1553_condString = (_1550_cond)._ToString(DCOMP.__default.IND); - readIdents = _1552_recIdents; - RAST._IExpr _1554_thn; - Dafny.ISet> _1555_thnIdents; - DCOMP._IEnvironment _1556_thnEnv; + (this).GenExpr(_1556_cond, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out142, out _out143, out _out144); + _1559_cond = _out142; + _1560___v83 = _out143; + _1561_recIdents = _out144; + Dafny.ISequence _1562_condString; + _1562_condString = (_1559_cond)._ToString(DCOMP.__default.IND); + readIdents = _1561_recIdents; + RAST._IExpr _1563_thn; + Dafny.ISet> _1564_thnIdents; + DCOMP._IEnvironment _1565_thnEnv; RAST._IExpr _out145; Dafny.ISet> _out146; DCOMP._IEnvironment _out147; - (this).GenStmts(_1548_thnDafny, selfIdent, env, isLast, earlyReturn, out _out145, out _out146, out _out147); - _1554_thn = _out145; - _1555_thnIdents = _out146; - _1556_thnEnv = _out147; - readIdents = Dafny.Set>.Union(readIdents, _1555_thnIdents); - RAST._IExpr _1557_els; - Dafny.ISet> _1558_elsIdents; - DCOMP._IEnvironment _1559_elsEnv; + (this).GenStmts(_1557_thnDafny, selfIdent, env, isLast, earlyReturn, out _out145, out _out146, out _out147); + _1563_thn = _out145; + _1564_thnIdents = _out146; + _1565_thnEnv = _out147; + readIdents = Dafny.Set>.Union(readIdents, _1564_thnIdents); + RAST._IExpr _1566_els; + Dafny.ISet> _1567_elsIdents; + DCOMP._IEnvironment _1568_elsEnv; RAST._IExpr _out148; Dafny.ISet> _out149; DCOMP._IEnvironment _out150; - (this).GenStmts(_1549_elsDafny, selfIdent, env, isLast, earlyReturn, out _out148, out _out149, out _out150); - _1557_els = _out148; - _1558_elsIdents = _out149; - _1559_elsEnv = _out150; - readIdents = Dafny.Set>.Union(readIdents, _1558_elsIdents); + (this).GenStmts(_1558_elsDafny, selfIdent, env, isLast, earlyReturn, out _out148, out _out149, out _out150); + _1566_els = _out148; + _1567_elsIdents = _out149; + _1568_elsEnv = _out150; + readIdents = Dafny.Set>.Union(readIdents, _1567_elsIdents); newEnv = env; - generated = RAST.Expr.create_IfExpr(_1550_cond, _1554_thn, _1557_els); + generated = RAST.Expr.create_IfExpr(_1559_cond, _1563_thn, _1566_els); } - goto after_match21; + goto after_match22; } } { - if (_source74.is_Labeled) { - Dafny.ISequence _1560_lbl = _source74.dtor_lbl; - Dafny.ISequence _1561_body = _source74.dtor_body; + if (_source75.is_Labeled) { + Dafny.ISequence _1569_lbl = _source75.dtor_lbl; + Dafny.ISequence _1570_body = _source75.dtor_body; { - RAST._IExpr _1562_body; - Dafny.ISet> _1563_bodyIdents; - DCOMP._IEnvironment _1564_env2; + RAST._IExpr _1571_body; + Dafny.ISet> _1572_bodyIdents; + DCOMP._IEnvironment _1573_env2; RAST._IExpr _out151; Dafny.ISet> _out152; DCOMP._IEnvironment _out153; - (this).GenStmts(_1561_body, selfIdent, env, isLast, earlyReturn, out _out151, out _out152, out _out153); - _1562_body = _out151; - _1563_bodyIdents = _out152; - _1564_env2 = _out153; - readIdents = _1563_bodyIdents; - generated = RAST.Expr.create_Labelled(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("label_"), _1560_lbl), RAST.Expr.create_Loop(Std.Wrappers.Option.create_None(), RAST.Expr.create_StmtExpr(_1562_body, RAST.Expr.create_Break(Std.Wrappers.Option>.create_None())))); + (this).GenStmts(_1570_body, selfIdent, env, isLast, earlyReturn, out _out151, out _out152, out _out153); + _1571_body = _out151; + _1572_bodyIdents = _out152; + _1573_env2 = _out153; + readIdents = _1572_bodyIdents; + generated = RAST.Expr.create_Labelled(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("label_"), _1569_lbl), RAST.Expr.create_Loop(Std.Wrappers.Option.create_None(), RAST.Expr.create_StmtExpr(_1571_body, RAST.Expr.create_Break(Std.Wrappers.Option>.create_None())))); newEnv = env; } - goto after_match21; + goto after_match22; } } { - if (_source74.is_While) { - DAST._IExpression _1565_cond = _source74.dtor_cond; - Dafny.ISequence _1566_body = _source74.dtor_body; + if (_source75.is_While) { + DAST._IExpression _1574_cond = _source75.dtor_cond; + Dafny.ISequence _1575_body = _source75.dtor_body; { - RAST._IExpr _1567_cond; - DCOMP._IOwnership _1568___v84; - Dafny.ISet> _1569_recIdents; + RAST._IExpr _1576_cond; + DCOMP._IOwnership _1577___v84; + Dafny.ISet> _1578_recIdents; RAST._IExpr _out154; DCOMP._IOwnership _out155; Dafny.ISet> _out156; - (this).GenExpr(_1565_cond, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out154, out _out155, out _out156); - _1567_cond = _out154; - _1568___v84 = _out155; - _1569_recIdents = _out156; - readIdents = _1569_recIdents; - RAST._IExpr _1570_bodyExpr; - Dafny.ISet> _1571_bodyIdents; - DCOMP._IEnvironment _1572_bodyEnv; + (this).GenExpr(_1574_cond, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out154, out _out155, out _out156); + _1576_cond = _out154; + _1577___v84 = _out155; + _1578_recIdents = _out156; + readIdents = _1578_recIdents; + RAST._IExpr _1579_bodyExpr; + Dafny.ISet> _1580_bodyIdents; + DCOMP._IEnvironment _1581_bodyEnv; RAST._IExpr _out157; Dafny.ISet> _out158; DCOMP._IEnvironment _out159; - (this).GenStmts(_1566_body, selfIdent, env, false, earlyReturn, out _out157, out _out158, out _out159); - _1570_bodyExpr = _out157; - _1571_bodyIdents = _out158; - _1572_bodyEnv = _out159; + (this).GenStmts(_1575_body, selfIdent, env, false, earlyReturn, out _out157, out _out158, out _out159); + _1579_bodyExpr = _out157; + _1580_bodyIdents = _out158; + _1581_bodyEnv = _out159; newEnv = env; - readIdents = Dafny.Set>.Union(readIdents, _1571_bodyIdents); - generated = RAST.Expr.create_Loop(Std.Wrappers.Option.create_Some(_1567_cond), _1570_bodyExpr); + readIdents = Dafny.Set>.Union(readIdents, _1580_bodyIdents); + generated = RAST.Expr.create_Loop(Std.Wrappers.Option.create_Some(_1576_cond), _1579_bodyExpr); } - goto after_match21; + goto after_match22; } } { - if (_source74.is_Foreach) { - Dafny.ISequence _1573_boundName = _source74.dtor_boundName; - DAST._IType _1574_boundType = _source74.dtor_boundType; - DAST._IExpression _1575_overExpr = _source74.dtor_over; - Dafny.ISequence _1576_body = _source74.dtor_body; + if (_source75.is_Foreach) { + Dafny.ISequence _1582_boundName = _source75.dtor_boundName; + DAST._IType _1583_boundType = _source75.dtor_boundType; + DAST._IExpression _1584_overExpr = _source75.dtor_over; + Dafny.ISequence _1585_body = _source75.dtor_body; { - RAST._IExpr _1577_over; - DCOMP._IOwnership _1578___v85; - Dafny.ISet> _1579_recIdents; + RAST._IExpr _1586_over; + DCOMP._IOwnership _1587___v85; + Dafny.ISet> _1588_recIdents; RAST._IExpr _out160; DCOMP._IOwnership _out161; Dafny.ISet> _out162; - (this).GenExpr(_1575_overExpr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out160, out _out161, out _out162); - _1577_over = _out160; - _1578___v85 = _out161; - _1579_recIdents = _out162; - if (((_1575_overExpr).is_MapBoundedPool) || ((_1575_overExpr).is_SetBoundedPool)) { - _1577_over = ((_1577_over).Sel(Dafny.Sequence.UnicodeFromString("cloned"))).Apply(Dafny.Sequence.FromElements()); + (this).GenExpr(_1584_overExpr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out160, out _out161, out _out162); + _1586_over = _out160; + _1587___v85 = _out161; + _1588_recIdents = _out162; + if (((_1584_overExpr).is_MapBoundedPool) || ((_1584_overExpr).is_SetBoundedPool)) { + _1586_over = ((_1586_over).Sel(Dafny.Sequence.UnicodeFromString("cloned"))).Apply(Dafny.Sequence.FromElements()); } - RAST._IType _1580_boundTpe; + RAST._IType _1589_boundTpe; RAST._IType _out163; - _out163 = (this).GenType(_1574_boundType, DCOMP.GenTypeContext.@default()); - _1580_boundTpe = _out163; - readIdents = _1579_recIdents; - Dafny.ISequence _1581_boundRName; - _1581_boundRName = DCOMP.__default.escapeName(_1573_boundName); - RAST._IExpr _1582_bodyExpr; - Dafny.ISet> _1583_bodyIdents; - DCOMP._IEnvironment _1584_bodyEnv; + _out163 = (this).GenType(_1583_boundType, DCOMP.GenTypeContext.@default()); + _1589_boundTpe = _out163; + readIdents = _1588_recIdents; + Dafny.ISequence _1590_boundRName; + _1590_boundRName = DCOMP.__default.escapeName(_1582_boundName); + RAST._IExpr _1591_bodyExpr; + Dafny.ISet> _1592_bodyIdents; + DCOMP._IEnvironment _1593_bodyEnv; RAST._IExpr _out164; Dafny.ISet> _out165; DCOMP._IEnvironment _out166; - (this).GenStmts(_1576_body, selfIdent, (env).AddAssigned(_1581_boundRName, _1580_boundTpe), false, earlyReturn, out _out164, out _out165, out _out166); - _1582_bodyExpr = _out164; - _1583_bodyIdents = _out165; - _1584_bodyEnv = _out166; - readIdents = Dafny.Set>.Difference(Dafny.Set>.Union(readIdents, _1583_bodyIdents), Dafny.Set>.FromElements(_1581_boundRName)); + (this).GenStmts(_1585_body, selfIdent, (env).AddAssigned(_1590_boundRName, _1589_boundTpe), false, earlyReturn, out _out164, out _out165, out _out166); + _1591_bodyExpr = _out164; + _1592_bodyIdents = _out165; + _1593_bodyEnv = _out166; + readIdents = Dafny.Set>.Difference(Dafny.Set>.Union(readIdents, _1592_bodyIdents), Dafny.Set>.FromElements(_1590_boundRName)); newEnv = env; - generated = RAST.Expr.create_For(_1581_boundRName, _1577_over, _1582_bodyExpr); + generated = RAST.Expr.create_For(_1590_boundRName, _1586_over, _1591_bodyExpr); } - goto after_match21; + goto after_match22; } } { - if (_source74.is_Break) { - Std.Wrappers._IOption> _1585_toLabel = _source74.dtor_toLabel; + if (_source75.is_Break) { + Std.Wrappers._IOption> _1594_toLabel = _source75.dtor_toLabel; { - Std.Wrappers._IOption> _source75 = _1585_toLabel; + Std.Wrappers._IOption> _source76 = _1594_toLabel; { - if (_source75.is_Some) { - Dafny.ISequence _1586_lbl = _source75.dtor_value; + if (_source76.is_Some) { + Dafny.ISequence _1595_lbl = _source76.dtor_value; { - generated = RAST.Expr.create_Break(Std.Wrappers.Option>.create_Some(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("label_"), _1586_lbl))); + generated = RAST.Expr.create_Break(Std.Wrappers.Option>.create_Some(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("label_"), _1595_lbl))); } - goto after_match22; + goto after_match23; } } { @@ -2946,405 +2977,405 @@ public void GenStmt(DAST._IStatement stmt, DCOMP._ISelfInfo selfIdent, DCOMP._IE generated = RAST.Expr.create_Break(Std.Wrappers.Option>.create_None()); } } - after_match22: ; + after_match23: ; readIdents = Dafny.Set>.FromElements(); newEnv = env; } - goto after_match21; + goto after_match22; } } { - if (_source74.is_TailRecursive) { - Dafny.ISequence _1587_body = _source74.dtor_body; + if (_source75.is_TailRecursive) { + Dafny.ISequence _1596_body = _source75.dtor_body; { generated = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")); if (!object.Equals(selfIdent, DCOMP.SelfInfo.create_NoSelf())) { - RAST._IExpr _1588_selfClone; - DCOMP._IOwnership _1589___v86; - Dafny.ISet> _1590___v87; + RAST._IExpr _1597_selfClone; + DCOMP._IOwnership _1598___v86; + Dafny.ISet> _1599___v87; RAST._IExpr _out167; DCOMP._IOwnership _out168; Dafny.ISet> _out169; (this).GenIdent((selfIdent).dtor_rSelfName, selfIdent, DCOMP.Environment.Empty(), DCOMP.Ownership.create_OwnershipOwned(), out _out167, out _out168, out _out169); - _1588_selfClone = _out167; - _1589___v86 = _out168; - _1590___v87 = _out169; - generated = (generated).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("_this"), Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(_1588_selfClone))); + _1597_selfClone = _out167; + _1598___v86 = _out168; + _1599___v87 = _out169; + generated = (generated).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("_this"), Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(_1597_selfClone))); } newEnv = env; - BigInteger _hi34 = new BigInteger(((env).dtor_names).Count); - for (BigInteger _1591_paramI = BigInteger.Zero; _1591_paramI < _hi34; _1591_paramI++) { - Dafny.ISequence _1592_param; - _1592_param = ((env).dtor_names).Select(_1591_paramI); - RAST._IExpr _1593_paramInit; - DCOMP._IOwnership _1594___v88; - Dafny.ISet> _1595___v89; + BigInteger _hi35 = new BigInteger(((env).dtor_names).Count); + for (BigInteger _1600_paramI = BigInteger.Zero; _1600_paramI < _hi35; _1600_paramI++) { + Dafny.ISequence _1601_param; + _1601_param = ((env).dtor_names).Select(_1600_paramI); + RAST._IExpr _1602_paramInit; + DCOMP._IOwnership _1603___v88; + Dafny.ISet> _1604___v89; RAST._IExpr _out170; DCOMP._IOwnership _out171; Dafny.ISet> _out172; - (this).GenIdent(_1592_param, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out170, out _out171, out _out172); - _1593_paramInit = _out170; - _1594___v88 = _out171; - _1595___v89 = _out172; - generated = (generated).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), _1592_param, Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(_1593_paramInit))); - if (((env).dtor_types).Contains(_1592_param)) { - RAST._IType _1596_declaredType; - _1596_declaredType = (Dafny.Map, RAST._IType>.Select((env).dtor_types,_1592_param)).ToOwned(); - newEnv = (newEnv).AddAssigned(_1592_param, _1596_declaredType); + (this).GenIdent(_1601_param, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out170, out _out171, out _out172); + _1602_paramInit = _out170; + _1603___v88 = _out171; + _1604___v89 = _out172; + generated = (generated).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), _1601_param, Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(_1602_paramInit))); + if (((env).dtor_types).Contains(_1601_param)) { + RAST._IType _1605_declaredType; + _1605_declaredType = (Dafny.Map, RAST._IType>.Select((env).dtor_types,_1601_param)).ToOwned(); + newEnv = (newEnv).AddAssigned(_1601_param, _1605_declaredType); } } - RAST._IExpr _1597_bodyExpr; - Dafny.ISet> _1598_bodyIdents; - DCOMP._IEnvironment _1599_bodyEnv; + RAST._IExpr _1606_bodyExpr; + Dafny.ISet> _1607_bodyIdents; + DCOMP._IEnvironment _1608_bodyEnv; RAST._IExpr _out173; Dafny.ISet> _out174; DCOMP._IEnvironment _out175; - (this).GenStmts(_1587_body, ((!object.Equals(selfIdent, DCOMP.SelfInfo.create_NoSelf())) ? (DCOMP.SelfInfo.create_ThisTyped(Dafny.Sequence.UnicodeFromString("_this"), (selfIdent).dtor_dafnyType)) : (DCOMP.SelfInfo.create_NoSelf())), newEnv, false, earlyReturn, out _out173, out _out174, out _out175); - _1597_bodyExpr = _out173; - _1598_bodyIdents = _out174; - _1599_bodyEnv = _out175; - readIdents = _1598_bodyIdents; - generated = (generated).Then(RAST.Expr.create_Labelled(Dafny.Sequence.UnicodeFromString("TAIL_CALL_START"), RAST.Expr.create_Loop(Std.Wrappers.Option.create_None(), _1597_bodyExpr))); + (this).GenStmts(_1596_body, ((!object.Equals(selfIdent, DCOMP.SelfInfo.create_NoSelf())) ? (DCOMP.SelfInfo.create_ThisTyped(Dafny.Sequence.UnicodeFromString("_this"), (selfIdent).dtor_dafnyType)) : (DCOMP.SelfInfo.create_NoSelf())), newEnv, false, earlyReturn, out _out173, out _out174, out _out175); + _1606_bodyExpr = _out173; + _1607_bodyIdents = _out174; + _1608_bodyEnv = _out175; + readIdents = _1607_bodyIdents; + generated = (generated).Then(RAST.Expr.create_Labelled(Dafny.Sequence.UnicodeFromString("TAIL_CALL_START"), RAST.Expr.create_Loop(Std.Wrappers.Option.create_None(), _1606_bodyExpr))); } - goto after_match21; + goto after_match22; } } { - if (_source74.is_JumpTailCallStart) { + if (_source75.is_JumpTailCallStart) { { generated = RAST.Expr.create_Continue(Std.Wrappers.Option>.create_Some(Dafny.Sequence.UnicodeFromString("TAIL_CALL_START"))); readIdents = Dafny.Set>.FromElements(); newEnv = env; } - goto after_match21; + goto after_match22; } } { - if (_source74.is_Call) { - DAST._IExpression _1600_on = _source74.dtor_on; - DAST._ICallName _1601_name = _source74.dtor_callName; - Dafny.ISequence _1602_typeArgs = _source74.dtor_typeArgs; - Dafny.ISequence _1603_args = _source74.dtor_args; - Std.Wrappers._IOption>> _1604_maybeOutVars = _source74.dtor_outs; + if (_source75.is_Call) { + DAST._IExpression _1609_on = _source75.dtor_on; + DAST._ICallName _1610_name = _source75.dtor_callName; + Dafny.ISequence _1611_typeArgs = _source75.dtor_typeArgs; + Dafny.ISequence _1612_args = _source75.dtor_args; + Std.Wrappers._IOption>> _1613_maybeOutVars = _source75.dtor_outs; { - Dafny.ISequence _1605_argExprs; - Dafny.ISet> _1606_recIdents; - Dafny.ISequence _1607_typeExprs; - Std.Wrappers._IOption _1608_fullNameQualifier; + Dafny.ISequence _1614_argExprs; + Dafny.ISet> _1615_recIdents; + Dafny.ISequence _1616_typeExprs; + Std.Wrappers._IOption _1617_fullNameQualifier; Dafny.ISequence _out176; Dafny.ISet> _out177; Dafny.ISequence _out178; Std.Wrappers._IOption _out179; - (this).GenArgs(selfIdent, _1601_name, _1602_typeArgs, _1603_args, env, out _out176, out _out177, out _out178, out _out179); - _1605_argExprs = _out176; - _1606_recIdents = _out177; - _1607_typeExprs = _out178; - _1608_fullNameQualifier = _out179; - readIdents = _1606_recIdents; - Std.Wrappers._IOption _source76 = _1608_fullNameQualifier; + (this).GenArgs(selfIdent, _1610_name, _1611_typeArgs, _1612_args, env, out _out176, out _out177, out _out178, out _out179); + _1614_argExprs = _out176; + _1615_recIdents = _out177; + _1616_typeExprs = _out178; + _1617_fullNameQualifier = _out179; + readIdents = _1615_recIdents; + Std.Wrappers._IOption _source77 = _1617_fullNameQualifier; { - if (_source76.is_Some) { - DAST._IResolvedType value9 = _source76.dtor_value; - Dafny.ISequence> _1609_path = value9.dtor_path; - Dafny.ISequence _1610_onTypeArgs = value9.dtor_typeArgs; - DAST._IResolvedTypeBase _1611_base = value9.dtor_kind; - RAST._IExpr _1612_fullPath; + if (_source77.is_Some) { + DAST._IResolvedType value9 = _source77.dtor_value; + Dafny.ISequence> _1618_path = value9.dtor_path; + Dafny.ISequence _1619_onTypeArgs = value9.dtor_typeArgs; + DAST._IResolvedTypeBase _1620_base = value9.dtor_kind; + RAST._IExpr _1621_fullPath; RAST._IExpr _out180; - _out180 = DCOMP.COMP.GenPathExpr(_1609_path); - _1612_fullPath = _out180; - Dafny.ISequence _1613_onTypeExprs; + _out180 = DCOMP.COMP.GenPathExpr(_1618_path); + _1621_fullPath = _out180; + Dafny.ISequence _1622_onTypeExprs; Dafny.ISequence _out181; - _out181 = (this).GenTypeArgs(_1610_onTypeArgs, DCOMP.GenTypeContext.@default()); - _1613_onTypeExprs = _out181; - RAST._IExpr _1614_onExpr = RAST.Expr.Default(); - DCOMP._IOwnership _1615_recOwnership = DCOMP.Ownership.Default(); - Dafny.ISet> _1616_recIdents = Dafny.Set>.Empty; - if (((_1611_base).is_Trait) || ((_1611_base).is_Class)) { + _out181 = (this).GenTypeArgs(_1619_onTypeArgs, DCOMP.GenTypeContext.@default()); + _1622_onTypeExprs = _out181; + RAST._IExpr _1623_onExpr = RAST.Expr.Default(); + DCOMP._IOwnership _1624_recOwnership = DCOMP.Ownership.Default(); + Dafny.ISet> _1625_recIdents = Dafny.Set>.Empty; + if (((_1620_base).is_Trait) || ((_1620_base).is_Class)) { RAST._IExpr _out182; DCOMP._IOwnership _out183; Dafny.ISet> _out184; - (this).GenExpr(_1600_on, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out182, out _out183, out _out184); - _1614_onExpr = _out182; - _1615_recOwnership = _out183; - _1616_recIdents = _out184; - _1614_onExpr = ((this).modify__macro).Apply1(_1614_onExpr); - readIdents = Dafny.Set>.Union(readIdents, _1616_recIdents); + (this).GenExpr(_1609_on, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out182, out _out183, out _out184); + _1623_onExpr = _out182; + _1624_recOwnership = _out183; + _1625_recIdents = _out184; + _1623_onExpr = ((this).modify__macro).Apply1(_1623_onExpr); + readIdents = Dafny.Set>.Union(readIdents, _1625_recIdents); } else { RAST._IExpr _out185; DCOMP._IOwnership _out186; Dafny.ISet> _out187; - (this).GenExpr(_1600_on, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowedMut(), out _out185, out _out186, out _out187); - _1614_onExpr = _out185; - _1615_recOwnership = _out186; - _1616_recIdents = _out187; - readIdents = Dafny.Set>.Union(readIdents, _1616_recIdents); + (this).GenExpr(_1609_on, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowedMut(), out _out185, out _out186, out _out187); + _1623_onExpr = _out185; + _1624_recOwnership = _out186; + _1625_recIdents = _out187; + readIdents = Dafny.Set>.Union(readIdents, _1625_recIdents); } - generated = ((((_1612_fullPath).ApplyType(_1613_onTypeExprs)).MSel(DCOMP.__default.escapeName((_1601_name).dtor_name))).ApplyType(_1607_typeExprs)).Apply(Dafny.Sequence.Concat(Dafny.Sequence.FromElements(_1614_onExpr), _1605_argExprs)); - goto after_match23; + generated = ((((_1621_fullPath).ApplyType(_1622_onTypeExprs)).MSel(DCOMP.__default.escapeName((_1610_name).dtor_name))).ApplyType(_1616_typeExprs)).Apply(Dafny.Sequence.Concat(Dafny.Sequence.FromElements(_1623_onExpr), _1614_argExprs)); + goto after_match24; } } { - RAST._IExpr _1617_onExpr; - DCOMP._IOwnership _1618___v94; - Dafny.ISet> _1619_enclosingIdents; + RAST._IExpr _1626_onExpr; + DCOMP._IOwnership _1627___v94; + Dafny.ISet> _1628_enclosingIdents; RAST._IExpr _out188; DCOMP._IOwnership _out189; Dafny.ISet> _out190; - (this).GenExpr(_1600_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out188, out _out189, out _out190); - _1617_onExpr = _out188; - _1618___v94 = _out189; - _1619_enclosingIdents = _out190; - readIdents = Dafny.Set>.Union(readIdents, _1619_enclosingIdents); - Dafny.ISequence _1620_renderedName; - DAST._ICallName _source77 = _1601_name; + (this).GenExpr(_1609_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out188, out _out189, out _out190); + _1626_onExpr = _out188; + _1627___v94 = _out189; + _1628_enclosingIdents = _out190; + readIdents = Dafny.Set>.Union(readIdents, _1628_enclosingIdents); + Dafny.ISequence _1629_renderedName; + DAST._ICallName _source78 = _1610_name; { - if (_source77.is_CallName) { - Dafny.ISequence _1621_name = _source77.dtor_name; - _1620_renderedName = DCOMP.__default.escapeName(_1621_name); - goto after_match24; + if (_source78.is_CallName) { + Dafny.ISequence _1630_name = _source78.dtor_name; + _1629_renderedName = DCOMP.__default.escapeName(_1630_name); + goto after_match25; } } { bool disjunctiveMatch11 = false; - if (_source77.is_MapBuilderAdd) { + if (_source78.is_MapBuilderAdd) { disjunctiveMatch11 = true; } - if (_source77.is_SetBuilderAdd) { + if (_source78.is_SetBuilderAdd) { disjunctiveMatch11 = true; } if (disjunctiveMatch11) { - _1620_renderedName = Dafny.Sequence.UnicodeFromString("add"); - goto after_match24; + _1629_renderedName = Dafny.Sequence.UnicodeFromString("add"); + goto after_match25; } } { - _1620_renderedName = Dafny.Sequence.UnicodeFromString("build"); + _1629_renderedName = Dafny.Sequence.UnicodeFromString("build"); } - after_match24: ; - DAST._IExpression _source78 = _1600_on; + after_match25: ; + DAST._IExpression _source79 = _1609_on; { - if (_source78.is_Companion) { + if (_source79.is_Companion) { { - _1617_onExpr = (_1617_onExpr).MSel(_1620_renderedName); + _1626_onExpr = (_1626_onExpr).MSel(_1629_renderedName); } - goto after_match25; + goto after_match26; } } { { - if (!object.Equals(_1617_onExpr, RAST.__default.self)) { - DAST._ICallName _source79 = _1601_name; + if (!object.Equals(_1626_onExpr, RAST.__default.self)) { + DAST._ICallName _source80 = _1610_name; { - if (_source79.is_CallName) { - Std.Wrappers._IOption onType0 = _source79.dtor_onType; + if (_source80.is_CallName) { + Std.Wrappers._IOption onType0 = _source80.dtor_onType; if (onType0.is_Some) { - DAST._IType _1622_tpe = onType0.dtor_value; - RAST._IType _1623_typ; + DAST._IType _1631_tpe = onType0.dtor_value; + RAST._IType _1632_typ; RAST._IType _out191; - _out191 = (this).GenType(_1622_tpe, DCOMP.GenTypeContext.@default()); - _1623_typ = _out191; - if (((_1623_typ).IsObjectOrPointer()) && (!object.Equals(_1617_onExpr, RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("self"))))) { - _1617_onExpr = ((this).modify__macro).Apply1(_1617_onExpr); + _out191 = (this).GenType(_1631_tpe, DCOMP.GenTypeContext.@default()); + _1632_typ = _out191; + if (((_1632_typ).IsObjectOrPointer()) && (!object.Equals(_1626_onExpr, RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("self"))))) { + _1626_onExpr = ((this).modify__macro).Apply1(_1626_onExpr); } - goto after_match26; + goto after_match27; } } } { } - after_match26: ; + after_match27: ; } - _1617_onExpr = (_1617_onExpr).Sel(_1620_renderedName); + _1626_onExpr = (_1626_onExpr).Sel(_1629_renderedName); } } - after_match25: ; - generated = ((_1617_onExpr).ApplyType(_1607_typeExprs)).Apply(_1605_argExprs); + after_match26: ; + generated = ((_1626_onExpr).ApplyType(_1616_typeExprs)).Apply(_1614_argExprs); } - after_match23: ; - if (((_1604_maybeOutVars).is_Some) && ((new BigInteger(((_1604_maybeOutVars).dtor_value).Count)) == (BigInteger.One))) { - Dafny.ISequence _1624_outVar; - _1624_outVar = DCOMP.__default.escapeName((((_1604_maybeOutVars).dtor_value).Select(BigInteger.Zero))); - if (!((env).CanReadWithoutClone(_1624_outVar))) { + after_match24: ; + if (((_1613_maybeOutVars).is_Some) && ((new BigInteger(((_1613_maybeOutVars).dtor_value).Count)) == (BigInteger.One))) { + Dafny.ISequence _1633_outVar; + _1633_outVar = DCOMP.__default.escapeName((((_1613_maybeOutVars).dtor_value).Select(BigInteger.Zero))); + if (!((env).CanReadWithoutClone(_1633_outVar))) { generated = RAST.__default.MaybePlacebo(generated); } - generated = RAST.__default.AssignVar(_1624_outVar, generated); - } else if (((_1604_maybeOutVars).is_None) || ((new BigInteger(((_1604_maybeOutVars).dtor_value).Count)).Sign == 0)) { + generated = RAST.__default.AssignVar(_1633_outVar, generated); + } else if (((_1613_maybeOutVars).is_None) || ((new BigInteger(((_1613_maybeOutVars).dtor_value).Count)).Sign == 0)) { } else { - Dafny.ISequence _1625_tmpVar; - _1625_tmpVar = Dafny.Sequence.UnicodeFromString("_x"); - RAST._IExpr _1626_tmpId; - _1626_tmpId = RAST.Expr.create_Identifier(_1625_tmpVar); - generated = RAST.Expr.create_DeclareVar(RAST.DeclareType.create_CONST(), _1625_tmpVar, Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(generated)); - Dafny.ISequence> _1627_outVars; - _1627_outVars = (_1604_maybeOutVars).dtor_value; - BigInteger _hi35 = new BigInteger((_1627_outVars).Count); - for (BigInteger _1628_outI = BigInteger.Zero; _1628_outI < _hi35; _1628_outI++) { - Dafny.ISequence _1629_outVar; - _1629_outVar = DCOMP.__default.escapeName(((_1627_outVars).Select(_1628_outI))); - RAST._IExpr _1630_rhs; - _1630_rhs = (_1626_tmpId).Sel(Std.Strings.__default.OfNat(_1628_outI)); - if (!((env).CanReadWithoutClone(_1629_outVar))) { - _1630_rhs = RAST.__default.MaybePlacebo(_1630_rhs); + Dafny.ISequence _1634_tmpVar; + _1634_tmpVar = Dafny.Sequence.UnicodeFromString("_x"); + RAST._IExpr _1635_tmpId; + _1635_tmpId = RAST.Expr.create_Identifier(_1634_tmpVar); + generated = RAST.Expr.create_DeclareVar(RAST.DeclareType.create_CONST(), _1634_tmpVar, Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(generated)); + Dafny.ISequence> _1636_outVars; + _1636_outVars = (_1613_maybeOutVars).dtor_value; + BigInteger _hi36 = new BigInteger((_1636_outVars).Count); + for (BigInteger _1637_outI = BigInteger.Zero; _1637_outI < _hi36; _1637_outI++) { + Dafny.ISequence _1638_outVar; + _1638_outVar = DCOMP.__default.escapeName(((_1636_outVars).Select(_1637_outI))); + RAST._IExpr _1639_rhs; + _1639_rhs = (_1635_tmpId).Sel(Std.Strings.__default.OfNat(_1637_outI)); + if (!((env).CanReadWithoutClone(_1638_outVar))) { + _1639_rhs = RAST.__default.MaybePlacebo(_1639_rhs); } - generated = (generated).Then(RAST.__default.AssignVar(_1629_outVar, _1630_rhs)); + generated = (generated).Then(RAST.__default.AssignVar(_1638_outVar, _1639_rhs)); } } newEnv = env; } - goto after_match21; + goto after_match22; } } { - if (_source74.is_Return) { - DAST._IExpression _1631_exprDafny = _source74.dtor_expr; + if (_source75.is_Return) { + DAST._IExpression _1640_exprDafny = _source75.dtor_expr; { - RAST._IExpr _1632_expr; - DCOMP._IOwnership _1633___v105; - Dafny.ISet> _1634_recIdents; + RAST._IExpr _1641_expr; + DCOMP._IOwnership _1642___v105; + Dafny.ISet> _1643_recIdents; RAST._IExpr _out192; DCOMP._IOwnership _out193; Dafny.ISet> _out194; - (this).GenExpr(_1631_exprDafny, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out192, out _out193, out _out194); - _1632_expr = _out192; - _1633___v105 = _out193; - _1634_recIdents = _out194; - readIdents = _1634_recIdents; + (this).GenExpr(_1640_exprDafny, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out192, out _out193, out _out194); + _1641_expr = _out192; + _1642___v105 = _out193; + _1643_recIdents = _out194; + readIdents = _1643_recIdents; if (isLast) { - generated = _1632_expr; + generated = _1641_expr; } else { - generated = RAST.Expr.create_Return(Std.Wrappers.Option.create_Some(_1632_expr)); + generated = RAST.Expr.create_Return(Std.Wrappers.Option.create_Some(_1641_expr)); } newEnv = env; } - goto after_match21; + goto after_match22; } } { - if (_source74.is_EarlyReturn) { + if (_source75.is_EarlyReturn) { { - Std.Wrappers._IOption>> _source80 = earlyReturn; + Std.Wrappers._IOption>> _source81 = earlyReturn; { - if (_source80.is_None) { + if (_source81.is_None) { generated = RAST.Expr.create_Return(Std.Wrappers.Option.create_None()); - goto after_match27; + goto after_match28; } } { - Dafny.ISequence> _1635_rustIdents = _source80.dtor_value; - Dafny.ISequence _1636_tupleArgs; - _1636_tupleArgs = Dafny.Sequence.FromElements(); - BigInteger _hi36 = new BigInteger((_1635_rustIdents).Count); - for (BigInteger _1637_i = BigInteger.Zero; _1637_i < _hi36; _1637_i++) { - RAST._IExpr _1638_rIdent; - DCOMP._IOwnership _1639___v106; - Dafny.ISet> _1640___v107; + Dafny.ISequence> _1644_rustIdents = _source81.dtor_value; + Dafny.ISequence _1645_tupleArgs; + _1645_tupleArgs = Dafny.Sequence.FromElements(); + BigInteger _hi37 = new BigInteger((_1644_rustIdents).Count); + for (BigInteger _1646_i = BigInteger.Zero; _1646_i < _hi37; _1646_i++) { + RAST._IExpr _1647_rIdent; + DCOMP._IOwnership _1648___v106; + Dafny.ISet> _1649___v107; RAST._IExpr _out195; DCOMP._IOwnership _out196; Dafny.ISet> _out197; - (this).GenIdent((_1635_rustIdents).Select(_1637_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out195, out _out196, out _out197); - _1638_rIdent = _out195; - _1639___v106 = _out196; - _1640___v107 = _out197; - _1636_tupleArgs = Dafny.Sequence.Concat(_1636_tupleArgs, Dafny.Sequence.FromElements(_1638_rIdent)); + (this).GenIdent((_1644_rustIdents).Select(_1646_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out195, out _out196, out _out197); + _1647_rIdent = _out195; + _1648___v106 = _out196; + _1649___v107 = _out197; + _1645_tupleArgs = Dafny.Sequence.Concat(_1645_tupleArgs, Dafny.Sequence.FromElements(_1647_rIdent)); } - if ((new BigInteger((_1636_tupleArgs).Count)) == (BigInteger.One)) { - generated = RAST.Expr.create_Return(Std.Wrappers.Option.create_Some((_1636_tupleArgs).Select(BigInteger.Zero))); + if ((new BigInteger((_1645_tupleArgs).Count)) == (BigInteger.One)) { + generated = RAST.Expr.create_Return(Std.Wrappers.Option.create_Some((_1645_tupleArgs).Select(BigInteger.Zero))); } else { - generated = RAST.Expr.create_Return(Std.Wrappers.Option.create_Some(RAST.Expr.create_Tuple(_1636_tupleArgs))); + generated = RAST.Expr.create_Return(Std.Wrappers.Option.create_Some(RAST.Expr.create_Tuple(_1645_tupleArgs))); } } - after_match27: ; + after_match28: ; readIdents = Dafny.Set>.FromElements(); newEnv = env; } - goto after_match21; + goto after_match22; } } { - if (_source74.is_Halt) { + if (_source75.is_Halt) { { generated = (RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("panic!"))).Apply1(RAST.Expr.create_LiteralString(Dafny.Sequence.UnicodeFromString("Halt"), false, false)); readIdents = Dafny.Set>.FromElements(); newEnv = env; } - goto after_match21; + goto after_match22; } } { - DAST._IExpression _1641_e = _source74.dtor_Print_a0; + DAST._IExpression _1650_e = _source75.dtor_Print_a0; { - RAST._IExpr _1642_printedExpr; - DCOMP._IOwnership _1643_recOwnership; - Dafny.ISet> _1644_recIdents; + RAST._IExpr _1651_printedExpr; + DCOMP._IOwnership _1652_recOwnership; + Dafny.ISet> _1653_recIdents; RAST._IExpr _out198; DCOMP._IOwnership _out199; Dafny.ISet> _out200; - (this).GenExpr(_1641_e, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out198, out _out199, out _out200); - _1642_printedExpr = _out198; - _1643_recOwnership = _out199; - _1644_recIdents = _out200; - generated = (RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("print!"))).Apply(Dafny.Sequence.FromElements(RAST.Expr.create_LiteralString(Dafny.Sequence.UnicodeFromString("{}"), false, false), ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("DafnyPrintWrapper"))).Apply1(_1642_printedExpr))); - readIdents = _1644_recIdents; + (this).GenExpr(_1650_e, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out198, out _out199, out _out200); + _1651_printedExpr = _out198; + _1652_recOwnership = _out199; + _1653_recIdents = _out200; + generated = (RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("print!"))).Apply(Dafny.Sequence.FromElements(RAST.Expr.create_LiteralString(Dafny.Sequence.UnicodeFromString("{}"), false, false), ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("DafnyPrintWrapper"))).Apply1(_1651_printedExpr))); + readIdents = _1653_recIdents; newEnv = env; } } - after_match21: ; + after_match22: ; } public static Std.Wrappers._IOption NewtypeToRustType(DAST._IType @base, DAST._INewtypeRange range) { - DAST._INewtypeRange _source81 = range; + DAST._INewtypeRange _source82 = range; { - if (_source81.is_NoRange) { + if (_source82.is_NoRange) { return Std.Wrappers.Option.create_None(); } } { - if (_source81.is_U8) { + if (_source82.is_U8) { return Std.Wrappers.Option.create_Some(RAST.Type.create_U8()); } } { - if (_source81.is_U16) { + if (_source82.is_U16) { return Std.Wrappers.Option.create_Some(RAST.Type.create_U16()); } } { - if (_source81.is_U32) { + if (_source82.is_U32) { return Std.Wrappers.Option.create_Some(RAST.Type.create_U32()); } } { - if (_source81.is_U64) { + if (_source82.is_U64) { return Std.Wrappers.Option.create_Some(RAST.Type.create_U64()); } } { - if (_source81.is_U128) { + if (_source82.is_U128) { return Std.Wrappers.Option.create_Some(RAST.Type.create_U128()); } } { - if (_source81.is_I8) { + if (_source82.is_I8) { return Std.Wrappers.Option.create_Some(RAST.Type.create_I8()); } } { - if (_source81.is_I16) { + if (_source82.is_I16) { return Std.Wrappers.Option.create_Some(RAST.Type.create_I16()); } } { - if (_source81.is_I32) { + if (_source82.is_I32) { return Std.Wrappers.Option.create_Some(RAST.Type.create_I32()); } } { - if (_source81.is_I64) { + if (_source82.is_I64) { return Std.Wrappers.Option.create_Some(RAST.Type.create_I64()); } } { - if (_source81.is_I128) { + if (_source82.is_I128) { return Std.Wrappers.Option.create_Some(RAST.Type.create_I128()); } } @@ -3421,59 +3452,59 @@ public void GenExprLiteral(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOM r = RAST.Expr.Default(); resultingOwnership = DCOMP.Ownership.Default(); readIdents = Dafny.Set>.Empty; - DAST._IExpression _source82 = e; + DAST._IExpression _source83 = e; { - if (_source82.is_Literal) { - DAST._ILiteral _h170 = _source82.dtor_Literal_a0; + if (_source83.is_Literal) { + DAST._ILiteral _h170 = _source83.dtor_Literal_a0; if (_h170.is_BoolLiteral) { - bool _1645_b = _h170.dtor_BoolLiteral_a0; + bool _1654_b = _h170.dtor_BoolLiteral_a0; { RAST._IExpr _out205; DCOMP._IOwnership _out206; - (this).FromOwned(RAST.Expr.create_LiteralBool(_1645_b), expectedOwnership, out _out205, out _out206); + (this).FromOwned(RAST.Expr.create_LiteralBool(_1654_b), expectedOwnership, out _out205, out _out206); r = _out205; resultingOwnership = _out206; readIdents = Dafny.Set>.FromElements(); return ; } - goto after_match28; + goto after_match29; } } } { - if (_source82.is_Literal) { - DAST._ILiteral _h171 = _source82.dtor_Literal_a0; + if (_source83.is_Literal) { + DAST._ILiteral _h171 = _source83.dtor_Literal_a0; if (_h171.is_IntLiteral) { - Dafny.ISequence _1646_i = _h171.dtor_IntLiteral_a0; - DAST._IType _1647_t = _h171.dtor_IntLiteral_a1; + Dafny.ISequence _1655_i = _h171.dtor_IntLiteral_a0; + DAST._IType _1656_t = _h171.dtor_IntLiteral_a1; { - DAST._IType _source83 = _1647_t; + DAST._IType _source84 = _1656_t; { - if (_source83.is_Primitive) { - DAST._IPrimitive _h70 = _source83.dtor_Primitive_a0; + if (_source84.is_Primitive) { + DAST._IPrimitive _h70 = _source84.dtor_Primitive_a0; if (_h70.is_Int) { { - if ((new BigInteger((_1646_i).Count)) <= (new BigInteger(4))) { - r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("int!"))).Apply1(RAST.Expr.create_LiteralInt(_1646_i)); + if ((new BigInteger((_1655_i).Count)) <= (new BigInteger(4))) { + r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("int!"))).Apply1(RAST.Expr.create_LiteralInt(_1655_i)); } else { - r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("int!"))).Apply1(RAST.Expr.create_LiteralString(_1646_i, true, false)); + r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("int!"))).Apply1(RAST.Expr.create_LiteralString(_1655_i, true, false)); } } - goto after_match29; + goto after_match30; } } } { - DAST._IType _1648_o = _source83; + DAST._IType _1657_o = _source84; { - RAST._IType _1649_genType; + RAST._IType _1658_genType; RAST._IType _out207; - _out207 = (this).GenType(_1648_o, DCOMP.GenTypeContext.@default()); - _1649_genType = _out207; - r = RAST.Expr.create_TypeAscription(RAST.Expr.create_RawExpr(_1646_i), _1649_genType); + _out207 = (this).GenType(_1657_o, DCOMP.GenTypeContext.@default()); + _1658_genType = _out207; + r = RAST.Expr.create_TypeAscription(RAST.Expr.create_RawExpr(_1655_i), _1658_genType); } } - after_match29: ; + after_match30: ; RAST._IExpr _out208; DCOMP._IOwnership _out209; (this).FromOwned(r, expectedOwnership, out _out208, out _out209); @@ -3482,41 +3513,41 @@ public void GenExprLiteral(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOM readIdents = Dafny.Set>.FromElements(); return ; } - goto after_match28; + goto after_match29; } } } { - if (_source82.is_Literal) { - DAST._ILiteral _h172 = _source82.dtor_Literal_a0; + if (_source83.is_Literal) { + DAST._ILiteral _h172 = _source83.dtor_Literal_a0; if (_h172.is_DecLiteral) { - Dafny.ISequence _1650_n = _h172.dtor_DecLiteral_a0; - Dafny.ISequence _1651_d = _h172.dtor_DecLiteral_a1; - DAST._IType _1652_t = _h172.dtor_DecLiteral_a2; + Dafny.ISequence _1659_n = _h172.dtor_DecLiteral_a0; + Dafny.ISequence _1660_d = _h172.dtor_DecLiteral_a1; + DAST._IType _1661_t = _h172.dtor_DecLiteral_a2; { - DAST._IType _source84 = _1652_t; + DAST._IType _source85 = _1661_t; { - if (_source84.is_Primitive) { - DAST._IPrimitive _h71 = _source84.dtor_Primitive_a0; + if (_source85.is_Primitive) { + DAST._IPrimitive _h71 = _source85.dtor_Primitive_a0; if (_h71.is_Real) { { - r = RAST.__default.RcNew(RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::BigRational::new(::dafny_runtime::BigInt::parse_bytes(b\""), _1650_n), Dafny.Sequence.UnicodeFromString("\", 10).unwrap(), ::dafny_runtime::BigInt::parse_bytes(b\"")), _1651_d), Dafny.Sequence.UnicodeFromString("\", 10).unwrap())")))); + r = RAST.__default.RcNew(RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::BigRational::new(::dafny_runtime::BigInt::parse_bytes(b\""), _1659_n), Dafny.Sequence.UnicodeFromString("\", 10).unwrap(), ::dafny_runtime::BigInt::parse_bytes(b\"")), _1660_d), Dafny.Sequence.UnicodeFromString("\", 10).unwrap())")))); } - goto after_match30; + goto after_match31; } } } { - DAST._IType _1653_o = _source84; + DAST._IType _1662_o = _source85; { - RAST._IType _1654_genType; + RAST._IType _1663_genType; RAST._IType _out210; - _out210 = (this).GenType(_1653_o, DCOMP.GenTypeContext.@default()); - _1654_genType = _out210; - r = RAST.Expr.create_TypeAscription(RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("("), _1650_n), Dafny.Sequence.UnicodeFromString(".0 / ")), _1651_d), Dafny.Sequence.UnicodeFromString(".0")), Dafny.Sequence.UnicodeFromString(")"))), _1654_genType); + _out210 = (this).GenType(_1662_o, DCOMP.GenTypeContext.@default()); + _1663_genType = _out210; + r = RAST.Expr.create_TypeAscription(RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("("), _1659_n), Dafny.Sequence.UnicodeFromString(".0 / ")), _1660_d), Dafny.Sequence.UnicodeFromString(".0")), Dafny.Sequence.UnicodeFromString(")"))), _1663_genType); } } - after_match30: ; + after_match31: ; RAST._IExpr _out211; DCOMP._IOwnership _out212; (this).FromOwned(r, expectedOwnership, out _out211, out _out212); @@ -3525,18 +3556,18 @@ public void GenExprLiteral(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOM readIdents = Dafny.Set>.FromElements(); return ; } - goto after_match28; + goto after_match29; } } } { - if (_source82.is_Literal) { - DAST._ILiteral _h173 = _source82.dtor_Literal_a0; + if (_source83.is_Literal) { + DAST._ILiteral _h173 = _source83.dtor_Literal_a0; if (_h173.is_StringLiteral) { - Dafny.ISequence _1655_l = _h173.dtor_StringLiteral_a0; - bool _1656_verbatim = _h173.dtor_verbatim; + Dafny.ISequence _1664_l = _h173.dtor_StringLiteral_a0; + bool _1665_verbatim = _h173.dtor_verbatim; { - r = ((RAST.__default.dafny__runtime).MSel((this).string__of)).Apply1(RAST.Expr.create_LiteralString(_1655_l, false, _1656_verbatim)); + r = ((RAST.__default.dafny__runtime).MSel((this).string__of)).Apply1(RAST.Expr.create_LiteralString(_1664_l, false, _1665_verbatim)); RAST._IExpr _out213; DCOMP._IOwnership _out214; (this).FromOwned(r, expectedOwnership, out _out213, out _out214); @@ -3545,17 +3576,17 @@ public void GenExprLiteral(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOM readIdents = Dafny.Set>.FromElements(); return ; } - goto after_match28; + goto after_match29; } } } { - if (_source82.is_Literal) { - DAST._ILiteral _h174 = _source82.dtor_Literal_a0; + if (_source83.is_Literal) { + DAST._ILiteral _h174 = _source83.dtor_Literal_a0; if (_h174.is_CharLiteralUTF16) { - BigInteger _1657_c = _h174.dtor_CharLiteralUTF16_a0; + BigInteger _1666_c = _h174.dtor_CharLiteralUTF16_a0; { - r = RAST.Expr.create_LiteralInt(Std.Strings.__default.OfNat(_1657_c)); + r = RAST.Expr.create_LiteralInt(Std.Strings.__default.OfNat(_1666_c)); r = RAST.Expr.create_TypeAscription(r, RAST.Type.create_U16()); r = ((RAST.__default.dafny__runtime).MSel((this).DafnyChar)).Apply1(r); RAST._IExpr _out215; @@ -3566,17 +3597,17 @@ public void GenExprLiteral(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOM readIdents = Dafny.Set>.FromElements(); return ; } - goto after_match28; + goto after_match29; } } } { - if (_source82.is_Literal) { - DAST._ILiteral _h175 = _source82.dtor_Literal_a0; + if (_source83.is_Literal) { + DAST._ILiteral _h175 = _source83.dtor_Literal_a0; if (_h175.is_CharLiteral) { - Dafny.Rune _1658_c = _h175.dtor_CharLiteral_a0; + Dafny.Rune _1667_c = _h175.dtor_CharLiteral_a0; { - r = RAST.Expr.create_LiteralInt(Std.Strings.__default.OfNat(new BigInteger((_1658_c).Value))); + r = RAST.Expr.create_LiteralInt(Std.Strings.__default.OfNat(new BigInteger((_1667_c).Value))); if (!((this).UnicodeChars)) { r = RAST.Expr.create_TypeAscription(r, RAST.Type.create_U16()); } else { @@ -3591,22 +3622,22 @@ public void GenExprLiteral(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOM readIdents = Dafny.Set>.FromElements(); return ; } - goto after_match28; + goto after_match29; } } } { - DAST._ILiteral _h176 = _source82.dtor_Literal_a0; - DAST._IType _1659_tpe = _h176.dtor_Null_a0; + DAST._ILiteral _h176 = _source83.dtor_Literal_a0; + DAST._IType _1668_tpe = _h176.dtor_Null_a0; { - RAST._IType _1660_tpeGen; + RAST._IType _1669_tpeGen; RAST._IType _out219; - _out219 = (this).GenType(_1659_tpe, DCOMP.GenTypeContext.@default()); - _1660_tpeGen = _out219; + _out219 = (this).GenType(_1668_tpe, DCOMP.GenTypeContext.@default()); + _1669_tpeGen = _out219; if (((this).ObjectType).is_RawPointers) { r = ((RAST.__default.std).MSel(Dafny.Sequence.UnicodeFromString("ptr"))).MSel(Dafny.Sequence.UnicodeFromString("null")); } else { - r = RAST.Expr.create_TypeAscription(((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("Object"))).Apply1(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("None"))), _1660_tpeGen); + r = RAST.Expr.create_TypeAscription(((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("Object"))).Apply1(RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("None"))), _1669_tpeGen); } RAST._IExpr _out220; DCOMP._IOwnership _out221; @@ -3617,7 +3648,7 @@ public void GenExprLiteral(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOM return ; } } - after_match28: ; + after_match29: ; } public void GenExprBinary(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnvironment env, DCOMP._IOwnership expectedOwnership, out RAST._IExpr r, out DCOMP._IOwnership resultingOwnership, out Dafny.ISet> readIdents) { @@ -3625,389 +3656,389 @@ public void GenExprBinary(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP resultingOwnership = DCOMP.Ownership.Default(); readIdents = Dafny.Set>.Empty; DAST._IExpression _let_tmp_rhs54 = e; - DAST._IBinOp _1661_op = _let_tmp_rhs54.dtor_op; - DAST._IExpression _1662_lExpr = _let_tmp_rhs54.dtor_left; - DAST._IExpression _1663_rExpr = _let_tmp_rhs54.dtor_right; - DAST.Format._IBinaryOpFormat _1664_format = _let_tmp_rhs54.dtor_format2; - bool _1665_becomesLeftCallsRight; - DAST._IBinOp _source85 = _1661_op; + DAST._IBinOp _1670_op = _let_tmp_rhs54.dtor_op; + DAST._IExpression _1671_lExpr = _let_tmp_rhs54.dtor_left; + DAST._IExpression _1672_rExpr = _let_tmp_rhs54.dtor_right; + DAST.Format._IBinaryOpFormat _1673_format = _let_tmp_rhs54.dtor_format2; + bool _1674_becomesLeftCallsRight; + DAST._IBinOp _source86 = _1670_op; { bool disjunctiveMatch12 = false; - if (_source85.is_SetMerge) { + if (_source86.is_SetMerge) { disjunctiveMatch12 = true; } - if (_source85.is_SetSubtraction) { + if (_source86.is_SetSubtraction) { disjunctiveMatch12 = true; } - if (_source85.is_SetIntersection) { + if (_source86.is_SetIntersection) { disjunctiveMatch12 = true; } - if (_source85.is_SetDisjoint) { + if (_source86.is_SetDisjoint) { disjunctiveMatch12 = true; } - if (_source85.is_MapMerge) { + if (_source86.is_MapMerge) { disjunctiveMatch12 = true; } - if (_source85.is_MapSubtraction) { + if (_source86.is_MapSubtraction) { disjunctiveMatch12 = true; } - if (_source85.is_MultisetMerge) { + if (_source86.is_MultisetMerge) { disjunctiveMatch12 = true; } - if (_source85.is_MultisetSubtraction) { + if (_source86.is_MultisetSubtraction) { disjunctiveMatch12 = true; } - if (_source85.is_MultisetIntersection) { + if (_source86.is_MultisetIntersection) { disjunctiveMatch12 = true; } - if (_source85.is_MultisetDisjoint) { + if (_source86.is_MultisetDisjoint) { disjunctiveMatch12 = true; } - if (_source85.is_Concat) { + if (_source86.is_Concat) { disjunctiveMatch12 = true; } if (disjunctiveMatch12) { - _1665_becomesLeftCallsRight = true; - goto after_match31; + _1674_becomesLeftCallsRight = true; + goto after_match32; } } { - _1665_becomesLeftCallsRight = false; + _1674_becomesLeftCallsRight = false; } - after_match31: ; - bool _1666_becomesRightCallsLeft; - DAST._IBinOp _source86 = _1661_op; + after_match32: ; + bool _1675_becomesRightCallsLeft; + DAST._IBinOp _source87 = _1670_op; { - if (_source86.is_In) { - _1666_becomesRightCallsLeft = true; - goto after_match32; + if (_source87.is_In) { + _1675_becomesRightCallsLeft = true; + goto after_match33; } } { - _1666_becomesRightCallsLeft = false; + _1675_becomesRightCallsLeft = false; } - after_match32: ; - bool _1667_becomesCallLeftRight; - DAST._IBinOp _source87 = _1661_op; + after_match33: ; + bool _1676_becomesCallLeftRight; + DAST._IBinOp _source88 = _1670_op; { - if (_source87.is_Eq) { - bool referential0 = _source87.dtor_referential; + if (_source88.is_Eq) { + bool referential0 = _source88.dtor_referential; if ((referential0) == (true)) { - _1667_becomesCallLeftRight = false; - goto after_match33; + _1676_becomesCallLeftRight = false; + goto after_match34; } } } { - if (_source87.is_SetMerge) { - _1667_becomesCallLeftRight = true; - goto after_match33; + if (_source88.is_SetMerge) { + _1676_becomesCallLeftRight = true; + goto after_match34; } } { - if (_source87.is_SetSubtraction) { - _1667_becomesCallLeftRight = true; - goto after_match33; + if (_source88.is_SetSubtraction) { + _1676_becomesCallLeftRight = true; + goto after_match34; } } { - if (_source87.is_SetIntersection) { - _1667_becomesCallLeftRight = true; - goto after_match33; + if (_source88.is_SetIntersection) { + _1676_becomesCallLeftRight = true; + goto after_match34; } } { - if (_source87.is_SetDisjoint) { - _1667_becomesCallLeftRight = true; - goto after_match33; + if (_source88.is_SetDisjoint) { + _1676_becomesCallLeftRight = true; + goto after_match34; } } { - if (_source87.is_MapMerge) { - _1667_becomesCallLeftRight = true; - goto after_match33; + if (_source88.is_MapMerge) { + _1676_becomesCallLeftRight = true; + goto after_match34; } } { - if (_source87.is_MapSubtraction) { - _1667_becomesCallLeftRight = true; - goto after_match33; + if (_source88.is_MapSubtraction) { + _1676_becomesCallLeftRight = true; + goto after_match34; } } { - if (_source87.is_MultisetMerge) { - _1667_becomesCallLeftRight = true; - goto after_match33; + if (_source88.is_MultisetMerge) { + _1676_becomesCallLeftRight = true; + goto after_match34; } } { - if (_source87.is_MultisetSubtraction) { - _1667_becomesCallLeftRight = true; - goto after_match33; + if (_source88.is_MultisetSubtraction) { + _1676_becomesCallLeftRight = true; + goto after_match34; } } { - if (_source87.is_MultisetIntersection) { - _1667_becomesCallLeftRight = true; - goto after_match33; + if (_source88.is_MultisetIntersection) { + _1676_becomesCallLeftRight = true; + goto after_match34; } } { - if (_source87.is_MultisetDisjoint) { - _1667_becomesCallLeftRight = true; - goto after_match33; + if (_source88.is_MultisetDisjoint) { + _1676_becomesCallLeftRight = true; + goto after_match34; } } { - if (_source87.is_Concat) { - _1667_becomesCallLeftRight = true; - goto after_match33; + if (_source88.is_Concat) { + _1676_becomesCallLeftRight = true; + goto after_match34; } } { - _1667_becomesCallLeftRight = false; + _1676_becomesCallLeftRight = false; } - after_match33: ; - DCOMP._IOwnership _1668_expectedLeftOwnership; - if (_1665_becomesLeftCallsRight) { - _1668_expectedLeftOwnership = DCOMP.Ownership.create_OwnershipAutoBorrowed(); - } else if ((_1666_becomesRightCallsLeft) || (_1667_becomesCallLeftRight)) { - _1668_expectedLeftOwnership = DCOMP.Ownership.create_OwnershipBorrowed(); + after_match34: ; + DCOMP._IOwnership _1677_expectedLeftOwnership; + if (_1674_becomesLeftCallsRight) { + _1677_expectedLeftOwnership = DCOMP.Ownership.create_OwnershipAutoBorrowed(); + } else if ((_1675_becomesRightCallsLeft) || (_1676_becomesCallLeftRight)) { + _1677_expectedLeftOwnership = DCOMP.Ownership.create_OwnershipBorrowed(); } else { - _1668_expectedLeftOwnership = DCOMP.Ownership.create_OwnershipOwned(); + _1677_expectedLeftOwnership = DCOMP.Ownership.create_OwnershipOwned(); } - DCOMP._IOwnership _1669_expectedRightOwnership; - if ((_1665_becomesLeftCallsRight) || (_1667_becomesCallLeftRight)) { - _1669_expectedRightOwnership = DCOMP.Ownership.create_OwnershipBorrowed(); - } else if (_1666_becomesRightCallsLeft) { - _1669_expectedRightOwnership = DCOMP.Ownership.create_OwnershipAutoBorrowed(); + DCOMP._IOwnership _1678_expectedRightOwnership; + if ((_1674_becomesLeftCallsRight) || (_1676_becomesCallLeftRight)) { + _1678_expectedRightOwnership = DCOMP.Ownership.create_OwnershipBorrowed(); + } else if (_1675_becomesRightCallsLeft) { + _1678_expectedRightOwnership = DCOMP.Ownership.create_OwnershipAutoBorrowed(); } else { - _1669_expectedRightOwnership = DCOMP.Ownership.create_OwnershipOwned(); + _1678_expectedRightOwnership = DCOMP.Ownership.create_OwnershipOwned(); } - RAST._IExpr _1670_left; - DCOMP._IOwnership _1671___v112; - Dafny.ISet> _1672_recIdentsL; + RAST._IExpr _1679_left; + DCOMP._IOwnership _1680___v112; + Dafny.ISet> _1681_recIdentsL; RAST._IExpr _out222; DCOMP._IOwnership _out223; Dafny.ISet> _out224; - (this).GenExpr(_1662_lExpr, selfIdent, env, _1668_expectedLeftOwnership, out _out222, out _out223, out _out224); - _1670_left = _out222; - _1671___v112 = _out223; - _1672_recIdentsL = _out224; - RAST._IExpr _1673_right; - DCOMP._IOwnership _1674___v113; - Dafny.ISet> _1675_recIdentsR; + (this).GenExpr(_1671_lExpr, selfIdent, env, _1677_expectedLeftOwnership, out _out222, out _out223, out _out224); + _1679_left = _out222; + _1680___v112 = _out223; + _1681_recIdentsL = _out224; + RAST._IExpr _1682_right; + DCOMP._IOwnership _1683___v113; + Dafny.ISet> _1684_recIdentsR; RAST._IExpr _out225; DCOMP._IOwnership _out226; Dafny.ISet> _out227; - (this).GenExpr(_1663_rExpr, selfIdent, env, _1669_expectedRightOwnership, out _out225, out _out226, out _out227); - _1673_right = _out225; - _1674___v113 = _out226; - _1675_recIdentsR = _out227; - DAST._IBinOp _source88 = _1661_op; + (this).GenExpr(_1672_rExpr, selfIdent, env, _1678_expectedRightOwnership, out _out225, out _out226, out _out227); + _1682_right = _out225; + _1683___v113 = _out226; + _1684_recIdentsR = _out227; + DAST._IBinOp _source89 = _1670_op; { - if (_source88.is_In) { + if (_source89.is_In) { { - r = ((_1673_right).Sel(Dafny.Sequence.UnicodeFromString("contains"))).Apply1(_1670_left); + r = ((_1682_right).Sel(Dafny.Sequence.UnicodeFromString("contains"))).Apply1(_1679_left); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_SeqProperPrefix) { - r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<"), _1670_left, _1673_right, _1664_format); - goto after_match34; + if (_source89.is_SeqProperPrefix) { + r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<"), _1679_left, _1682_right, _1673_format); + goto after_match35; } } { - if (_source88.is_SeqPrefix) { - r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<="), _1670_left, _1673_right, _1664_format); - goto after_match34; + if (_source89.is_SeqPrefix) { + r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<="), _1679_left, _1682_right, _1673_format); + goto after_match35; } } { - if (_source88.is_SetMerge) { + if (_source89.is_SetMerge) { { - r = ((_1670_left).Sel(Dafny.Sequence.UnicodeFromString("merge"))).Apply1(_1673_right); + r = ((_1679_left).Sel(Dafny.Sequence.UnicodeFromString("merge"))).Apply1(_1682_right); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_SetSubtraction) { + if (_source89.is_SetSubtraction) { { - r = ((_1670_left).Sel(Dafny.Sequence.UnicodeFromString("subtract"))).Apply1(_1673_right); + r = ((_1679_left).Sel(Dafny.Sequence.UnicodeFromString("subtract"))).Apply1(_1682_right); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_SetIntersection) { + if (_source89.is_SetIntersection) { { - r = ((_1670_left).Sel(Dafny.Sequence.UnicodeFromString("intersect"))).Apply1(_1673_right); + r = ((_1679_left).Sel(Dafny.Sequence.UnicodeFromString("intersect"))).Apply1(_1682_right); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_Subset) { + if (_source89.is_Subset) { { - r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<="), _1670_left, _1673_right, _1664_format); + r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<="), _1679_left, _1682_right, _1673_format); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_ProperSubset) { + if (_source89.is_ProperSubset) { { - r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<"), _1670_left, _1673_right, _1664_format); + r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<"), _1679_left, _1682_right, _1673_format); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_SetDisjoint) { + if (_source89.is_SetDisjoint) { { - r = ((_1670_left).Sel(Dafny.Sequence.UnicodeFromString("disjoint"))).Apply1(_1673_right); + r = ((_1679_left).Sel(Dafny.Sequence.UnicodeFromString("disjoint"))).Apply1(_1682_right); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_MapMerge) { + if (_source89.is_MapMerge) { { - r = ((_1670_left).Sel(Dafny.Sequence.UnicodeFromString("merge"))).Apply1(_1673_right); + r = ((_1679_left).Sel(Dafny.Sequence.UnicodeFromString("merge"))).Apply1(_1682_right); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_MapSubtraction) { + if (_source89.is_MapSubtraction) { { - r = ((_1670_left).Sel(Dafny.Sequence.UnicodeFromString("subtract"))).Apply1(_1673_right); + r = ((_1679_left).Sel(Dafny.Sequence.UnicodeFromString("subtract"))).Apply1(_1682_right); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_MultisetMerge) { + if (_source89.is_MultisetMerge) { { - r = ((_1670_left).Sel(Dafny.Sequence.UnicodeFromString("merge"))).Apply1(_1673_right); + r = ((_1679_left).Sel(Dafny.Sequence.UnicodeFromString("merge"))).Apply1(_1682_right); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_MultisetSubtraction) { + if (_source89.is_MultisetSubtraction) { { - r = ((_1670_left).Sel(Dafny.Sequence.UnicodeFromString("subtract"))).Apply1(_1673_right); + r = ((_1679_left).Sel(Dafny.Sequence.UnicodeFromString("subtract"))).Apply1(_1682_right); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_MultisetIntersection) { + if (_source89.is_MultisetIntersection) { { - r = ((_1670_left).Sel(Dafny.Sequence.UnicodeFromString("intersect"))).Apply1(_1673_right); + r = ((_1679_left).Sel(Dafny.Sequence.UnicodeFromString("intersect"))).Apply1(_1682_right); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_Submultiset) { + if (_source89.is_Submultiset) { { - r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<="), _1670_left, _1673_right, _1664_format); + r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<="), _1679_left, _1682_right, _1673_format); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_ProperSubmultiset) { + if (_source89.is_ProperSubmultiset) { { - r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<"), _1670_left, _1673_right, _1664_format); + r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<"), _1679_left, _1682_right, _1673_format); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_MultisetDisjoint) { + if (_source89.is_MultisetDisjoint) { { - r = ((_1670_left).Sel(Dafny.Sequence.UnicodeFromString("disjoint"))).Apply1(_1673_right); + r = ((_1679_left).Sel(Dafny.Sequence.UnicodeFromString("disjoint"))).Apply1(_1682_right); } - goto after_match34; + goto after_match35; } } { - if (_source88.is_Concat) { + if (_source89.is_Concat) { { - r = ((_1670_left).Sel(Dafny.Sequence.UnicodeFromString("concat"))).Apply1(_1673_right); + r = ((_1679_left).Sel(Dafny.Sequence.UnicodeFromString("concat"))).Apply1(_1682_right); } - goto after_match34; + goto after_match35; } } { { - if ((DCOMP.COMP.OpTable).Contains(_1661_op)) { - r = RAST.Expr.create_BinaryOp(Dafny.Map>.Select(DCOMP.COMP.OpTable,_1661_op), _1670_left, _1673_right, _1664_format); + if ((DCOMP.COMP.OpTable).Contains(_1670_op)) { + r = RAST.Expr.create_BinaryOp(Dafny.Map>.Select(DCOMP.COMP.OpTable,_1670_op), _1679_left, _1682_right, _1673_format); } else { - DAST._IBinOp _source89 = _1661_op; + DAST._IBinOp _source90 = _1670_op; { - if (_source89.is_Eq) { - bool _1676_referential = _source89.dtor_referential; + if (_source90.is_Eq) { + bool _1685_referential = _source90.dtor_referential; { - if (_1676_referential) { + if (_1685_referential) { if (((this).ObjectType).is_RawPointers) { (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.UnicodeFromString("Cannot compare raw pointers yet - need to wrap them with a structure to ensure they are compared properly")); r = RAST.Expr.create_RawExpr((this.error).dtor_value); } else { - r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=="), _1670_left, _1673_right, DAST.Format.BinaryOpFormat.create_NoFormat()); + r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=="), _1679_left, _1682_right, DAST.Format.BinaryOpFormat.create_NoFormat()); } } else { - if (((_1663_rExpr).is_SeqValue) && ((new BigInteger(((_1663_rExpr).dtor_elements).Count)).Sign == 0)) { - r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=="), ((((_1670_left).Sel(Dafny.Sequence.UnicodeFromString("to_array"))).Apply(Dafny.Sequence.FromElements())).Sel(Dafny.Sequence.UnicodeFromString("len"))).Apply(Dafny.Sequence.FromElements()), RAST.Expr.create_LiteralInt(Dafny.Sequence.UnicodeFromString("0")), DAST.Format.BinaryOpFormat.create_NoFormat()); - } else if (((_1662_lExpr).is_SeqValue) && ((new BigInteger(((_1662_lExpr).dtor_elements).Count)).Sign == 0)) { - r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=="), RAST.Expr.create_LiteralInt(Dafny.Sequence.UnicodeFromString("0")), ((((_1673_right).Sel(Dafny.Sequence.UnicodeFromString("to_array"))).Apply(Dafny.Sequence.FromElements())).Sel(Dafny.Sequence.UnicodeFromString("len"))).Apply(Dafny.Sequence.FromElements()), DAST.Format.BinaryOpFormat.create_NoFormat()); + if (((_1672_rExpr).is_SeqValue) && ((new BigInteger(((_1672_rExpr).dtor_elements).Count)).Sign == 0)) { + r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=="), ((((_1679_left).Sel(Dafny.Sequence.UnicodeFromString("to_array"))).Apply(Dafny.Sequence.FromElements())).Sel(Dafny.Sequence.UnicodeFromString("len"))).Apply(Dafny.Sequence.FromElements()), RAST.Expr.create_LiteralInt(Dafny.Sequence.UnicodeFromString("0")), DAST.Format.BinaryOpFormat.create_NoFormat()); + } else if (((_1671_lExpr).is_SeqValue) && ((new BigInteger(((_1671_lExpr).dtor_elements).Count)).Sign == 0)) { + r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=="), RAST.Expr.create_LiteralInt(Dafny.Sequence.UnicodeFromString("0")), ((((_1682_right).Sel(Dafny.Sequence.UnicodeFromString("to_array"))).Apply(Dafny.Sequence.FromElements())).Sel(Dafny.Sequence.UnicodeFromString("len"))).Apply(Dafny.Sequence.FromElements()), DAST.Format.BinaryOpFormat.create_NoFormat()); } else { - r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=="), _1670_left, _1673_right, DAST.Format.BinaryOpFormat.create_NoFormat()); + r = RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=="), _1679_left, _1682_right, DAST.Format.BinaryOpFormat.create_NoFormat()); } } } - goto after_match35; + goto after_match36; } } { - if (_source89.is_EuclidianDiv) { + if (_source90.is_EuclidianDiv) { { - r = (RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("::dafny_runtime::euclidian_division"))).Apply(Dafny.Sequence.FromElements(_1670_left, _1673_right)); + r = (RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("::dafny_runtime::euclidian_division"))).Apply(Dafny.Sequence.FromElements(_1679_left, _1682_right)); } - goto after_match35; + goto after_match36; } } { - if (_source89.is_EuclidianMod) { + if (_source90.is_EuclidianMod) { { - r = (RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("::dafny_runtime::euclidian_modulo"))).Apply(Dafny.Sequence.FromElements(_1670_left, _1673_right)); + r = (RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("::dafny_runtime::euclidian_modulo"))).Apply(Dafny.Sequence.FromElements(_1679_left, _1682_right)); } - goto after_match35; + goto after_match36; } } { - Dafny.ISequence _1677_op = _source89.dtor_Passthrough_a0; + Dafny.ISequence _1686_op = _source90.dtor_Passthrough_a0; { - r = RAST.Expr.create_BinaryOp(_1677_op, _1670_left, _1673_right, _1664_format); + r = RAST.Expr.create_BinaryOp(_1686_op, _1679_left, _1682_right, _1673_format); } } - after_match35: ; + after_match36: ; } } } - after_match34: ; + after_match35: ; RAST._IExpr _out228; DCOMP._IOwnership _out229; (this).FromOwned(r, expectedOwnership, out _out228, out _out229); r = _out228; resultingOwnership = _out229; - readIdents = Dafny.Set>.Union(_1672_recIdentsL, _1675_recIdentsR); + readIdents = Dafny.Set>.Union(_1681_recIdentsL, _1684_recIdentsR); return ; } public void GenExprConvertToNewtype(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnvironment env, DCOMP._IOwnership expectedOwnership, out RAST._IExpr r, out DCOMP._IOwnership resultingOwnership, out Dafny.ISet> readIdents) @@ -4016,130 +4047,130 @@ public void GenExprConvertToNewtype(DAST._IExpression e, DCOMP._ISelfInfo selfId resultingOwnership = DCOMP.Ownership.Default(); readIdents = Dafny.Set>.Empty; DAST._IExpression _let_tmp_rhs55 = e; - DAST._IExpression _1678_expr = _let_tmp_rhs55.dtor_value; - DAST._IType _1679_fromTpe = _let_tmp_rhs55.dtor_from; - DAST._IType _1680_toTpe = _let_tmp_rhs55.dtor_typ; - DAST._IType _let_tmp_rhs56 = _1680_toTpe; + DAST._IExpression _1687_expr = _let_tmp_rhs55.dtor_value; + DAST._IType _1688_fromTpe = _let_tmp_rhs55.dtor_from; + DAST._IType _1689_toTpe = _let_tmp_rhs55.dtor_typ; + DAST._IType _let_tmp_rhs56 = _1689_toTpe; DAST._IResolvedType _let_tmp_rhs57 = _let_tmp_rhs56.dtor_resolved; - Dafny.ISequence> _1681_path = _let_tmp_rhs57.dtor_path; - Dafny.ISequence _1682_typeArgs = _let_tmp_rhs57.dtor_typeArgs; + Dafny.ISequence> _1690_path = _let_tmp_rhs57.dtor_path; + Dafny.ISequence _1691_typeArgs = _let_tmp_rhs57.dtor_typeArgs; DAST._IResolvedTypeBase _let_tmp_rhs58 = _let_tmp_rhs57.dtor_kind; - DAST._IType _1683_b = _let_tmp_rhs58.dtor_baseType; - DAST._INewtypeRange _1684_range = _let_tmp_rhs58.dtor_range; - bool _1685_erase = _let_tmp_rhs58.dtor_erase; - Dafny.ISequence _1686___v115 = _let_tmp_rhs57.dtor_attributes; - Dafny.ISequence> _1687___v116 = _let_tmp_rhs57.dtor_properMethods; - Dafny.ISequence _1688___v117 = _let_tmp_rhs57.dtor_extendedTypes; - Std.Wrappers._IOption _1689_nativeToType; - _1689_nativeToType = DCOMP.COMP.NewtypeToRustType(_1683_b, _1684_range); - if (object.Equals(_1679_fromTpe, _1683_b)) { - RAST._IExpr _1690_recursiveGen; - DCOMP._IOwnership _1691_recOwned; - Dafny.ISet> _1692_recIdents; + DAST._IType _1692_b = _let_tmp_rhs58.dtor_baseType; + DAST._INewtypeRange _1693_range = _let_tmp_rhs58.dtor_range; + bool _1694_erase = _let_tmp_rhs58.dtor_erase; + Dafny.ISequence _1695___v115 = _let_tmp_rhs57.dtor_attributes; + Dafny.ISequence> _1696___v116 = _let_tmp_rhs57.dtor_properMethods; + Dafny.ISequence _1697___v117 = _let_tmp_rhs57.dtor_extendedTypes; + Std.Wrappers._IOption _1698_nativeToType; + _1698_nativeToType = DCOMP.COMP.NewtypeToRustType(_1692_b, _1693_range); + if (object.Equals(_1688_fromTpe, _1692_b)) { + RAST._IExpr _1699_recursiveGen; + DCOMP._IOwnership _1700_recOwned; + Dafny.ISet> _1701_recIdents; RAST._IExpr _out230; DCOMP._IOwnership _out231; Dafny.ISet> _out232; - (this).GenExpr(_1678_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out230, out _out231, out _out232); - _1690_recursiveGen = _out230; - _1691_recOwned = _out231; - _1692_recIdents = _out232; - readIdents = _1692_recIdents; - Std.Wrappers._IOption _source90 = _1689_nativeToType; + (this).GenExpr(_1687_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out230, out _out231, out _out232); + _1699_recursiveGen = _out230; + _1700_recOwned = _out231; + _1701_recIdents = _out232; + readIdents = _1701_recIdents; + Std.Wrappers._IOption _source91 = _1698_nativeToType; { - if (_source90.is_Some) { - RAST._IType _1693_v = _source90.dtor_value; - r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("truncate!"))).Apply(Dafny.Sequence.FromElements(_1690_recursiveGen, RAST.Expr.create_ExprFromType(_1693_v))); + if (_source91.is_Some) { + RAST._IType _1702_v = _source91.dtor_value; + r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("truncate!"))).Apply(Dafny.Sequence.FromElements(_1699_recursiveGen, RAST.Expr.create_ExprFromType(_1702_v))); RAST._IExpr _out233; DCOMP._IOwnership _out234; (this).FromOwned(r, expectedOwnership, out _out233, out _out234); r = _out233; resultingOwnership = _out234; - goto after_match36; + goto after_match37; } } { - if (_1685_erase) { - r = _1690_recursiveGen; + if (_1694_erase) { + r = _1699_recursiveGen; } else { - RAST._IType _1694_rhsType; + RAST._IType _1703_rhsType; RAST._IType _out235; - _out235 = (this).GenType(_1680_toTpe, DCOMP.GenTypeContext.InBinding()); - _1694_rhsType = _out235; - r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat((_1694_rhsType)._ToString(DCOMP.__default.IND), Dafny.Sequence.UnicodeFromString("(")), (_1690_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(")"))); + _out235 = (this).GenType(_1689_toTpe, DCOMP.GenTypeContext.InBinding()); + _1703_rhsType = _out235; + r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat((_1703_rhsType)._ToString(DCOMP.__default.IND), Dafny.Sequence.UnicodeFromString("(")), (_1699_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(")"))); } RAST._IExpr _out236; DCOMP._IOwnership _out237; - (this).FromOwnership(r, _1691_recOwned, expectedOwnership, out _out236, out _out237); + (this).FromOwnership(r, _1700_recOwned, expectedOwnership, out _out236, out _out237); r = _out236; resultingOwnership = _out237; } - after_match36: ; + after_match37: ; } else { - if ((_1689_nativeToType).is_Some) { - DAST._IType _source91 = _1679_fromTpe; + if ((_1698_nativeToType).is_Some) { + DAST._IType _source92 = _1688_fromTpe; { - if (_source91.is_UserDefined) { - DAST._IResolvedType resolved1 = _source91.dtor_resolved; + if (_source92.is_UserDefined) { + DAST._IResolvedType resolved1 = _source92.dtor_resolved; DAST._IResolvedTypeBase kind1 = resolved1.dtor_kind; if (kind1.is_Newtype) { - DAST._IType _1695_b0 = kind1.dtor_baseType; - DAST._INewtypeRange _1696_range0 = kind1.dtor_range; - bool _1697_erase0 = kind1.dtor_erase; - Dafny.ISequence _1698_attributes0 = resolved1.dtor_attributes; + DAST._IType _1704_b0 = kind1.dtor_baseType; + DAST._INewtypeRange _1705_range0 = kind1.dtor_range; + bool _1706_erase0 = kind1.dtor_erase; + Dafny.ISequence _1707_attributes0 = resolved1.dtor_attributes; { - Std.Wrappers._IOption _1699_nativeFromType; - _1699_nativeFromType = DCOMP.COMP.NewtypeToRustType(_1695_b0, _1696_range0); - if ((_1699_nativeFromType).is_Some) { - RAST._IExpr _1700_recursiveGen; - DCOMP._IOwnership _1701_recOwned; - Dafny.ISet> _1702_recIdents; + Std.Wrappers._IOption _1708_nativeFromType; + _1708_nativeFromType = DCOMP.COMP.NewtypeToRustType(_1704_b0, _1705_range0); + if ((_1708_nativeFromType).is_Some) { + RAST._IExpr _1709_recursiveGen; + DCOMP._IOwnership _1710_recOwned; + Dafny.ISet> _1711_recIdents; RAST._IExpr _out238; DCOMP._IOwnership _out239; Dafny.ISet> _out240; - (this).GenExpr(_1678_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out238, out _out239, out _out240); - _1700_recursiveGen = _out238; - _1701_recOwned = _out239; - _1702_recIdents = _out240; + (this).GenExpr(_1687_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out238, out _out239, out _out240); + _1709_recursiveGen = _out238; + _1710_recOwned = _out239; + _1711_recIdents = _out240; RAST._IExpr _out241; DCOMP._IOwnership _out242; - (this).FromOwnership(RAST.Expr.create_TypeAscription(_1700_recursiveGen, (_1689_nativeToType).dtor_value), _1701_recOwned, expectedOwnership, out _out241, out _out242); + (this).FromOwnership(RAST.Expr.create_TypeAscription(_1709_recursiveGen, (_1698_nativeToType).dtor_value), _1710_recOwned, expectedOwnership, out _out241, out _out242); r = _out241; resultingOwnership = _out242; - readIdents = _1702_recIdents; + readIdents = _1711_recIdents; return ; } } - goto after_match37; + goto after_match38; } } } { } - after_match37: ; - if (object.Equals(_1679_fromTpe, DAST.Type.create_Primitive(DAST.Primitive.create_Char()))) { - RAST._IExpr _1703_recursiveGen; - DCOMP._IOwnership _1704_recOwned; - Dafny.ISet> _1705_recIdents; + after_match38: ; + if (object.Equals(_1688_fromTpe, DAST.Type.create_Primitive(DAST.Primitive.create_Char()))) { + RAST._IExpr _1712_recursiveGen; + DCOMP._IOwnership _1713_recOwned; + Dafny.ISet> _1714_recIdents; RAST._IExpr _out243; DCOMP._IOwnership _out244; Dafny.ISet> _out245; - (this).GenExpr(_1678_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out243, out _out244, out _out245); - _1703_recursiveGen = _out243; - _1704_recOwned = _out244; - _1705_recIdents = _out245; + (this).GenExpr(_1687_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out243, out _out244, out _out245); + _1712_recursiveGen = _out243; + _1713_recOwned = _out244; + _1714_recIdents = _out245; RAST._IExpr _out246; DCOMP._IOwnership _out247; - (this).FromOwnership(RAST.Expr.create_TypeAscription((_1703_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("0")), (_1689_nativeToType).dtor_value), _1704_recOwned, expectedOwnership, out _out246, out _out247); + (this).FromOwnership(RAST.Expr.create_TypeAscription((_1712_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("0")), (_1698_nativeToType).dtor_value), _1713_recOwned, expectedOwnership, out _out246, out _out247); r = _out246; resultingOwnership = _out247; - readIdents = _1705_recIdents; + readIdents = _1714_recIdents; return ; } } RAST._IExpr _out248; DCOMP._IOwnership _out249; Dafny.ISet> _out250; - (this).GenExpr(DAST.Expression.create_Convert(DAST.Expression.create_Convert(_1678_expr, _1679_fromTpe, _1683_b), _1683_b, _1680_toTpe), selfIdent, env, expectedOwnership, out _out248, out _out249, out _out250); + (this).GenExpr(DAST.Expression.create_Convert(DAST.Expression.create_Convert(_1687_expr, _1688_fromTpe, _1692_b), _1692_b, _1689_toTpe), selfIdent, env, expectedOwnership, out _out248, out _out249, out _out250); r = _out248; resultingOwnership = _out249; readIdents = _out250; @@ -4151,90 +4182,90 @@ public void GenExprConvertFromNewtype(DAST._IExpression e, DCOMP._ISelfInfo self resultingOwnership = DCOMP.Ownership.Default(); readIdents = Dafny.Set>.Empty; DAST._IExpression _let_tmp_rhs59 = e; - DAST._IExpression _1706_expr = _let_tmp_rhs59.dtor_value; - DAST._IType _1707_fromTpe = _let_tmp_rhs59.dtor_from; - DAST._IType _1708_toTpe = _let_tmp_rhs59.dtor_typ; - DAST._IType _let_tmp_rhs60 = _1707_fromTpe; + DAST._IExpression _1715_expr = _let_tmp_rhs59.dtor_value; + DAST._IType _1716_fromTpe = _let_tmp_rhs59.dtor_from; + DAST._IType _1717_toTpe = _let_tmp_rhs59.dtor_typ; + DAST._IType _let_tmp_rhs60 = _1716_fromTpe; DAST._IResolvedType _let_tmp_rhs61 = _let_tmp_rhs60.dtor_resolved; - Dafny.ISequence> _1709___v123 = _let_tmp_rhs61.dtor_path; - Dafny.ISequence _1710___v124 = _let_tmp_rhs61.dtor_typeArgs; + Dafny.ISequence> _1718___v123 = _let_tmp_rhs61.dtor_path; + Dafny.ISequence _1719___v124 = _let_tmp_rhs61.dtor_typeArgs; DAST._IResolvedTypeBase _let_tmp_rhs62 = _let_tmp_rhs61.dtor_kind; - DAST._IType _1711_b = _let_tmp_rhs62.dtor_baseType; - DAST._INewtypeRange _1712_range = _let_tmp_rhs62.dtor_range; - bool _1713_erase = _let_tmp_rhs62.dtor_erase; - Dafny.ISequence _1714_attributes = _let_tmp_rhs61.dtor_attributes; - Dafny.ISequence> _1715___v125 = _let_tmp_rhs61.dtor_properMethods; - Dafny.ISequence _1716___v126 = _let_tmp_rhs61.dtor_extendedTypes; - Std.Wrappers._IOption _1717_nativeFromType; - _1717_nativeFromType = DCOMP.COMP.NewtypeToRustType(_1711_b, _1712_range); - if (object.Equals(_1711_b, _1708_toTpe)) { - RAST._IExpr _1718_recursiveGen; - DCOMP._IOwnership _1719_recOwned; - Dafny.ISet> _1720_recIdents; + DAST._IType _1720_b = _let_tmp_rhs62.dtor_baseType; + DAST._INewtypeRange _1721_range = _let_tmp_rhs62.dtor_range; + bool _1722_erase = _let_tmp_rhs62.dtor_erase; + Dafny.ISequence _1723_attributes = _let_tmp_rhs61.dtor_attributes; + Dafny.ISequence> _1724___v125 = _let_tmp_rhs61.dtor_properMethods; + Dafny.ISequence _1725___v126 = _let_tmp_rhs61.dtor_extendedTypes; + Std.Wrappers._IOption _1726_nativeFromType; + _1726_nativeFromType = DCOMP.COMP.NewtypeToRustType(_1720_b, _1721_range); + if (object.Equals(_1720_b, _1717_toTpe)) { + RAST._IExpr _1727_recursiveGen; + DCOMP._IOwnership _1728_recOwned; + Dafny.ISet> _1729_recIdents; RAST._IExpr _out251; DCOMP._IOwnership _out252; Dafny.ISet> _out253; - (this).GenExpr(_1706_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out251, out _out252, out _out253); - _1718_recursiveGen = _out251; - _1719_recOwned = _out252; - _1720_recIdents = _out253; - readIdents = _1720_recIdents; - Std.Wrappers._IOption _source92 = _1717_nativeFromType; + (this).GenExpr(_1715_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out251, out _out252, out _out253); + _1727_recursiveGen = _out251; + _1728_recOwned = _out252; + _1729_recIdents = _out253; + readIdents = _1729_recIdents; + Std.Wrappers._IOption _source93 = _1726_nativeFromType; { - if (_source92.is_Some) { - RAST._IType _1721_v = _source92.dtor_value; - RAST._IType _1722_toTpeRust; + if (_source93.is_Some) { + RAST._IType _1730_v = _source93.dtor_value; + RAST._IType _1731_toTpeRust; RAST._IType _out254; - _out254 = (this).GenType(_1708_toTpe, DCOMP.GenTypeContext.@default()); - _1722_toTpeRust = _out254; - r = (((RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("Into"))).ApplyType(Dafny.Sequence.FromElements(_1722_toTpeRust))).MSel(Dafny.Sequence.UnicodeFromString("into"))).Apply(Dafny.Sequence.FromElements(_1718_recursiveGen)); + _out254 = (this).GenType(_1717_toTpe, DCOMP.GenTypeContext.@default()); + _1731_toTpeRust = _out254; + r = (((RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("Into"))).ApplyType(Dafny.Sequence.FromElements(_1731_toTpeRust))).MSel(Dafny.Sequence.UnicodeFromString("into"))).Apply(Dafny.Sequence.FromElements(_1727_recursiveGen)); RAST._IExpr _out255; DCOMP._IOwnership _out256; (this).FromOwned(r, expectedOwnership, out _out255, out _out256); r = _out255; resultingOwnership = _out256; - goto after_match38; + goto after_match39; } } { - if (_1713_erase) { - r = _1718_recursiveGen; + if (_1722_erase) { + r = _1727_recursiveGen; } else { - r = (_1718_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("0")); + r = (_1727_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("0")); } RAST._IExpr _out257; DCOMP._IOwnership _out258; - (this).FromOwnership(r, _1719_recOwned, expectedOwnership, out _out257, out _out258); + (this).FromOwnership(r, _1728_recOwned, expectedOwnership, out _out257, out _out258); r = _out257; resultingOwnership = _out258; } - after_match38: ; + after_match39: ; } else { - if ((_1717_nativeFromType).is_Some) { - if (object.Equals(_1708_toTpe, DAST.Type.create_Primitive(DAST.Primitive.create_Char()))) { - RAST._IExpr _1723_recursiveGen; - DCOMP._IOwnership _1724_recOwned; - Dafny.ISet> _1725_recIdents; + if ((_1726_nativeFromType).is_Some) { + if (object.Equals(_1717_toTpe, DAST.Type.create_Primitive(DAST.Primitive.create_Char()))) { + RAST._IExpr _1732_recursiveGen; + DCOMP._IOwnership _1733_recOwned; + Dafny.ISet> _1734_recIdents; RAST._IExpr _out259; DCOMP._IOwnership _out260; Dafny.ISet> _out261; - (this).GenExpr(_1706_expr, selfIdent, env, expectedOwnership, out _out259, out _out260, out _out261); - _1723_recursiveGen = _out259; - _1724_recOwned = _out260; - _1725_recIdents = _out261; + (this).GenExpr(_1715_expr, selfIdent, env, expectedOwnership, out _out259, out _out260, out _out261); + _1732_recursiveGen = _out259; + _1733_recOwned = _out260; + _1734_recIdents = _out261; RAST._IExpr _out262; DCOMP._IOwnership _out263; - (this).FromOwnership(((RAST.__default.dafny__runtime).MSel((this).DafnyChar)).Apply1(RAST.Expr.create_TypeAscription(_1723_recursiveGen, (this).DafnyCharUnderlying)), _1724_recOwned, expectedOwnership, out _out262, out _out263); + (this).FromOwnership(((RAST.__default.dafny__runtime).MSel((this).DafnyChar)).Apply1(RAST.Expr.create_TypeAscription(_1732_recursiveGen, (this).DafnyCharUnderlying)), _1733_recOwned, expectedOwnership, out _out262, out _out263); r = _out262; resultingOwnership = _out263; - readIdents = _1725_recIdents; + readIdents = _1734_recIdents; return ; } } RAST._IExpr _out264; DCOMP._IOwnership _out265; Dafny.ISet> _out266; - (this).GenExpr(DAST.Expression.create_Convert(DAST.Expression.create_Convert(_1706_expr, _1707_fromTpe, _1711_b), _1711_b, _1708_toTpe), selfIdent, env, expectedOwnership, out _out264, out _out265, out _out266); + (this).GenExpr(DAST.Expression.create_Convert(DAST.Expression.create_Convert(_1715_expr, _1716_fromTpe, _1720_b), _1720_b, _1717_toTpe), selfIdent, env, expectedOwnership, out _out264, out _out265, out _out266); r = _out264; resultingOwnership = _out265; readIdents = _out266; @@ -4258,17 +4289,17 @@ public bool SameTypesButDifferentTypeParameters(DAST._IType fromType, RAST._ITyp if ((new BigInteger((xs).Count)).Sign == 0) { return Std.Wrappers.Result, __E>.create_Success(Dafny.Sequence<__T>.FromElements()); } else { - Std.Wrappers._IResult<__T, __E> _1726_valueOrError0 = (xs).Select(BigInteger.Zero); - if ((_1726_valueOrError0).IsFailure()) { - return (_1726_valueOrError0).PropagateFailure>(); + Std.Wrappers._IResult<__T, __E> _1735_valueOrError0 = (xs).Select(BigInteger.Zero); + if ((_1735_valueOrError0).IsFailure()) { + return (_1735_valueOrError0).PropagateFailure>(); } else { - __T _1727_head = (_1726_valueOrError0).Extract(); - Std.Wrappers._IResult, __E> _1728_valueOrError1 = (this).SeqResultToResultSeq<__T, __E>((xs).Drop(BigInteger.One)); - if ((_1728_valueOrError1).IsFailure()) { - return (_1728_valueOrError1).PropagateFailure>(); + __T _1736_head = (_1735_valueOrError0).Extract(); + Std.Wrappers._IResult, __E> _1737_valueOrError1 = (this).SeqResultToResultSeq<__T, __E>((xs).Drop(BigInteger.One)); + if ((_1737_valueOrError1).IsFailure()) { + return (_1737_valueOrError1).PropagateFailure>(); } else { - Dafny.ISequence<__T> _1729_tail = (_1728_valueOrError1).Extract(); - return Std.Wrappers.Result, __E>.create_Success(Dafny.Sequence<__T>.Concat(Dafny.Sequence<__T>.FromElements(_1727_head), _1729_tail)); + Dafny.ISequence<__T> _1738_tail = (_1737_valueOrError1).Extract(); + return Std.Wrappers.Result, __E>.create_Success(Dafny.Sequence<__T>.Concat(Dafny.Sequence<__T>.FromElements(_1736_head), _1738_tail)); } } } @@ -4281,69 +4312,69 @@ public bool SameTypesButDifferentTypeParameters(DAST._IType fromType, RAST._ITyp if (!(((toTpe).ObjectOrPointerUnderlying()).is_DynType)) { return Std.Wrappers.Result,RAST._IExpr>>>.create_Failure(_System.Tuple5,RAST._IExpr>>.create(fromType, fromTpe, toType, toTpe, typeParams)); } else { - RAST._IType _1730_fromTpeUnderlying = (fromTpe).ObjectOrPointerUnderlying(); - RAST._IType _1731_toTpeUnderlying = (toTpe).ObjectOrPointerUnderlying(); - return Std.Wrappers.Result,RAST._IExpr>>>.create_Success((((RAST.__default.dafny__runtime).MSel((this).upcast)).ApplyType(Dafny.Sequence.FromElements(_1730_fromTpeUnderlying, _1731_toTpeUnderlying))).Apply(Dafny.Sequence.FromElements())); + RAST._IType _1739_fromTpeUnderlying = (fromTpe).ObjectOrPointerUnderlying(); + RAST._IType _1740_toTpeUnderlying = (toTpe).ObjectOrPointerUnderlying(); + return Std.Wrappers.Result,RAST._IExpr>>>.create_Success((((RAST.__default.dafny__runtime).MSel((this).upcast)).ApplyType(Dafny.Sequence.FromElements(_1739_fromTpeUnderlying, _1740_toTpeUnderlying))).Apply(Dafny.Sequence.FromElements())); } } else if ((typeParams).Contains(_System.Tuple2.create(fromTpe, toTpe))) { return Std.Wrappers.Result,RAST._IExpr>>>.create_Success(Dafny.Map<_System._ITuple2, RAST._IExpr>.Select(typeParams,_System.Tuple2.create(fromTpe, toTpe))); } else if (((fromTpe).IsRc()) && ((toTpe).IsRc())) { - Std.Wrappers._IResult,RAST._IExpr>>> _1732_valueOrError0 = (this).UpcastConversionLambda(fromType, (fromTpe).RcUnderlying(), toType, (toTpe).RcUnderlying(), typeParams); - if ((_1732_valueOrError0).IsFailure()) { - return (_1732_valueOrError0).PropagateFailure(); + Std.Wrappers._IResult,RAST._IExpr>>> _1741_valueOrError0 = (this).UpcastConversionLambda(fromType, (fromTpe).RcUnderlying(), toType, (toTpe).RcUnderlying(), typeParams); + if ((_1741_valueOrError0).IsFailure()) { + return (_1741_valueOrError0).PropagateFailure(); } else { - RAST._IExpr _1733_lambda = (_1732_valueOrError0).Extract(); + RAST._IExpr _1742_lambda = (_1741_valueOrError0).Extract(); if ((fromType).is_Arrow) { - return Std.Wrappers.Result,RAST._IExpr>>>.create_Success(_1733_lambda); + return Std.Wrappers.Result,RAST._IExpr>>>.create_Success(_1742_lambda); } else { - return Std.Wrappers.Result,RAST._IExpr>>>.create_Success(((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("rc_coerce"))).Apply1(_1733_lambda)); + return Std.Wrappers.Result,RAST._IExpr>>>.create_Success(((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("rc_coerce"))).Apply1(_1742_lambda)); } } } else if ((this).SameTypesButDifferentTypeParameters(fromType, fromTpe, toType, toTpe)) { - Std.Wrappers._IResult, _System._ITuple5,RAST._IExpr>>> _1734_valueOrError1 = (this).SeqResultToResultSeq,RAST._IExpr>>>(((System.Func,RAST._IExpr>>>>>) (() => { + Std.Wrappers._IResult, _System._ITuple5,RAST._IExpr>>> _1743_valueOrError1 = (this).SeqResultToResultSeq,RAST._IExpr>>>(((System.Func,RAST._IExpr>>>>>) (() => { BigInteger dim12 = new BigInteger(((fromTpe).dtor_arguments).Count); var arr12 = new Std.Wrappers._IResult,RAST._IExpr>>>[Dafny.Helpers.ToIntChecked(dim12, "array size exceeds memory limit")]; for (int i12 = 0; i12 < dim12; i12++) { - var _1735_i = (BigInteger) i12; - arr12[(int)(_1735_i)] = (this).UpcastConversionLambda((((fromType).dtor_resolved).dtor_typeArgs).Select(_1735_i), ((fromTpe).dtor_arguments).Select(_1735_i), (((toType).dtor_resolved).dtor_typeArgs).Select(_1735_i), ((toTpe).dtor_arguments).Select(_1735_i), typeParams); + var _1744_i = (BigInteger) i12; + arr12[(int)(_1744_i)] = (this).UpcastConversionLambda((((fromType).dtor_resolved).dtor_typeArgs).Select(_1744_i), ((fromTpe).dtor_arguments).Select(_1744_i), (((toType).dtor_resolved).dtor_typeArgs).Select(_1744_i), ((toTpe).dtor_arguments).Select(_1744_i), typeParams); } return Dafny.Sequence,RAST._IExpr>>>>.FromArray(arr12); }))()); - if ((_1734_valueOrError1).IsFailure()) { - return (_1734_valueOrError1).PropagateFailure(); + if ((_1743_valueOrError1).IsFailure()) { + return (_1743_valueOrError1).PropagateFailure(); } else { - Dafny.ISequence _1736_lambdas = (_1734_valueOrError1).Extract(); + Dafny.ISequence _1745_lambdas = (_1743_valueOrError1).Extract(); return Std.Wrappers.Result,RAST._IExpr>>>.create_Success((((RAST.Expr.create_ExprFromType((fromTpe).dtor_baseName)).ApplyType(((System.Func>) (() => { BigInteger dim13 = new BigInteger(((fromTpe).dtor_arguments).Count); var arr13 = new RAST._IType[Dafny.Helpers.ToIntChecked(dim13, "array size exceeds memory limit")]; for (int i13 = 0; i13 < dim13; i13++) { - var _1737_i = (BigInteger) i13; - arr13[(int)(_1737_i)] = ((fromTpe).dtor_arguments).Select(_1737_i); + var _1746_i = (BigInteger) i13; + arr13[(int)(_1746_i)] = ((fromTpe).dtor_arguments).Select(_1746_i); } return Dafny.Sequence.FromArray(arr13); -}))())).MSel(Dafny.Sequence.UnicodeFromString("coerce"))).Apply(_1736_lambdas)); +}))())).MSel(Dafny.Sequence.UnicodeFromString("coerce"))).Apply(_1745_lambdas)); } } else if (((((fromTpe).IsBuiltinCollection()) && ((toTpe).IsBuiltinCollection())) && ((this).IsBuiltinCollection(fromType))) && ((this).IsBuiltinCollection(toType))) { - RAST._IType _1738_newFromTpe = (fromTpe).GetBuiltinCollectionElement(); - RAST._IType _1739_newToTpe = (toTpe).GetBuiltinCollectionElement(); - DAST._IType _1740_newFromType = (this).GetBuiltinCollectionElement(fromType); - DAST._IType _1741_newToType = (this).GetBuiltinCollectionElement(toType); - Std.Wrappers._IResult,RAST._IExpr>>> _1742_valueOrError2 = (this).UpcastConversionLambda(_1740_newFromType, _1738_newFromTpe, _1741_newToType, _1739_newToTpe, typeParams); - if ((_1742_valueOrError2).IsFailure()) { - return (_1742_valueOrError2).PropagateFailure(); + RAST._IType _1747_newFromTpe = (fromTpe).GetBuiltinCollectionElement(); + RAST._IType _1748_newToTpe = (toTpe).GetBuiltinCollectionElement(); + DAST._IType _1749_newFromType = (this).GetBuiltinCollectionElement(fromType); + DAST._IType _1750_newToType = (this).GetBuiltinCollectionElement(toType); + Std.Wrappers._IResult,RAST._IExpr>>> _1751_valueOrError2 = (this).UpcastConversionLambda(_1749_newFromType, _1747_newFromTpe, _1750_newToType, _1748_newToTpe, typeParams); + if ((_1751_valueOrError2).IsFailure()) { + return (_1751_valueOrError2).PropagateFailure(); } else { - RAST._IExpr _1743_coerceArg = (_1742_valueOrError2).Extract(); - RAST._IExpr _1744_collectionType = (RAST.__default.dafny__runtime).MSel(((fromTpe).dtor_baseName).dtor_name); - RAST._IExpr _1745_baseType = (((((fromTpe).dtor_baseName).dtor_name).Equals(Dafny.Sequence.UnicodeFromString("Map"))) ? ((_1744_collectionType).ApplyType(Dafny.Sequence.FromElements(((fromTpe).dtor_arguments).Select(BigInteger.Zero), _1738_newFromTpe))) : ((_1744_collectionType).ApplyType(Dafny.Sequence.FromElements(_1738_newFromTpe)))); - return Std.Wrappers.Result,RAST._IExpr>>>.create_Success(((_1745_baseType).MSel(Dafny.Sequence.UnicodeFromString("coerce"))).Apply1(_1743_coerceArg)); + RAST._IExpr _1752_coerceArg = (_1751_valueOrError2).Extract(); + RAST._IExpr _1753_collectionType = (RAST.__default.dafny__runtime).MSel(((fromTpe).dtor_baseName).dtor_name); + RAST._IExpr _1754_baseType = (((((fromTpe).dtor_baseName).dtor_name).Equals(Dafny.Sequence.UnicodeFromString("Map"))) ? ((_1753_collectionType).ApplyType(Dafny.Sequence.FromElements(((fromTpe).dtor_arguments).Select(BigInteger.Zero), _1747_newFromTpe))) : ((_1753_collectionType).ApplyType(Dafny.Sequence.FromElements(_1747_newFromTpe)))); + return Std.Wrappers.Result,RAST._IExpr>>>.create_Success(((_1754_baseType).MSel(Dafny.Sequence.UnicodeFromString("coerce"))).Apply1(_1752_coerceArg)); } } else if ((((((((((fromTpe).is_DynType) && (((fromTpe).dtor_underlying).is_FnType)) && ((toTpe).is_DynType)) && (((toTpe).dtor_underlying).is_FnType)) && ((((fromTpe).dtor_underlying).dtor_arguments).Equals(((toTpe).dtor_underlying).dtor_arguments))) && ((fromType).is_Arrow)) && ((toType).is_Arrow)) && ((new BigInteger((((fromTpe).dtor_underlying).dtor_arguments).Count)) == (BigInteger.One))) && (((((fromTpe).dtor_underlying).dtor_arguments).Select(BigInteger.Zero)).is_Borrowed)) { - Std.Wrappers._IResult,RAST._IExpr>>> _1746_valueOrError3 = (this).UpcastConversionLambda((fromType).dtor_result, ((fromTpe).dtor_underlying).dtor_returnType, (toType).dtor_result, ((toTpe).dtor_underlying).dtor_returnType, typeParams); - if ((_1746_valueOrError3).IsFailure()) { - return (_1746_valueOrError3).PropagateFailure(); + Std.Wrappers._IResult,RAST._IExpr>>> _1755_valueOrError3 = (this).UpcastConversionLambda((fromType).dtor_result, ((fromTpe).dtor_underlying).dtor_returnType, (toType).dtor_result, ((toTpe).dtor_underlying).dtor_returnType, typeParams); + if ((_1755_valueOrError3).IsFailure()) { + return (_1755_valueOrError3).PropagateFailure(); } else { - RAST._IExpr _1747_lambda = (_1746_valueOrError3).Extract(); - return Std.Wrappers.Result,RAST._IExpr>>>.create_Success((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("fn1_coerce"))).ApplyType(Dafny.Sequence.FromElements(((((fromTpe).dtor_underlying).dtor_arguments).Select(BigInteger.Zero)).dtor_underlying, ((fromTpe).dtor_underlying).dtor_returnType, ((toTpe).dtor_underlying).dtor_returnType))).Apply1(_1747_lambda)); + RAST._IExpr _1756_lambda = (_1755_valueOrError3).Extract(); + return Std.Wrappers.Result,RAST._IExpr>>>.create_Success((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("fn1_coerce"))).ApplyType(Dafny.Sequence.FromElements(((((fromTpe).dtor_underlying).dtor_arguments).Select(BigInteger.Zero)).dtor_underlying, ((fromTpe).dtor_underlying).dtor_returnType, ((toTpe).dtor_underlying).dtor_returnType))).Apply1(_1756_lambda)); } } else { return Std.Wrappers.Result,RAST._IExpr>>>.create_Failure(_System.Tuple5,RAST._IExpr>>.create(fromType, fromTpe, toType, toTpe, typeParams)); @@ -4363,84 +4394,84 @@ public void GenExprConvertOther(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, resultingOwnership = DCOMP.Ownership.Default(); readIdents = Dafny.Set>.Empty; DAST._IExpression _let_tmp_rhs63 = e; - DAST._IExpression _1748_expr = _let_tmp_rhs63.dtor_value; - DAST._IType _1749_fromTpe = _let_tmp_rhs63.dtor_from; - DAST._IType _1750_toTpe = _let_tmp_rhs63.dtor_typ; - RAST._IType _1751_fromTpeGen; + DAST._IExpression _1757_expr = _let_tmp_rhs63.dtor_value; + DAST._IType _1758_fromTpe = _let_tmp_rhs63.dtor_from; + DAST._IType _1759_toTpe = _let_tmp_rhs63.dtor_typ; + RAST._IType _1760_fromTpeGen; RAST._IType _out267; - _out267 = (this).GenType(_1749_fromTpe, DCOMP.GenTypeContext.InBinding()); - _1751_fromTpeGen = _out267; - RAST._IType _1752_toTpeGen; + _out267 = (this).GenType(_1758_fromTpe, DCOMP.GenTypeContext.InBinding()); + _1760_fromTpeGen = _out267; + RAST._IType _1761_toTpeGen; RAST._IType _out268; - _out268 = (this).GenType(_1750_toTpe, DCOMP.GenTypeContext.InBinding()); - _1752_toTpeGen = _out268; - Std.Wrappers._IResult,RAST._IExpr>>> _1753_upcastConverter; - _1753_upcastConverter = (this).UpcastConversionLambda(_1749_fromTpe, _1751_fromTpeGen, _1750_toTpe, _1752_toTpeGen, Dafny.Map<_System._ITuple2, RAST._IExpr>.FromElements()); - if ((_1753_upcastConverter).is_Success) { - RAST._IExpr _1754_conversionLambda; - _1754_conversionLambda = (_1753_upcastConverter).dtor_value; - RAST._IExpr _1755_recursiveGen; - DCOMP._IOwnership _1756_recOwned; - Dafny.ISet> _1757_recIdents; + _out268 = (this).GenType(_1759_toTpe, DCOMP.GenTypeContext.InBinding()); + _1761_toTpeGen = _out268; + Std.Wrappers._IResult,RAST._IExpr>>> _1762_upcastConverter; + _1762_upcastConverter = (this).UpcastConversionLambda(_1758_fromTpe, _1760_fromTpeGen, _1759_toTpe, _1761_toTpeGen, Dafny.Map<_System._ITuple2, RAST._IExpr>.FromElements()); + if ((_1762_upcastConverter).is_Success) { + RAST._IExpr _1763_conversionLambda; + _1763_conversionLambda = (_1762_upcastConverter).dtor_value; + RAST._IExpr _1764_recursiveGen; + DCOMP._IOwnership _1765_recOwned; + Dafny.ISet> _1766_recIdents; RAST._IExpr _out269; DCOMP._IOwnership _out270; Dafny.ISet> _out271; - (this).GenExpr(_1748_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out269, out _out270, out _out271); - _1755_recursiveGen = _out269; - _1756_recOwned = _out270; - _1757_recIdents = _out271; - readIdents = _1757_recIdents; - r = (_1754_conversionLambda).Apply1(_1755_recursiveGen); + (this).GenExpr(_1757_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out269, out _out270, out _out271); + _1764_recursiveGen = _out269; + _1765_recOwned = _out270; + _1766_recIdents = _out271; + readIdents = _1766_recIdents; + r = (_1763_conversionLambda).Apply1(_1764_recursiveGen); RAST._IExpr _out272; DCOMP._IOwnership _out273; (this).FromOwnership(r, DCOMP.Ownership.create_OwnershipOwned(), expectedOwnership, out _out272, out _out273); r = _out272; resultingOwnership = _out273; - } else if ((this).IsDowncastConversion(_1751_fromTpeGen, _1752_toTpeGen)) { - RAST._IExpr _1758_recursiveGen; - DCOMP._IOwnership _1759_recOwned; - Dafny.ISet> _1760_recIdents; + } else if ((this).IsDowncastConversion(_1760_fromTpeGen, _1761_toTpeGen)) { + RAST._IExpr _1767_recursiveGen; + DCOMP._IOwnership _1768_recOwned; + Dafny.ISet> _1769_recIdents; RAST._IExpr _out274; DCOMP._IOwnership _out275; Dafny.ISet> _out276; - (this).GenExpr(_1748_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out274, out _out275, out _out276); - _1758_recursiveGen = _out274; - _1759_recOwned = _out275; - _1760_recIdents = _out276; - readIdents = _1760_recIdents; - _1752_toTpeGen = (_1752_toTpeGen).ObjectOrPointerUnderlying(); - r = ((RAST.__default.dafny__runtime).MSel((this).downcast)).Apply(Dafny.Sequence.FromElements(_1758_recursiveGen, RAST.Expr.create_ExprFromType(_1752_toTpeGen))); + (this).GenExpr(_1757_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out274, out _out275, out _out276); + _1767_recursiveGen = _out274; + _1768_recOwned = _out275; + _1769_recIdents = _out276; + readIdents = _1769_recIdents; + _1761_toTpeGen = (_1761_toTpeGen).ObjectOrPointerUnderlying(); + r = ((RAST.__default.dafny__runtime).MSel((this).downcast)).Apply(Dafny.Sequence.FromElements(_1767_recursiveGen, RAST.Expr.create_ExprFromType(_1761_toTpeGen))); RAST._IExpr _out277; DCOMP._IOwnership _out278; (this).FromOwnership(r, DCOMP.Ownership.create_OwnershipOwned(), expectedOwnership, out _out277, out _out278); r = _out277; resultingOwnership = _out278; } else { - RAST._IExpr _1761_recursiveGen; - DCOMP._IOwnership _1762_recOwned; - Dafny.ISet> _1763_recIdents; + RAST._IExpr _1770_recursiveGen; + DCOMP._IOwnership _1771_recOwned; + Dafny.ISet> _1772_recIdents; RAST._IExpr _out279; DCOMP._IOwnership _out280; Dafny.ISet> _out281; - (this).GenExpr(_1748_expr, selfIdent, env, expectedOwnership, out _out279, out _out280, out _out281); - _1761_recursiveGen = _out279; - _1762_recOwned = _out280; - _1763_recIdents = _out281; - readIdents = _1763_recIdents; - Std.Wrappers._IResult,RAST._IExpr>>> _let_tmp_rhs64 = _1753_upcastConverter; + (this).GenExpr(_1757_expr, selfIdent, env, expectedOwnership, out _out279, out _out280, out _out281); + _1770_recursiveGen = _out279; + _1771_recOwned = _out280; + _1772_recIdents = _out281; + readIdents = _1772_recIdents; + Std.Wrappers._IResult,RAST._IExpr>>> _let_tmp_rhs64 = _1762_upcastConverter; _System._ITuple5,RAST._IExpr>> _let_tmp_rhs65 = _let_tmp_rhs64.dtor_error; - DAST._IType _1764_fromType = _let_tmp_rhs65.dtor__0; - RAST._IType _1765_fromTpeGen = _let_tmp_rhs65.dtor__1; - DAST._IType _1766_toType = _let_tmp_rhs65.dtor__2; - RAST._IType _1767_toTpeGen = _let_tmp_rhs65.dtor__3; - Dafny.IMap<_System._ITuple2,RAST._IExpr> _1768_m = _let_tmp_rhs65.dtor__4; - Dafny.ISequence _1769_msg; - _1769_msg = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("/* Coercion from "), (_1765_fromTpeGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(" to ")), (_1767_toTpeGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(" not yet implemented */")); - (this).error = Std.Wrappers.Option>.create_Some(_1769_msg); - r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat((_1761_recursiveGen)._ToString(DCOMP.__default.IND), _1769_msg)); + DAST._IType _1773_fromType = _let_tmp_rhs65.dtor__0; + RAST._IType _1774_fromTpeGen = _let_tmp_rhs65.dtor__1; + DAST._IType _1775_toType = _let_tmp_rhs65.dtor__2; + RAST._IType _1776_toTpeGen = _let_tmp_rhs65.dtor__3; + Dafny.IMap<_System._ITuple2,RAST._IExpr> _1777_m = _let_tmp_rhs65.dtor__4; + Dafny.ISequence _1778_msg; + _1778_msg = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("/* Coercion from "), (_1774_fromTpeGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(" to ")), (_1776_toTpeGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(" not yet implemented */")); + (this).error = Std.Wrappers.Option>.create_Some(_1778_msg); + r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat((_1770_recursiveGen)._ToString(DCOMP.__default.IND), _1778_msg)); RAST._IExpr _out282; DCOMP._IOwnership _out283; - (this).FromOwnership(r, _1762_recOwned, expectedOwnership, out _out282, out _out283); + (this).FromOwnership(r, _1771_recOwned, expectedOwnership, out _out282, out _out283); r = _out282; resultingOwnership = _out283; } @@ -4451,39 +4482,39 @@ public void GenExprConvert(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOM resultingOwnership = DCOMP.Ownership.Default(); readIdents = Dafny.Set>.Empty; DAST._IExpression _let_tmp_rhs66 = e; - DAST._IExpression _1770_expr = _let_tmp_rhs66.dtor_value; - DAST._IType _1771_fromTpe = _let_tmp_rhs66.dtor_from; - DAST._IType _1772_toTpe = _let_tmp_rhs66.dtor_typ; - if (object.Equals(_1771_fromTpe, _1772_toTpe)) { - RAST._IExpr _1773_recursiveGen; - DCOMP._IOwnership _1774_recOwned; - Dafny.ISet> _1775_recIdents; + DAST._IExpression _1779_expr = _let_tmp_rhs66.dtor_value; + DAST._IType _1780_fromTpe = _let_tmp_rhs66.dtor_from; + DAST._IType _1781_toTpe = _let_tmp_rhs66.dtor_typ; + if (object.Equals(_1780_fromTpe, _1781_toTpe)) { + RAST._IExpr _1782_recursiveGen; + DCOMP._IOwnership _1783_recOwned; + Dafny.ISet> _1784_recIdents; RAST._IExpr _out284; DCOMP._IOwnership _out285; Dafny.ISet> _out286; - (this).GenExpr(_1770_expr, selfIdent, env, expectedOwnership, out _out284, out _out285, out _out286); - _1773_recursiveGen = _out284; - _1774_recOwned = _out285; - _1775_recIdents = _out286; - r = _1773_recursiveGen; + (this).GenExpr(_1779_expr, selfIdent, env, expectedOwnership, out _out284, out _out285, out _out286); + _1782_recursiveGen = _out284; + _1783_recOwned = _out285; + _1784_recIdents = _out286; + r = _1782_recursiveGen; RAST._IExpr _out287; DCOMP._IOwnership _out288; - (this).FromOwnership(r, _1774_recOwned, expectedOwnership, out _out287, out _out288); + (this).FromOwnership(r, _1783_recOwned, expectedOwnership, out _out287, out _out288); r = _out287; resultingOwnership = _out288; - readIdents = _1775_recIdents; + readIdents = _1784_recIdents; } else { - _System._ITuple2 _source93 = _System.Tuple2.create(_1771_fromTpe, _1772_toTpe); + _System._ITuple2 _source94 = _System.Tuple2.create(_1780_fromTpe, _1781_toTpe); { - DAST._IType _10 = _source93.dtor__1; + DAST._IType _10 = _source94.dtor__1; if (_10.is_UserDefined) { DAST._IResolvedType resolved2 = _10.dtor_resolved; DAST._IResolvedTypeBase kind2 = resolved2.dtor_kind; if (kind2.is_Newtype) { - DAST._IType _1776_b = kind2.dtor_baseType; - DAST._INewtypeRange _1777_range = kind2.dtor_range; - bool _1778_erase = kind2.dtor_erase; - Dafny.ISequence _1779_attributes = resolved2.dtor_attributes; + DAST._IType _1785_b = kind2.dtor_baseType; + DAST._INewtypeRange _1786_range = kind2.dtor_range; + bool _1787_erase = kind2.dtor_erase; + Dafny.ISequence _1788_attributes = resolved2.dtor_attributes; { RAST._IExpr _out289; DCOMP._IOwnership _out290; @@ -4493,20 +4524,20 @@ public void GenExprConvert(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOM resultingOwnership = _out290; readIdents = _out291; } - goto after_match39; + goto after_match40; } } } { - DAST._IType _00 = _source93.dtor__0; + DAST._IType _00 = _source94.dtor__0; if (_00.is_UserDefined) { DAST._IResolvedType resolved3 = _00.dtor_resolved; DAST._IResolvedTypeBase kind3 = resolved3.dtor_kind; if (kind3.is_Newtype) { - DAST._IType _1780_b = kind3.dtor_baseType; - DAST._INewtypeRange _1781_range = kind3.dtor_range; - bool _1782_erase = kind3.dtor_erase; - Dafny.ISequence _1783_attributes = resolved3.dtor_attributes; + DAST._IType _1789_b = kind3.dtor_baseType; + DAST._INewtypeRange _1790_range = kind3.dtor_range; + bool _1791_erase = kind3.dtor_erase; + Dafny.ISequence _1792_attributes = resolved3.dtor_attributes; { RAST._IExpr _out292; DCOMP._IOwnership _out293; @@ -4516,253 +4547,253 @@ public void GenExprConvert(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOM resultingOwnership = _out293; readIdents = _out294; } - goto after_match39; + goto after_match40; } } } { - DAST._IType _01 = _source93.dtor__0; + DAST._IType _01 = _source94.dtor__0; if (_01.is_Primitive) { DAST._IPrimitive _h72 = _01.dtor_Primitive_a0; if (_h72.is_Int) { - DAST._IType _11 = _source93.dtor__1; + DAST._IType _11 = _source94.dtor__1; if (_11.is_Primitive) { DAST._IPrimitive _h73 = _11.dtor_Primitive_a0; if (_h73.is_Real) { { - RAST._IExpr _1784_recursiveGen; - DCOMP._IOwnership _1785___v137; - Dafny.ISet> _1786_recIdents; + RAST._IExpr _1793_recursiveGen; + DCOMP._IOwnership _1794___v137; + Dafny.ISet> _1795_recIdents; RAST._IExpr _out295; DCOMP._IOwnership _out296; Dafny.ISet> _out297; - (this).GenExpr(_1770_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out295, out _out296, out _out297); - _1784_recursiveGen = _out295; - _1785___v137 = _out296; - _1786_recIdents = _out297; - r = RAST.__default.RcNew(RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::BigRational::from_integer("), (_1784_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(")")))); + (this).GenExpr(_1779_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out295, out _out296, out _out297); + _1793_recursiveGen = _out295; + _1794___v137 = _out296; + _1795_recIdents = _out297; + r = RAST.__default.RcNew(RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::BigRational::from_integer("), (_1793_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(")")))); RAST._IExpr _out298; DCOMP._IOwnership _out299; (this).FromOwned(r, expectedOwnership, out _out298, out _out299); r = _out298; resultingOwnership = _out299; - readIdents = _1786_recIdents; + readIdents = _1795_recIdents; } - goto after_match39; + goto after_match40; } } } } } { - DAST._IType _02 = _source93.dtor__0; + DAST._IType _02 = _source94.dtor__0; if (_02.is_Primitive) { DAST._IPrimitive _h74 = _02.dtor_Primitive_a0; if (_h74.is_Real) { - DAST._IType _12 = _source93.dtor__1; + DAST._IType _12 = _source94.dtor__1; if (_12.is_Primitive) { DAST._IPrimitive _h75 = _12.dtor_Primitive_a0; if (_h75.is_Int) { { - RAST._IExpr _1787_recursiveGen; - DCOMP._IOwnership _1788___v138; - Dafny.ISet> _1789_recIdents; + RAST._IExpr _1796_recursiveGen; + DCOMP._IOwnership _1797___v138; + Dafny.ISet> _1798_recIdents; RAST._IExpr _out300; DCOMP._IOwnership _out301; Dafny.ISet> _out302; - (this).GenExpr(_1770_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out300, out _out301, out _out302); - _1787_recursiveGen = _out300; - _1788___v138 = _out301; - _1789_recIdents = _out302; - r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::dafny_rational_to_int("), (_1787_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(")"))); + (this).GenExpr(_1779_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out300, out _out301, out _out302); + _1796_recursiveGen = _out300; + _1797___v138 = _out301; + _1798_recIdents = _out302; + r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::dafny_rational_to_int("), (_1796_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(")"))); RAST._IExpr _out303; DCOMP._IOwnership _out304; (this).FromOwned(r, expectedOwnership, out _out303, out _out304); r = _out303; resultingOwnership = _out304; - readIdents = _1789_recIdents; + readIdents = _1798_recIdents; } - goto after_match39; + goto after_match40; } } } } } { - DAST._IType _03 = _source93.dtor__0; + DAST._IType _03 = _source94.dtor__0; if (_03.is_Primitive) { DAST._IPrimitive _h76 = _03.dtor_Primitive_a0; if (_h76.is_Int) { - DAST._IType _13 = _source93.dtor__1; + DAST._IType _13 = _source94.dtor__1; if (_13.is_Passthrough) { { - RAST._IType _1790_rhsType; + RAST._IType _1799_rhsType; RAST._IType _out305; - _out305 = (this).GenType(_1772_toTpe, DCOMP.GenTypeContext.InBinding()); - _1790_rhsType = _out305; - RAST._IExpr _1791_recursiveGen; - DCOMP._IOwnership _1792___v140; - Dafny.ISet> _1793_recIdents; + _out305 = (this).GenType(_1781_toTpe, DCOMP.GenTypeContext.InBinding()); + _1799_rhsType = _out305; + RAST._IExpr _1800_recursiveGen; + DCOMP._IOwnership _1801___v140; + Dafny.ISet> _1802_recIdents; RAST._IExpr _out306; DCOMP._IOwnership _out307; Dafny.ISet> _out308; - (this).GenExpr(_1770_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out306, out _out307, out _out308); - _1791_recursiveGen = _out306; - _1792___v140 = _out307; - _1793_recIdents = _out308; - r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("<"), (_1790_rhsType)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(" as ::dafny_runtime::NumCast>::from(")), (_1791_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(").unwrap()"))); + (this).GenExpr(_1779_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out306, out _out307, out _out308); + _1800_recursiveGen = _out306; + _1801___v140 = _out307; + _1802_recIdents = _out308; + r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("<"), (_1799_rhsType)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(" as ::dafny_runtime::NumCast>::from(")), (_1800_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(").unwrap()"))); RAST._IExpr _out309; DCOMP._IOwnership _out310; (this).FromOwned(r, expectedOwnership, out _out309, out _out310); r = _out309; resultingOwnership = _out310; - readIdents = _1793_recIdents; + readIdents = _1802_recIdents; } - goto after_match39; + goto after_match40; } } } } { - DAST._IType _04 = _source93.dtor__0; + DAST._IType _04 = _source94.dtor__0; if (_04.is_Passthrough) { - DAST._IType _14 = _source93.dtor__1; + DAST._IType _14 = _source94.dtor__1; if (_14.is_Primitive) { DAST._IPrimitive _h77 = _14.dtor_Primitive_a0; if (_h77.is_Int) { { - RAST._IType _1794_rhsType; + RAST._IType _1803_rhsType; RAST._IType _out311; - _out311 = (this).GenType(_1771_fromTpe, DCOMP.GenTypeContext.InBinding()); - _1794_rhsType = _out311; - RAST._IExpr _1795_recursiveGen; - DCOMP._IOwnership _1796___v142; - Dafny.ISet> _1797_recIdents; + _out311 = (this).GenType(_1780_fromTpe, DCOMP.GenTypeContext.InBinding()); + _1803_rhsType = _out311; + RAST._IExpr _1804_recursiveGen; + DCOMP._IOwnership _1805___v142; + Dafny.ISet> _1806_recIdents; RAST._IExpr _out312; DCOMP._IOwnership _out313; Dafny.ISet> _out314; - (this).GenExpr(_1770_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out312, out _out313, out _out314); - _1795_recursiveGen = _out312; - _1796___v142 = _out313; - _1797_recIdents = _out314; - r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::DafnyInt::new(::std::rc::Rc::new(::dafny_runtime::BigInt::from("), (_1795_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(")))"))); + (this).GenExpr(_1779_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out312, out _out313, out _out314); + _1804_recursiveGen = _out312; + _1805___v142 = _out313; + _1806_recIdents = _out314; + r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::DafnyInt::new(::std::rc::Rc::new(::dafny_runtime::BigInt::from("), (_1804_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(")))"))); RAST._IExpr _out315; DCOMP._IOwnership _out316; (this).FromOwned(r, expectedOwnership, out _out315, out _out316); r = _out315; resultingOwnership = _out316; - readIdents = _1797_recIdents; + readIdents = _1806_recIdents; } - goto after_match39; + goto after_match40; } } } } { - DAST._IType _05 = _source93.dtor__0; + DAST._IType _05 = _source94.dtor__0; if (_05.is_Primitive) { DAST._IPrimitive _h78 = _05.dtor_Primitive_a0; if (_h78.is_Int) { - DAST._IType _15 = _source93.dtor__1; + DAST._IType _15 = _source94.dtor__1; if (_15.is_Primitive) { DAST._IPrimitive _h79 = _15.dtor_Primitive_a0; if (_h79.is_Char) { { - RAST._IType _1798_rhsType; + RAST._IType _1807_rhsType; RAST._IType _out317; - _out317 = (this).GenType(_1772_toTpe, DCOMP.GenTypeContext.InBinding()); - _1798_rhsType = _out317; - RAST._IExpr _1799_recursiveGen; - DCOMP._IOwnership _1800___v143; - Dafny.ISet> _1801_recIdents; + _out317 = (this).GenType(_1781_toTpe, DCOMP.GenTypeContext.InBinding()); + _1807_rhsType = _out317; + RAST._IExpr _1808_recursiveGen; + DCOMP._IOwnership _1809___v143; + Dafny.ISet> _1810_recIdents; RAST._IExpr _out318; DCOMP._IOwnership _out319; Dafny.ISet> _out320; - (this).GenExpr(_1770_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out318, out _out319, out _out320); - _1799_recursiveGen = _out318; - _1800___v143 = _out319; - _1801_recIdents = _out320; - r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::"), (this).DafnyChar), Dafny.Sequence.UnicodeFromString("(")), (((this).UnicodeChars) ? (Dafny.Sequence.UnicodeFromString("char::from_u32(.UnicodeFromString(".UnicodeFromString(" as ::dafny_runtime::NumCast>::from(")), (_1799_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(").unwrap())")), (((this).UnicodeChars) ? (Dafny.Sequence.UnicodeFromString(".unwrap())")) : (Dafny.Sequence.UnicodeFromString(""))))); + (this).GenExpr(_1779_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out318, out _out319, out _out320); + _1808_recursiveGen = _out318; + _1809___v143 = _out319; + _1810_recIdents = _out320; + r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::"), (this).DafnyChar), Dafny.Sequence.UnicodeFromString("(")), (((this).UnicodeChars) ? (Dafny.Sequence.UnicodeFromString("char::from_u32(.UnicodeFromString(".UnicodeFromString(" as ::dafny_runtime::NumCast>::from(")), (_1808_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(").unwrap())")), (((this).UnicodeChars) ? (Dafny.Sequence.UnicodeFromString(".unwrap())")) : (Dafny.Sequence.UnicodeFromString(""))))); RAST._IExpr _out321; DCOMP._IOwnership _out322; (this).FromOwned(r, expectedOwnership, out _out321, out _out322); r = _out321; resultingOwnership = _out322; - readIdents = _1801_recIdents; + readIdents = _1810_recIdents; } - goto after_match39; + goto after_match40; } } } } } { - DAST._IType _06 = _source93.dtor__0; + DAST._IType _06 = _source94.dtor__0; if (_06.is_Primitive) { DAST._IPrimitive _h710 = _06.dtor_Primitive_a0; if (_h710.is_Char) { - DAST._IType _16 = _source93.dtor__1; + DAST._IType _16 = _source94.dtor__1; if (_16.is_Primitive) { DAST._IPrimitive _h711 = _16.dtor_Primitive_a0; if (_h711.is_Int) { { - RAST._IType _1802_rhsType; + RAST._IType _1811_rhsType; RAST._IType _out323; - _out323 = (this).GenType(_1771_fromTpe, DCOMP.GenTypeContext.InBinding()); - _1802_rhsType = _out323; - RAST._IExpr _1803_recursiveGen; - DCOMP._IOwnership _1804___v144; - Dafny.ISet> _1805_recIdents; + _out323 = (this).GenType(_1780_fromTpe, DCOMP.GenTypeContext.InBinding()); + _1811_rhsType = _out323; + RAST._IExpr _1812_recursiveGen; + DCOMP._IOwnership _1813___v144; + Dafny.ISet> _1814_recIdents; RAST._IExpr _out324; DCOMP._IOwnership _out325; Dafny.ISet> _out326; - (this).GenExpr(_1770_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out324, out _out325, out _out326); - _1803_recursiveGen = _out324; - _1804___v144 = _out325; - _1805_recIdents = _out326; - r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("int!"))).Apply1((_1803_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("0"))); + (this).GenExpr(_1779_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out324, out _out325, out _out326); + _1812_recursiveGen = _out324; + _1813___v144 = _out325; + _1814_recIdents = _out326; + r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("int!"))).Apply1((_1812_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("0"))); RAST._IExpr _out327; DCOMP._IOwnership _out328; (this).FromOwned(r, expectedOwnership, out _out327, out _out328); r = _out327; resultingOwnership = _out328; - readIdents = _1805_recIdents; + readIdents = _1814_recIdents; } - goto after_match39; + goto after_match40; } } } } } { - DAST._IType _07 = _source93.dtor__0; + DAST._IType _07 = _source94.dtor__0; if (_07.is_Passthrough) { - DAST._IType _17 = _source93.dtor__1; + DAST._IType _17 = _source94.dtor__1; if (_17.is_Passthrough) { { - RAST._IExpr _1806_recursiveGen; - DCOMP._IOwnership _1807___v147; - Dafny.ISet> _1808_recIdents; + RAST._IExpr _1815_recursiveGen; + DCOMP._IOwnership _1816___v147; + Dafny.ISet> _1817_recIdents; RAST._IExpr _out329; DCOMP._IOwnership _out330; Dafny.ISet> _out331; - (this).GenExpr(_1770_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out329, out _out330, out _out331); - _1806_recursiveGen = _out329; - _1807___v147 = _out330; - _1808_recIdents = _out331; - RAST._IType _1809_toTpeGen; + (this).GenExpr(_1779_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out329, out _out330, out _out331); + _1815_recursiveGen = _out329; + _1816___v147 = _out330; + _1817_recIdents = _out331; + RAST._IType _1818_toTpeGen; RAST._IType _out332; - _out332 = (this).GenType(_1772_toTpe, DCOMP.GenTypeContext.InBinding()); - _1809_toTpeGen = _out332; - r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("(("), (_1806_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(") as ")), (_1809_toTpeGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(")"))); + _out332 = (this).GenType(_1781_toTpe, DCOMP.GenTypeContext.InBinding()); + _1818_toTpeGen = _out332; + r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("(("), (_1815_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(") as ")), (_1818_toTpeGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(")"))); RAST._IExpr _out333; DCOMP._IOwnership _out334; (this).FromOwned(r, expectedOwnership, out _out333, out _out334); r = _out333; resultingOwnership = _out334; - readIdents = _1808_recIdents; + readIdents = _1817_recIdents; } - goto after_match39; + goto after_match40; } } } @@ -4777,7 +4808,7 @@ public void GenExprConvert(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOM readIdents = _out337; } } - after_match39: ; + after_match40: ; } return ; } @@ -4787,26 +4818,26 @@ public void GenIdent(Dafny.ISequence rName, DCOMP._ISelfInfo selfIde resultingOwnership = DCOMP.Ownership.Default(); readIdents = Dafny.Set>.Empty; r = RAST.Expr.create_Identifier(rName); - Std.Wrappers._IOption _1810_tpe; - _1810_tpe = (env).GetType(rName); - Std.Wrappers._IOption _1811_placeboOpt; - if ((_1810_tpe).is_Some) { - _1811_placeboOpt = ((_1810_tpe).dtor_value).ExtractMaybePlacebo(); + Std.Wrappers._IOption _1819_tpe; + _1819_tpe = (env).GetType(rName); + Std.Wrappers._IOption _1820_placeboOpt; + if ((_1819_tpe).is_Some) { + _1820_placeboOpt = ((_1819_tpe).dtor_value).ExtractMaybePlacebo(); } else { - _1811_placeboOpt = Std.Wrappers.Option.create_None(); + _1820_placeboOpt = Std.Wrappers.Option.create_None(); } - bool _1812_currentlyBorrowed; - _1812_currentlyBorrowed = (env).IsBorrowed(rName); - bool _1813_noNeedOfClone; - _1813_noNeedOfClone = (env).CanReadWithoutClone(rName); - if ((_1811_placeboOpt).is_Some) { + bool _1821_currentlyBorrowed; + _1821_currentlyBorrowed = (env).IsBorrowed(rName); + bool _1822_noNeedOfClone; + _1822_noNeedOfClone = (env).CanReadWithoutClone(rName); + if ((_1820_placeboOpt).is_Some) { r = ((r).Sel(Dafny.Sequence.UnicodeFromString("read"))).Apply(Dafny.Sequence.FromElements()); - _1812_currentlyBorrowed = false; - _1813_noNeedOfClone = true; - _1810_tpe = Std.Wrappers.Option.create_Some((_1811_placeboOpt).dtor_value); + _1821_currentlyBorrowed = false; + _1822_noNeedOfClone = true; + _1819_tpe = Std.Wrappers.Option.create_Some((_1820_placeboOpt).dtor_value); } if (object.Equals(expectedOwnership, DCOMP.Ownership.create_OwnershipAutoBorrowed())) { - if (_1812_currentlyBorrowed) { + if (_1821_currentlyBorrowed) { resultingOwnership = DCOMP.Ownership.create_OwnershipBorrowed(); } else { resultingOwnership = DCOMP.Ownership.create_OwnershipOwned(); @@ -4815,7 +4846,7 @@ public void GenIdent(Dafny.ISequence rName, DCOMP._ISelfInfo selfIde if ((rName).Equals(Dafny.Sequence.UnicodeFromString("self"))) { resultingOwnership = DCOMP.Ownership.create_OwnershipBorrowedMut(); } else { - if (((_1810_tpe).is_Some) && (((_1810_tpe).dtor_value).IsObjectOrPointer())) { + if (((_1819_tpe).is_Some) && (((_1819_tpe).dtor_value).IsObjectOrPointer())) { r = ((this).modify__macro).Apply1(r); } else { r = RAST.__default.BorrowMut(r); @@ -4823,40 +4854,40 @@ public void GenIdent(Dafny.ISequence rName, DCOMP._ISelfInfo selfIde } resultingOwnership = DCOMP.Ownership.create_OwnershipBorrowedMut(); } else if (object.Equals(expectedOwnership, DCOMP.Ownership.create_OwnershipOwned())) { - bool _1814_needObjectFromRef; - _1814_needObjectFromRef = ((((selfIdent).is_ThisTyped) && ((selfIdent).IsSelf())) && (((selfIdent).dtor_rSelfName).Equals(rName))) && (((System.Func)(() => { - DAST._IType _source94 = (selfIdent).dtor_dafnyType; + bool _1823_needObjectFromRef; + _1823_needObjectFromRef = ((((selfIdent).is_ThisTyped) && ((selfIdent).IsSelf())) && (((selfIdent).dtor_rSelfName).Equals(rName))) && (((System.Func)(() => { + DAST._IType _source95 = (selfIdent).dtor_dafnyType; { - if (_source94.is_UserDefined) { - DAST._IResolvedType resolved4 = _source94.dtor_resolved; - DAST._IResolvedTypeBase _1815_base = resolved4.dtor_kind; - Dafny.ISequence _1816_attributes = resolved4.dtor_attributes; - return ((_1815_base).is_Class) || ((_1815_base).is_Trait); + if (_source95.is_UserDefined) { + DAST._IResolvedType resolved4 = _source95.dtor_resolved; + DAST._IResolvedTypeBase _1824_base = resolved4.dtor_kind; + Dafny.ISequence _1825_attributes = resolved4.dtor_attributes; + return ((_1824_base).is_Class) || ((_1824_base).is_Trait); } } { return false; } }))()); - if (_1814_needObjectFromRef) { + if (_1823_needObjectFromRef) { r = ((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("Object"))).ApplyType(Dafny.Sequence.FromElements(RAST.__default.RawType(Dafny.Sequence.UnicodeFromString("_"))))).MSel(Dafny.Sequence.UnicodeFromString("from_ref"))).Apply(Dafny.Sequence.FromElements(r)); } else { - if (!(_1813_noNeedOfClone)) { + if (!(_1822_noNeedOfClone)) { r = (r).Clone(); } } resultingOwnership = DCOMP.Ownership.create_OwnershipOwned(); } else if (object.Equals(expectedOwnership, DCOMP.Ownership.create_OwnershipOwnedBox())) { - if (!(_1813_noNeedOfClone)) { + if (!(_1822_noNeedOfClone)) { r = (r).Clone(); } r = RAST.__default.BoxNew(r); resultingOwnership = DCOMP.Ownership.create_OwnershipOwnedBox(); - } else if (_1812_currentlyBorrowed) { + } else if (_1821_currentlyBorrowed) { resultingOwnership = DCOMP.Ownership.create_OwnershipBorrowed(); } else { if (!(rName).Equals(Dafny.Sequence.UnicodeFromString("self"))) { - if (((_1810_tpe).is_Some) && (((_1810_tpe).dtor_value).IsPointer())) { + if (((_1819_tpe).is_Some) && (((_1819_tpe).dtor_value).IsPointer())) { r = ((this).read__macro).Apply1(r); } else { r = RAST.__default.Borrow(r); @@ -4868,9 +4899,9 @@ public void GenIdent(Dafny.ISequence rName, DCOMP._ISelfInfo selfIde return ; } public bool HasExternAttributeRenamingModule(Dafny.ISequence attributes) { - return Dafny.Helpers.Id, bool>>((_1817_attributes) => Dafny.Helpers.Quantifier((_1817_attributes).UniqueElements, false, (((_exists_var_1) => { - DAST._IAttribute _1818_attribute = (DAST._IAttribute)_exists_var_1; - return ((_1817_attributes).Contains(_1818_attribute)) && ((((_1818_attribute).dtor_name).Equals(Dafny.Sequence.UnicodeFromString("extern"))) && ((new BigInteger(((_1818_attribute).dtor_args).Count)) == (new BigInteger(2)))); + return Dafny.Helpers.Id, bool>>((_1826_attributes) => Dafny.Helpers.Quantifier((_1826_attributes).UniqueElements, false, (((_exists_var_2) => { + DAST._IAttribute _1827_attribute = (DAST._IAttribute)_exists_var_2; + return ((_1826_attributes).Contains(_1827_attribute)) && ((((_1827_attribute).dtor_name).Equals(Dafny.Sequence.UnicodeFromString("extern"))) && ((new BigInteger(((_1827_attribute).dtor_args).Count)) == (new BigInteger(2)))); }))))(attributes); } public void GenArgs(DCOMP._ISelfInfo selfIdent, DAST._ICallName name, Dafny.ISequence typeArgs, Dafny.ISequence args, DCOMP._IEnvironment env, out Dafny.ISequence argExprs, out Dafny.ISet> readIdents, out Dafny.ISequence typeExprs, out Std.Wrappers._IOption fullNameQualifier) @@ -4881,59 +4912,59 @@ public void GenArgs(DCOMP._ISelfInfo selfIdent, DAST._ICallName name, Dafny.ISeq fullNameQualifier = Std.Wrappers.Option.Default(); argExprs = Dafny.Sequence.FromElements(); readIdents = Dafny.Set>.FromElements(); - BigInteger _hi37 = new BigInteger((args).Count); - for (BigInteger _1819_i = BigInteger.Zero; _1819_i < _hi37; _1819_i++) { - DCOMP._IOwnership _1820_argOwnership; - _1820_argOwnership = DCOMP.Ownership.create_OwnershipBorrowed(); - if (((name).is_CallName) && ((_1819_i) < (new BigInteger((((name).dtor_signature)).Count)))) { - RAST._IType _1821_tpe; + BigInteger _hi38 = new BigInteger((args).Count); + for (BigInteger _1828_i = BigInteger.Zero; _1828_i < _hi38; _1828_i++) { + DCOMP._IOwnership _1829_argOwnership; + _1829_argOwnership = DCOMP.Ownership.create_OwnershipBorrowed(); + if (((name).is_CallName) && ((_1828_i) < (new BigInteger((((name).dtor_signature)).Count)))) { + RAST._IType _1830_tpe; RAST._IType _out338; - _out338 = (this).GenType(((((name).dtor_signature)).Select(_1819_i)).dtor_typ, DCOMP.GenTypeContext.@default()); - _1821_tpe = _out338; - if ((_1821_tpe).CanReadWithoutClone()) { - _1820_argOwnership = DCOMP.Ownership.create_OwnershipOwned(); + _out338 = (this).GenType(((((name).dtor_signature)).Select(_1828_i)).dtor_typ, DCOMP.GenTypeContext.@default()); + _1830_tpe = _out338; + if ((_1830_tpe).CanReadWithoutClone()) { + _1829_argOwnership = DCOMP.Ownership.create_OwnershipOwned(); } } - RAST._IExpr _1822_argExpr; - DCOMP._IOwnership _1823___v154; - Dafny.ISet> _1824_argIdents; + RAST._IExpr _1831_argExpr; + DCOMP._IOwnership _1832___v154; + Dafny.ISet> _1833_argIdents; RAST._IExpr _out339; DCOMP._IOwnership _out340; Dafny.ISet> _out341; - (this).GenExpr((args).Select(_1819_i), selfIdent, env, _1820_argOwnership, out _out339, out _out340, out _out341); - _1822_argExpr = _out339; - _1823___v154 = _out340; - _1824_argIdents = _out341; - argExprs = Dafny.Sequence.Concat(argExprs, Dafny.Sequence.FromElements(_1822_argExpr)); - readIdents = Dafny.Set>.Union(readIdents, _1824_argIdents); + (this).GenExpr((args).Select(_1828_i), selfIdent, env, _1829_argOwnership, out _out339, out _out340, out _out341); + _1831_argExpr = _out339; + _1832___v154 = _out340; + _1833_argIdents = _out341; + argExprs = Dafny.Sequence.Concat(argExprs, Dafny.Sequence.FromElements(_1831_argExpr)); + readIdents = Dafny.Set>.Union(readIdents, _1833_argIdents); } typeExprs = Dafny.Sequence.FromElements(); - BigInteger _hi38 = new BigInteger((typeArgs).Count); - for (BigInteger _1825_typeI = BigInteger.Zero; _1825_typeI < _hi38; _1825_typeI++) { - RAST._IType _1826_typeExpr; + BigInteger _hi39 = new BigInteger((typeArgs).Count); + for (BigInteger _1834_typeI = BigInteger.Zero; _1834_typeI < _hi39; _1834_typeI++) { + RAST._IType _1835_typeExpr; RAST._IType _out342; - _out342 = (this).GenType((typeArgs).Select(_1825_typeI), DCOMP.GenTypeContext.@default()); - _1826_typeExpr = _out342; - typeExprs = Dafny.Sequence.Concat(typeExprs, Dafny.Sequence.FromElements(_1826_typeExpr)); + _out342 = (this).GenType((typeArgs).Select(_1834_typeI), DCOMP.GenTypeContext.@default()); + _1835_typeExpr = _out342; + typeExprs = Dafny.Sequence.Concat(typeExprs, Dafny.Sequence.FromElements(_1835_typeExpr)); } - DAST._ICallName _source95 = name; + DAST._ICallName _source96 = name; { - if (_source95.is_CallName) { - Dafny.ISequence _1827_nameIdent = _source95.dtor_name; - Std.Wrappers._IOption onType1 = _source95.dtor_onType; + if (_source96.is_CallName) { + Dafny.ISequence _1836_nameIdent = _source96.dtor_name; + Std.Wrappers._IOption onType1 = _source96.dtor_onType; if (onType1.is_Some) { DAST._IType value10 = onType1.dtor_value; if (value10.is_UserDefined) { - DAST._IResolvedType _1828_resolvedType = value10.dtor_resolved; - if ((((_1828_resolvedType).dtor_kind).is_Trait) || (Dafny.Helpers.Id, bool>>((_1829_resolvedType, _1830_nameIdent) => Dafny.Helpers.Quantifier>(((_1829_resolvedType).dtor_properMethods).UniqueElements, true, (((_forall_var_8) => { - Dafny.ISequence _1831_m = (Dafny.ISequence)_forall_var_8; - return !(((_1829_resolvedType).dtor_properMethods).Contains(_1831_m)) || (!object.Equals((_1831_m), _1830_nameIdent)); - }))))(_1828_resolvedType, _1827_nameIdent))) { - fullNameQualifier = Std.Wrappers.Option.create_Some(Std.Wrappers.Option.GetOr(DCOMP.__default.TraitTypeContainingMethod(_1828_resolvedType, (_1827_nameIdent)), _1828_resolvedType)); + DAST._IResolvedType _1837_resolvedType = value10.dtor_resolved; + if ((((_1837_resolvedType).dtor_kind).is_Trait) || (Dafny.Helpers.Id, bool>>((_1838_resolvedType, _1839_nameIdent) => Dafny.Helpers.Quantifier>(((_1838_resolvedType).dtor_properMethods).UniqueElements, true, (((_forall_var_8) => { + Dafny.ISequence _1840_m = (Dafny.ISequence)_forall_var_8; + return !(((_1838_resolvedType).dtor_properMethods).Contains(_1840_m)) || (!object.Equals((_1840_m), _1839_nameIdent)); + }))))(_1837_resolvedType, _1836_nameIdent))) { + fullNameQualifier = Std.Wrappers.Option.create_Some(Std.Wrappers.Option.GetOr(DCOMP.__default.TraitTypeContainingMethod(_1837_resolvedType, (_1836_nameIdent)), _1837_resolvedType)); } else { fullNameQualifier = Std.Wrappers.Option.create_None(); } - goto after_match40; + goto after_match41; } } } @@ -4941,7 +4972,7 @@ public void GenArgs(DCOMP._ISelfInfo selfIdent, DAST._ICallName name, Dafny.ISeq { fullNameQualifier = Std.Wrappers.Option.create_None(); } - after_match40: ; + after_match41: ; if ((((((fullNameQualifier).is_Some) && ((selfIdent).is_ThisTyped)) && (((selfIdent).dtor_dafnyType).is_UserDefined)) && ((this).IsSameResolvedType(((selfIdent).dtor_dafnyType).dtor_resolved, (fullNameQualifier).dtor_value))) && (!((this).HasExternAttributeRenamingModule(((fullNameQualifier).dtor_value).dtor_attributes)))) { fullNameQualifier = Std.Wrappers.Option.create_None(); } @@ -4951,9 +4982,9 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv r = RAST.Expr.Default(); resultingOwnership = DCOMP.Ownership.Default(); readIdents = Dafny.Set>.Empty; - DAST._IExpression _source96 = e; + DAST._IExpression _source97 = e; { - if (_source96.is_Literal) { + if (_source97.is_Literal) { RAST._IExpr _out343; DCOMP._IOwnership _out344; Dafny.ISet> _out345; @@ -4961,44 +4992,44 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv r = _out343; resultingOwnership = _out344; readIdents = _out345; - goto after_match41; + goto after_match42; } } { - if (_source96.is_Ident) { - Dafny.ISequence _1832_name = _source96.dtor_name; + if (_source97.is_Ident) { + Dafny.ISequence _1841_name = _source97.dtor_name; { RAST._IExpr _out346; DCOMP._IOwnership _out347; Dafny.ISet> _out348; - (this).GenIdent(DCOMP.__default.escapeName(_1832_name), selfIdent, env, expectedOwnership, out _out346, out _out347, out _out348); + (this).GenIdent(DCOMP.__default.escapeName(_1841_name), selfIdent, env, expectedOwnership, out _out346, out _out347, out _out348); r = _out346; resultingOwnership = _out347; readIdents = _out348; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_Companion) { - Dafny.ISequence> _1833_path = _source96.dtor_Companion_a0; - Dafny.ISequence _1834_typeArgs = _source96.dtor_typeArgs; + if (_source97.is_Companion) { + Dafny.ISequence> _1842_path = _source97.dtor_Companion_a0; + Dafny.ISequence _1843_typeArgs = _source97.dtor_typeArgs; { RAST._IExpr _out349; - _out349 = DCOMP.COMP.GenPathExpr(_1833_path); + _out349 = DCOMP.COMP.GenPathExpr(_1842_path); r = _out349; - if ((new BigInteger((_1834_typeArgs).Count)).Sign == 1) { - Dafny.ISequence _1835_typeExprs; - _1835_typeExprs = Dafny.Sequence.FromElements(); - BigInteger _hi39 = new BigInteger((_1834_typeArgs).Count); - for (BigInteger _1836_i = BigInteger.Zero; _1836_i < _hi39; _1836_i++) { - RAST._IType _1837_typeExpr; + if ((new BigInteger((_1843_typeArgs).Count)).Sign == 1) { + Dafny.ISequence _1844_typeExprs; + _1844_typeExprs = Dafny.Sequence.FromElements(); + BigInteger _hi40 = new BigInteger((_1843_typeArgs).Count); + for (BigInteger _1845_i = BigInteger.Zero; _1845_i < _hi40; _1845_i++) { + RAST._IType _1846_typeExpr; RAST._IType _out350; - _out350 = (this).GenType((_1834_typeArgs).Select(_1836_i), DCOMP.GenTypeContext.@default()); - _1837_typeExpr = _out350; - _1835_typeExprs = Dafny.Sequence.Concat(_1835_typeExprs, Dafny.Sequence.FromElements(_1837_typeExpr)); + _out350 = (this).GenType((_1843_typeArgs).Select(_1845_i), DCOMP.GenTypeContext.@default()); + _1846_typeExpr = _out350; + _1844_typeExprs = Dafny.Sequence.Concat(_1844_typeExprs, Dafny.Sequence.FromElements(_1846_typeExpr)); } - r = (r).ApplyType(_1835_typeExprs); + r = (r).ApplyType(_1844_typeExprs); } if (object.Equals(expectedOwnership, DCOMP.Ownership.create_OwnershipBorrowed())) { resultingOwnership = DCOMP.Ownership.create_OwnershipBorrowed(); @@ -5014,21 +5045,21 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv readIdents = Dafny.Set>.FromElements(); return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_InitializationValue) { - DAST._IType _1838_typ = _source96.dtor_typ; + if (_source97.is_InitializationValue) { + DAST._IType _1847_typ = _source97.dtor_typ; { - RAST._IType _1839_typExpr; + RAST._IType _1848_typExpr; RAST._IType _out353; - _out353 = (this).GenType(_1838_typ, DCOMP.GenTypeContext.@default()); - _1839_typExpr = _out353; - if ((_1839_typExpr).IsObjectOrPointer()) { - r = (_1839_typExpr).ToNullExpr(); + _out353 = (this).GenType(_1847_typ, DCOMP.GenTypeContext.@default()); + _1848_typExpr = _out353; + if ((_1848_typExpr).IsObjectOrPointer()) { + r = (_1848_typExpr).ToNullExpr(); } else { - r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("<"), (_1839_typExpr)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(" as std::default::Default>::default()"))); + r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("<"), (_1848_typExpr)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(" as std::default::Default>::default()"))); } RAST._IExpr _out354; DCOMP._IOwnership _out355; @@ -5038,35 +5069,35 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv readIdents = Dafny.Set>.FromElements(); return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_Tuple) { - Dafny.ISequence _1840_values = _source96.dtor_Tuple_a0; + if (_source97.is_Tuple) { + Dafny.ISequence _1849_values = _source97.dtor_Tuple_a0; { - Dafny.ISequence _1841_exprs; - _1841_exprs = Dafny.Sequence.FromElements(); + Dafny.ISequence _1850_exprs; + _1850_exprs = Dafny.Sequence.FromElements(); readIdents = Dafny.Set>.FromElements(); - BigInteger _hi40 = new BigInteger((_1840_values).Count); - for (BigInteger _1842_i = BigInteger.Zero; _1842_i < _hi40; _1842_i++) { - RAST._IExpr _1843_recursiveGen; - DCOMP._IOwnership _1844___v159; - Dafny.ISet> _1845_recIdents; + BigInteger _hi41 = new BigInteger((_1849_values).Count); + for (BigInteger _1851_i = BigInteger.Zero; _1851_i < _hi41; _1851_i++) { + RAST._IExpr _1852_recursiveGen; + DCOMP._IOwnership _1853___v159; + Dafny.ISet> _1854_recIdents; RAST._IExpr _out356; DCOMP._IOwnership _out357; Dafny.ISet> _out358; - (this).GenExpr((_1840_values).Select(_1842_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out356, out _out357, out _out358); - _1843_recursiveGen = _out356; - _1844___v159 = _out357; - _1845_recIdents = _out358; - _1841_exprs = Dafny.Sequence.Concat(_1841_exprs, Dafny.Sequence.FromElements(_1843_recursiveGen)); - readIdents = Dafny.Set>.Union(readIdents, _1845_recIdents); + (this).GenExpr((_1849_values).Select(_1851_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out356, out _out357, out _out358); + _1852_recursiveGen = _out356; + _1853___v159 = _out357; + _1854_recIdents = _out358; + _1850_exprs = Dafny.Sequence.Concat(_1850_exprs, Dafny.Sequence.FromElements(_1852_recursiveGen)); + readIdents = Dafny.Set>.Union(readIdents, _1854_recIdents); } - if ((new BigInteger((_1840_values).Count)) <= (RAST.__default.MAX__TUPLE__SIZE)) { - r = RAST.Expr.create_Tuple(_1841_exprs); + if ((new BigInteger((_1849_values).Count)) <= (RAST.__default.MAX__TUPLE__SIZE)) { + r = RAST.Expr.create_Tuple(_1850_exprs); } else { - r = RAST.__default.SystemTuple(_1841_exprs); + r = RAST.__default.SystemTuple(_1850_exprs); } RAST._IExpr _out359; DCOMP._IOwnership _out360; @@ -5075,51 +5106,51 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out360; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_New) { - Dafny.ISequence> _1846_path = _source96.dtor_path; - Dafny.ISequence _1847_typeArgs = _source96.dtor_typeArgs; - Dafny.ISequence _1848_args = _source96.dtor_args; + if (_source97.is_New) { + Dafny.ISequence> _1855_path = _source97.dtor_path; + Dafny.ISequence _1856_typeArgs = _source97.dtor_typeArgs; + Dafny.ISequence _1857_args = _source97.dtor_args; { RAST._IExpr _out361; - _out361 = DCOMP.COMP.GenPathExpr(_1846_path); + _out361 = DCOMP.COMP.GenPathExpr(_1855_path); r = _out361; - if ((new BigInteger((_1847_typeArgs).Count)).Sign == 1) { - Dafny.ISequence _1849_typeExprs; - _1849_typeExprs = Dafny.Sequence.FromElements(); - BigInteger _hi41 = new BigInteger((_1847_typeArgs).Count); - for (BigInteger _1850_i = BigInteger.Zero; _1850_i < _hi41; _1850_i++) { - RAST._IType _1851_typeExpr; + if ((new BigInteger((_1856_typeArgs).Count)).Sign == 1) { + Dafny.ISequence _1858_typeExprs; + _1858_typeExprs = Dafny.Sequence.FromElements(); + BigInteger _hi42 = new BigInteger((_1856_typeArgs).Count); + for (BigInteger _1859_i = BigInteger.Zero; _1859_i < _hi42; _1859_i++) { + RAST._IType _1860_typeExpr; RAST._IType _out362; - _out362 = (this).GenType((_1847_typeArgs).Select(_1850_i), DCOMP.GenTypeContext.@default()); - _1851_typeExpr = _out362; - _1849_typeExprs = Dafny.Sequence.Concat(_1849_typeExprs, Dafny.Sequence.FromElements(_1851_typeExpr)); + _out362 = (this).GenType((_1856_typeArgs).Select(_1859_i), DCOMP.GenTypeContext.@default()); + _1860_typeExpr = _out362; + _1858_typeExprs = Dafny.Sequence.Concat(_1858_typeExprs, Dafny.Sequence.FromElements(_1860_typeExpr)); } - r = (r).ApplyType(_1849_typeExprs); + r = (r).ApplyType(_1858_typeExprs); } r = (r).MSel((this).allocate__fn); readIdents = Dafny.Set>.FromElements(); - Dafny.ISequence _1852_arguments; - _1852_arguments = Dafny.Sequence.FromElements(); - BigInteger _hi42 = new BigInteger((_1848_args).Count); - for (BigInteger _1853_i = BigInteger.Zero; _1853_i < _hi42; _1853_i++) { - RAST._IExpr _1854_recursiveGen; - DCOMP._IOwnership _1855___v160; - Dafny.ISet> _1856_recIdents; + Dafny.ISequence _1861_arguments; + _1861_arguments = Dafny.Sequence.FromElements(); + BigInteger _hi43 = new BigInteger((_1857_args).Count); + for (BigInteger _1862_i = BigInteger.Zero; _1862_i < _hi43; _1862_i++) { + RAST._IExpr _1863_recursiveGen; + DCOMP._IOwnership _1864___v160; + Dafny.ISet> _1865_recIdents; RAST._IExpr _out363; DCOMP._IOwnership _out364; Dafny.ISet> _out365; - (this).GenExpr((_1848_args).Select(_1853_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out363, out _out364, out _out365); - _1854_recursiveGen = _out363; - _1855___v160 = _out364; - _1856_recIdents = _out365; - _1852_arguments = Dafny.Sequence.Concat(_1852_arguments, Dafny.Sequence.FromElements(_1854_recursiveGen)); - readIdents = Dafny.Set>.Union(readIdents, _1856_recIdents); + (this).GenExpr((_1857_args).Select(_1862_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out363, out _out364, out _out365); + _1863_recursiveGen = _out363; + _1864___v160 = _out364; + _1865_recIdents = _out365; + _1861_arguments = Dafny.Sequence.Concat(_1861_arguments, Dafny.Sequence.FromElements(_1863_recursiveGen)); + readIdents = Dafny.Set>.Union(readIdents, _1865_recIdents); } - r = (r).Apply(_1852_arguments); + r = (r).Apply(_1861_arguments); RAST._IExpr _out366; DCOMP._IOwnership _out367; (this).FromOwned(r, expectedOwnership, out _out366, out _out367); @@ -5127,52 +5158,52 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out367; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_NewUninitArray) { - Dafny.ISequence _1857_dims = _source96.dtor_dims; - DAST._IType _1858_typ = _source96.dtor_typ; + if (_source97.is_NewUninitArray) { + Dafny.ISequence _1866_dims = _source97.dtor_dims; + DAST._IType _1867_typ = _source97.dtor_typ; { - if ((new BigInteger(16)) < (new BigInteger((_1857_dims).Count))) { - Dafny.ISequence _1859_msg; - _1859_msg = Dafny.Sequence.UnicodeFromString("Unsupported: Creation of arrays of more than 16 dimensions"); + if ((new BigInteger(16)) < (new BigInteger((_1866_dims).Count))) { + Dafny.ISequence _1868_msg; + _1868_msg = Dafny.Sequence.UnicodeFromString("Unsupported: Creation of arrays of more than 16 dimensions"); if ((this.error).is_None) { - (this).error = Std.Wrappers.Option>.create_Some(_1859_msg); + (this).error = Std.Wrappers.Option>.create_Some(_1868_msg); } - r = RAST.Expr.create_RawExpr(_1859_msg); + r = RAST.Expr.create_RawExpr(_1868_msg); readIdents = Dafny.Set>.FromElements(); } else { r = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")); - RAST._IType _1860_typeGen; + RAST._IType _1869_typeGen; RAST._IType _out368; - _out368 = (this).GenType(_1858_typ, DCOMP.GenTypeContext.@default()); - _1860_typeGen = _out368; + _out368 = (this).GenType(_1867_typ, DCOMP.GenTypeContext.@default()); + _1869_typeGen = _out368; readIdents = Dafny.Set>.FromElements(); - Dafny.ISequence _1861_dimExprs; - _1861_dimExprs = Dafny.Sequence.FromElements(); - BigInteger _hi43 = new BigInteger((_1857_dims).Count); - for (BigInteger _1862_i = BigInteger.Zero; _1862_i < _hi43; _1862_i++) { - RAST._IExpr _1863_recursiveGen; - DCOMP._IOwnership _1864___v161; - Dafny.ISet> _1865_recIdents; + Dafny.ISequence _1870_dimExprs; + _1870_dimExprs = Dafny.Sequence.FromElements(); + BigInteger _hi44 = new BigInteger((_1866_dims).Count); + for (BigInteger _1871_i = BigInteger.Zero; _1871_i < _hi44; _1871_i++) { + RAST._IExpr _1872_recursiveGen; + DCOMP._IOwnership _1873___v161; + Dafny.ISet> _1874_recIdents; RAST._IExpr _out369; DCOMP._IOwnership _out370; Dafny.ISet> _out371; - (this).GenExpr((_1857_dims).Select(_1862_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out369, out _out370, out _out371); - _1863_recursiveGen = _out369; - _1864___v161 = _out370; - _1865_recIdents = _out371; - _1861_dimExprs = Dafny.Sequence.Concat(_1861_dimExprs, Dafny.Sequence.FromElements(RAST.__default.IntoUsize(_1863_recursiveGen))); - readIdents = Dafny.Set>.Union(readIdents, _1865_recIdents); + (this).GenExpr((_1866_dims).Select(_1871_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out369, out _out370, out _out371); + _1872_recursiveGen = _out369; + _1873___v161 = _out370; + _1874_recIdents = _out371; + _1870_dimExprs = Dafny.Sequence.Concat(_1870_dimExprs, Dafny.Sequence.FromElements(RAST.__default.IntoUsize(_1872_recursiveGen))); + readIdents = Dafny.Set>.Union(readIdents, _1874_recIdents); } - if ((new BigInteger((_1857_dims).Count)) > (BigInteger.One)) { - Dafny.ISequence _1866_class__name; - _1866_class__name = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Array"), Std.Strings.__default.OfNat(new BigInteger((_1857_dims).Count))); - r = ((((RAST.__default.dafny__runtime).MSel(_1866_class__name)).ApplyType(Dafny.Sequence.FromElements(_1860_typeGen))).MSel((this).placebos__usize)).Apply(_1861_dimExprs); + if ((new BigInteger((_1866_dims).Count)) > (BigInteger.One)) { + Dafny.ISequence _1875_class__name; + _1875_class__name = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Array"), Std.Strings.__default.OfNat(new BigInteger((_1866_dims).Count))); + r = ((((RAST.__default.dafny__runtime).MSel(_1875_class__name)).ApplyType(Dafny.Sequence.FromElements(_1869_typeGen))).MSel((this).placebos__usize)).Apply(_1870_dimExprs); } else { - r = ((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("array"))).MSel((this).placebos__usize)).ApplyType(Dafny.Sequence.FromElements(_1860_typeGen))).Apply(_1861_dimExprs); + r = ((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("array"))).MSel((this).placebos__usize)).ApplyType(Dafny.Sequence.FromElements(_1869_typeGen))).Apply(_1870_dimExprs); } } RAST._IExpr _out372; @@ -5181,69 +5212,69 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv r = _out372; resultingOwnership = _out373; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_ArrayIndexToInt) { - DAST._IExpression _1867_underlying = _source96.dtor_value; + if (_source97.is_ArrayIndexToInt) { + DAST._IExpression _1876_underlying = _source97.dtor_value; { - RAST._IExpr _1868_recursiveGen; - DCOMP._IOwnership _1869___v162; - Dafny.ISet> _1870_recIdents; + RAST._IExpr _1877_recursiveGen; + DCOMP._IOwnership _1878___v162; + Dafny.ISet> _1879_recIdents; RAST._IExpr _out374; DCOMP._IOwnership _out375; Dafny.ISet> _out376; - (this).GenExpr(_1867_underlying, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out374, out _out375, out _out376); - _1868_recursiveGen = _out374; - _1869___v162 = _out375; - _1870_recIdents = _out376; - r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("int!"))).Apply1(_1868_recursiveGen); - readIdents = _1870_recIdents; + (this).GenExpr(_1876_underlying, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out374, out _out375, out _out376); + _1877_recursiveGen = _out374; + _1878___v162 = _out375; + _1879_recIdents = _out376; + r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("int!"))).Apply1(_1877_recursiveGen); + readIdents = _1879_recIdents; RAST._IExpr _out377; DCOMP._IOwnership _out378; (this).FromOwned(r, expectedOwnership, out _out377, out _out378); r = _out377; resultingOwnership = _out378; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_FinalizeNewArray) { - DAST._IExpression _1871_underlying = _source96.dtor_value; - DAST._IType _1872_typ = _source96.dtor_typ; + if (_source97.is_FinalizeNewArray) { + DAST._IExpression _1880_underlying = _source97.dtor_value; + DAST._IType _1881_typ = _source97.dtor_typ; { - RAST._IType _1873_tpe; + RAST._IType _1882_tpe; RAST._IType _out379; - _out379 = (this).GenType(_1872_typ, DCOMP.GenTypeContext.@default()); - _1873_tpe = _out379; - RAST._IExpr _1874_recursiveGen; - DCOMP._IOwnership _1875___v163; - Dafny.ISet> _1876_recIdents; + _out379 = (this).GenType(_1881_typ, DCOMP.GenTypeContext.@default()); + _1882_tpe = _out379; + RAST._IExpr _1883_recursiveGen; + DCOMP._IOwnership _1884___v163; + Dafny.ISet> _1885_recIdents; RAST._IExpr _out380; DCOMP._IOwnership _out381; Dafny.ISet> _out382; - (this).GenExpr(_1871_underlying, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out380, out _out381, out _out382); - _1874_recursiveGen = _out380; - _1875___v163 = _out381; - _1876_recIdents = _out382; - readIdents = _1876_recIdents; - if ((_1873_tpe).IsObjectOrPointer()) { - RAST._IType _1877_t; - _1877_t = (_1873_tpe).ObjectOrPointerUnderlying(); - if ((_1877_t).is_Array) { - r = (((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("array"))).MSel((this).array__construct)).Apply1(_1874_recursiveGen); - } else if ((_1877_t).IsMultiArray()) { - Dafny.ISequence _1878_c; - _1878_c = (_1877_t).MultiArrayClass(); - r = (((RAST.__default.dafny__runtime).MSel(_1878_c)).MSel((this).array__construct)).Apply1(_1874_recursiveGen); + (this).GenExpr(_1880_underlying, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out380, out _out381, out _out382); + _1883_recursiveGen = _out380; + _1884___v163 = _out381; + _1885_recIdents = _out382; + readIdents = _1885_recIdents; + if ((_1882_tpe).IsObjectOrPointer()) { + RAST._IType _1886_t; + _1886_t = (_1882_tpe).ObjectOrPointerUnderlying(); + if ((_1886_t).is_Array) { + r = (((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("array"))).MSel((this).array__construct)).Apply1(_1883_recursiveGen); + } else if ((_1886_t).IsMultiArray()) { + Dafny.ISequence _1887_c; + _1887_c = (_1886_t).MultiArrayClass(); + r = (((RAST.__default.dafny__runtime).MSel(_1887_c)).MSel((this).array__construct)).Apply1(_1883_recursiveGen); } else { - (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Finalize New Array with a pointer or object type to something that is not an array or a multi array: "), (_1873_tpe)._ToString(DCOMP.__default.IND))); + (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Finalize New Array with a pointer or object type to something that is not an array or a multi array: "), (_1882_tpe)._ToString(DCOMP.__default.IND))); r = RAST.Expr.create_RawExpr((this.error).dtor_value); } } else { - (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Finalize New Array with a type that is not a pointer or an object: "), (_1873_tpe)._ToString(DCOMP.__default.IND))); + (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Finalize New Array with a type that is not a pointer or an object: "), (_1882_tpe)._ToString(DCOMP.__default.IND))); r = RAST.Expr.create_RawExpr((this.error).dtor_value); } RAST._IExpr _out383; @@ -5252,89 +5283,89 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv r = _out383; resultingOwnership = _out384; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_DatatypeValue) { - DAST._IResolvedType _1879_datatypeType = _source96.dtor_datatypeType; - Dafny.ISequence _1880_typeArgs = _source96.dtor_typeArgs; - Dafny.ISequence _1881_variant = _source96.dtor_variant; - bool _1882_isCo = _source96.dtor_isCo; - Dafny.ISequence<_System._ITuple2, DAST._IExpression>> _1883_values = _source96.dtor_contents; + if (_source97.is_DatatypeValue) { + DAST._IResolvedType _1888_datatypeType = _source97.dtor_datatypeType; + Dafny.ISequence _1889_typeArgs = _source97.dtor_typeArgs; + Dafny.ISequence _1890_variant = _source97.dtor_variant; + bool _1891_isCo = _source97.dtor_isCo; + Dafny.ISequence<_System._ITuple2, DAST._IExpression>> _1892_values = _source97.dtor_contents; { RAST._IExpr _out385; - _out385 = DCOMP.COMP.GenPathExpr((_1879_datatypeType).dtor_path); + _out385 = DCOMP.COMP.GenPathExpr((_1888_datatypeType).dtor_path); r = _out385; - Dafny.ISequence _1884_genTypeArgs; - _1884_genTypeArgs = Dafny.Sequence.FromElements(); - BigInteger _hi44 = new BigInteger((_1880_typeArgs).Count); - for (BigInteger _1885_i = BigInteger.Zero; _1885_i < _hi44; _1885_i++) { - RAST._IType _1886_typeExpr; + Dafny.ISequence _1893_genTypeArgs; + _1893_genTypeArgs = Dafny.Sequence.FromElements(); + BigInteger _hi45 = new BigInteger((_1889_typeArgs).Count); + for (BigInteger _1894_i = BigInteger.Zero; _1894_i < _hi45; _1894_i++) { + RAST._IType _1895_typeExpr; RAST._IType _out386; - _out386 = (this).GenType((_1880_typeArgs).Select(_1885_i), DCOMP.GenTypeContext.@default()); - _1886_typeExpr = _out386; - _1884_genTypeArgs = Dafny.Sequence.Concat(_1884_genTypeArgs, Dafny.Sequence.FromElements(_1886_typeExpr)); + _out386 = (this).GenType((_1889_typeArgs).Select(_1894_i), DCOMP.GenTypeContext.@default()); + _1895_typeExpr = _out386; + _1893_genTypeArgs = Dafny.Sequence.Concat(_1893_genTypeArgs, Dafny.Sequence.FromElements(_1895_typeExpr)); } - if ((new BigInteger((_1880_typeArgs).Count)).Sign == 1) { - r = (r).ApplyType(_1884_genTypeArgs); + if ((new BigInteger((_1889_typeArgs).Count)).Sign == 1) { + r = (r).ApplyType(_1893_genTypeArgs); } - r = (r).MSel(DCOMP.__default.escapeName(_1881_variant)); + r = (r).MSel(DCOMP.__default.escapeName(_1890_variant)); readIdents = Dafny.Set>.FromElements(); - Dafny.ISequence _1887_assignments; - _1887_assignments = Dafny.Sequence.FromElements(); - BigInteger _hi45 = new BigInteger((_1883_values).Count); - for (BigInteger _1888_i = BigInteger.Zero; _1888_i < _hi45; _1888_i++) { - _System._ITuple2, DAST._IExpression> _let_tmp_rhs67 = (_1883_values).Select(_1888_i); - Dafny.ISequence _1889_name = _let_tmp_rhs67.dtor__0; - DAST._IExpression _1890_value = _let_tmp_rhs67.dtor__1; - if (_1882_isCo) { - RAST._IExpr _1891_recursiveGen; - DCOMP._IOwnership _1892___v164; - Dafny.ISet> _1893_recIdents; + Dafny.ISequence _1896_assignments; + _1896_assignments = Dafny.Sequence.FromElements(); + BigInteger _hi46 = new BigInteger((_1892_values).Count); + for (BigInteger _1897_i = BigInteger.Zero; _1897_i < _hi46; _1897_i++) { + _System._ITuple2, DAST._IExpression> _let_tmp_rhs67 = (_1892_values).Select(_1897_i); + Dafny.ISequence _1898_name = _let_tmp_rhs67.dtor__0; + DAST._IExpression _1899_value = _let_tmp_rhs67.dtor__1; + if (_1891_isCo) { + RAST._IExpr _1900_recursiveGen; + DCOMP._IOwnership _1901___v164; + Dafny.ISet> _1902_recIdents; RAST._IExpr _out387; DCOMP._IOwnership _out388; Dafny.ISet> _out389; - (this).GenExpr(_1890_value, selfIdent, DCOMP.Environment.Empty(), DCOMP.Ownership.create_OwnershipOwned(), out _out387, out _out388, out _out389); - _1891_recursiveGen = _out387; - _1892___v164 = _out388; - _1893_recIdents = _out389; - readIdents = Dafny.Set>.Union(readIdents, _1893_recIdents); - Dafny.ISequence _1894_allReadCloned; - _1894_allReadCloned = Dafny.Sequence.UnicodeFromString(""); - while (!(_1893_recIdents).Equals(Dafny.Set>.FromElements())) { - Dafny.ISequence _1895_next; - foreach (Dafny.ISequence _assign_such_that_2 in (_1893_recIdents).Elements) { - _1895_next = (Dafny.ISequence)_assign_such_that_2; - if ((_1893_recIdents).Contains(_1895_next)) { + (this).GenExpr(_1899_value, selfIdent, DCOMP.Environment.Empty(), DCOMP.Ownership.create_OwnershipOwned(), out _out387, out _out388, out _out389); + _1900_recursiveGen = _out387; + _1901___v164 = _out388; + _1902_recIdents = _out389; + readIdents = Dafny.Set>.Union(readIdents, _1902_recIdents); + Dafny.ISequence _1903_allReadCloned; + _1903_allReadCloned = Dafny.Sequence.UnicodeFromString(""); + while (!(_1902_recIdents).Equals(Dafny.Set>.FromElements())) { + Dafny.ISequence _1904_next; + foreach (Dafny.ISequence _assign_such_that_2 in (_1902_recIdents).Elements) { + _1904_next = (Dafny.ISequence)_assign_such_that_2; + if ((_1902_recIdents).Contains(_1904_next)) { goto after__ASSIGN_SUCH_THAT_2; } } - throw new System.Exception("assign-such-that search produced no value (line 4402)"); + throw new System.Exception("assign-such-that search produced no value (line 4433)"); after__ASSIGN_SUCH_THAT_2: ; - _1894_allReadCloned = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1894_allReadCloned, Dafny.Sequence.UnicodeFromString("let ")), _1895_next), Dafny.Sequence.UnicodeFromString(" = ")), _1895_next), Dafny.Sequence.UnicodeFromString(".clone();\n")); - _1893_recIdents = Dafny.Set>.Difference(_1893_recIdents, Dafny.Set>.FromElements(_1895_next)); + _1903_allReadCloned = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1903_allReadCloned, Dafny.Sequence.UnicodeFromString("let ")), _1904_next), Dafny.Sequence.UnicodeFromString(" = ")), _1904_next), Dafny.Sequence.UnicodeFromString(".clone();\n")); + _1902_recIdents = Dafny.Set>.Difference(_1902_recIdents, Dafny.Set>.FromElements(_1904_next)); } - Dafny.ISequence _1896_wasAssigned; - _1896_wasAssigned = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::LazyFieldWrapper(::dafny_runtime::Lazy::new(::std::boxed::Box::new({\n"), _1894_allReadCloned), Dafny.Sequence.UnicodeFromString("move || (")), (_1891_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(")})))")); - _1887_assignments = Dafny.Sequence.Concat(_1887_assignments, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(DCOMP.__default.escapeIdent(_1889_name), RAST.Expr.create_RawExpr(_1896_wasAssigned)))); + Dafny.ISequence _1905_wasAssigned; + _1905_wasAssigned = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::dafny_runtime::LazyFieldWrapper(::dafny_runtime::Lazy::new(::std::boxed::Box::new({\n"), _1903_allReadCloned), Dafny.Sequence.UnicodeFromString("move || (")), (_1900_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(")})))")); + _1896_assignments = Dafny.Sequence.Concat(_1896_assignments, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(DCOMP.__default.escapeIdent(_1898_name), RAST.Expr.create_RawExpr(_1905_wasAssigned)))); } else { - RAST._IExpr _1897_recursiveGen; - DCOMP._IOwnership _1898___v165; - Dafny.ISet> _1899_recIdents; + RAST._IExpr _1906_recursiveGen; + DCOMP._IOwnership _1907___v165; + Dafny.ISet> _1908_recIdents; RAST._IExpr _out390; DCOMP._IOwnership _out391; Dafny.ISet> _out392; - (this).GenExpr(_1890_value, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out390, out _out391, out _out392); - _1897_recursiveGen = _out390; - _1898___v165 = _out391; - _1899_recIdents = _out392; - _1887_assignments = Dafny.Sequence.Concat(_1887_assignments, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(DCOMP.__default.escapeIdent(_1889_name), _1897_recursiveGen))); - readIdents = Dafny.Set>.Union(readIdents, _1899_recIdents); + (this).GenExpr(_1899_value, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out390, out _out391, out _out392); + _1906_recursiveGen = _out390; + _1907___v165 = _out391; + _1908_recIdents = _out392; + _1896_assignments = Dafny.Sequence.Concat(_1896_assignments, Dafny.Sequence.FromElements(RAST.AssignIdentifier.create(DCOMP.__default.escapeIdent(_1898_name), _1906_recursiveGen))); + readIdents = Dafny.Set>.Union(readIdents, _1908_recIdents); } } - r = RAST.Expr.create_StructBuild(r, _1887_assignments); - if ((this).IsRcWrapped((_1879_datatypeType).dtor_attributes)) { + r = RAST.Expr.create_StructBuild(r, _1896_assignments); + if ((this).IsRcWrapped((_1888_datatypeType).dtor_attributes)) { r = RAST.__default.RcNew(r); } RAST._IExpr _out393; @@ -5344,11 +5375,11 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out394; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_Convert) { + if (_source97.is_Convert) { { RAST._IExpr _out395; DCOMP._IOwnership _out396; @@ -5358,36 +5389,36 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out396; readIdents = _out397; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_SeqConstruct) { - DAST._IExpression _1900_length = _source96.dtor_length; - DAST._IExpression _1901_expr = _source96.dtor_elem; + if (_source97.is_SeqConstruct) { + DAST._IExpression _1909_length = _source97.dtor_length; + DAST._IExpression _1910_expr = _source97.dtor_elem; { - RAST._IExpr _1902_recursiveGen; - DCOMP._IOwnership _1903___v169; - Dafny.ISet> _1904_recIdents; + RAST._IExpr _1911_recursiveGen; + DCOMP._IOwnership _1912___v169; + Dafny.ISet> _1913_recIdents; RAST._IExpr _out398; DCOMP._IOwnership _out399; Dafny.ISet> _out400; - (this).GenExpr(_1901_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out398, out _out399, out _out400); - _1902_recursiveGen = _out398; - _1903___v169 = _out399; - _1904_recIdents = _out400; - RAST._IExpr _1905_lengthGen; - DCOMP._IOwnership _1906___v170; - Dafny.ISet> _1907_lengthIdents; + (this).GenExpr(_1910_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out398, out _out399, out _out400); + _1911_recursiveGen = _out398; + _1912___v169 = _out399; + _1913_recIdents = _out400; + RAST._IExpr _1914_lengthGen; + DCOMP._IOwnership _1915___v170; + Dafny.ISet> _1916_lengthIdents; RAST._IExpr _out401; DCOMP._IOwnership _out402; Dafny.ISet> _out403; - (this).GenExpr(_1900_length, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out401, out _out402, out _out403); - _1905_lengthGen = _out401; - _1906___v170 = _out402; - _1907_lengthIdents = _out403; - r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("{\nlet _initializer = "), (_1902_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(";\n::dafny_runtime::integer_range(::dafny_runtime::Zero::zero(), ")), (_1905_lengthGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(").map(|i| _initializer(&i)).collect::<::dafny_runtime::Sequence<_>>()\n}"))); - readIdents = Dafny.Set>.Union(_1904_recIdents, _1907_lengthIdents); + (this).GenExpr(_1909_length, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out401, out _out402, out _out403); + _1914_lengthGen = _out401; + _1915___v170 = _out402; + _1916_lengthIdents = _out403; + r = RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("{\nlet _initializer = "), (_1911_recursiveGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(";\n::dafny_runtime::integer_range(::dafny_runtime::Zero::zero(), ")), (_1914_lengthGen)._ToString(DCOMP.__default.IND)), Dafny.Sequence.UnicodeFromString(").map(|i| _initializer(&i)).collect::<::dafny_runtime::Sequence<_>>()\n}"))); + readIdents = Dafny.Set>.Union(_1913_recIdents, _1916_lengthIdents); RAST._IExpr _out404; DCOMP._IOwnership _out405; (this).FromOwned(r, expectedOwnership, out _out404, out _out405); @@ -5395,41 +5426,41 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out405; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_SeqValue) { - Dafny.ISequence _1908_exprs = _source96.dtor_elements; - DAST._IType _1909_typ = _source96.dtor_typ; + if (_source97.is_SeqValue) { + Dafny.ISequence _1917_exprs = _source97.dtor_elements; + DAST._IType _1918_typ = _source97.dtor_typ; { readIdents = Dafny.Set>.FromElements(); - RAST._IType _1910_genTpe; + RAST._IType _1919_genTpe; RAST._IType _out406; - _out406 = (this).GenType(_1909_typ, DCOMP.GenTypeContext.@default()); - _1910_genTpe = _out406; - BigInteger _1911_i; - _1911_i = BigInteger.Zero; - Dafny.ISequence _1912_args; - _1912_args = Dafny.Sequence.FromElements(); - while ((_1911_i) < (new BigInteger((_1908_exprs).Count))) { - RAST._IExpr _1913_recursiveGen; - DCOMP._IOwnership _1914___v171; - Dafny.ISet> _1915_recIdents; + _out406 = (this).GenType(_1918_typ, DCOMP.GenTypeContext.@default()); + _1919_genTpe = _out406; + BigInteger _1920_i; + _1920_i = BigInteger.Zero; + Dafny.ISequence _1921_args; + _1921_args = Dafny.Sequence.FromElements(); + while ((_1920_i) < (new BigInteger((_1917_exprs).Count))) { + RAST._IExpr _1922_recursiveGen; + DCOMP._IOwnership _1923___v171; + Dafny.ISet> _1924_recIdents; RAST._IExpr _out407; DCOMP._IOwnership _out408; Dafny.ISet> _out409; - (this).GenExpr((_1908_exprs).Select(_1911_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out407, out _out408, out _out409); - _1913_recursiveGen = _out407; - _1914___v171 = _out408; - _1915_recIdents = _out409; - readIdents = Dafny.Set>.Union(readIdents, _1915_recIdents); - _1912_args = Dafny.Sequence.Concat(_1912_args, Dafny.Sequence.FromElements(_1913_recursiveGen)); - _1911_i = (_1911_i) + (BigInteger.One); + (this).GenExpr((_1917_exprs).Select(_1920_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out407, out _out408, out _out409); + _1922_recursiveGen = _out407; + _1923___v171 = _out408; + _1924_recIdents = _out409; + readIdents = Dafny.Set>.Union(readIdents, _1924_recIdents); + _1921_args = Dafny.Sequence.Concat(_1921_args, Dafny.Sequence.FromElements(_1922_recursiveGen)); + _1920_i = (_1920_i) + (BigInteger.One); } - r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("seq!"))).Apply(_1912_args); - if ((new BigInteger((_1912_args).Count)).Sign == 0) { - r = RAST.Expr.create_TypeAscription(r, ((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("Sequence"))).Apply1(_1910_genTpe)); + r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("seq!"))).Apply(_1921_args); + if ((new BigInteger((_1921_args).Count)).Sign == 0) { + r = RAST.Expr.create_TypeAscription(r, ((RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("Sequence"))).Apply1(_1919_genTpe)); } RAST._IExpr _out410; DCOMP._IOwnership _out411; @@ -5438,34 +5469,34 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out411; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_SetValue) { - Dafny.ISequence _1916_exprs = _source96.dtor_elements; + if (_source97.is_SetValue) { + Dafny.ISequence _1925_exprs = _source97.dtor_elements; { - Dafny.ISequence _1917_generatedValues; - _1917_generatedValues = Dafny.Sequence.FromElements(); + Dafny.ISequence _1926_generatedValues; + _1926_generatedValues = Dafny.Sequence.FromElements(); readIdents = Dafny.Set>.FromElements(); - BigInteger _1918_i; - _1918_i = BigInteger.Zero; - while ((_1918_i) < (new BigInteger((_1916_exprs).Count))) { - RAST._IExpr _1919_recursiveGen; - DCOMP._IOwnership _1920___v172; - Dafny.ISet> _1921_recIdents; + BigInteger _1927_i; + _1927_i = BigInteger.Zero; + while ((_1927_i) < (new BigInteger((_1925_exprs).Count))) { + RAST._IExpr _1928_recursiveGen; + DCOMP._IOwnership _1929___v172; + Dafny.ISet> _1930_recIdents; RAST._IExpr _out412; DCOMP._IOwnership _out413; Dafny.ISet> _out414; - (this).GenExpr((_1916_exprs).Select(_1918_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out412, out _out413, out _out414); - _1919_recursiveGen = _out412; - _1920___v172 = _out413; - _1921_recIdents = _out414; - _1917_generatedValues = Dafny.Sequence.Concat(_1917_generatedValues, Dafny.Sequence.FromElements(_1919_recursiveGen)); - readIdents = Dafny.Set>.Union(readIdents, _1921_recIdents); - _1918_i = (_1918_i) + (BigInteger.One); + (this).GenExpr((_1925_exprs).Select(_1927_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out412, out _out413, out _out414); + _1928_recursiveGen = _out412; + _1929___v172 = _out413; + _1930_recIdents = _out414; + _1926_generatedValues = Dafny.Sequence.Concat(_1926_generatedValues, Dafny.Sequence.FromElements(_1928_recursiveGen)); + readIdents = Dafny.Set>.Union(readIdents, _1930_recIdents); + _1927_i = (_1927_i) + (BigInteger.One); } - r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("set!"))).Apply(_1917_generatedValues); + r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("set!"))).Apply(_1926_generatedValues); RAST._IExpr _out415; DCOMP._IOwnership _out416; (this).FromOwned(r, expectedOwnership, out _out415, out _out416); @@ -5473,34 +5504,34 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out416; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_MultisetValue) { - Dafny.ISequence _1922_exprs = _source96.dtor_elements; + if (_source97.is_MultisetValue) { + Dafny.ISequence _1931_exprs = _source97.dtor_elements; { - Dafny.ISequence _1923_generatedValues; - _1923_generatedValues = Dafny.Sequence.FromElements(); + Dafny.ISequence _1932_generatedValues; + _1932_generatedValues = Dafny.Sequence.FromElements(); readIdents = Dafny.Set>.FromElements(); - BigInteger _1924_i; - _1924_i = BigInteger.Zero; - while ((_1924_i) < (new BigInteger((_1922_exprs).Count))) { - RAST._IExpr _1925_recursiveGen; - DCOMP._IOwnership _1926___v173; - Dafny.ISet> _1927_recIdents; + BigInteger _1933_i; + _1933_i = BigInteger.Zero; + while ((_1933_i) < (new BigInteger((_1931_exprs).Count))) { + RAST._IExpr _1934_recursiveGen; + DCOMP._IOwnership _1935___v173; + Dafny.ISet> _1936_recIdents; RAST._IExpr _out417; DCOMP._IOwnership _out418; Dafny.ISet> _out419; - (this).GenExpr((_1922_exprs).Select(_1924_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out417, out _out418, out _out419); - _1925_recursiveGen = _out417; - _1926___v173 = _out418; - _1927_recIdents = _out419; - _1923_generatedValues = Dafny.Sequence.Concat(_1923_generatedValues, Dafny.Sequence.FromElements(_1925_recursiveGen)); - readIdents = Dafny.Set>.Union(readIdents, _1927_recIdents); - _1924_i = (_1924_i) + (BigInteger.One); + (this).GenExpr((_1931_exprs).Select(_1933_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out417, out _out418, out _out419); + _1934_recursiveGen = _out417; + _1935___v173 = _out418; + _1936_recIdents = _out419; + _1932_generatedValues = Dafny.Sequence.Concat(_1932_generatedValues, Dafny.Sequence.FromElements(_1934_recursiveGen)); + readIdents = Dafny.Set>.Union(readIdents, _1936_recIdents); + _1933_i = (_1933_i) + (BigInteger.One); } - r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("multiset!"))).Apply(_1923_generatedValues); + r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("multiset!"))).Apply(_1932_generatedValues); RAST._IExpr _out420; DCOMP._IOwnership _out421; (this).FromOwned(r, expectedOwnership, out _out420, out _out421); @@ -5508,25 +5539,25 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out421; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_ToMultiset) { - DAST._IExpression _1928_expr = _source96.dtor_ToMultiset_a0; + if (_source97.is_ToMultiset) { + DAST._IExpression _1937_expr = _source97.dtor_ToMultiset_a0; { - RAST._IExpr _1929_recursiveGen; - DCOMP._IOwnership _1930___v174; - Dafny.ISet> _1931_recIdents; + RAST._IExpr _1938_recursiveGen; + DCOMP._IOwnership _1939___v174; + Dafny.ISet> _1940_recIdents; RAST._IExpr _out422; DCOMP._IOwnership _out423; Dafny.ISet> _out424; - (this).GenExpr(_1928_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out422, out _out423, out _out424); - _1929_recursiveGen = _out422; - _1930___v174 = _out423; - _1931_recIdents = _out424; - r = ((_1929_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("as_dafny_multiset"))).Apply(Dafny.Sequence.FromElements()); - readIdents = _1931_recIdents; + (this).GenExpr(_1937_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out422, out _out423, out _out424); + _1938_recursiveGen = _out422; + _1939___v174 = _out423; + _1940_recIdents = _out424; + r = ((_1938_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("as_dafny_multiset"))).Apply(Dafny.Sequence.FromElements()); + readIdents = _1940_recIdents; RAST._IExpr _out425; DCOMP._IOwnership _out426; (this).FromOwned(r, expectedOwnership, out _out425, out _out426); @@ -5534,55 +5565,55 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out426; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_MapValue) { - Dafny.ISequence<_System._ITuple2> _1932_mapElems = _source96.dtor_mapElems; + if (_source97.is_MapValue) { + Dafny.ISequence<_System._ITuple2> _1941_mapElems = _source97.dtor_mapElems; { - Dafny.ISequence<_System._ITuple2> _1933_generatedValues; - _1933_generatedValues = Dafny.Sequence<_System._ITuple2>.FromElements(); + Dafny.ISequence<_System._ITuple2> _1942_generatedValues; + _1942_generatedValues = Dafny.Sequence<_System._ITuple2>.FromElements(); readIdents = Dafny.Set>.FromElements(); - BigInteger _1934_i; - _1934_i = BigInteger.Zero; - while ((_1934_i) < (new BigInteger((_1932_mapElems).Count))) { - RAST._IExpr _1935_recursiveGenKey; - DCOMP._IOwnership _1936___v175; - Dafny.ISet> _1937_recIdentsKey; + BigInteger _1943_i; + _1943_i = BigInteger.Zero; + while ((_1943_i) < (new BigInteger((_1941_mapElems).Count))) { + RAST._IExpr _1944_recursiveGenKey; + DCOMP._IOwnership _1945___v175; + Dafny.ISet> _1946_recIdentsKey; RAST._IExpr _out427; DCOMP._IOwnership _out428; Dafny.ISet> _out429; - (this).GenExpr(((_1932_mapElems).Select(_1934_i)).dtor__0, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out427, out _out428, out _out429); - _1935_recursiveGenKey = _out427; - _1936___v175 = _out428; - _1937_recIdentsKey = _out429; - RAST._IExpr _1938_recursiveGenValue; - DCOMP._IOwnership _1939___v176; - Dafny.ISet> _1940_recIdentsValue; + (this).GenExpr(((_1941_mapElems).Select(_1943_i)).dtor__0, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out427, out _out428, out _out429); + _1944_recursiveGenKey = _out427; + _1945___v175 = _out428; + _1946_recIdentsKey = _out429; + RAST._IExpr _1947_recursiveGenValue; + DCOMP._IOwnership _1948___v176; + Dafny.ISet> _1949_recIdentsValue; RAST._IExpr _out430; DCOMP._IOwnership _out431; Dafny.ISet> _out432; - (this).GenExpr(((_1932_mapElems).Select(_1934_i)).dtor__1, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out430, out _out431, out _out432); - _1938_recursiveGenValue = _out430; - _1939___v176 = _out431; - _1940_recIdentsValue = _out432; - _1933_generatedValues = Dafny.Sequence<_System._ITuple2>.Concat(_1933_generatedValues, Dafny.Sequence<_System._ITuple2>.FromElements(_System.Tuple2.create(_1935_recursiveGenKey, _1938_recursiveGenValue))); - readIdents = Dafny.Set>.Union(Dafny.Set>.Union(readIdents, _1937_recIdentsKey), _1940_recIdentsValue); - _1934_i = (_1934_i) + (BigInteger.One); + (this).GenExpr(((_1941_mapElems).Select(_1943_i)).dtor__1, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out430, out _out431, out _out432); + _1947_recursiveGenValue = _out430; + _1948___v176 = _out431; + _1949_recIdentsValue = _out432; + _1942_generatedValues = Dafny.Sequence<_System._ITuple2>.Concat(_1942_generatedValues, Dafny.Sequence<_System._ITuple2>.FromElements(_System.Tuple2.create(_1944_recursiveGenKey, _1947_recursiveGenValue))); + readIdents = Dafny.Set>.Union(Dafny.Set>.Union(readIdents, _1946_recIdentsKey), _1949_recIdentsValue); + _1943_i = (_1943_i) + (BigInteger.One); } - _1934_i = BigInteger.Zero; - Dafny.ISequence _1941_arguments; - _1941_arguments = Dafny.Sequence.FromElements(); - while ((_1934_i) < (new BigInteger((_1933_generatedValues).Count))) { - RAST._IExpr _1942_genKey; - _1942_genKey = ((_1933_generatedValues).Select(_1934_i)).dtor__0; - RAST._IExpr _1943_genValue; - _1943_genValue = ((_1933_generatedValues).Select(_1934_i)).dtor__1; - _1941_arguments = Dafny.Sequence.Concat(_1941_arguments, Dafny.Sequence.FromElements(RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=>"), _1942_genKey, _1943_genValue, DAST.Format.BinaryOpFormat.create_NoFormat()))); - _1934_i = (_1934_i) + (BigInteger.One); + _1943_i = BigInteger.Zero; + Dafny.ISequence _1950_arguments; + _1950_arguments = Dafny.Sequence.FromElements(); + while ((_1943_i) < (new BigInteger((_1942_generatedValues).Count))) { + RAST._IExpr _1951_genKey; + _1951_genKey = ((_1942_generatedValues).Select(_1943_i)).dtor__0; + RAST._IExpr _1952_genValue; + _1952_genValue = ((_1942_generatedValues).Select(_1943_i)).dtor__1; + _1950_arguments = Dafny.Sequence.Concat(_1950_arguments, Dafny.Sequence.FromElements(RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("=>"), _1951_genKey, _1952_genValue, DAST.Format.BinaryOpFormat.create_NoFormat()))); + _1943_i = (_1943_i) + (BigInteger.One); } - r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("map!"))).Apply(_1941_arguments); + r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("map!"))).Apply(_1950_arguments); RAST._IExpr _out433; DCOMP._IOwnership _out434; (this).FromOwned(r, expectedOwnership, out _out433, out _out434); @@ -5590,127 +5621,127 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out434; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_SeqUpdate) { - DAST._IExpression _1944_expr = _source96.dtor_expr; - DAST._IExpression _1945_index = _source96.dtor_indexExpr; - DAST._IExpression _1946_value = _source96.dtor_value; + if (_source97.is_SeqUpdate) { + DAST._IExpression _1953_expr = _source97.dtor_expr; + DAST._IExpression _1954_index = _source97.dtor_indexExpr; + DAST._IExpression _1955_value = _source97.dtor_value; { - RAST._IExpr _1947_exprR; - DCOMP._IOwnership _1948___v177; - Dafny.ISet> _1949_exprIdents; + RAST._IExpr _1956_exprR; + DCOMP._IOwnership _1957___v177; + Dafny.ISet> _1958_exprIdents; RAST._IExpr _out435; DCOMP._IOwnership _out436; Dafny.ISet> _out437; - (this).GenExpr(_1944_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out435, out _out436, out _out437); - _1947_exprR = _out435; - _1948___v177 = _out436; - _1949_exprIdents = _out437; - RAST._IExpr _1950_indexR; - DCOMP._IOwnership _1951_indexOwnership; - Dafny.ISet> _1952_indexIdents; + (this).GenExpr(_1953_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out435, out _out436, out _out437); + _1956_exprR = _out435; + _1957___v177 = _out436; + _1958_exprIdents = _out437; + RAST._IExpr _1959_indexR; + DCOMP._IOwnership _1960_indexOwnership; + Dafny.ISet> _1961_indexIdents; RAST._IExpr _out438; DCOMP._IOwnership _out439; Dafny.ISet> _out440; - (this).GenExpr(_1945_index, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out438, out _out439, out _out440); - _1950_indexR = _out438; - _1951_indexOwnership = _out439; - _1952_indexIdents = _out440; - RAST._IExpr _1953_valueR; - DCOMP._IOwnership _1954_valueOwnership; - Dafny.ISet> _1955_valueIdents; + (this).GenExpr(_1954_index, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out438, out _out439, out _out440); + _1959_indexR = _out438; + _1960_indexOwnership = _out439; + _1961_indexIdents = _out440; + RAST._IExpr _1962_valueR; + DCOMP._IOwnership _1963_valueOwnership; + Dafny.ISet> _1964_valueIdents; RAST._IExpr _out441; DCOMP._IOwnership _out442; Dafny.ISet> _out443; - (this).GenExpr(_1946_value, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out441, out _out442, out _out443); - _1953_valueR = _out441; - _1954_valueOwnership = _out442; - _1955_valueIdents = _out443; - r = ((_1947_exprR).Sel(Dafny.Sequence.UnicodeFromString("update_index"))).Apply(Dafny.Sequence.FromElements(_1950_indexR, _1953_valueR)); + (this).GenExpr(_1955_value, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out441, out _out442, out _out443); + _1962_valueR = _out441; + _1963_valueOwnership = _out442; + _1964_valueIdents = _out443; + r = ((_1956_exprR).Sel(Dafny.Sequence.UnicodeFromString("update_index"))).Apply(Dafny.Sequence.FromElements(_1959_indexR, _1962_valueR)); RAST._IExpr _out444; DCOMP._IOwnership _out445; (this).FromOwned(r, expectedOwnership, out _out444, out _out445); r = _out444; resultingOwnership = _out445; - readIdents = Dafny.Set>.Union(Dafny.Set>.Union(_1949_exprIdents, _1952_indexIdents), _1955_valueIdents); + readIdents = Dafny.Set>.Union(Dafny.Set>.Union(_1958_exprIdents, _1961_indexIdents), _1964_valueIdents); return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_MapUpdate) { - DAST._IExpression _1956_expr = _source96.dtor_expr; - DAST._IExpression _1957_index = _source96.dtor_indexExpr; - DAST._IExpression _1958_value = _source96.dtor_value; + if (_source97.is_MapUpdate) { + DAST._IExpression _1965_expr = _source97.dtor_expr; + DAST._IExpression _1966_index = _source97.dtor_indexExpr; + DAST._IExpression _1967_value = _source97.dtor_value; { - RAST._IExpr _1959_exprR; - DCOMP._IOwnership _1960___v178; - Dafny.ISet> _1961_exprIdents; + RAST._IExpr _1968_exprR; + DCOMP._IOwnership _1969___v178; + Dafny.ISet> _1970_exprIdents; RAST._IExpr _out446; DCOMP._IOwnership _out447; Dafny.ISet> _out448; - (this).GenExpr(_1956_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out446, out _out447, out _out448); - _1959_exprR = _out446; - _1960___v178 = _out447; - _1961_exprIdents = _out448; - RAST._IExpr _1962_indexR; - DCOMP._IOwnership _1963_indexOwnership; - Dafny.ISet> _1964_indexIdents; + (this).GenExpr(_1965_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out446, out _out447, out _out448); + _1968_exprR = _out446; + _1969___v178 = _out447; + _1970_exprIdents = _out448; + RAST._IExpr _1971_indexR; + DCOMP._IOwnership _1972_indexOwnership; + Dafny.ISet> _1973_indexIdents; RAST._IExpr _out449; DCOMP._IOwnership _out450; Dafny.ISet> _out451; - (this).GenExpr(_1957_index, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out449, out _out450, out _out451); - _1962_indexR = _out449; - _1963_indexOwnership = _out450; - _1964_indexIdents = _out451; - RAST._IExpr _1965_valueR; - DCOMP._IOwnership _1966_valueOwnership; - Dafny.ISet> _1967_valueIdents; + (this).GenExpr(_1966_index, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out449, out _out450, out _out451); + _1971_indexR = _out449; + _1972_indexOwnership = _out450; + _1973_indexIdents = _out451; + RAST._IExpr _1974_valueR; + DCOMP._IOwnership _1975_valueOwnership; + Dafny.ISet> _1976_valueIdents; RAST._IExpr _out452; DCOMP._IOwnership _out453; Dafny.ISet> _out454; - (this).GenExpr(_1958_value, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out452, out _out453, out _out454); - _1965_valueR = _out452; - _1966_valueOwnership = _out453; - _1967_valueIdents = _out454; - r = ((_1959_exprR).Sel(Dafny.Sequence.UnicodeFromString("update_index"))).Apply(Dafny.Sequence.FromElements(_1962_indexR, _1965_valueR)); + (this).GenExpr(_1967_value, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out452, out _out453, out _out454); + _1974_valueR = _out452; + _1975_valueOwnership = _out453; + _1976_valueIdents = _out454; + r = ((_1968_exprR).Sel(Dafny.Sequence.UnicodeFromString("update_index"))).Apply(Dafny.Sequence.FromElements(_1971_indexR, _1974_valueR)); RAST._IExpr _out455; DCOMP._IOwnership _out456; (this).FromOwned(r, expectedOwnership, out _out455, out _out456); r = _out455; resultingOwnership = _out456; - readIdents = Dafny.Set>.Union(Dafny.Set>.Union(_1961_exprIdents, _1964_indexIdents), _1967_valueIdents); + readIdents = Dafny.Set>.Union(Dafny.Set>.Union(_1970_exprIdents, _1973_indexIdents), _1976_valueIdents); return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_This) { + if (_source97.is_This) { { - DCOMP._ISelfInfo _source97 = selfIdent; + DCOMP._ISelfInfo _source98 = selfIdent; { - if (_source97.is_ThisTyped) { - Dafny.ISequence _1968_id = _source97.dtor_rSelfName; - DAST._IType _1969_dafnyType = _source97.dtor_dafnyType; + if (_source98.is_ThisTyped) { + Dafny.ISequence _1977_id = _source98.dtor_rSelfName; + DAST._IType _1978_dafnyType = _source98.dtor_dafnyType; { RAST._IExpr _out457; DCOMP._IOwnership _out458; Dafny.ISet> _out459; - (this).GenIdent(_1968_id, selfIdent, env, expectedOwnership, out _out457, out _out458, out _out459); + (this).GenIdent(_1977_id, selfIdent, env, expectedOwnership, out _out457, out _out458, out _out459); r = _out457; resultingOwnership = _out458; readIdents = _out459; } - goto after_match42; + goto after_match43; } } { - DCOMP._ISelfInfo _1970_None = _source97; + DCOMP._ISelfInfo _1979_None = _source98; { r = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("panic!(\"this outside of a method\")")); RAST._IExpr _out460; @@ -5721,152 +5752,152 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv readIdents = Dafny.Set>.FromElements(); } } - after_match42: ; + after_match43: ; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_Ite) { - DAST._IExpression _1971_cond = _source96.dtor_cond; - DAST._IExpression _1972_t = _source96.dtor_thn; - DAST._IExpression _1973_f = _source96.dtor_els; + if (_source97.is_Ite) { + DAST._IExpression _1980_cond = _source97.dtor_cond; + DAST._IExpression _1981_t = _source97.dtor_thn; + DAST._IExpression _1982_f = _source97.dtor_els; { - RAST._IExpr _1974_cond; - DCOMP._IOwnership _1975___v179; - Dafny.ISet> _1976_recIdentsCond; + RAST._IExpr _1983_cond; + DCOMP._IOwnership _1984___v179; + Dafny.ISet> _1985_recIdentsCond; RAST._IExpr _out462; DCOMP._IOwnership _out463; Dafny.ISet> _out464; - (this).GenExpr(_1971_cond, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out462, out _out463, out _out464); - _1974_cond = _out462; - _1975___v179 = _out463; - _1976_recIdentsCond = _out464; - RAST._IExpr _1977_fExpr; - DCOMP._IOwnership _1978_fOwned; - Dafny.ISet> _1979_recIdentsF; + (this).GenExpr(_1980_cond, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out462, out _out463, out _out464); + _1983_cond = _out462; + _1984___v179 = _out463; + _1985_recIdentsCond = _out464; + RAST._IExpr _1986_fExpr; + DCOMP._IOwnership _1987_fOwned; + Dafny.ISet> _1988_recIdentsF; RAST._IExpr _out465; DCOMP._IOwnership _out466; Dafny.ISet> _out467; - (this).GenExpr(_1973_f, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out465, out _out466, out _out467); - _1977_fExpr = _out465; - _1978_fOwned = _out466; - _1979_recIdentsF = _out467; - RAST._IExpr _1980_tExpr; - DCOMP._IOwnership _1981___v180; - Dafny.ISet> _1982_recIdentsT; + (this).GenExpr(_1982_f, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out465, out _out466, out _out467); + _1986_fExpr = _out465; + _1987_fOwned = _out466; + _1988_recIdentsF = _out467; + RAST._IExpr _1989_tExpr; + DCOMP._IOwnership _1990___v180; + Dafny.ISet> _1991_recIdentsT; RAST._IExpr _out468; DCOMP._IOwnership _out469; Dafny.ISet> _out470; - (this).GenExpr(_1972_t, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out468, out _out469, out _out470); - _1980_tExpr = _out468; - _1981___v180 = _out469; - _1982_recIdentsT = _out470; - r = RAST.Expr.create_IfExpr(_1974_cond, _1980_tExpr, _1977_fExpr); + (this).GenExpr(_1981_t, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out468, out _out469, out _out470); + _1989_tExpr = _out468; + _1990___v180 = _out469; + _1991_recIdentsT = _out470; + r = RAST.Expr.create_IfExpr(_1983_cond, _1989_tExpr, _1986_fExpr); RAST._IExpr _out471; DCOMP._IOwnership _out472; (this).FromOwnership(r, DCOMP.Ownership.create_OwnershipOwned(), expectedOwnership, out _out471, out _out472); r = _out471; resultingOwnership = _out472; - readIdents = Dafny.Set>.Union(Dafny.Set>.Union(_1976_recIdentsCond, _1982_recIdentsT), _1979_recIdentsF); + readIdents = Dafny.Set>.Union(Dafny.Set>.Union(_1985_recIdentsCond, _1991_recIdentsT), _1988_recIdentsF); return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_UnOp) { - DAST._IUnaryOp unOp0 = _source96.dtor_unOp; + if (_source97.is_UnOp) { + DAST._IUnaryOp unOp0 = _source97.dtor_unOp; if (unOp0.is_Not) { - DAST._IExpression _1983_e = _source96.dtor_expr; - DAST.Format._IUnaryOpFormat _1984_format = _source96.dtor_format1; + DAST._IExpression _1992_e = _source97.dtor_expr; + DAST.Format._IUnaryOpFormat _1993_format = _source97.dtor_format1; { - RAST._IExpr _1985_recursiveGen; - DCOMP._IOwnership _1986___v181; - Dafny.ISet> _1987_recIdents; + RAST._IExpr _1994_recursiveGen; + DCOMP._IOwnership _1995___v181; + Dafny.ISet> _1996_recIdents; RAST._IExpr _out473; DCOMP._IOwnership _out474; Dafny.ISet> _out475; - (this).GenExpr(_1983_e, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out473, out _out474, out _out475); - _1985_recursiveGen = _out473; - _1986___v181 = _out474; - _1987_recIdents = _out475; - r = RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!"), _1985_recursiveGen, _1984_format); + (this).GenExpr(_1992_e, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out473, out _out474, out _out475); + _1994_recursiveGen = _out473; + _1995___v181 = _out474; + _1996_recIdents = _out475; + r = RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("!"), _1994_recursiveGen, _1993_format); RAST._IExpr _out476; DCOMP._IOwnership _out477; (this).FromOwned(r, expectedOwnership, out _out476, out _out477); r = _out476; resultingOwnership = _out477; - readIdents = _1987_recIdents; + readIdents = _1996_recIdents; return ; } - goto after_match41; + goto after_match42; } } } { - if (_source96.is_UnOp) { - DAST._IUnaryOp unOp1 = _source96.dtor_unOp; + if (_source97.is_UnOp) { + DAST._IUnaryOp unOp1 = _source97.dtor_unOp; if (unOp1.is_BitwiseNot) { - DAST._IExpression _1988_e = _source96.dtor_expr; - DAST.Format._IUnaryOpFormat _1989_format = _source96.dtor_format1; + DAST._IExpression _1997_e = _source97.dtor_expr; + DAST.Format._IUnaryOpFormat _1998_format = _source97.dtor_format1; { - RAST._IExpr _1990_recursiveGen; - DCOMP._IOwnership _1991___v182; - Dafny.ISet> _1992_recIdents; + RAST._IExpr _1999_recursiveGen; + DCOMP._IOwnership _2000___v182; + Dafny.ISet> _2001_recIdents; RAST._IExpr _out478; DCOMP._IOwnership _out479; Dafny.ISet> _out480; - (this).GenExpr(_1988_e, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out478, out _out479, out _out480); - _1990_recursiveGen = _out478; - _1991___v182 = _out479; - _1992_recIdents = _out480; - r = RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("~"), _1990_recursiveGen, _1989_format); + (this).GenExpr(_1997_e, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out478, out _out479, out _out480); + _1999_recursiveGen = _out478; + _2000___v182 = _out479; + _2001_recIdents = _out480; + r = RAST.Expr.create_UnaryOp(Dafny.Sequence.UnicodeFromString("~"), _1999_recursiveGen, _1998_format); RAST._IExpr _out481; DCOMP._IOwnership _out482; (this).FromOwned(r, expectedOwnership, out _out481, out _out482); r = _out481; resultingOwnership = _out482; - readIdents = _1992_recIdents; + readIdents = _2001_recIdents; return ; } - goto after_match41; + goto after_match42; } } } { - if (_source96.is_UnOp) { - DAST._IUnaryOp unOp2 = _source96.dtor_unOp; + if (_source97.is_UnOp) { + DAST._IUnaryOp unOp2 = _source97.dtor_unOp; if (unOp2.is_Cardinality) { - DAST._IExpression _1993_e = _source96.dtor_expr; - DAST.Format._IUnaryOpFormat _1994_format = _source96.dtor_format1; + DAST._IExpression _2002_e = _source97.dtor_expr; + DAST.Format._IUnaryOpFormat _2003_format = _source97.dtor_format1; { - RAST._IExpr _1995_recursiveGen; - DCOMP._IOwnership _1996_recOwned; - Dafny.ISet> _1997_recIdents; + RAST._IExpr _2004_recursiveGen; + DCOMP._IOwnership _2005_recOwned; + Dafny.ISet> _2006_recIdents; RAST._IExpr _out483; DCOMP._IOwnership _out484; Dafny.ISet> _out485; - (this).GenExpr(_1993_e, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out483, out _out484, out _out485); - _1995_recursiveGen = _out483; - _1996_recOwned = _out484; - _1997_recIdents = _out485; - r = ((_1995_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("cardinality"))).Apply(Dafny.Sequence.FromElements()); + (this).GenExpr(_2002_e, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out483, out _out484, out _out485); + _2004_recursiveGen = _out483; + _2005_recOwned = _out484; + _2006_recIdents = _out485; + r = ((_2004_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("cardinality"))).Apply(Dafny.Sequence.FromElements()); RAST._IExpr _out486; DCOMP._IOwnership _out487; (this).FromOwned(r, expectedOwnership, out _out486, out _out487); r = _out486; resultingOwnership = _out487; - readIdents = _1997_recIdents; + readIdents = _2006_recIdents; return ; } - goto after_match41; + goto after_match42; } } } { - if (_source96.is_BinOp) { + if (_source97.is_BinOp) { RAST._IExpr _out488; DCOMP._IOwnership _out489; Dafny.ISet> _out490; @@ -5874,48 +5905,48 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv r = _out488; resultingOwnership = _out489; readIdents = _out490; - goto after_match41; + goto after_match42; } } { - if (_source96.is_ArrayLen) { - DAST._IExpression _1998_expr = _source96.dtor_expr; - DAST._IType _1999_exprType = _source96.dtor_exprType; - BigInteger _2000_dim = _source96.dtor_dim; - bool _2001_native = _source96.dtor_native; + if (_source97.is_ArrayLen) { + DAST._IExpression _2007_expr = _source97.dtor_expr; + DAST._IType _2008_exprType = _source97.dtor_exprType; + BigInteger _2009_dim = _source97.dtor_dim; + bool _2010_native = _source97.dtor_native; { - RAST._IExpr _2002_recursiveGen; - DCOMP._IOwnership _2003___v187; - Dafny.ISet> _2004_recIdents; + RAST._IExpr _2011_recursiveGen; + DCOMP._IOwnership _2012___v187; + Dafny.ISet> _2013_recIdents; RAST._IExpr _out491; DCOMP._IOwnership _out492; Dafny.ISet> _out493; - (this).GenExpr(_1998_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out491, out _out492, out _out493); - _2002_recursiveGen = _out491; - _2003___v187 = _out492; - _2004_recIdents = _out493; - RAST._IType _2005_arrayType; + (this).GenExpr(_2007_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out491, out _out492, out _out493); + _2011_recursiveGen = _out491; + _2012___v187 = _out492; + _2013_recIdents = _out493; + RAST._IType _2014_arrayType; RAST._IType _out494; - _out494 = (this).GenType(_1999_exprType, DCOMP.GenTypeContext.@default()); - _2005_arrayType = _out494; - if (!((_2005_arrayType).IsObjectOrPointer())) { - Dafny.ISequence _2006_msg; - _2006_msg = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Array length of something not an array but "), (_2005_arrayType)._ToString(DCOMP.__default.IND)); - (this).error = Std.Wrappers.Option>.create_Some(_2006_msg); - r = RAST.Expr.create_RawExpr(_2006_msg); + _out494 = (this).GenType(_2008_exprType, DCOMP.GenTypeContext.@default()); + _2014_arrayType = _out494; + if (!((_2014_arrayType).IsObjectOrPointer())) { + Dafny.ISequence _2015_msg; + _2015_msg = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("Array length of something not an array but "), (_2014_arrayType)._ToString(DCOMP.__default.IND)); + (this).error = Std.Wrappers.Option>.create_Some(_2015_msg); + r = RAST.Expr.create_RawExpr(_2015_msg); } else { - RAST._IType _2007_underlying; - _2007_underlying = (_2005_arrayType).ObjectOrPointerUnderlying(); - if (((_2000_dim).Sign == 0) && ((_2007_underlying).is_Array)) { - r = ((((this).read__macro).Apply1(_2002_recursiveGen)).Sel(Dafny.Sequence.UnicodeFromString("len"))).Apply(Dafny.Sequence.FromElements()); + RAST._IType _2016_underlying; + _2016_underlying = (_2014_arrayType).ObjectOrPointerUnderlying(); + if (((_2009_dim).Sign == 0) && ((_2016_underlying).is_Array)) { + r = ((((this).read__macro).Apply1(_2011_recursiveGen)).Sel(Dafny.Sequence.UnicodeFromString("len"))).Apply(Dafny.Sequence.FromElements()); } else { - if ((_2000_dim).Sign == 0) { - r = (((((this).read__macro).Apply1(_2002_recursiveGen)).Sel(Dafny.Sequence.UnicodeFromString("data"))).Sel(Dafny.Sequence.UnicodeFromString("len"))).Apply(Dafny.Sequence.FromElements()); + if ((_2009_dim).Sign == 0) { + r = (((((this).read__macro).Apply1(_2011_recursiveGen)).Sel(Dafny.Sequence.UnicodeFromString("data"))).Sel(Dafny.Sequence.UnicodeFromString("len"))).Apply(Dafny.Sequence.FromElements()); } else { - r = ((((this).read__macro).Apply1(_2002_recursiveGen)).Sel(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("length"), Std.Strings.__default.OfNat(_2000_dim)), Dafny.Sequence.UnicodeFromString("_usize")))).Apply(Dafny.Sequence.FromElements()); + r = ((((this).read__macro).Apply1(_2011_recursiveGen)).Sel(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("length"), Std.Strings.__default.OfNat(_2009_dim)), Dafny.Sequence.UnicodeFromString("_usize")))).Apply(Dafny.Sequence.FromElements()); } } - if (!(_2001_native)) { + if (!(_2010_native)) { r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("int!"))).Apply1(r); } } @@ -5924,28 +5955,28 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv (this).FromOwned(r, expectedOwnership, out _out495, out _out496); r = _out495; resultingOwnership = _out496; - readIdents = _2004_recIdents; + readIdents = _2013_recIdents; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_MapKeys) { - DAST._IExpression _2008_expr = _source96.dtor_expr; + if (_source97.is_MapKeys) { + DAST._IExpression _2017_expr = _source97.dtor_expr; { - RAST._IExpr _2009_recursiveGen; - DCOMP._IOwnership _2010___v188; - Dafny.ISet> _2011_recIdents; + RAST._IExpr _2018_recursiveGen; + DCOMP._IOwnership _2019___v188; + Dafny.ISet> _2020_recIdents; RAST._IExpr _out497; DCOMP._IOwnership _out498; Dafny.ISet> _out499; - (this).GenExpr(_2008_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out497, out _out498, out _out499); - _2009_recursiveGen = _out497; - _2010___v188 = _out498; - _2011_recIdents = _out499; - readIdents = _2011_recIdents; - r = ((_2009_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("keys"))).Apply(Dafny.Sequence.FromElements()); + (this).GenExpr(_2017_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out497, out _out498, out _out499); + _2018_recursiveGen = _out497; + _2019___v188 = _out498; + _2020_recIdents = _out499; + readIdents = _2020_recIdents; + r = ((_2018_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("keys"))).Apply(Dafny.Sequence.FromElements()); RAST._IExpr _out500; DCOMP._IOwnership _out501; (this).FromOwned(r, expectedOwnership, out _out500, out _out501); @@ -5953,25 +5984,25 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out501; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_MapValues) { - DAST._IExpression _2012_expr = _source96.dtor_expr; + if (_source97.is_MapValues) { + DAST._IExpression _2021_expr = _source97.dtor_expr; { - RAST._IExpr _2013_recursiveGen; - DCOMP._IOwnership _2014___v189; - Dafny.ISet> _2015_recIdents; + RAST._IExpr _2022_recursiveGen; + DCOMP._IOwnership _2023___v189; + Dafny.ISet> _2024_recIdents; RAST._IExpr _out502; DCOMP._IOwnership _out503; Dafny.ISet> _out504; - (this).GenExpr(_2012_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out502, out _out503, out _out504); - _2013_recursiveGen = _out502; - _2014___v189 = _out503; - _2015_recIdents = _out504; - readIdents = _2015_recIdents; - r = ((_2013_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("values"))).Apply(Dafny.Sequence.FromElements()); + (this).GenExpr(_2021_expr, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out502, out _out503, out _out504); + _2022_recursiveGen = _out502; + _2023___v189 = _out503; + _2024_recIdents = _out504; + readIdents = _2024_recIdents; + r = ((_2022_recursiveGen).Sel(Dafny.Sequence.UnicodeFromString("values"))).Apply(Dafny.Sequence.FromElements()); RAST._IExpr _out505; DCOMP._IOwnership _out506; (this).FromOwned(r, expectedOwnership, out _out505, out _out506); @@ -5979,164 +6010,164 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out506; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_SelectFn) { - DAST._IExpression _2016_on = _source96.dtor_expr; - Dafny.ISequence _2017_field = _source96.dtor_field; - bool _2018_isDatatype = _source96.dtor_onDatatype; - bool _2019_isStatic = _source96.dtor_isStatic; - BigInteger _2020_arity = _source96.dtor_arity; + if (_source97.is_SelectFn) { + DAST._IExpression _2025_on = _source97.dtor_expr; + Dafny.ISequence _2026_field = _source97.dtor_field; + bool _2027_isDatatype = _source97.dtor_onDatatype; + bool _2028_isStatic = _source97.dtor_isStatic; + BigInteger _2029_arity = _source97.dtor_arity; { - RAST._IExpr _2021_onExpr; - DCOMP._IOwnership _2022_onOwned; - Dafny.ISet> _2023_recIdents; + RAST._IExpr _2030_onExpr; + DCOMP._IOwnership _2031_onOwned; + Dafny.ISet> _2032_recIdents; RAST._IExpr _out507; DCOMP._IOwnership _out508; Dafny.ISet> _out509; - (this).GenExpr(_2016_on, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out507, out _out508, out _out509); - _2021_onExpr = _out507; - _2022_onOwned = _out508; - _2023_recIdents = _out509; - Dafny.ISequence _2024_s = Dafny.Sequence.Empty; - Dafny.ISequence _2025_onString; - _2025_onString = (_2021_onExpr)._ToString(DCOMP.__default.IND); - if (_2019_isStatic) { - _2024_s = Dafny.Sequence.Concat(Dafny.Sequence.Concat(_2025_onString, Dafny.Sequence.UnicodeFromString("::")), DCOMP.__default.escapeName(_2017_field)); + (this).GenExpr(_2025_on, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out507, out _out508, out _out509); + _2030_onExpr = _out507; + _2031_onOwned = _out508; + _2032_recIdents = _out509; + Dafny.ISequence _2033_s = Dafny.Sequence.Empty; + Dafny.ISequence _2034_onString; + _2034_onString = (_2030_onExpr)._ToString(DCOMP.__default.IND); + if (_2028_isStatic) { + _2033_s = Dafny.Sequence.Concat(Dafny.Sequence.Concat(_2034_onString, Dafny.Sequence.UnicodeFromString("::")), DCOMP.__default.escapeName(_2026_field)); } else { - _2024_s = Dafny.Sequence.UnicodeFromString("{\n"); - _2024_s = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_2024_s, Dafny.Sequence.UnicodeFromString("let callTarget = (")), _2025_onString), ((object.Equals(_2022_onOwned, DCOMP.Ownership.create_OwnershipOwned())) ? (Dafny.Sequence.UnicodeFromString(")")) : (Dafny.Sequence.UnicodeFromString(").clone()")))), Dafny.Sequence.UnicodeFromString(";\n")); - Dafny.ISequence _2026_args; - _2026_args = Dafny.Sequence.UnicodeFromString(""); - BigInteger _2027_i; - _2027_i = BigInteger.Zero; - while ((_2027_i) < (_2020_arity)) { - if ((_2027_i).Sign == 1) { - _2026_args = Dafny.Sequence.Concat(_2026_args, Dafny.Sequence.UnicodeFromString(", ")); + _2033_s = Dafny.Sequence.UnicodeFromString("{\n"); + _2033_s = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_2033_s, Dafny.Sequence.UnicodeFromString("let callTarget = (")), _2034_onString), ((object.Equals(_2031_onOwned, DCOMP.Ownership.create_OwnershipOwned())) ? (Dafny.Sequence.UnicodeFromString(")")) : (Dafny.Sequence.UnicodeFromString(").clone()")))), Dafny.Sequence.UnicodeFromString(";\n")); + Dafny.ISequence _2035_args; + _2035_args = Dafny.Sequence.UnicodeFromString(""); + BigInteger _2036_i; + _2036_i = BigInteger.Zero; + while ((_2036_i) < (_2029_arity)) { + if ((_2036_i).Sign == 1) { + _2035_args = Dafny.Sequence.Concat(_2035_args, Dafny.Sequence.UnicodeFromString(", ")); } - _2026_args = Dafny.Sequence.Concat(Dafny.Sequence.Concat(_2026_args, Dafny.Sequence.UnicodeFromString("arg")), Std.Strings.__default.OfNat(_2027_i)); - _2027_i = (_2027_i) + (BigInteger.One); + _2035_args = Dafny.Sequence.Concat(Dafny.Sequence.Concat(_2035_args, Dafny.Sequence.UnicodeFromString("arg")), Std.Strings.__default.OfNat(_2036_i)); + _2036_i = (_2036_i) + (BigInteger.One); } - _2024_s = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_2024_s, Dafny.Sequence.UnicodeFromString("move |")), _2026_args), Dafny.Sequence.UnicodeFromString("| {\n")); - _2024_s = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_2024_s, Dafny.Sequence.UnicodeFromString("callTarget.")), DCOMP.__default.escapeName(_2017_field)), Dafny.Sequence.UnicodeFromString("(")), _2026_args), Dafny.Sequence.UnicodeFromString(")\n")); - _2024_s = Dafny.Sequence.Concat(_2024_s, Dafny.Sequence.UnicodeFromString("}\n")); - _2024_s = Dafny.Sequence.Concat(_2024_s, Dafny.Sequence.UnicodeFromString("}")); + _2033_s = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_2033_s, Dafny.Sequence.UnicodeFromString("move |")), _2035_args), Dafny.Sequence.UnicodeFromString("| {\n")); + _2033_s = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_2033_s, Dafny.Sequence.UnicodeFromString("callTarget.")), DCOMP.__default.escapeName(_2026_field)), Dafny.Sequence.UnicodeFromString("(")), _2035_args), Dafny.Sequence.UnicodeFromString(")\n")); + _2033_s = Dafny.Sequence.Concat(_2033_s, Dafny.Sequence.UnicodeFromString("}\n")); + _2033_s = Dafny.Sequence.Concat(_2033_s, Dafny.Sequence.UnicodeFromString("}")); } - Dafny.ISequence _2028_typeShape; - _2028_typeShape = Dafny.Sequence.UnicodeFromString("dyn ::std::ops::Fn("); - BigInteger _2029_i; - _2029_i = BigInteger.Zero; - while ((_2029_i) < (_2020_arity)) { - if ((_2029_i).Sign == 1) { - _2028_typeShape = Dafny.Sequence.Concat(_2028_typeShape, Dafny.Sequence.UnicodeFromString(", ")); + Dafny.ISequence _2037_typeShape; + _2037_typeShape = Dafny.Sequence.UnicodeFromString("dyn ::std::ops::Fn("); + BigInteger _2038_i; + _2038_i = BigInteger.Zero; + while ((_2038_i) < (_2029_arity)) { + if ((_2038_i).Sign == 1) { + _2037_typeShape = Dafny.Sequence.Concat(_2037_typeShape, Dafny.Sequence.UnicodeFromString(", ")); } - _2028_typeShape = Dafny.Sequence.Concat(_2028_typeShape, Dafny.Sequence.UnicodeFromString("&_")); - _2029_i = (_2029_i) + (BigInteger.One); + _2037_typeShape = Dafny.Sequence.Concat(_2037_typeShape, Dafny.Sequence.UnicodeFromString("&_")); + _2038_i = (_2038_i) + (BigInteger.One); } - _2028_typeShape = Dafny.Sequence.Concat(_2028_typeShape, Dafny.Sequence.UnicodeFromString(") -> _")); - _2024_s = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::std::rc::Rc::new("), _2024_s), Dafny.Sequence.UnicodeFromString(") as ::std::rc::Rc<")), _2028_typeShape), Dafny.Sequence.UnicodeFromString(">")); - r = RAST.Expr.create_RawExpr(_2024_s); + _2037_typeShape = Dafny.Sequence.Concat(_2037_typeShape, Dafny.Sequence.UnicodeFromString(") -> _")); + _2033_s = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::std::rc::Rc::new("), _2033_s), Dafny.Sequence.UnicodeFromString(") as ::std::rc::Rc<")), _2037_typeShape), Dafny.Sequence.UnicodeFromString(">")); + r = RAST.Expr.create_RawExpr(_2033_s); RAST._IExpr _out510; DCOMP._IOwnership _out511; (this).FromOwned(r, expectedOwnership, out _out510, out _out511); r = _out510; resultingOwnership = _out511; - readIdents = _2023_recIdents; + readIdents = _2032_recIdents; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_Select) { - DAST._IExpression expr0 = _source96.dtor_expr; + if (_source97.is_Select) { + DAST._IExpression expr0 = _source97.dtor_expr; if (expr0.is_Companion) { - Dafny.ISequence> _2030_c = expr0.dtor_Companion_a0; - Dafny.ISequence _2031_typeArgs = expr0.dtor_typeArgs; - Dafny.ISequence _2032_field = _source96.dtor_field; - bool _2033_isConstant = _source96.dtor_isConstant; - bool _2034_isDatatype = _source96.dtor_onDatatype; - DAST._IType _2035_fieldType = _source96.dtor_fieldType; + Dafny.ISequence> _2039_c = expr0.dtor_Companion_a0; + Dafny.ISequence _2040_typeArgs = expr0.dtor_typeArgs; + Dafny.ISequence _2041_field = _source97.dtor_field; + bool _2042_isConstant = _source97.dtor_isConstant; + bool _2043_isDatatype = _source97.dtor_onDatatype; + DAST._IType _2044_fieldType = _source97.dtor_fieldType; { - RAST._IExpr _2036_onExpr; - DCOMP._IOwnership _2037_onOwned; - Dafny.ISet> _2038_recIdents; + RAST._IExpr _2045_onExpr; + DCOMP._IOwnership _2046_onOwned; + Dafny.ISet> _2047_recIdents; RAST._IExpr _out512; DCOMP._IOwnership _out513; Dafny.ISet> _out514; - (this).GenExpr(DAST.Expression.create_Companion(_2030_c, _2031_typeArgs), selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out512, out _out513, out _out514); - _2036_onExpr = _out512; - _2037_onOwned = _out513; - _2038_recIdents = _out514; - r = ((_2036_onExpr).MSel(DCOMP.__default.escapeName(_2032_field))).Apply(Dafny.Sequence.FromElements()); + (this).GenExpr(DAST.Expression.create_Companion(_2039_c, _2040_typeArgs), selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out512, out _out513, out _out514); + _2045_onExpr = _out512; + _2046_onOwned = _out513; + _2047_recIdents = _out514; + r = ((_2045_onExpr).MSel(DCOMP.__default.escapeName(_2041_field))).Apply(Dafny.Sequence.FromElements()); RAST._IExpr _out515; DCOMP._IOwnership _out516; (this).FromOwned(r, expectedOwnership, out _out515, out _out516); r = _out515; resultingOwnership = _out516; - readIdents = _2038_recIdents; + readIdents = _2047_recIdents; return ; } - goto after_match41; + goto after_match42; } } } { - if (_source96.is_Select) { - DAST._IExpression _2039_on = _source96.dtor_expr; - Dafny.ISequence _2040_field = _source96.dtor_field; - bool _2041_isConstant = _source96.dtor_isConstant; - bool _2042_isDatatype = _source96.dtor_onDatatype; - DAST._IType _2043_fieldType = _source96.dtor_fieldType; + if (_source97.is_Select) { + DAST._IExpression _2048_on = _source97.dtor_expr; + Dafny.ISequence _2049_field = _source97.dtor_field; + bool _2050_isConstant = _source97.dtor_isConstant; + bool _2051_isDatatype = _source97.dtor_onDatatype; + DAST._IType _2052_fieldType = _source97.dtor_fieldType; { - if (_2042_isDatatype) { - RAST._IExpr _2044_onExpr; - DCOMP._IOwnership _2045_onOwned; - Dafny.ISet> _2046_recIdents; + if (_2051_isDatatype) { + RAST._IExpr _2053_onExpr; + DCOMP._IOwnership _2054_onOwned; + Dafny.ISet> _2055_recIdents; RAST._IExpr _out517; DCOMP._IOwnership _out518; Dafny.ISet> _out519; - (this).GenExpr(_2039_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out517, out _out518, out _out519); - _2044_onExpr = _out517; - _2045_onOwned = _out518; - _2046_recIdents = _out519; - r = ((_2044_onExpr).Sel(DCOMP.__default.escapeName(_2040_field))).Apply(Dafny.Sequence.FromElements()); - RAST._IType _2047_typ; + (this).GenExpr(_2048_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out517, out _out518, out _out519); + _2053_onExpr = _out517; + _2054_onOwned = _out518; + _2055_recIdents = _out519; + r = ((_2053_onExpr).Sel(DCOMP.__default.escapeName(_2049_field))).Apply(Dafny.Sequence.FromElements()); + RAST._IType _2056_typ; RAST._IType _out520; - _out520 = (this).GenType(_2043_fieldType, DCOMP.GenTypeContext.@default()); - _2047_typ = _out520; + _out520 = (this).GenType(_2052_fieldType, DCOMP.GenTypeContext.@default()); + _2056_typ = _out520; RAST._IExpr _out521; DCOMP._IOwnership _out522; (this).FromOwnership(r, DCOMP.Ownership.create_OwnershipBorrowed(), expectedOwnership, out _out521, out _out522); r = _out521; resultingOwnership = _out522; - readIdents = _2046_recIdents; + readIdents = _2055_recIdents; } else { - RAST._IExpr _2048_onExpr; - DCOMP._IOwnership _2049_onOwned; - Dafny.ISet> _2050_recIdents; + RAST._IExpr _2057_onExpr; + DCOMP._IOwnership _2058_onOwned; + Dafny.ISet> _2059_recIdents; RAST._IExpr _out523; DCOMP._IOwnership _out524; Dafny.ISet> _out525; - (this).GenExpr(_2039_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out523, out _out524, out _out525); - _2048_onExpr = _out523; - _2049_onOwned = _out524; - _2050_recIdents = _out525; - r = _2048_onExpr; - if (!object.Equals(_2048_onExpr, RAST.__default.self)) { - RAST._IExpr _source98 = _2048_onExpr; + (this).GenExpr(_2048_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out523, out _out524, out _out525); + _2057_onExpr = _out523; + _2058_onOwned = _out524; + _2059_recIdents = _out525; + r = _2057_onExpr; + if (!object.Equals(_2057_onExpr, RAST.__default.self)) { + RAST._IExpr _source99 = _2057_onExpr; { - if (_source98.is_UnaryOp) { - Dafny.ISequence op15 = _source98.dtor_op1; + if (_source99.is_UnaryOp) { + Dafny.ISequence op15 = _source99.dtor_op1; if (object.Equals(op15, Dafny.Sequence.UnicodeFromString("&"))) { - RAST._IExpr underlying5 = _source98.dtor_underlying; + RAST._IExpr underlying5 = _source99.dtor_underlying; if (underlying5.is_Identifier) { Dafny.ISequence name15 = underlying5.dtor_name; if (object.Equals(name15, Dafny.Sequence.UnicodeFromString("this"))) { r = RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("this")); - goto after_match43; + goto after_match44; } } } @@ -6144,14 +6175,14 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv } { } - after_match43: ; + after_match44: ; if (((this).ObjectType).is_RcMut) { r = (r).Clone(); } r = ((this).read__macro).Apply1(r); } - r = (r).Sel(DCOMP.__default.escapeName(_2040_field)); - if (_2041_isConstant) { + r = (r).Sel(DCOMP.__default.escapeName(_2049_field)); + if (_2050_isConstant) { r = (r).Apply(Dafny.Sequence.FromElements()); } r = (r).Clone(); @@ -6160,72 +6191,72 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv (this).FromOwned(r, expectedOwnership, out _out526, out _out527); r = _out526; resultingOwnership = _out527; - readIdents = _2050_recIdents; + readIdents = _2059_recIdents; } return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_Index) { - DAST._IExpression _2051_on = _source96.dtor_expr; - DAST._ICollKind _2052_collKind = _source96.dtor_collKind; - Dafny.ISequence _2053_indices = _source96.dtor_indices; + if (_source97.is_Index) { + DAST._IExpression _2060_on = _source97.dtor_expr; + DAST._ICollKind _2061_collKind = _source97.dtor_collKind; + Dafny.ISequence _2062_indices = _source97.dtor_indices; { - RAST._IExpr _2054_onExpr; - DCOMP._IOwnership _2055_onOwned; - Dafny.ISet> _2056_recIdents; + RAST._IExpr _2063_onExpr; + DCOMP._IOwnership _2064_onOwned; + Dafny.ISet> _2065_recIdents; RAST._IExpr _out528; DCOMP._IOwnership _out529; Dafny.ISet> _out530; - (this).GenExpr(_2051_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out528, out _out529, out _out530); - _2054_onExpr = _out528; - _2055_onOwned = _out529; - _2056_recIdents = _out530; - readIdents = _2056_recIdents; - r = _2054_onExpr; - bool _2057_hadArray; - _2057_hadArray = false; - if (object.Equals(_2052_collKind, DAST.CollKind.create_Array())) { + (this).GenExpr(_2060_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out528, out _out529, out _out530); + _2063_onExpr = _out528; + _2064_onOwned = _out529; + _2065_recIdents = _out530; + readIdents = _2065_recIdents; + r = _2063_onExpr; + bool _2066_hadArray; + _2066_hadArray = false; + if (object.Equals(_2061_collKind, DAST.CollKind.create_Array())) { r = ((this).read__macro).Apply1(r); - _2057_hadArray = true; - if ((new BigInteger((_2053_indices).Count)) > (BigInteger.One)) { + _2066_hadArray = true; + if ((new BigInteger((_2062_indices).Count)) > (BigInteger.One)) { r = (r).Sel(Dafny.Sequence.UnicodeFromString("data")); } } - BigInteger _hi46 = new BigInteger((_2053_indices).Count); - for (BigInteger _2058_i = BigInteger.Zero; _2058_i < _hi46; _2058_i++) { - if (object.Equals(_2052_collKind, DAST.CollKind.create_Array())) { - RAST._IExpr _2059_idx; - DCOMP._IOwnership _2060_idxOwned; - Dafny.ISet> _2061_recIdentsIdx; + BigInteger _hi47 = new BigInteger((_2062_indices).Count); + for (BigInteger _2067_i = BigInteger.Zero; _2067_i < _hi47; _2067_i++) { + if (object.Equals(_2061_collKind, DAST.CollKind.create_Array())) { + RAST._IExpr _2068_idx; + DCOMP._IOwnership _2069_idxOwned; + Dafny.ISet> _2070_recIdentsIdx; RAST._IExpr _out531; DCOMP._IOwnership _out532; Dafny.ISet> _out533; - (this).GenExpr((_2053_indices).Select(_2058_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out531, out _out532, out _out533); - _2059_idx = _out531; - _2060_idxOwned = _out532; - _2061_recIdentsIdx = _out533; - _2059_idx = RAST.__default.IntoUsize(_2059_idx); - r = RAST.Expr.create_SelectIndex(r, _2059_idx); - readIdents = Dafny.Set>.Union(readIdents, _2061_recIdentsIdx); + (this).GenExpr((_2062_indices).Select(_2067_i), selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out531, out _out532, out _out533); + _2068_idx = _out531; + _2069_idxOwned = _out532; + _2070_recIdentsIdx = _out533; + _2068_idx = RAST.__default.IntoUsize(_2068_idx); + r = RAST.Expr.create_SelectIndex(r, _2068_idx); + readIdents = Dafny.Set>.Union(readIdents, _2070_recIdentsIdx); } else { - RAST._IExpr _2062_idx; - DCOMP._IOwnership _2063_idxOwned; - Dafny.ISet> _2064_recIdentsIdx; + RAST._IExpr _2071_idx; + DCOMP._IOwnership _2072_idxOwned; + Dafny.ISet> _2073_recIdentsIdx; RAST._IExpr _out534; DCOMP._IOwnership _out535; Dafny.ISet> _out536; - (this).GenExpr((_2053_indices).Select(_2058_i), selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out534, out _out535, out _out536); - _2062_idx = _out534; - _2063_idxOwned = _out535; - _2064_recIdentsIdx = _out536; - r = ((r).Sel(Dafny.Sequence.UnicodeFromString("get"))).Apply1(_2062_idx); - readIdents = Dafny.Set>.Union(readIdents, _2064_recIdentsIdx); + (this).GenExpr((_2062_indices).Select(_2067_i), selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out534, out _out535, out _out536); + _2071_idx = _out534; + _2072_idxOwned = _out535; + _2073_recIdentsIdx = _out536; + r = ((r).Sel(Dafny.Sequence.UnicodeFromString("get"))).Apply1(_2071_idx); + readIdents = Dafny.Set>.Union(readIdents, _2073_recIdentsIdx); } } - if (_2057_hadArray) { + if (_2066_hadArray) { r = (r).Clone(); } RAST._IExpr _out537; @@ -6235,98 +6266,98 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out538; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_IndexRange) { - DAST._IExpression _2065_on = _source96.dtor_expr; - bool _2066_isArray = _source96.dtor_isArray; - Std.Wrappers._IOption _2067_low = _source96.dtor_low; - Std.Wrappers._IOption _2068_high = _source96.dtor_high; + if (_source97.is_IndexRange) { + DAST._IExpression _2074_on = _source97.dtor_expr; + bool _2075_isArray = _source97.dtor_isArray; + Std.Wrappers._IOption _2076_low = _source97.dtor_low; + Std.Wrappers._IOption _2077_high = _source97.dtor_high; { - RAST._IExpr _2069_onExpr; - DCOMP._IOwnership _2070_onOwned; - Dafny.ISet> _2071_recIdents; + RAST._IExpr _2078_onExpr; + DCOMP._IOwnership _2079_onOwned; + Dafny.ISet> _2080_recIdents; RAST._IExpr _out539; DCOMP._IOwnership _out540; Dafny.ISet> _out541; - (this).GenExpr(_2065_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out539, out _out540, out _out541); - _2069_onExpr = _out539; - _2070_onOwned = _out540; - _2071_recIdents = _out541; - readIdents = _2071_recIdents; - Dafny.ISequence _2072_methodName; - if ((_2067_low).is_Some) { - if ((_2068_high).is_Some) { - _2072_methodName = Dafny.Sequence.UnicodeFromString("slice"); + (this).GenExpr(_2074_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out539, out _out540, out _out541); + _2078_onExpr = _out539; + _2079_onOwned = _out540; + _2080_recIdents = _out541; + readIdents = _2080_recIdents; + Dafny.ISequence _2081_methodName; + if ((_2076_low).is_Some) { + if ((_2077_high).is_Some) { + _2081_methodName = Dafny.Sequence.UnicodeFromString("slice"); } else { - _2072_methodName = Dafny.Sequence.UnicodeFromString("drop"); + _2081_methodName = Dafny.Sequence.UnicodeFromString("drop"); } - } else if ((_2068_high).is_Some) { - _2072_methodName = Dafny.Sequence.UnicodeFromString("take"); + } else if ((_2077_high).is_Some) { + _2081_methodName = Dafny.Sequence.UnicodeFromString("take"); } else { - _2072_methodName = Dafny.Sequence.UnicodeFromString(""); + _2081_methodName = Dafny.Sequence.UnicodeFromString(""); } - Dafny.ISequence _2073_arguments; - _2073_arguments = Dafny.Sequence.FromElements(); - Std.Wrappers._IOption _source99 = _2067_low; + Dafny.ISequence _2082_arguments; + _2082_arguments = Dafny.Sequence.FromElements(); + Std.Wrappers._IOption _source100 = _2076_low; { - if (_source99.is_Some) { - DAST._IExpression _2074_l = _source99.dtor_value; + if (_source100.is_Some) { + DAST._IExpression _2083_l = _source100.dtor_value; { - RAST._IExpr _2075_lExpr; - DCOMP._IOwnership _2076___v192; - Dafny.ISet> _2077_recIdentsL; + RAST._IExpr _2084_lExpr; + DCOMP._IOwnership _2085___v192; + Dafny.ISet> _2086_recIdentsL; RAST._IExpr _out542; DCOMP._IOwnership _out543; Dafny.ISet> _out544; - (this).GenExpr(_2074_l, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out542, out _out543, out _out544); - _2075_lExpr = _out542; - _2076___v192 = _out543; - _2077_recIdentsL = _out544; - _2073_arguments = Dafny.Sequence.Concat(_2073_arguments, Dafny.Sequence.FromElements(_2075_lExpr)); - readIdents = Dafny.Set>.Union(readIdents, _2077_recIdentsL); + (this).GenExpr(_2083_l, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out542, out _out543, out _out544); + _2084_lExpr = _out542; + _2085___v192 = _out543; + _2086_recIdentsL = _out544; + _2082_arguments = Dafny.Sequence.Concat(_2082_arguments, Dafny.Sequence.FromElements(_2084_lExpr)); + readIdents = Dafny.Set>.Union(readIdents, _2086_recIdentsL); } - goto after_match44; + goto after_match45; } } { } - after_match44: ; - Std.Wrappers._IOption _source100 = _2068_high; + after_match45: ; + Std.Wrappers._IOption _source101 = _2077_high; { - if (_source100.is_Some) { - DAST._IExpression _2078_h = _source100.dtor_value; + if (_source101.is_Some) { + DAST._IExpression _2087_h = _source101.dtor_value; { - RAST._IExpr _2079_hExpr; - DCOMP._IOwnership _2080___v193; - Dafny.ISet> _2081_recIdentsH; + RAST._IExpr _2088_hExpr; + DCOMP._IOwnership _2089___v193; + Dafny.ISet> _2090_recIdentsH; RAST._IExpr _out545; DCOMP._IOwnership _out546; Dafny.ISet> _out547; - (this).GenExpr(_2078_h, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out545, out _out546, out _out547); - _2079_hExpr = _out545; - _2080___v193 = _out546; - _2081_recIdentsH = _out547; - _2073_arguments = Dafny.Sequence.Concat(_2073_arguments, Dafny.Sequence.FromElements(_2079_hExpr)); - readIdents = Dafny.Set>.Union(readIdents, _2081_recIdentsH); + (this).GenExpr(_2087_h, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out545, out _out546, out _out547); + _2088_hExpr = _out545; + _2089___v193 = _out546; + _2090_recIdentsH = _out547; + _2082_arguments = Dafny.Sequence.Concat(_2082_arguments, Dafny.Sequence.FromElements(_2088_hExpr)); + readIdents = Dafny.Set>.Union(readIdents, _2090_recIdentsH); } - goto after_match45; + goto after_match46; } } { } - after_match45: ; - r = _2069_onExpr; - if (_2066_isArray) { - if (!(_2072_methodName).Equals(Dafny.Sequence.UnicodeFromString(""))) { - _2072_methodName = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("_"), _2072_methodName); + after_match46: ; + r = _2078_onExpr; + if (_2075_isArray) { + if (!(_2081_methodName).Equals(Dafny.Sequence.UnicodeFromString(""))) { + _2081_methodName = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("_"), _2081_methodName); } - r = ((RAST.__default.dafny__runtime__Sequence).MSel(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("from_array"), _2072_methodName))).Apply(_2073_arguments); + r = ((RAST.__default.dafny__runtime__Sequence).MSel(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("from_array"), _2081_methodName))).Apply(_2082_arguments); } else { - if (!(_2072_methodName).Equals(Dafny.Sequence.UnicodeFromString(""))) { - r = ((r).Sel(_2072_methodName)).Apply(_2073_arguments); + if (!(_2081_methodName).Equals(Dafny.Sequence.UnicodeFromString(""))) { + r = ((r).Sel(_2081_methodName)).Apply(_2082_arguments); } } RAST._IExpr _out548; @@ -6336,196 +6367,196 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out549; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_TupleSelect) { - DAST._IExpression _2082_on = _source96.dtor_expr; - BigInteger _2083_idx = _source96.dtor_index; - DAST._IType _2084_fieldType = _source96.dtor_fieldType; + if (_source97.is_TupleSelect) { + DAST._IExpression _2091_on = _source97.dtor_expr; + BigInteger _2092_idx = _source97.dtor_index; + DAST._IType _2093_fieldType = _source97.dtor_fieldType; { - RAST._IExpr _2085_onExpr; - DCOMP._IOwnership _2086_onOwnership; - Dafny.ISet> _2087_recIdents; + RAST._IExpr _2094_onExpr; + DCOMP._IOwnership _2095_onOwnership; + Dafny.ISet> _2096_recIdents; RAST._IExpr _out550; DCOMP._IOwnership _out551; Dafny.ISet> _out552; - (this).GenExpr(_2082_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out550, out _out551, out _out552); - _2085_onExpr = _out550; - _2086_onOwnership = _out551; - _2087_recIdents = _out552; - Dafny.ISequence _2088_selName; - _2088_selName = Std.Strings.__default.OfNat(_2083_idx); - DAST._IType _source101 = _2084_fieldType; + (this).GenExpr(_2091_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out550, out _out551, out _out552); + _2094_onExpr = _out550; + _2095_onOwnership = _out551; + _2096_recIdents = _out552; + Dafny.ISequence _2097_selName; + _2097_selName = Std.Strings.__default.OfNat(_2092_idx); + DAST._IType _source102 = _2093_fieldType; { - if (_source101.is_Tuple) { - Dafny.ISequence _2089_tps = _source101.dtor_Tuple_a0; - if (((_2084_fieldType).is_Tuple) && ((new BigInteger((_2089_tps).Count)) > (RAST.__default.MAX__TUPLE__SIZE))) { - _2088_selName = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("_"), _2088_selName); + if (_source102.is_Tuple) { + Dafny.ISequence _2098_tps = _source102.dtor_Tuple_a0; + if (((_2093_fieldType).is_Tuple) && ((new BigInteger((_2098_tps).Count)) > (RAST.__default.MAX__TUPLE__SIZE))) { + _2097_selName = Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("_"), _2097_selName); } - goto after_match46; + goto after_match47; } } { } - after_match46: ; - r = ((_2085_onExpr).Sel(_2088_selName)).Clone(); + after_match47: ; + r = ((_2094_onExpr).Sel(_2097_selName)).Clone(); RAST._IExpr _out553; DCOMP._IOwnership _out554; (this).FromOwnership(r, DCOMP.Ownership.create_OwnershipOwned(), expectedOwnership, out _out553, out _out554); r = _out553; resultingOwnership = _out554; - readIdents = _2087_recIdents; + readIdents = _2096_recIdents; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_Call) { - DAST._IExpression _2090_on = _source96.dtor_on; - DAST._ICallName _2091_name = _source96.dtor_callName; - Dafny.ISequence _2092_typeArgs = _source96.dtor_typeArgs; - Dafny.ISequence _2093_args = _source96.dtor_args; + if (_source97.is_Call) { + DAST._IExpression _2099_on = _source97.dtor_on; + DAST._ICallName _2100_name = _source97.dtor_callName; + Dafny.ISequence _2101_typeArgs = _source97.dtor_typeArgs; + Dafny.ISequence _2102_args = _source97.dtor_args; { - Dafny.ISequence _2094_argExprs; - Dafny.ISet> _2095_recIdents; - Dafny.ISequence _2096_typeExprs; - Std.Wrappers._IOption _2097_fullNameQualifier; + Dafny.ISequence _2103_argExprs; + Dafny.ISet> _2104_recIdents; + Dafny.ISequence _2105_typeExprs; + Std.Wrappers._IOption _2106_fullNameQualifier; Dafny.ISequence _out555; Dafny.ISet> _out556; Dafny.ISequence _out557; Std.Wrappers._IOption _out558; - (this).GenArgs(selfIdent, _2091_name, _2092_typeArgs, _2093_args, env, out _out555, out _out556, out _out557, out _out558); - _2094_argExprs = _out555; - _2095_recIdents = _out556; - _2096_typeExprs = _out557; - _2097_fullNameQualifier = _out558; - readIdents = _2095_recIdents; - Std.Wrappers._IOption _source102 = _2097_fullNameQualifier; + (this).GenArgs(selfIdent, _2100_name, _2101_typeArgs, _2102_args, env, out _out555, out _out556, out _out557, out _out558); + _2103_argExprs = _out555; + _2104_recIdents = _out556; + _2105_typeExprs = _out557; + _2106_fullNameQualifier = _out558; + readIdents = _2104_recIdents; + Std.Wrappers._IOption _source103 = _2106_fullNameQualifier; { - if (_source102.is_Some) { - DAST._IResolvedType value11 = _source102.dtor_value; - Dafny.ISequence> _2098_path = value11.dtor_path; - Dafny.ISequence _2099_onTypeArgs = value11.dtor_typeArgs; - DAST._IResolvedTypeBase _2100_base = value11.dtor_kind; - RAST._IExpr _2101_fullPath; + if (_source103.is_Some) { + DAST._IResolvedType value11 = _source103.dtor_value; + Dafny.ISequence> _2107_path = value11.dtor_path; + Dafny.ISequence _2108_onTypeArgs = value11.dtor_typeArgs; + DAST._IResolvedTypeBase _2109_base = value11.dtor_kind; + RAST._IExpr _2110_fullPath; RAST._IExpr _out559; - _out559 = DCOMP.COMP.GenPathExpr(_2098_path); - _2101_fullPath = _out559; - Dafny.ISequence _2102_onTypeExprs; + _out559 = DCOMP.COMP.GenPathExpr(_2107_path); + _2110_fullPath = _out559; + Dafny.ISequence _2111_onTypeExprs; Dafny.ISequence _out560; - _out560 = (this).GenTypeArgs(_2099_onTypeArgs, DCOMP.GenTypeContext.@default()); - _2102_onTypeExprs = _out560; - RAST._IExpr _2103_onExpr = RAST.Expr.Default(); - DCOMP._IOwnership _2104_recOwnership = DCOMP.Ownership.Default(); - Dafny.ISet> _2105_recIdents = Dafny.Set>.Empty; - if (((_2100_base).is_Trait) || ((_2100_base).is_Class)) { + _out560 = (this).GenTypeArgs(_2108_onTypeArgs, DCOMP.GenTypeContext.@default()); + _2111_onTypeExprs = _out560; + RAST._IExpr _2112_onExpr = RAST.Expr.Default(); + DCOMP._IOwnership _2113_recOwnership = DCOMP.Ownership.Default(); + Dafny.ISet> _2114_recIdents = Dafny.Set>.Empty; + if (((_2109_base).is_Trait) || ((_2109_base).is_Class)) { RAST._IExpr _out561; DCOMP._IOwnership _out562; Dafny.ISet> _out563; - (this).GenExpr(_2090_on, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out561, out _out562, out _out563); - _2103_onExpr = _out561; - _2104_recOwnership = _out562; - _2105_recIdents = _out563; - _2103_onExpr = ((this).read__macro).Apply1(_2103_onExpr); - readIdents = Dafny.Set>.Union(readIdents, _2105_recIdents); + (this).GenExpr(_2099_on, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out561, out _out562, out _out563); + _2112_onExpr = _out561; + _2113_recOwnership = _out562; + _2114_recIdents = _out563; + _2112_onExpr = ((this).read__macro).Apply1(_2112_onExpr); + readIdents = Dafny.Set>.Union(readIdents, _2114_recIdents); } else { RAST._IExpr _out564; DCOMP._IOwnership _out565; Dafny.ISet> _out566; - (this).GenExpr(_2090_on, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out564, out _out565, out _out566); - _2103_onExpr = _out564; - _2104_recOwnership = _out565; - _2105_recIdents = _out566; - readIdents = Dafny.Set>.Union(readIdents, _2105_recIdents); + (this).GenExpr(_2099_on, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out564, out _out565, out _out566); + _2112_onExpr = _out564; + _2113_recOwnership = _out565; + _2114_recIdents = _out566; + readIdents = Dafny.Set>.Union(readIdents, _2114_recIdents); } - r = ((((_2101_fullPath).ApplyType(_2102_onTypeExprs)).MSel(DCOMP.__default.escapeName((_2091_name).dtor_name))).ApplyType(_2096_typeExprs)).Apply(Dafny.Sequence.Concat(Dafny.Sequence.FromElements(_2103_onExpr), _2094_argExprs)); + r = ((((_2110_fullPath).ApplyType(_2111_onTypeExprs)).MSel(DCOMP.__default.escapeName((_2100_name).dtor_name))).ApplyType(_2105_typeExprs)).Apply(Dafny.Sequence.Concat(Dafny.Sequence.FromElements(_2112_onExpr), _2103_argExprs)); RAST._IExpr _out567; DCOMP._IOwnership _out568; (this).FromOwned(r, expectedOwnership, out _out567, out _out568); r = _out567; resultingOwnership = _out568; - goto after_match47; + goto after_match48; } } { - RAST._IExpr _2106_onExpr; - DCOMP._IOwnership _2107___v199; - Dafny.ISet> _2108_recIdents; + RAST._IExpr _2115_onExpr; + DCOMP._IOwnership _2116___v199; + Dafny.ISet> _2117_recIdents; RAST._IExpr _out569; DCOMP._IOwnership _out570; Dafny.ISet> _out571; - (this).GenExpr(_2090_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out569, out _out570, out _out571); - _2106_onExpr = _out569; - _2107___v199 = _out570; - _2108_recIdents = _out571; - readIdents = Dafny.Set>.Union(readIdents, _2108_recIdents); - Dafny.ISequence _2109_renderedName; - DAST._ICallName _source103 = _2091_name; + (this).GenExpr(_2099_on, selfIdent, env, DCOMP.Ownership.create_OwnershipAutoBorrowed(), out _out569, out _out570, out _out571); + _2115_onExpr = _out569; + _2116___v199 = _out570; + _2117_recIdents = _out571; + readIdents = Dafny.Set>.Union(readIdents, _2117_recIdents); + Dafny.ISequence _2118_renderedName; + DAST._ICallName _source104 = _2100_name; { - if (_source103.is_CallName) { - Dafny.ISequence _2110_ident = _source103.dtor_name; - _2109_renderedName = DCOMP.__default.escapeName(_2110_ident); - goto after_match48; + if (_source104.is_CallName) { + Dafny.ISequence _2119_ident = _source104.dtor_name; + _2118_renderedName = DCOMP.__default.escapeName(_2119_ident); + goto after_match49; } } { bool disjunctiveMatch13 = false; - if (_source103.is_MapBuilderAdd) { + if (_source104.is_MapBuilderAdd) { disjunctiveMatch13 = true; } - if (_source103.is_SetBuilderAdd) { + if (_source104.is_SetBuilderAdd) { disjunctiveMatch13 = true; } if (disjunctiveMatch13) { - _2109_renderedName = Dafny.Sequence.UnicodeFromString("add"); - goto after_match48; + _2118_renderedName = Dafny.Sequence.UnicodeFromString("add"); + goto after_match49; } } { - _2109_renderedName = Dafny.Sequence.UnicodeFromString("build"); + _2118_renderedName = Dafny.Sequence.UnicodeFromString("build"); } - after_match48: ; - DAST._IExpression _source104 = _2090_on; + after_match49: ; + DAST._IExpression _source105 = _2099_on; { - if (_source104.is_Companion) { + if (_source105.is_Companion) { { - _2106_onExpr = (_2106_onExpr).MSel(_2109_renderedName); + _2115_onExpr = (_2115_onExpr).MSel(_2118_renderedName); } - goto after_match49; + goto after_match50; } } { { - if (!object.Equals(_2106_onExpr, RAST.__default.self)) { - DAST._ICallName _source105 = _2091_name; + if (!object.Equals(_2115_onExpr, RAST.__default.self)) { + DAST._ICallName _source106 = _2100_name; { - if (_source105.is_CallName) { - Std.Wrappers._IOption onType2 = _source105.dtor_onType; + if (_source106.is_CallName) { + Std.Wrappers._IOption onType2 = _source106.dtor_onType; if (onType2.is_Some) { - DAST._IType _2111_tpe = onType2.dtor_value; - RAST._IType _2112_typ; + DAST._IType _2120_tpe = onType2.dtor_value; + RAST._IType _2121_typ; RAST._IType _out572; - _out572 = (this).GenType(_2111_tpe, DCOMP.GenTypeContext.@default()); - _2112_typ = _out572; - if ((_2112_typ).IsObjectOrPointer()) { - _2106_onExpr = ((this).read__macro).Apply1(_2106_onExpr); + _out572 = (this).GenType(_2120_tpe, DCOMP.GenTypeContext.@default()); + _2121_typ = _out572; + if ((_2121_typ).IsObjectOrPointer()) { + _2115_onExpr = ((this).read__macro).Apply1(_2115_onExpr); } - goto after_match50; + goto after_match51; } } } { } - after_match50: ; + after_match51: ; } - _2106_onExpr = (_2106_onExpr).Sel(_2109_renderedName); + _2115_onExpr = (_2115_onExpr).Sel(_2118_renderedName); } } - after_match49: ; - r = ((_2106_onExpr).ApplyType(_2096_typeExprs)).Apply(_2094_argExprs); + after_match50: ; + r = ((_2115_onExpr).ApplyType(_2105_typeExprs)).Apply(_2103_argExprs); RAST._IExpr _out573; DCOMP._IOwnership _out574; (this).FromOwned(r, expectedOwnership, out _out573, out _out574); @@ -6533,92 +6564,92 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out574; return ; } - after_match47: ; + after_match48: ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_Lambda) { - Dafny.ISequence _2113_paramsDafny = _source96.dtor_params; - DAST._IType _2114_retType = _source96.dtor_retType; - Dafny.ISequence _2115_body = _source96.dtor_body; + if (_source97.is_Lambda) { + Dafny.ISequence _2122_paramsDafny = _source97.dtor_params; + DAST._IType _2123_retType = _source97.dtor_retType; + Dafny.ISequence _2124_body = _source97.dtor_body; { - Dafny.ISequence _2116_params; + Dafny.ISequence _2125_params; Dafny.ISequence _out575; - _out575 = (this).GenParams(_2113_paramsDafny); - _2116_params = _out575; - Dafny.ISequence> _2117_paramNames; - _2117_paramNames = Dafny.Sequence>.FromElements(); - Dafny.IMap,RAST._IType> _2118_paramTypesMap; - _2118_paramTypesMap = Dafny.Map, RAST._IType>.FromElements(); - BigInteger _hi47 = new BigInteger((_2116_params).Count); - for (BigInteger _2119_i = BigInteger.Zero; _2119_i < _hi47; _2119_i++) { - Dafny.ISequence _2120_name; - _2120_name = ((_2116_params).Select(_2119_i)).dtor_name; - _2117_paramNames = Dafny.Sequence>.Concat(_2117_paramNames, Dafny.Sequence>.FromElements(_2120_name)); - _2118_paramTypesMap = Dafny.Map, RAST._IType>.Update(_2118_paramTypesMap, _2120_name, ((_2116_params).Select(_2119_i)).dtor_tpe); + _out575 = (this).GenParams(_2122_paramsDafny); + _2125_params = _out575; + Dafny.ISequence> _2126_paramNames; + _2126_paramNames = Dafny.Sequence>.FromElements(); + Dafny.IMap,RAST._IType> _2127_paramTypesMap; + _2127_paramTypesMap = Dafny.Map, RAST._IType>.FromElements(); + BigInteger _hi48 = new BigInteger((_2125_params).Count); + for (BigInteger _2128_i = BigInteger.Zero; _2128_i < _hi48; _2128_i++) { + Dafny.ISequence _2129_name; + _2129_name = ((_2125_params).Select(_2128_i)).dtor_name; + _2126_paramNames = Dafny.Sequence>.Concat(_2126_paramNames, Dafny.Sequence>.FromElements(_2129_name)); + _2127_paramTypesMap = Dafny.Map, RAST._IType>.Update(_2127_paramTypesMap, _2129_name, ((_2125_params).Select(_2128_i)).dtor_tpe); } - DCOMP._IEnvironment _2121_subEnv; - _2121_subEnv = ((env).ToOwned()).merge(DCOMP.Environment.create(_2117_paramNames, _2118_paramTypesMap)); - RAST._IExpr _2122_recursiveGen; - Dafny.ISet> _2123_recIdents; - DCOMP._IEnvironment _2124___v210; + DCOMP._IEnvironment _2130_subEnv; + _2130_subEnv = ((env).ToOwned()).merge(DCOMP.Environment.create(_2126_paramNames, _2127_paramTypesMap)); + RAST._IExpr _2131_recursiveGen; + Dafny.ISet> _2132_recIdents; + DCOMP._IEnvironment _2133___v210; RAST._IExpr _out576; Dafny.ISet> _out577; DCOMP._IEnvironment _out578; - (this).GenStmts(_2115_body, ((!object.Equals(selfIdent, DCOMP.SelfInfo.create_NoSelf())) ? (DCOMP.SelfInfo.create_ThisTyped(Dafny.Sequence.UnicodeFromString("_this"), (selfIdent).dtor_dafnyType)) : (DCOMP.SelfInfo.create_NoSelf())), _2121_subEnv, true, Std.Wrappers.Option>>.create_None(), out _out576, out _out577, out _out578); - _2122_recursiveGen = _out576; - _2123_recIdents = _out577; - _2124___v210 = _out578; + (this).GenStmts(_2124_body, ((!object.Equals(selfIdent, DCOMP.SelfInfo.create_NoSelf())) ? (DCOMP.SelfInfo.create_ThisTyped(Dafny.Sequence.UnicodeFromString("_this"), (selfIdent).dtor_dafnyType)) : (DCOMP.SelfInfo.create_NoSelf())), _2130_subEnv, true, Std.Wrappers.Option>>.create_None(), out _out576, out _out577, out _out578); + _2131_recursiveGen = _out576; + _2132_recIdents = _out577; + _2133___v210 = _out578; readIdents = Dafny.Set>.FromElements(); - _2123_recIdents = Dafny.Set>.Difference(_2123_recIdents, Dafny.Helpers.Id>, Dafny.ISet>>>((_2125_paramNames) => ((System.Func>>)(() => { + _2132_recIdents = Dafny.Set>.Difference(_2132_recIdents, Dafny.Helpers.Id>, Dafny.ISet>>>((_2134_paramNames) => ((System.Func>>)(() => { var _coll7 = new System.Collections.Generic.List>(); - foreach (Dafny.ISequence _compr_7 in (_2125_paramNames).CloneAsArray()) { - Dafny.ISequence _2126_name = (Dafny.ISequence)_compr_7; - if ((_2125_paramNames).Contains(_2126_name)) { - _coll7.Add(_2126_name); + foreach (Dafny.ISequence _compr_7 in (_2134_paramNames).CloneAsArray()) { + Dafny.ISequence _2135_name = (Dafny.ISequence)_compr_7; + if ((_2134_paramNames).Contains(_2135_name)) { + _coll7.Add(_2135_name); } } return Dafny.Set>.FromCollection(_coll7); - }))())(_2117_paramNames)); - RAST._IExpr _2127_allReadCloned; - _2127_allReadCloned = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")); - while (!(_2123_recIdents).Equals(Dafny.Set>.FromElements())) { - Dafny.ISequence _2128_next; - foreach (Dafny.ISequence _assign_such_that_3 in (_2123_recIdents).Elements) { - _2128_next = (Dafny.ISequence)_assign_such_that_3; - if ((_2123_recIdents).Contains(_2128_next)) { + }))())(_2126_paramNames)); + RAST._IExpr _2136_allReadCloned; + _2136_allReadCloned = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")); + while (!(_2132_recIdents).Equals(Dafny.Set>.FromElements())) { + Dafny.ISequence _2137_next; + foreach (Dafny.ISequence _assign_such_that_3 in (_2132_recIdents).Elements) { + _2137_next = (Dafny.ISequence)_assign_such_that_3; + if ((_2132_recIdents).Contains(_2137_next)) { goto after__ASSIGN_SUCH_THAT_3; } } - throw new System.Exception("assign-such-that search produced no value (line 4877)"); + throw new System.Exception("assign-such-that search produced no value (line 4908)"); after__ASSIGN_SUCH_THAT_3: ; - if ((!object.Equals(selfIdent, DCOMP.SelfInfo.create_NoSelf())) && ((_2128_next).Equals(Dafny.Sequence.UnicodeFromString("_this")))) { - RAST._IExpr _2129_selfCloned; - DCOMP._IOwnership _2130___v211; - Dafny.ISet> _2131___v212; + if ((!object.Equals(selfIdent, DCOMP.SelfInfo.create_NoSelf())) && ((_2137_next).Equals(Dafny.Sequence.UnicodeFromString("_this")))) { + RAST._IExpr _2138_selfCloned; + DCOMP._IOwnership _2139___v211; + Dafny.ISet> _2140___v212; RAST._IExpr _out579; DCOMP._IOwnership _out580; Dafny.ISet> _out581; (this).GenIdent(Dafny.Sequence.UnicodeFromString("self"), selfIdent, DCOMP.Environment.Empty(), DCOMP.Ownership.create_OwnershipOwned(), out _out579, out _out580, out _out581); - _2129_selfCloned = _out579; - _2130___v211 = _out580; - _2131___v212 = _out581; - _2127_allReadCloned = (_2127_allReadCloned).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("_this"), Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(_2129_selfCloned))); - } else if (!((_2117_paramNames).Contains(_2128_next))) { - RAST._IExpr _2132_copy; - _2132_copy = (RAST.Expr.create_Identifier(_2128_next)).Clone(); - _2127_allReadCloned = (_2127_allReadCloned).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), _2128_next, Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(_2132_copy))); - readIdents = Dafny.Set>.Union(readIdents, Dafny.Set>.FromElements(_2128_next)); + _2138_selfCloned = _out579; + _2139___v211 = _out580; + _2140___v212 = _out581; + _2136_allReadCloned = (_2136_allReadCloned).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), Dafny.Sequence.UnicodeFromString("_this"), Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(_2138_selfCloned))); + } else if (!((_2126_paramNames).Contains(_2137_next))) { + RAST._IExpr _2141_copy; + _2141_copy = (RAST.Expr.create_Identifier(_2137_next)).Clone(); + _2136_allReadCloned = (_2136_allReadCloned).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_MUT(), _2137_next, Std.Wrappers.Option.create_None(), Std.Wrappers.Option.create_Some(_2141_copy))); + readIdents = Dafny.Set>.Union(readIdents, Dafny.Set>.FromElements(_2137_next)); } - _2123_recIdents = Dafny.Set>.Difference(_2123_recIdents, Dafny.Set>.FromElements(_2128_next)); + _2132_recIdents = Dafny.Set>.Difference(_2132_recIdents, Dafny.Set>.FromElements(_2137_next)); } - RAST._IType _2133_retTypeGen; + RAST._IType _2142_retTypeGen; RAST._IType _out582; - _out582 = (this).GenType(_2114_retType, DCOMP.GenTypeContext.InFn()); - _2133_retTypeGen = _out582; - r = RAST.Expr.create_Block((_2127_allReadCloned).Then(RAST.__default.RcNew(RAST.Expr.create_Lambda(_2116_params, Std.Wrappers.Option.create_Some(_2133_retTypeGen), RAST.Expr.create_Block(_2122_recursiveGen))))); + _out582 = (this).GenType(_2123_retType, DCOMP.GenTypeContext.InFn()); + _2142_retTypeGen = _out582; + r = RAST.Expr.create_Block((_2136_allReadCloned).Then(RAST.__default.RcNew(RAST.Expr.create_Lambda(_2125_params, Std.Wrappers.Option.create_Some(_2142_retTypeGen), RAST.Expr.create_Block(_2131_recursiveGen))))); RAST._IExpr _out583; DCOMP._IOwnership _out584; (this).FromOwned(r, expectedOwnership, out _out583, out _out584); @@ -6626,116 +6657,116 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out584; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_BetaRedex) { - Dafny.ISequence<_System._ITuple2> _2134_values = _source96.dtor_values; - DAST._IType _2135_retType = _source96.dtor_retType; - DAST._IExpression _2136_expr = _source96.dtor_expr; + if (_source97.is_BetaRedex) { + Dafny.ISequence<_System._ITuple2> _2143_values = _source97.dtor_values; + DAST._IType _2144_retType = _source97.dtor_retType; + DAST._IExpression _2145_expr = _source97.dtor_expr; { - Dafny.ISequence> _2137_paramNames; - _2137_paramNames = Dafny.Sequence>.FromElements(); - Dafny.ISequence _2138_paramFormals; + Dafny.ISequence> _2146_paramNames; + _2146_paramNames = Dafny.Sequence>.FromElements(); + Dafny.ISequence _2147_paramFormals; Dafny.ISequence _out585; - _out585 = (this).GenParams(Std.Collections.Seq.__default.Map<_System._ITuple2, DAST._IFormal>(((System.Func<_System._ITuple2, DAST._IFormal>)((_2139_value) => { - return (_2139_value).dtor__0; - })), _2134_values)); - _2138_paramFormals = _out585; - Dafny.IMap,RAST._IType> _2140_paramTypes; - _2140_paramTypes = Dafny.Map, RAST._IType>.FromElements(); - Dafny.ISet> _2141_paramNamesSet; - _2141_paramNamesSet = Dafny.Set>.FromElements(); - BigInteger _hi48 = new BigInteger((_2134_values).Count); - for (BigInteger _2142_i = BigInteger.Zero; _2142_i < _hi48; _2142_i++) { - Dafny.ISequence _2143_name; - _2143_name = (((_2134_values).Select(_2142_i)).dtor__0).dtor_name; - Dafny.ISequence _2144_rName; - _2144_rName = DCOMP.__default.escapeName(_2143_name); - _2137_paramNames = Dafny.Sequence>.Concat(_2137_paramNames, Dafny.Sequence>.FromElements(_2144_rName)); - _2140_paramTypes = Dafny.Map, RAST._IType>.Update(_2140_paramTypes, _2144_rName, ((_2138_paramFormals).Select(_2142_i)).dtor_tpe); - _2141_paramNamesSet = Dafny.Set>.Union(_2141_paramNamesSet, Dafny.Set>.FromElements(_2144_rName)); + _out585 = (this).GenParams(Std.Collections.Seq.__default.Map<_System._ITuple2, DAST._IFormal>(((System.Func<_System._ITuple2, DAST._IFormal>)((_2148_value) => { + return (_2148_value).dtor__0; + })), _2143_values)); + _2147_paramFormals = _out585; + Dafny.IMap,RAST._IType> _2149_paramTypes; + _2149_paramTypes = Dafny.Map, RAST._IType>.FromElements(); + Dafny.ISet> _2150_paramNamesSet; + _2150_paramNamesSet = Dafny.Set>.FromElements(); + BigInteger _hi49 = new BigInteger((_2143_values).Count); + for (BigInteger _2151_i = BigInteger.Zero; _2151_i < _hi49; _2151_i++) { + Dafny.ISequence _2152_name; + _2152_name = (((_2143_values).Select(_2151_i)).dtor__0).dtor_name; + Dafny.ISequence _2153_rName; + _2153_rName = DCOMP.__default.escapeName(_2152_name); + _2146_paramNames = Dafny.Sequence>.Concat(_2146_paramNames, Dafny.Sequence>.FromElements(_2153_rName)); + _2149_paramTypes = Dafny.Map, RAST._IType>.Update(_2149_paramTypes, _2153_rName, ((_2147_paramFormals).Select(_2151_i)).dtor_tpe); + _2150_paramNamesSet = Dafny.Set>.Union(_2150_paramNamesSet, Dafny.Set>.FromElements(_2153_rName)); } readIdents = Dafny.Set>.FromElements(); r = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")); - BigInteger _hi49 = new BigInteger((_2134_values).Count); - for (BigInteger _2145_i = BigInteger.Zero; _2145_i < _hi49; _2145_i++) { - RAST._IType _2146_typeGen; + BigInteger _hi50 = new BigInteger((_2143_values).Count); + for (BigInteger _2154_i = BigInteger.Zero; _2154_i < _hi50; _2154_i++) { + RAST._IType _2155_typeGen; RAST._IType _out586; - _out586 = (this).GenType((((_2134_values).Select(_2145_i)).dtor__0).dtor_typ, DCOMP.GenTypeContext.InFn()); - _2146_typeGen = _out586; - RAST._IExpr _2147_valueGen; - DCOMP._IOwnership _2148___v213; - Dafny.ISet> _2149_recIdents; + _out586 = (this).GenType((((_2143_values).Select(_2154_i)).dtor__0).dtor_typ, DCOMP.GenTypeContext.InFn()); + _2155_typeGen = _out586; + RAST._IExpr _2156_valueGen; + DCOMP._IOwnership _2157___v213; + Dafny.ISet> _2158_recIdents; RAST._IExpr _out587; DCOMP._IOwnership _out588; Dafny.ISet> _out589; - (this).GenExpr(((_2134_values).Select(_2145_i)).dtor__1, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out587, out _out588, out _out589); - _2147_valueGen = _out587; - _2148___v213 = _out588; - _2149_recIdents = _out589; - r = (r).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_CONST(), DCOMP.__default.escapeName((((_2134_values).Select(_2145_i)).dtor__0).dtor_name), Std.Wrappers.Option.create_Some(_2146_typeGen), Std.Wrappers.Option.create_Some(_2147_valueGen))); - readIdents = Dafny.Set>.Union(readIdents, _2149_recIdents); + (this).GenExpr(((_2143_values).Select(_2154_i)).dtor__1, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out587, out _out588, out _out589); + _2156_valueGen = _out587; + _2157___v213 = _out588; + _2158_recIdents = _out589; + r = (r).Then(RAST.Expr.create_DeclareVar(RAST.DeclareType.create_CONST(), DCOMP.__default.escapeName((((_2143_values).Select(_2154_i)).dtor__0).dtor_name), Std.Wrappers.Option.create_Some(_2155_typeGen), Std.Wrappers.Option.create_Some(_2156_valueGen))); + readIdents = Dafny.Set>.Union(readIdents, _2158_recIdents); } - DCOMP._IEnvironment _2150_newEnv; - _2150_newEnv = DCOMP.Environment.create(_2137_paramNames, _2140_paramTypes); - RAST._IExpr _2151_recGen; - DCOMP._IOwnership _2152_recOwned; - Dafny.ISet> _2153_recIdents; + DCOMP._IEnvironment _2159_newEnv; + _2159_newEnv = DCOMP.Environment.create(_2146_paramNames, _2149_paramTypes); + RAST._IExpr _2160_recGen; + DCOMP._IOwnership _2161_recOwned; + Dafny.ISet> _2162_recIdents; RAST._IExpr _out590; DCOMP._IOwnership _out591; Dafny.ISet> _out592; - (this).GenExpr(_2136_expr, selfIdent, _2150_newEnv, expectedOwnership, out _out590, out _out591, out _out592); - _2151_recGen = _out590; - _2152_recOwned = _out591; - _2153_recIdents = _out592; - readIdents = Dafny.Set>.Difference(_2153_recIdents, _2141_paramNamesSet); - r = RAST.Expr.create_Block((r).Then(_2151_recGen)); + (this).GenExpr(_2145_expr, selfIdent, _2159_newEnv, expectedOwnership, out _out590, out _out591, out _out592); + _2160_recGen = _out590; + _2161_recOwned = _out591; + _2162_recIdents = _out592; + readIdents = Dafny.Set>.Difference(_2162_recIdents, _2150_paramNamesSet); + r = RAST.Expr.create_Block((r).Then(_2160_recGen)); RAST._IExpr _out593; DCOMP._IOwnership _out594; - (this).FromOwnership(r, _2152_recOwned, expectedOwnership, out _out593, out _out594); + (this).FromOwnership(r, _2161_recOwned, expectedOwnership, out _out593, out _out594); r = _out593; resultingOwnership = _out594; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_IIFE) { - Dafny.ISequence _2154_name = _source96.dtor_ident; - DAST._IType _2155_tpe = _source96.dtor_typ; - DAST._IExpression _2156_value = _source96.dtor_value; - DAST._IExpression _2157_iifeBody = _source96.dtor_iifeBody; + if (_source97.is_IIFE) { + Dafny.ISequence _2163_name = _source97.dtor_ident; + DAST._IType _2164_tpe = _source97.dtor_typ; + DAST._IExpression _2165_value = _source97.dtor_value; + DAST._IExpression _2166_iifeBody = _source97.dtor_iifeBody; { - RAST._IExpr _2158_valueGen; - DCOMP._IOwnership _2159___v214; - Dafny.ISet> _2160_recIdents; + RAST._IExpr _2167_valueGen; + DCOMP._IOwnership _2168___v214; + Dafny.ISet> _2169_recIdents; RAST._IExpr _out595; DCOMP._IOwnership _out596; Dafny.ISet> _out597; - (this).GenExpr(_2156_value, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out595, out _out596, out _out597); - _2158_valueGen = _out595; - _2159___v214 = _out596; - _2160_recIdents = _out597; - readIdents = _2160_recIdents; - RAST._IType _2161_valueTypeGen; + (this).GenExpr(_2165_value, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out595, out _out596, out _out597); + _2167_valueGen = _out595; + _2168___v214 = _out596; + _2169_recIdents = _out597; + readIdents = _2169_recIdents; + RAST._IType _2170_valueTypeGen; RAST._IType _out598; - _out598 = (this).GenType(_2155_tpe, DCOMP.GenTypeContext.InFn()); - _2161_valueTypeGen = _out598; - RAST._IExpr _2162_bodyGen; - DCOMP._IOwnership _2163___v215; - Dafny.ISet> _2164_bodyIdents; + _out598 = (this).GenType(_2164_tpe, DCOMP.GenTypeContext.InFn()); + _2170_valueTypeGen = _out598; + RAST._IExpr _2171_bodyGen; + DCOMP._IOwnership _2172___v215; + Dafny.ISet> _2173_bodyIdents; RAST._IExpr _out599; DCOMP._IOwnership _out600; Dafny.ISet> _out601; - (this).GenExpr(_2157_iifeBody, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out599, out _out600, out _out601); - _2162_bodyGen = _out599; - _2163___v215 = _out600; - _2164_bodyIdents = _out601; - readIdents = Dafny.Set>.Union(readIdents, Dafny.Set>.Difference(_2164_bodyIdents, Dafny.Set>.FromElements(DCOMP.__default.escapeName((_2154_name))))); - r = RAST.Expr.create_Block((RAST.Expr.create_DeclareVar(RAST.DeclareType.create_CONST(), DCOMP.__default.escapeName((_2154_name)), Std.Wrappers.Option.create_Some(_2161_valueTypeGen), Std.Wrappers.Option.create_Some(_2158_valueGen))).Then(_2162_bodyGen)); + (this).GenExpr(_2166_iifeBody, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out599, out _out600, out _out601); + _2171_bodyGen = _out599; + _2172___v215 = _out600; + _2173_bodyIdents = _out601; + readIdents = Dafny.Set>.Union(readIdents, Dafny.Set>.Difference(_2173_bodyIdents, Dafny.Set>.FromElements(DCOMP.__default.escapeName((_2163_name))))); + r = RAST.Expr.create_Block((RAST.Expr.create_DeclareVar(RAST.DeclareType.create_CONST(), DCOMP.__default.escapeName((_2163_name)), Std.Wrappers.Option.create_Some(_2170_valueTypeGen), Std.Wrappers.Option.create_Some(_2167_valueGen))).Then(_2171_bodyGen)); RAST._IExpr _out602; DCOMP._IOwnership _out603; (this).FromOwned(r, expectedOwnership, out _out602, out _out603); @@ -6743,43 +6774,43 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out603; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_Apply) { - DAST._IExpression _2165_func = _source96.dtor_expr; - Dafny.ISequence _2166_args = _source96.dtor_args; + if (_source97.is_Apply) { + DAST._IExpression _2174_func = _source97.dtor_expr; + Dafny.ISequence _2175_args = _source97.dtor_args; { - RAST._IExpr _2167_funcExpr; - DCOMP._IOwnership _2168___v216; - Dafny.ISet> _2169_recIdents; + RAST._IExpr _2176_funcExpr; + DCOMP._IOwnership _2177___v216; + Dafny.ISet> _2178_recIdents; RAST._IExpr _out604; DCOMP._IOwnership _out605; Dafny.ISet> _out606; - (this).GenExpr(_2165_func, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out604, out _out605, out _out606); - _2167_funcExpr = _out604; - _2168___v216 = _out605; - _2169_recIdents = _out606; - readIdents = _2169_recIdents; - Dafny.ISequence _2170_rArgs; - _2170_rArgs = Dafny.Sequence.FromElements(); - BigInteger _hi50 = new BigInteger((_2166_args).Count); - for (BigInteger _2171_i = BigInteger.Zero; _2171_i < _hi50; _2171_i++) { - RAST._IExpr _2172_argExpr; - DCOMP._IOwnership _2173_argOwned; - Dafny.ISet> _2174_argIdents; + (this).GenExpr(_2174_func, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out604, out _out605, out _out606); + _2176_funcExpr = _out604; + _2177___v216 = _out605; + _2178_recIdents = _out606; + readIdents = _2178_recIdents; + Dafny.ISequence _2179_rArgs; + _2179_rArgs = Dafny.Sequence.FromElements(); + BigInteger _hi51 = new BigInteger((_2175_args).Count); + for (BigInteger _2180_i = BigInteger.Zero; _2180_i < _hi51; _2180_i++) { + RAST._IExpr _2181_argExpr; + DCOMP._IOwnership _2182_argOwned; + Dafny.ISet> _2183_argIdents; RAST._IExpr _out607; DCOMP._IOwnership _out608; Dafny.ISet> _out609; - (this).GenExpr((_2166_args).Select(_2171_i), selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out607, out _out608, out _out609); - _2172_argExpr = _out607; - _2173_argOwned = _out608; - _2174_argIdents = _out609; - _2170_rArgs = Dafny.Sequence.Concat(_2170_rArgs, Dafny.Sequence.FromElements(_2172_argExpr)); - readIdents = Dafny.Set>.Union(readIdents, _2174_argIdents); + (this).GenExpr((_2175_args).Select(_2180_i), selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out607, out _out608, out _out609); + _2181_argExpr = _out607; + _2182_argOwned = _out608; + _2183_argIdents = _out609; + _2179_rArgs = Dafny.Sequence.Concat(_2179_rArgs, Dafny.Sequence.FromElements(_2181_argExpr)); + readIdents = Dafny.Set>.Union(readIdents, _2183_argIdents); } - r = (_2167_funcExpr).Apply(_2170_rArgs); + r = (_2176_funcExpr).Apply(_2179_rArgs); RAST._IExpr _out610; DCOMP._IOwnership _out611; (this).FromOwned(r, expectedOwnership, out _out610, out _out611); @@ -6787,43 +6818,43 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out611; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_TypeTest) { - DAST._IExpression _2175_on = _source96.dtor_on; - Dafny.ISequence> _2176_dType = _source96.dtor_dType; - Dafny.ISequence _2177_variant = _source96.dtor_variant; + if (_source97.is_TypeTest) { + DAST._IExpression _2184_on = _source97.dtor_on; + Dafny.ISequence> _2185_dType = _source97.dtor_dType; + Dafny.ISequence _2186_variant = _source97.dtor_variant; { - RAST._IExpr _2178_exprGen; - DCOMP._IOwnership _2179___v217; - Dafny.ISet> _2180_recIdents; + RAST._IExpr _2187_exprGen; + DCOMP._IOwnership _2188___v217; + Dafny.ISet> _2189_recIdents; RAST._IExpr _out612; DCOMP._IOwnership _out613; Dafny.ISet> _out614; - (this).GenExpr(_2175_on, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out612, out _out613, out _out614); - _2178_exprGen = _out612; - _2179___v217 = _out613; - _2180_recIdents = _out614; - RAST._IType _2181_dTypePath; + (this).GenExpr(_2184_on, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out612, out _out613, out _out614); + _2187_exprGen = _out612; + _2188___v217 = _out613; + _2189_recIdents = _out614; + RAST._IType _2190_dTypePath; RAST._IType _out615; - _out615 = DCOMP.COMP.GenPath(_2176_dType); - _2181_dTypePath = _out615; - r = (RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("matches!"))).Apply(Dafny.Sequence.FromElements(((_2178_exprGen).Sel(Dafny.Sequence.UnicodeFromString("as_ref"))).Apply(Dafny.Sequence.FromElements()), RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(((_2181_dTypePath).MSel(DCOMP.__default.escapeName(_2177_variant)))._ToString(DCOMP.__default.IND), Dafny.Sequence.UnicodeFromString("{ .. }"))))); + _out615 = DCOMP.COMP.GenPath(_2185_dType); + _2190_dTypePath = _out615; + r = (RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("matches!"))).Apply(Dafny.Sequence.FromElements(((_2187_exprGen).Sel(Dafny.Sequence.UnicodeFromString("as_ref"))).Apply(Dafny.Sequence.FromElements()), RAST.Expr.create_RawExpr(Dafny.Sequence.Concat(((_2190_dTypePath).MSel(DCOMP.__default.escapeName(_2186_variant)))._ToString(DCOMP.__default.IND), Dafny.Sequence.UnicodeFromString("{ .. }"))))); RAST._IExpr _out616; DCOMP._IOwnership _out617; (this).FromOwned(r, expectedOwnership, out _out616, out _out617); r = _out616; resultingOwnership = _out617; - readIdents = _2180_recIdents; + readIdents = _2189_recIdents; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_BoolBoundedPool) { + if (_source97.is_BoolBoundedPool) { { r = RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("[false, true]")); RAST._IExpr _out618; @@ -6834,52 +6865,52 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv readIdents = Dafny.Set>.FromElements(); return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_SetBoundedPool) { - DAST._IExpression _2182_of = _source96.dtor_of; + if (_source97.is_SetBoundedPool) { + DAST._IExpression _2191_of = _source97.dtor_of; { - RAST._IExpr _2183_exprGen; - DCOMP._IOwnership _2184___v218; - Dafny.ISet> _2185_recIdents; + RAST._IExpr _2192_exprGen; + DCOMP._IOwnership _2193___v218; + Dafny.ISet> _2194_recIdents; RAST._IExpr _out620; DCOMP._IOwnership _out621; Dafny.ISet> _out622; - (this).GenExpr(_2182_of, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out620, out _out621, out _out622); - _2183_exprGen = _out620; - _2184___v218 = _out621; - _2185_recIdents = _out622; - r = ((_2183_exprGen).Sel(Dafny.Sequence.UnicodeFromString("iter"))).Apply(Dafny.Sequence.FromElements()); + (this).GenExpr(_2191_of, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out620, out _out621, out _out622); + _2192_exprGen = _out620; + _2193___v218 = _out621; + _2194_recIdents = _out622; + r = ((_2192_exprGen).Sel(Dafny.Sequence.UnicodeFromString("iter"))).Apply(Dafny.Sequence.FromElements()); RAST._IExpr _out623; DCOMP._IOwnership _out624; (this).FromOwned(r, expectedOwnership, out _out623, out _out624); r = _out623; resultingOwnership = _out624; - readIdents = _2185_recIdents; + readIdents = _2194_recIdents; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_SeqBoundedPool) { - DAST._IExpression _2186_of = _source96.dtor_of; - bool _2187_includeDuplicates = _source96.dtor_includeDuplicates; + if (_source97.is_SeqBoundedPool) { + DAST._IExpression _2195_of = _source97.dtor_of; + bool _2196_includeDuplicates = _source97.dtor_includeDuplicates; { - RAST._IExpr _2188_exprGen; - DCOMP._IOwnership _2189___v219; - Dafny.ISet> _2190_recIdents; + RAST._IExpr _2197_exprGen; + DCOMP._IOwnership _2198___v219; + Dafny.ISet> _2199_recIdents; RAST._IExpr _out625; DCOMP._IOwnership _out626; Dafny.ISet> _out627; - (this).GenExpr(_2186_of, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out625, out _out626, out _out627); - _2188_exprGen = _out625; - _2189___v219 = _out626; - _2190_recIdents = _out627; - r = ((_2188_exprGen).Sel(Dafny.Sequence.UnicodeFromString("iter"))).Apply(Dafny.Sequence.FromElements()); - if (!(_2187_includeDuplicates)) { + (this).GenExpr(_2195_of, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out625, out _out626, out _out627); + _2197_exprGen = _out625; + _2198___v219 = _out626; + _2199_recIdents = _out627; + r = ((_2197_exprGen).Sel(Dafny.Sequence.UnicodeFromString("iter"))).Apply(Dafny.Sequence.FromElements()); + if (!(_2196_includeDuplicates)) { r = ((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("itertools"))).MSel(Dafny.Sequence.UnicodeFromString("Itertools"))).MSel(Dafny.Sequence.UnicodeFromString("unique"))).Apply1(r); } RAST._IExpr _out628; @@ -6887,124 +6918,124 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv (this).FromOwned(r, expectedOwnership, out _out628, out _out629); r = _out628; resultingOwnership = _out629; - readIdents = _2190_recIdents; + readIdents = _2199_recIdents; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_MapBoundedPool) { - DAST._IExpression _2191_of = _source96.dtor_of; + if (_source97.is_MapBoundedPool) { + DAST._IExpression _2200_of = _source97.dtor_of; { - RAST._IExpr _2192_exprGen; - DCOMP._IOwnership _2193___v220; - Dafny.ISet> _2194_recIdents; + RAST._IExpr _2201_exprGen; + DCOMP._IOwnership _2202___v220; + Dafny.ISet> _2203_recIdents; RAST._IExpr _out630; DCOMP._IOwnership _out631; Dafny.ISet> _out632; - (this).GenExpr(_2191_of, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out630, out _out631, out _out632); - _2192_exprGen = _out630; - _2193___v220 = _out631; - _2194_recIdents = _out632; - r = ((((_2192_exprGen).Sel(Dafny.Sequence.UnicodeFromString("keys"))).Apply(Dafny.Sequence.FromElements())).Sel(Dafny.Sequence.UnicodeFromString("iter"))).Apply(Dafny.Sequence.FromElements()); - readIdents = _2194_recIdents; + (this).GenExpr(_2200_of, selfIdent, env, DCOMP.Ownership.create_OwnershipBorrowed(), out _out630, out _out631, out _out632); + _2201_exprGen = _out630; + _2202___v220 = _out631; + _2203_recIdents = _out632; + r = ((((_2201_exprGen).Sel(Dafny.Sequence.UnicodeFromString("keys"))).Apply(Dafny.Sequence.FromElements())).Sel(Dafny.Sequence.UnicodeFromString("iter"))).Apply(Dafny.Sequence.FromElements()); + readIdents = _2203_recIdents; RAST._IExpr _out633; DCOMP._IOwnership _out634; (this).FromOwned(r, expectedOwnership, out _out633, out _out634); r = _out633; resultingOwnership = _out634; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_IntRange) { - DAST._IExpression _2195_lo = _source96.dtor_lo; - DAST._IExpression _2196_hi = _source96.dtor_hi; - bool _2197_up = _source96.dtor_up; + if (_source97.is_IntRange) { + DAST._IExpression _2204_lo = _source97.dtor_lo; + DAST._IExpression _2205_hi = _source97.dtor_hi; + bool _2206_up = _source97.dtor_up; { - RAST._IExpr _2198_lo; - DCOMP._IOwnership _2199___v221; - Dafny.ISet> _2200_recIdentsLo; + RAST._IExpr _2207_lo; + DCOMP._IOwnership _2208___v221; + Dafny.ISet> _2209_recIdentsLo; RAST._IExpr _out635; DCOMP._IOwnership _out636; Dafny.ISet> _out637; - (this).GenExpr(_2195_lo, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out635, out _out636, out _out637); - _2198_lo = _out635; - _2199___v221 = _out636; - _2200_recIdentsLo = _out637; - RAST._IExpr _2201_hi; - DCOMP._IOwnership _2202___v222; - Dafny.ISet> _2203_recIdentsHi; + (this).GenExpr(_2204_lo, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out635, out _out636, out _out637); + _2207_lo = _out635; + _2208___v221 = _out636; + _2209_recIdentsLo = _out637; + RAST._IExpr _2210_hi; + DCOMP._IOwnership _2211___v222; + Dafny.ISet> _2212_recIdentsHi; RAST._IExpr _out638; DCOMP._IOwnership _out639; Dafny.ISet> _out640; - (this).GenExpr(_2196_hi, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out638, out _out639, out _out640); - _2201_hi = _out638; - _2202___v222 = _out639; - _2203_recIdentsHi = _out640; - if (_2197_up) { - r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("integer_range"))).Apply(Dafny.Sequence.FromElements(_2198_lo, _2201_hi)); + (this).GenExpr(_2205_hi, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out638, out _out639, out _out640); + _2210_hi = _out638; + _2211___v222 = _out639; + _2212_recIdentsHi = _out640; + if (_2206_up) { + r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("integer_range"))).Apply(Dafny.Sequence.FromElements(_2207_lo, _2210_hi)); } else { - r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("integer_range_down"))).Apply(Dafny.Sequence.FromElements(_2201_hi, _2198_lo)); + r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("integer_range_down"))).Apply(Dafny.Sequence.FromElements(_2210_hi, _2207_lo)); } RAST._IExpr _out641; DCOMP._IOwnership _out642; (this).FromOwned(r, expectedOwnership, out _out641, out _out642); r = _out641; resultingOwnership = _out642; - readIdents = Dafny.Set>.Union(_2200_recIdentsLo, _2203_recIdentsHi); + readIdents = Dafny.Set>.Union(_2209_recIdentsLo, _2212_recIdentsHi); return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_UnboundedIntRange) { - DAST._IExpression _2204_start = _source96.dtor_start; - bool _2205_up = _source96.dtor_up; + if (_source97.is_UnboundedIntRange) { + DAST._IExpression _2213_start = _source97.dtor_start; + bool _2214_up = _source97.dtor_up; { - RAST._IExpr _2206_start; - DCOMP._IOwnership _2207___v223; - Dafny.ISet> _2208_recIdentStart; + RAST._IExpr _2215_start; + DCOMP._IOwnership _2216___v223; + Dafny.ISet> _2217_recIdentStart; RAST._IExpr _out643; DCOMP._IOwnership _out644; Dafny.ISet> _out645; - (this).GenExpr(_2204_start, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out643, out _out644, out _out645); - _2206_start = _out643; - _2207___v223 = _out644; - _2208_recIdentStart = _out645; - if (_2205_up) { - r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("integer_range_unbounded"))).Apply1(_2206_start); + (this).GenExpr(_2213_start, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out643, out _out644, out _out645); + _2215_start = _out643; + _2216___v223 = _out644; + _2217_recIdentStart = _out645; + if (_2214_up) { + r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("integer_range_unbounded"))).Apply1(_2215_start); } else { - r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("integer_range_down_unbounded"))).Apply1(_2206_start); + r = ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("integer_range_down_unbounded"))).Apply1(_2215_start); } RAST._IExpr _out646; DCOMP._IOwnership _out647; (this).FromOwned(r, expectedOwnership, out _out646, out _out647); r = _out646; resultingOwnership = _out647; - readIdents = _2208_recIdentStart; + readIdents = _2217_recIdentStart; return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_MapBuilder) { - DAST._IType _2209_keyType = _source96.dtor_keyType; - DAST._IType _2210_valueType = _source96.dtor_valueType; + if (_source97.is_MapBuilder) { + DAST._IType _2218_keyType = _source97.dtor_keyType; + DAST._IType _2219_valueType = _source97.dtor_valueType; { - RAST._IType _2211_kType; + RAST._IType _2220_kType; RAST._IType _out648; - _out648 = (this).GenType(_2209_keyType, DCOMP.GenTypeContext.@default()); - _2211_kType = _out648; - RAST._IType _2212_vType; + _out648 = (this).GenType(_2218_keyType, DCOMP.GenTypeContext.@default()); + _2220_kType = _out648; + RAST._IType _2221_vType; RAST._IType _out649; - _out649 = (this).GenType(_2210_valueType, DCOMP.GenTypeContext.@default()); - _2212_vType = _out649; - r = ((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("MapBuilder"))).ApplyType(Dafny.Sequence.FromElements(_2211_kType, _2212_vType))).MSel(Dafny.Sequence.UnicodeFromString("new"))).Apply(Dafny.Sequence.FromElements()); + _out649 = (this).GenType(_2219_valueType, DCOMP.GenTypeContext.@default()); + _2221_vType = _out649; + r = ((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("MapBuilder"))).ApplyType(Dafny.Sequence.FromElements(_2220_kType, _2221_vType))).MSel(Dafny.Sequence.UnicodeFromString("new"))).Apply(Dafny.Sequence.FromElements()); RAST._IExpr _out650; DCOMP._IOwnership _out651; (this).FromOwned(r, expectedOwnership, out _out650, out _out651); @@ -7013,19 +7044,19 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv readIdents = Dafny.Set>.FromElements(); return ; } - goto after_match41; + goto after_match42; } } { - if (_source96.is_SetBuilder) { - DAST._IType _2213_elemType = _source96.dtor_elemType; + if (_source97.is_SetBuilder) { + DAST._IType _2222_elemType = _source97.dtor_elemType; { - RAST._IType _2214_eType; + RAST._IType _2223_eType; RAST._IType _out652; - _out652 = (this).GenType(_2213_elemType, DCOMP.GenTypeContext.@default()); - _2214_eType = _out652; + _out652 = (this).GenType(_2222_elemType, DCOMP.GenTypeContext.@default()); + _2223_eType = _out652; readIdents = Dafny.Set>.FromElements(); - r = ((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("SetBuilder"))).ApplyType(Dafny.Sequence.FromElements(_2214_eType))).MSel(Dafny.Sequence.UnicodeFromString("new"))).Apply(Dafny.Sequence.FromElements()); + r = ((((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("SetBuilder"))).ApplyType(Dafny.Sequence.FromElements(_2223_eType))).MSel(Dafny.Sequence.UnicodeFromString("new"))).Apply(Dafny.Sequence.FromElements()); RAST._IExpr _out653; DCOMP._IOwnership _out654; (this).FromOwned(r, expectedOwnership, out _out653, out _out654); @@ -7033,67 +7064,67 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out654; return ; } - goto after_match41; + goto after_match42; } } { - DAST._IType _2215_elemType = _source96.dtor_elemType; - DAST._IExpression _2216_collection = _source96.dtor_collection; - bool _2217_is__forall = _source96.dtor_is__forall; - DAST._IExpression _2218_lambda = _source96.dtor_lambda; + DAST._IType _2224_elemType = _source97.dtor_elemType; + DAST._IExpression _2225_collection = _source97.dtor_collection; + bool _2226_is__forall = _source97.dtor_is__forall; + DAST._IExpression _2227_lambda = _source97.dtor_lambda; { - RAST._IType _2219_tpe; + RAST._IType _2228_tpe; RAST._IType _out655; - _out655 = (this).GenType(_2215_elemType, DCOMP.GenTypeContext.@default()); - _2219_tpe = _out655; - RAST._IExpr _2220_collectionGen; - DCOMP._IOwnership _2221___v224; - Dafny.ISet> _2222_recIdents; + _out655 = (this).GenType(_2224_elemType, DCOMP.GenTypeContext.@default()); + _2228_tpe = _out655; + RAST._IExpr _2229_collectionGen; + DCOMP._IOwnership _2230___v224; + Dafny.ISet> _2231_recIdents; RAST._IExpr _out656; DCOMP._IOwnership _out657; Dafny.ISet> _out658; - (this).GenExpr(_2216_collection, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out656, out _out657, out _out658); - _2220_collectionGen = _out656; - _2221___v224 = _out657; - _2222_recIdents = _out658; - Dafny.ISequence _2223_extraAttributes; - _2223_extraAttributes = Dafny.Sequence.FromElements(); - if ((((_2216_collection).is_IntRange) || ((_2216_collection).is_UnboundedIntRange)) || ((_2216_collection).is_SeqBoundedPool)) { - _2223_extraAttributes = Dafny.Sequence.FromElements(DCOMP.__default.AttributeOwned); - } - if ((_2218_lambda).is_Lambda) { - Dafny.ISequence _2224_formals; - _2224_formals = (_2218_lambda).dtor_params; - Dafny.ISequence _2225_newFormals; - _2225_newFormals = Dafny.Sequence.FromElements(); - BigInteger _hi51 = new BigInteger((_2224_formals).Count); - for (BigInteger _2226_i = BigInteger.Zero; _2226_i < _hi51; _2226_i++) { - var _pat_let_tv4 = _2223_extraAttributes; - var _pat_let_tv5 = _2224_formals; - _2225_newFormals = Dafny.Sequence.Concat(_2225_newFormals, Dafny.Sequence.FromElements(Dafny.Helpers.Let((_2224_formals).Select(_2226_i), _pat_let34_0 => Dafny.Helpers.Let(_pat_let34_0, _2227_dt__update__tmp_h0 => Dafny.Helpers.Let, DAST._IFormal>(Dafny.Sequence.Concat(_pat_let_tv4, ((_pat_let_tv5).Select(_2226_i)).dtor_attributes), _pat_let35_0 => Dafny.Helpers.Let, DAST._IFormal>(_pat_let35_0, _2228_dt__update_hattributes_h0 => DAST.Formal.create((_2227_dt__update__tmp_h0).dtor_name, (_2227_dt__update__tmp_h0).dtor_typ, _2228_dt__update_hattributes_h0))))))); + (this).GenExpr(_2225_collection, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out656, out _out657, out _out658); + _2229_collectionGen = _out656; + _2230___v224 = _out657; + _2231_recIdents = _out658; + Dafny.ISequence _2232_extraAttributes; + _2232_extraAttributes = Dafny.Sequence.FromElements(); + if ((((_2225_collection).is_IntRange) || ((_2225_collection).is_UnboundedIntRange)) || ((_2225_collection).is_SeqBoundedPool)) { + _2232_extraAttributes = Dafny.Sequence.FromElements(DCOMP.__default.AttributeOwned); + } + if ((_2227_lambda).is_Lambda) { + Dafny.ISequence _2233_formals; + _2233_formals = (_2227_lambda).dtor_params; + Dafny.ISequence _2234_newFormals; + _2234_newFormals = Dafny.Sequence.FromElements(); + BigInteger _hi52 = new BigInteger((_2233_formals).Count); + for (BigInteger _2235_i = BigInteger.Zero; _2235_i < _hi52; _2235_i++) { + var _pat_let_tv4 = _2232_extraAttributes; + var _pat_let_tv5 = _2233_formals; + _2234_newFormals = Dafny.Sequence.Concat(_2234_newFormals, Dafny.Sequence.FromElements(Dafny.Helpers.Let((_2233_formals).Select(_2235_i), _pat_let34_0 => Dafny.Helpers.Let(_pat_let34_0, _2236_dt__update__tmp_h0 => Dafny.Helpers.Let, DAST._IFormal>(Dafny.Sequence.Concat(_pat_let_tv4, ((_pat_let_tv5).Select(_2235_i)).dtor_attributes), _pat_let35_0 => Dafny.Helpers.Let, DAST._IFormal>(_pat_let35_0, _2237_dt__update_hattributes_h0 => DAST.Formal.create((_2236_dt__update__tmp_h0).dtor_name, (_2236_dt__update__tmp_h0).dtor_typ, _2237_dt__update_hattributes_h0))))))); } - DAST._IExpression _2229_newLambda; - DAST._IExpression _2230_dt__update__tmp_h1 = _2218_lambda; - Dafny.ISequence _2231_dt__update_hparams_h0 = _2225_newFormals; - _2229_newLambda = DAST.Expression.create_Lambda(_2231_dt__update_hparams_h0, (_2230_dt__update__tmp_h1).dtor_retType, (_2230_dt__update__tmp_h1).dtor_body); - RAST._IExpr _2232_lambdaGen; - DCOMP._IOwnership _2233___v225; - Dafny.ISet> _2234_recLambdaIdents; + DAST._IExpression _2238_newLambda; + DAST._IExpression _2239_dt__update__tmp_h1 = _2227_lambda; + Dafny.ISequence _2240_dt__update_hparams_h0 = _2234_newFormals; + _2238_newLambda = DAST.Expression.create_Lambda(_2240_dt__update_hparams_h0, (_2239_dt__update__tmp_h1).dtor_retType, (_2239_dt__update__tmp_h1).dtor_body); + RAST._IExpr _2241_lambdaGen; + DCOMP._IOwnership _2242___v225; + Dafny.ISet> _2243_recLambdaIdents; RAST._IExpr _out659; DCOMP._IOwnership _out660; Dafny.ISet> _out661; - (this).GenExpr(_2229_newLambda, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out659, out _out660, out _out661); - _2232_lambdaGen = _out659; - _2233___v225 = _out660; - _2234_recLambdaIdents = _out661; - Dafny.ISequence _2235_fn; - if (_2217_is__forall) { - _2235_fn = Dafny.Sequence.UnicodeFromString("all"); + (this).GenExpr(_2238_newLambda, selfIdent, env, DCOMP.Ownership.create_OwnershipOwned(), out _out659, out _out660, out _out661); + _2241_lambdaGen = _out659; + _2242___v225 = _out660; + _2243_recLambdaIdents = _out661; + Dafny.ISequence _2244_fn; + if (_2226_is__forall) { + _2244_fn = Dafny.Sequence.UnicodeFromString("all"); } else { - _2235_fn = Dafny.Sequence.UnicodeFromString("any"); + _2244_fn = Dafny.Sequence.UnicodeFromString("any"); } - r = ((_2220_collectionGen).Sel(_2235_fn)).Apply1(((_2232_lambdaGen).Sel(Dafny.Sequence.UnicodeFromString("as_ref"))).Apply(Dafny.Sequence.FromElements())); - readIdents = Dafny.Set>.Union(_2222_recIdents, _2234_recLambdaIdents); + r = ((_2229_collectionGen).Sel(_2244_fn)).Apply1(((_2241_lambdaGen).Sel(Dafny.Sequence.UnicodeFromString("as_ref"))).Apply(Dafny.Sequence.FromElements())); + readIdents = Dafny.Set>.Union(_2231_recIdents, _2243_recLambdaIdents); } else { (this).error = Std.Wrappers.Option>.create_Some(Dafny.Sequence.UnicodeFromString("Quantifier without an inline lambda")); r = RAST.Expr.create_RawExpr((this.error).dtor_value); @@ -7106,27 +7137,27 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv resultingOwnership = _out663; } } - after_match41: ; + after_match42: ; } public Dafny.ISequence Compile(Dafny.ISequence p) { Dafny.ISequence s = Dafny.Sequence.Empty; s = Dafny.Sequence.UnicodeFromString("#![allow(warnings, unconditional_panic)]\n"); s = Dafny.Sequence.Concat(s, Dafny.Sequence.UnicodeFromString("#![allow(nonstandard_style)]\n")); - BigInteger _2236_i; - _2236_i = BigInteger.Zero; - while ((_2236_i) < (new BigInteger((p).Count))) { - Dafny.ISequence _2237_generated = Dafny.Sequence.Empty; - RAST._IMod _2238_m; + BigInteger _2245_i; + _2245_i = BigInteger.Zero; + while ((_2245_i) < (new BigInteger((p).Count))) { + Dafny.ISequence _2246_generated = Dafny.Sequence.Empty; + RAST._IMod _2247_m; RAST._IMod _out664; - _out664 = (this).GenModule((p).Select(_2236_i), Dafny.Sequence>.FromElements()); - _2238_m = _out664; - _2237_generated = (_2238_m)._ToString(Dafny.Sequence.UnicodeFromString("")); - if ((_2236_i).Sign == 1) { + _out664 = (this).GenModule((p).Select(_2245_i), Dafny.Sequence>.FromElements()); + _2247_m = _out664; + _2246_generated = (_2247_m)._ToString(Dafny.Sequence.UnicodeFromString("")); + if ((_2245_i).Sign == 1) { s = Dafny.Sequence.Concat(s, Dafny.Sequence.UnicodeFromString("\n")); } - s = Dafny.Sequence.Concat(s, _2237_generated); - _2236_i = (_2236_i) + (BigInteger.One); + s = Dafny.Sequence.Concat(s, _2246_generated); + _2245_i = (_2245_i) + (BigInteger.One); } return s; } @@ -7134,14 +7165,14 @@ public void GenExpr(DAST._IExpression e, DCOMP._ISelfInfo selfIdent, DCOMP._IEnv { Dafny.ISequence s = Dafny.Sequence.Empty; s = Dafny.Sequence.UnicodeFromString("\nfn main() {\n"); - BigInteger _2239_i; - _2239_i = BigInteger.Zero; - while ((_2239_i) < (new BigInteger((fullName).Count))) { - if ((_2239_i).Sign == 1) { + BigInteger _2248_i; + _2248_i = BigInteger.Zero; + while ((_2248_i) < (new BigInteger((fullName).Count))) { + if ((_2248_i).Sign == 1) { s = Dafny.Sequence.Concat(s, Dafny.Sequence.UnicodeFromString("::")); } - s = Dafny.Sequence.Concat(s, DCOMP.__default.escapeName((fullName).Select(_2239_i))); - _2239_i = (_2239_i) + (BigInteger.One); + s = Dafny.Sequence.Concat(s, DCOMP.__default.escapeName((fullName).Select(_2248_i))); + _2248_i = (_2248_i) + (BigInteger.One); } s = Dafny.Sequence.Concat(s, Dafny.Sequence.UnicodeFromString("();\n}")); return s; diff --git a/Source/DafnyCore/GeneratedFromDafny/RAST.cs b/Source/DafnyCore/GeneratedFromDafny/RAST.cs index c8a5fe19bfd..ea8d1e6d75a 100644 --- a/Source/DafnyCore/GeneratedFromDafny/RAST.cs +++ b/Source/DafnyCore/GeneratedFromDafny/RAST.cs @@ -264,6 +264,7 @@ public interface _IMod { bool is_Mod { get; } bool is_ExternMod { get; } Dafny.ISequence dtor_name { get; } + Dafny.ISequence> dtor_attributes { get; } Dafny.ISequence dtor_body { get; } _IMod DowncastClone(); Dafny.ISequence _ToString(Dafny.ISequence ind); @@ -271,7 +272,7 @@ public interface _IMod { public abstract class Mod : _IMod { public Mod() { } - private static readonly RAST._IMod theDefault = create_Mod(Dafny.Sequence.Empty, Dafny.Sequence.Empty); + private static readonly RAST._IMod theDefault = create_Mod(Dafny.Sequence.Empty, Dafny.Sequence>.Empty, Dafny.Sequence.Empty); public static RAST._IMod Default() { return theDefault; } @@ -279,8 +280,8 @@ public static RAST._IMod Default() { public static Dafny.TypeDescriptor _TypeDescriptor() { return _TYPE; } - public static _IMod create_Mod(Dafny.ISequence name, Dafny.ISequence body) { - return new Mod_Mod(name, body); + public static _IMod create_Mod(Dafny.ISequence name, Dafny.ISequence> attributes, Dafny.ISequence body) { + return new Mod_Mod(name, attributes, body); } public static _IMod create_ExternMod(Dafny.ISequence name) { return new Mod_ExternMod(name); @@ -294,6 +295,12 @@ public Dafny.ISequence dtor_name { return ((Mod_ExternMod)d)._name; } } + public Dafny.ISequence> dtor_attributes { + get { + var d = this; + return ((Mod_Mod)d)._attributes; + } + } public Dafny.ISequence dtor_body { get { var d = this; @@ -311,32 +318,36 @@ public Dafny.ISequence dtor_body { } { Dafny.ISequence _792_name = _source27.dtor_name; - Dafny.ISequence _793_body = _source27.dtor_body; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("pub mod "), _792_name), Dafny.Sequence.UnicodeFromString(" {")), Dafny.Sequence.UnicodeFromString("\n")), ind), RAST.__default.IND), RAST.__default.SeqToString(_793_body, Dafny.Helpers.Id, Func>>>((_794_ind) => ((System.Func>)((_795_modDecl) => { - return (_795_modDecl)._ToString(Dafny.Sequence.Concat(_794_ind, RAST.__default.IND)); + Dafny.ISequence> _793_attributes = _source27.dtor_attributes; + Dafny.ISequence _794_body = _source27.dtor_body; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(RAST.Attribute.ToStringMultiple(_793_attributes, ind), Dafny.Sequence.UnicodeFromString("pub mod ")), _792_name), Dafny.Sequence.UnicodeFromString(" {")), Dafny.Sequence.UnicodeFromString("\n")), ind), RAST.__default.IND), RAST.__default.SeqToString(_794_body, Dafny.Helpers.Id, Func>>>((_795_ind) => ((System.Func>)((_796_modDecl) => { + return (_796_modDecl)._ToString(Dafny.Sequence.Concat(_795_ind, RAST.__default.IND)); })))(ind), Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n\n"), ind), RAST.__default.IND))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}")); } } } public class Mod_Mod : Mod { public readonly Dafny.ISequence _name; + public readonly Dafny.ISequence> _attributes; public readonly Dafny.ISequence _body; - public Mod_Mod(Dafny.ISequence name, Dafny.ISequence body) : base() { + public Mod_Mod(Dafny.ISequence name, Dafny.ISequence> attributes, Dafny.ISequence body) : base() { this._name = name; + this._attributes = attributes; this._body = body; } public override _IMod DowncastClone() { if (this is _IMod dt) { return dt; } - return new Mod_Mod(_name, _body); + return new Mod_Mod(_name, _attributes, _body); } public override bool Equals(object other) { var oth = other as RAST.Mod_Mod; - return oth != null && object.Equals(this._name, oth._name) && object.Equals(this._body, oth._body); + return oth != null && object.Equals(this._name, oth._name) && object.Equals(this._attributes, oth._attributes) && object.Equals(this._body, oth._body); } public override int GetHashCode() { ulong hash = 5381; hash = ((hash << 5) + hash) + 0; hash = ((hash << 5) + hash) + ((ulong)Dafny.Helpers.GetHashCode(this._name)); + hash = ((hash << 5) + hash) + ((ulong)Dafny.Helpers.GetHashCode(this._attributes)); hash = ((hash << 5) + hash) + ((ulong)Dafny.Helpers.GetHashCode(this._body)); return (int) hash; } @@ -345,6 +356,8 @@ public override string ToString() { s += "("; s += this._name.ToVerbatimString(true); s += ", "; + s += Dafny.Helpers.ToString(this._attributes); + s += ", "; s += Dafny.Helpers.ToString(this._body); s += ")"; return s; @@ -898,8 +911,8 @@ public Dafny.ISequence dtor_content { } public static Dafny.ISequence ToStringMultiple(Dafny.ISequence> attributes, Dafny.ISequence ind) { - return RAST.__default.SeqToString>(attributes, Dafny.Helpers.Id, Func, Dafny.ISequence>>>((_796_ind) => ((System.Func, Dafny.ISequence>)((_797_attribute) => { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat((_797_attribute), Dafny.Sequence.UnicodeFromString("\n")), _796_ind); + return RAST.__default.SeqToString>(attributes, Dafny.Helpers.Id, Func, Dafny.ISequence>>>((_797_ind) => ((System.Func, Dafny.ISequence>)((_798_attribute) => { + return Dafny.Sequence.Concat(Dafny.Sequence.Concat((_798_attribute), Dafny.Sequence.UnicodeFromString("\n")), _797_ind); })))(ind), Dafny.Sequence.UnicodeFromString("")); } } @@ -1360,8 +1373,8 @@ public RAST._IFields ToNamelessFields() { BigInteger dim11 = new BigInteger(((this).dtor_fields).Count); var arr11 = new RAST._INamelessField[Dafny.Helpers.ToIntChecked(dim11, "array size exceeds memory limit")]; for (int i11 = 0; i11 < dim11; i11++) { - var _798_i = (BigInteger) i11; - arr11[(int)(_798_i)] = (((this).dtor_fields).Select(_798_i)).ToNamelessField(); + var _799_i = (BigInteger) i11; + arr11[(int)(_799_i)] = (((this).dtor_fields).Select(_799_i)).ToNamelessField(); } return Dafny.Sequence.FromArray(arr11); }))()); @@ -1369,18 +1382,18 @@ public RAST._IFields ToNamelessFields() { public Dafny.ISequence _ToString(Dafny.ISequence ind, bool newLine) { if ((this).is_NamedFields) { - Dafny.ISequence _799_separator = ((newLine) ? (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(",\n"), ind), RAST.__default.IND)) : (Dafny.Sequence.UnicodeFromString(", "))); + Dafny.ISequence _800_separator = ((newLine) ? (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(",\n"), ind), RAST.__default.IND)) : (Dafny.Sequence.UnicodeFromString(", "))); _System._ITuple2, Dafny.ISequence> _let_tmp_rhs40 = (((newLine) && ((new BigInteger(((this).dtor_fields).Count)).Sign == 1)) ? (_System.Tuple2, Dafny.ISequence>.create(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind), RAST.__default.IND), Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind))) : ((((new BigInteger(((this).dtor_fields).Count)).Sign == 1) ? (_System.Tuple2, Dafny.ISequence>.create(Dafny.Sequence.UnicodeFromString(" "), Dafny.Sequence.UnicodeFromString(" "))) : (_System.Tuple2, Dafny.ISequence>.create(Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.UnicodeFromString("")))))); - Dafny.ISequence _800_beginSpace = _let_tmp_rhs40.dtor__0; - Dafny.ISequence _801_endSpace = _let_tmp_rhs40.dtor__1; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" {"), _800_beginSpace), RAST.__default.SeqToString((this).dtor_fields, Dafny.Helpers.Id, Func>>>((_802_ind) => ((System.Func>)((_803_field) => { - return (_803_field)._ToString(Dafny.Sequence.Concat(_802_ind, RAST.__default.IND)); - })))(ind), _799_separator)), _801_endSpace), Dafny.Sequence.UnicodeFromString("}")); + Dafny.ISequence _801_beginSpace = _let_tmp_rhs40.dtor__0; + Dafny.ISequence _802_endSpace = _let_tmp_rhs40.dtor__1; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" {"), _801_beginSpace), RAST.__default.SeqToString((this).dtor_fields, Dafny.Helpers.Id, Func>>>((_803_ind) => ((System.Func>)((_804_field) => { + return (_804_field)._ToString(Dafny.Sequence.Concat(_803_ind, RAST.__default.IND)); + })))(ind), _800_separator)), _802_endSpace), Dafny.Sequence.UnicodeFromString("}")); } else { - Dafny.ISequence _804_separator = ((newLine) ? (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(",\n"), ind), RAST.__default.IND)) : (Dafny.Sequence.UnicodeFromString(", "))); - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("("), RAST.__default.SeqToString((this).dtor_types, Dafny.Helpers.Id, Func>>>((_805_ind) => ((System.Func>)((_806_t) => { - return (_806_t)._ToString(Dafny.Sequence.Concat(_805_ind, RAST.__default.IND)); - })))(ind), _804_separator)), Dafny.Sequence.UnicodeFromString(")")); + Dafny.ISequence _805_separator = ((newLine) ? (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(",\n"), ind), RAST.__default.IND)) : (Dafny.Sequence.UnicodeFromString(", "))); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("("), RAST.__default.SeqToString((this).dtor_types, Dafny.Helpers.Id, Func>>>((_806_ind) => ((System.Func>)((_807_t) => { + return (_807_t)._ToString(Dafny.Sequence.Concat(_806_ind, RAST.__default.IND)); + })))(ind), _805_separator)), Dafny.Sequence.UnicodeFromString(")")); } } } @@ -1594,8 +1607,8 @@ public Dafny.ISequence dtor_variants { } } public Dafny.ISequence _ToString(Dafny.ISequence ind) { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(RAST.Attribute.ToStringMultiple((this).dtor_attributes, ind), Dafny.Sequence.UnicodeFromString("pub enum ")), (this).dtor_name), RAST.TypeParamDecl.ToStringMultiple((this).dtor_typeParams, ind)), Dafny.Sequence.UnicodeFromString(" {")), RAST.__default.SeqToString((this).dtor_variants, Dafny.Helpers.Id, Func>>>((_807_ind) => ((System.Func>)((_808_variant) => { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _807_ind), RAST.__default.IND), (_808_variant)._ToString(Dafny.Sequence.Concat(_807_ind, RAST.__default.IND), true)); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(RAST.Attribute.ToStringMultiple((this).dtor_attributes, ind), Dafny.Sequence.UnicodeFromString("pub enum ")), (this).dtor_name), RAST.TypeParamDecl.ToStringMultiple((this).dtor_typeParams, ind)), Dafny.Sequence.UnicodeFromString(" {")), RAST.__default.SeqToString((this).dtor_variants, Dafny.Helpers.Id, Func>>>((_808_ind) => ((System.Func>)((_809_variant) => { + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _808_ind), RAST.__default.IND), (_809_variant)._ToString(Dafny.Sequence.Concat(_808_ind, RAST.__default.IND), true)); })))(ind), Dafny.Sequence.UnicodeFromString(","))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}")); } } @@ -1669,19 +1682,19 @@ public Dafny.ISequence dtor_constraints { if ((new BigInteger((typeParams).Count)).Sign == 0) { return Dafny.Sequence.UnicodeFromString(""); } else { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("<"), RAST.__default.SeqToString(typeParams, Dafny.Helpers.Id, Func>>>((_809_ind) => ((System.Func>)((_810_t) => { - return (_810_t)._ToString(Dafny.Sequence.Concat(_809_ind, RAST.__default.IND)); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("<"), RAST.__default.SeqToString(typeParams, Dafny.Helpers.Id, Func>>>((_810_ind) => ((System.Func>)((_811_t) => { + return (_811_t)._ToString(Dafny.Sequence.Concat(_810_ind, RAST.__default.IND)); })))(ind), Dafny.Sequence.UnicodeFromString(", "))), Dafny.Sequence.UnicodeFromString(">")); } } public static Dafny.ISequence AddConstraintsMultiple(Dafny.ISequence typeParams, Dafny.ISequence constraints) { - Dafny.ISequence _811___accumulator = Dafny.Sequence.FromElements(); + Dafny.ISequence _812___accumulator = Dafny.Sequence.FromElements(); TAIL_CALL_START: ; if ((new BigInteger((typeParams).Count)).Sign == 0) { - return Dafny.Sequence.Concat(_811___accumulator, Dafny.Sequence.FromElements()); + return Dafny.Sequence.Concat(_812___accumulator, Dafny.Sequence.FromElements()); } else { - _811___accumulator = Dafny.Sequence.Concat(_811___accumulator, Dafny.Sequence.FromElements(((typeParams).Select(BigInteger.Zero)).AddConstraints(constraints))); + _812___accumulator = Dafny.Sequence.Concat(_812___accumulator, Dafny.Sequence.FromElements(((typeParams).Select(BigInteger.Zero)).AddConstraints(constraints))); Dafny.ISequence _in111 = (typeParams).Drop(BigInteger.One); Dafny.ISequence _in112 = constraints; typeParams = _in111; @@ -1690,13 +1703,13 @@ public Dafny.ISequence dtor_constraints { } } public RAST._ITypeParamDecl AddConstraints(Dafny.ISequence constraints) { - RAST._ITypeParamDecl _812_dt__update__tmp_h0 = this; - Dafny.ISequence _813_dt__update_hconstraints_h0 = Dafny.Sequence.Concat((this).dtor_constraints, constraints); - return RAST.TypeParamDecl.create((_812_dt__update__tmp_h0).dtor_content, _813_dt__update_hconstraints_h0); + RAST._ITypeParamDecl _813_dt__update__tmp_h0 = this; + Dafny.ISequence _814_dt__update_hconstraints_h0 = Dafny.Sequence.Concat((this).dtor_constraints, constraints); + return RAST.TypeParamDecl.create((_813_dt__update__tmp_h0).dtor_content, _814_dt__update_hconstraints_h0); } public Dafny.ISequence _ToString(Dafny.ISequence ind) { - return Dafny.Sequence.Concat((this).dtor_content, (((new BigInteger(((this).dtor_constraints).Count)).Sign == 0) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(": "), RAST.__default.SeqToString((this).dtor_constraints, Dafny.Helpers.Id, Func>>>((_814_ind) => ((System.Func>)((_815_t) => { - return (_815_t)._ToString(Dafny.Sequence.Concat(_814_ind, RAST.__default.IND)); + return Dafny.Sequence.Concat((this).dtor_content, (((new BigInteger(((this).dtor_constraints).Count)).Sign == 0) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(": "), RAST.__default.SeqToString((this).dtor_constraints, Dafny.Helpers.Id, Func>>>((_815_ind) => ((System.Func>)((_816_t) => { + return (_816_t)._ToString(Dafny.Sequence.Concat(_815_ind, RAST.__default.IND)); })))(ind), Dafny.Sequence.UnicodeFromString(" + ")))))); } } @@ -1995,214 +2008,214 @@ public RAST._IType Replace(Dafny.IMap mapping) { } { if (_source28.is_TMemberSelect) { - RAST._IType _816_base = _source28.dtor_base; - Dafny.ISequence _817_name = _source28.dtor_name; - RAST._IType _818_dt__update__tmp_h0 = this; - RAST._IType _819_dt__update_hbase_h0 = (_816_base).Replace(mapping); - return RAST.Type.create_TMemberSelect(_819_dt__update_hbase_h0, (_818_dt__update__tmp_h0).dtor_name); + RAST._IType _817_base = _source28.dtor_base; + Dafny.ISequence _818_name = _source28.dtor_name; + RAST._IType _819_dt__update__tmp_h0 = this; + RAST._IType _820_dt__update_hbase_h0 = (_817_base).Replace(mapping); + return RAST.Type.create_TMemberSelect(_820_dt__update_hbase_h0, (_819_dt__update__tmp_h0).dtor_name); } } { if (_source28.is_TypeApp) { - RAST._IType _820_baseName = _source28.dtor_baseName; - Dafny.ISequence _821_arguments = _source28.dtor_arguments; - RAST._IType _822_dt__update__tmp_h1 = this; - Dafny.ISequence _823_dt__update_harguments_h0 = Std.Collections.Seq.__default.Map(Dafny.Helpers.Id, Dafny.ISequence, Func>>((_824_mapping, _825_arguments) => ((System.Func)((_826_t) => { - return (_826_t).Replace(_824_mapping); - })))(mapping, _821_arguments), _821_arguments); - RAST._IType _827_dt__update_hbaseName_h0 = (_820_baseName).Replace(mapping); - return RAST.Type.create_TypeApp(_827_dt__update_hbaseName_h0, _823_dt__update_harguments_h0); + RAST._IType _821_baseName = _source28.dtor_baseName; + Dafny.ISequence _822_arguments = _source28.dtor_arguments; + RAST._IType _823_dt__update__tmp_h1 = this; + Dafny.ISequence _824_dt__update_harguments_h0 = Std.Collections.Seq.__default.Map(Dafny.Helpers.Id, Dafny.ISequence, Func>>((_825_mapping, _826_arguments) => ((System.Func)((_827_t) => { + return (_827_t).Replace(_825_mapping); + })))(mapping, _822_arguments), _822_arguments); + RAST._IType _828_dt__update_hbaseName_h0 = (_821_baseName).Replace(mapping); + return RAST.Type.create_TypeApp(_828_dt__update_hbaseName_h0, _824_dt__update_harguments_h0); } } { if (_source28.is_Borrowed) { - RAST._IType _828_underlying = _source28.dtor_underlying; - RAST._IType _829_dt__update__tmp_h2 = this; - RAST._IType _830_dt__update_hunderlying_h0 = (_828_underlying).Replace(mapping); - if ((_829_dt__update__tmp_h2).is_Borrowed) { - return RAST.Type.create_Borrowed(_830_dt__update_hunderlying_h0); - } else if ((_829_dt__update__tmp_h2).is_BorrowedMut) { - return RAST.Type.create_BorrowedMut(_830_dt__update_hunderlying_h0); - } else if ((_829_dt__update__tmp_h2).is_Pointer) { - return RAST.Type.create_Pointer(_830_dt__update_hunderlying_h0); - } else if ((_829_dt__update__tmp_h2).is_PointerMut) { - return RAST.Type.create_PointerMut(_830_dt__update_hunderlying_h0); - } else if ((_829_dt__update__tmp_h2).is_ImplType) { - return RAST.Type.create_ImplType(_830_dt__update_hunderlying_h0); - } else if ((_829_dt__update__tmp_h2).is_DynType) { - return RAST.Type.create_DynType(_830_dt__update_hunderlying_h0); + RAST._IType _829_underlying = _source28.dtor_underlying; + RAST._IType _830_dt__update__tmp_h2 = this; + RAST._IType _831_dt__update_hunderlying_h0 = (_829_underlying).Replace(mapping); + if ((_830_dt__update__tmp_h2).is_Borrowed) { + return RAST.Type.create_Borrowed(_831_dt__update_hunderlying_h0); + } else if ((_830_dt__update__tmp_h2).is_BorrowedMut) { + return RAST.Type.create_BorrowedMut(_831_dt__update_hunderlying_h0); + } else if ((_830_dt__update__tmp_h2).is_Pointer) { + return RAST.Type.create_Pointer(_831_dt__update_hunderlying_h0); + } else if ((_830_dt__update__tmp_h2).is_PointerMut) { + return RAST.Type.create_PointerMut(_831_dt__update_hunderlying_h0); + } else if ((_830_dt__update__tmp_h2).is_ImplType) { + return RAST.Type.create_ImplType(_831_dt__update_hunderlying_h0); + } else if ((_830_dt__update__tmp_h2).is_DynType) { + return RAST.Type.create_DynType(_831_dt__update_hunderlying_h0); } else { - return RAST.Type.create_Array(_830_dt__update_hunderlying_h0, (_829_dt__update__tmp_h2).dtor_size); + return RAST.Type.create_Array(_831_dt__update_hunderlying_h0, (_830_dt__update__tmp_h2).dtor_size); } } } { if (_source28.is_BorrowedMut) { - RAST._IType _831_underlying = _source28.dtor_underlying; - RAST._IType _832_dt__update__tmp_h3 = this; - RAST._IType _833_dt__update_hunderlying_h1 = (_831_underlying).Replace(mapping); - if ((_832_dt__update__tmp_h3).is_Borrowed) { - return RAST.Type.create_Borrowed(_833_dt__update_hunderlying_h1); - } else if ((_832_dt__update__tmp_h3).is_BorrowedMut) { - return RAST.Type.create_BorrowedMut(_833_dt__update_hunderlying_h1); - } else if ((_832_dt__update__tmp_h3).is_Pointer) { - return RAST.Type.create_Pointer(_833_dt__update_hunderlying_h1); - } else if ((_832_dt__update__tmp_h3).is_PointerMut) { - return RAST.Type.create_PointerMut(_833_dt__update_hunderlying_h1); - } else if ((_832_dt__update__tmp_h3).is_ImplType) { - return RAST.Type.create_ImplType(_833_dt__update_hunderlying_h1); - } else if ((_832_dt__update__tmp_h3).is_DynType) { - return RAST.Type.create_DynType(_833_dt__update_hunderlying_h1); + RAST._IType _832_underlying = _source28.dtor_underlying; + RAST._IType _833_dt__update__tmp_h3 = this; + RAST._IType _834_dt__update_hunderlying_h1 = (_832_underlying).Replace(mapping); + if ((_833_dt__update__tmp_h3).is_Borrowed) { + return RAST.Type.create_Borrowed(_834_dt__update_hunderlying_h1); + } else if ((_833_dt__update__tmp_h3).is_BorrowedMut) { + return RAST.Type.create_BorrowedMut(_834_dt__update_hunderlying_h1); + } else if ((_833_dt__update__tmp_h3).is_Pointer) { + return RAST.Type.create_Pointer(_834_dt__update_hunderlying_h1); + } else if ((_833_dt__update__tmp_h3).is_PointerMut) { + return RAST.Type.create_PointerMut(_834_dt__update_hunderlying_h1); + } else if ((_833_dt__update__tmp_h3).is_ImplType) { + return RAST.Type.create_ImplType(_834_dt__update_hunderlying_h1); + } else if ((_833_dt__update__tmp_h3).is_DynType) { + return RAST.Type.create_DynType(_834_dt__update_hunderlying_h1); } else { - return RAST.Type.create_Array(_833_dt__update_hunderlying_h1, (_832_dt__update__tmp_h3).dtor_size); + return RAST.Type.create_Array(_834_dt__update_hunderlying_h1, (_833_dt__update__tmp_h3).dtor_size); } } } { if (_source28.is_Pointer) { - RAST._IType _834_underlying = _source28.dtor_underlying; - RAST._IType _835_dt__update__tmp_h4 = this; - RAST._IType _836_dt__update_hunderlying_h2 = (_834_underlying).Replace(mapping); - if ((_835_dt__update__tmp_h4).is_Borrowed) { - return RAST.Type.create_Borrowed(_836_dt__update_hunderlying_h2); - } else if ((_835_dt__update__tmp_h4).is_BorrowedMut) { - return RAST.Type.create_BorrowedMut(_836_dt__update_hunderlying_h2); - } else if ((_835_dt__update__tmp_h4).is_Pointer) { - return RAST.Type.create_Pointer(_836_dt__update_hunderlying_h2); - } else if ((_835_dt__update__tmp_h4).is_PointerMut) { - return RAST.Type.create_PointerMut(_836_dt__update_hunderlying_h2); - } else if ((_835_dt__update__tmp_h4).is_ImplType) { - return RAST.Type.create_ImplType(_836_dt__update_hunderlying_h2); - } else if ((_835_dt__update__tmp_h4).is_DynType) { - return RAST.Type.create_DynType(_836_dt__update_hunderlying_h2); + RAST._IType _835_underlying = _source28.dtor_underlying; + RAST._IType _836_dt__update__tmp_h4 = this; + RAST._IType _837_dt__update_hunderlying_h2 = (_835_underlying).Replace(mapping); + if ((_836_dt__update__tmp_h4).is_Borrowed) { + return RAST.Type.create_Borrowed(_837_dt__update_hunderlying_h2); + } else if ((_836_dt__update__tmp_h4).is_BorrowedMut) { + return RAST.Type.create_BorrowedMut(_837_dt__update_hunderlying_h2); + } else if ((_836_dt__update__tmp_h4).is_Pointer) { + return RAST.Type.create_Pointer(_837_dt__update_hunderlying_h2); + } else if ((_836_dt__update__tmp_h4).is_PointerMut) { + return RAST.Type.create_PointerMut(_837_dt__update_hunderlying_h2); + } else if ((_836_dt__update__tmp_h4).is_ImplType) { + return RAST.Type.create_ImplType(_837_dt__update_hunderlying_h2); + } else if ((_836_dt__update__tmp_h4).is_DynType) { + return RAST.Type.create_DynType(_837_dt__update_hunderlying_h2); } else { - return RAST.Type.create_Array(_836_dt__update_hunderlying_h2, (_835_dt__update__tmp_h4).dtor_size); + return RAST.Type.create_Array(_837_dt__update_hunderlying_h2, (_836_dt__update__tmp_h4).dtor_size); } } } { if (_source28.is_PointerMut) { - RAST._IType _837_underlying = _source28.dtor_underlying; - RAST._IType _838_dt__update__tmp_h5 = this; - RAST._IType _839_dt__update_hunderlying_h3 = (_837_underlying).Replace(mapping); - if ((_838_dt__update__tmp_h5).is_Borrowed) { - return RAST.Type.create_Borrowed(_839_dt__update_hunderlying_h3); - } else if ((_838_dt__update__tmp_h5).is_BorrowedMut) { - return RAST.Type.create_BorrowedMut(_839_dt__update_hunderlying_h3); - } else if ((_838_dt__update__tmp_h5).is_Pointer) { - return RAST.Type.create_Pointer(_839_dt__update_hunderlying_h3); - } else if ((_838_dt__update__tmp_h5).is_PointerMut) { - return RAST.Type.create_PointerMut(_839_dt__update_hunderlying_h3); - } else if ((_838_dt__update__tmp_h5).is_ImplType) { - return RAST.Type.create_ImplType(_839_dt__update_hunderlying_h3); - } else if ((_838_dt__update__tmp_h5).is_DynType) { - return RAST.Type.create_DynType(_839_dt__update_hunderlying_h3); + RAST._IType _838_underlying = _source28.dtor_underlying; + RAST._IType _839_dt__update__tmp_h5 = this; + RAST._IType _840_dt__update_hunderlying_h3 = (_838_underlying).Replace(mapping); + if ((_839_dt__update__tmp_h5).is_Borrowed) { + return RAST.Type.create_Borrowed(_840_dt__update_hunderlying_h3); + } else if ((_839_dt__update__tmp_h5).is_BorrowedMut) { + return RAST.Type.create_BorrowedMut(_840_dt__update_hunderlying_h3); + } else if ((_839_dt__update__tmp_h5).is_Pointer) { + return RAST.Type.create_Pointer(_840_dt__update_hunderlying_h3); + } else if ((_839_dt__update__tmp_h5).is_PointerMut) { + return RAST.Type.create_PointerMut(_840_dt__update_hunderlying_h3); + } else if ((_839_dt__update__tmp_h5).is_ImplType) { + return RAST.Type.create_ImplType(_840_dt__update_hunderlying_h3); + } else if ((_839_dt__update__tmp_h5).is_DynType) { + return RAST.Type.create_DynType(_840_dt__update_hunderlying_h3); } else { - return RAST.Type.create_Array(_839_dt__update_hunderlying_h3, (_838_dt__update__tmp_h5).dtor_size); + return RAST.Type.create_Array(_840_dt__update_hunderlying_h3, (_839_dt__update__tmp_h5).dtor_size); } } } { if (_source28.is_ImplType) { - RAST._IType _840_underlying = _source28.dtor_underlying; - RAST._IType _841_dt__update__tmp_h6 = this; - RAST._IType _842_dt__update_hunderlying_h4 = (_840_underlying).Replace(mapping); - if ((_841_dt__update__tmp_h6).is_Borrowed) { - return RAST.Type.create_Borrowed(_842_dt__update_hunderlying_h4); - } else if ((_841_dt__update__tmp_h6).is_BorrowedMut) { - return RAST.Type.create_BorrowedMut(_842_dt__update_hunderlying_h4); - } else if ((_841_dt__update__tmp_h6).is_Pointer) { - return RAST.Type.create_Pointer(_842_dt__update_hunderlying_h4); - } else if ((_841_dt__update__tmp_h6).is_PointerMut) { - return RAST.Type.create_PointerMut(_842_dt__update_hunderlying_h4); - } else if ((_841_dt__update__tmp_h6).is_ImplType) { - return RAST.Type.create_ImplType(_842_dt__update_hunderlying_h4); - } else if ((_841_dt__update__tmp_h6).is_DynType) { - return RAST.Type.create_DynType(_842_dt__update_hunderlying_h4); + RAST._IType _841_underlying = _source28.dtor_underlying; + RAST._IType _842_dt__update__tmp_h6 = this; + RAST._IType _843_dt__update_hunderlying_h4 = (_841_underlying).Replace(mapping); + if ((_842_dt__update__tmp_h6).is_Borrowed) { + return RAST.Type.create_Borrowed(_843_dt__update_hunderlying_h4); + } else if ((_842_dt__update__tmp_h6).is_BorrowedMut) { + return RAST.Type.create_BorrowedMut(_843_dt__update_hunderlying_h4); + } else if ((_842_dt__update__tmp_h6).is_Pointer) { + return RAST.Type.create_Pointer(_843_dt__update_hunderlying_h4); + } else if ((_842_dt__update__tmp_h6).is_PointerMut) { + return RAST.Type.create_PointerMut(_843_dt__update_hunderlying_h4); + } else if ((_842_dt__update__tmp_h6).is_ImplType) { + return RAST.Type.create_ImplType(_843_dt__update_hunderlying_h4); + } else if ((_842_dt__update__tmp_h6).is_DynType) { + return RAST.Type.create_DynType(_843_dt__update_hunderlying_h4); } else { - return RAST.Type.create_Array(_842_dt__update_hunderlying_h4, (_841_dt__update__tmp_h6).dtor_size); + return RAST.Type.create_Array(_843_dt__update_hunderlying_h4, (_842_dt__update__tmp_h6).dtor_size); } } } { if (_source28.is_DynType) { - RAST._IType _843_underlying = _source28.dtor_underlying; - RAST._IType _844_dt__update__tmp_h7 = this; - RAST._IType _845_dt__update_hunderlying_h5 = (_843_underlying).Replace(mapping); - if ((_844_dt__update__tmp_h7).is_Borrowed) { - return RAST.Type.create_Borrowed(_845_dt__update_hunderlying_h5); - } else if ((_844_dt__update__tmp_h7).is_BorrowedMut) { - return RAST.Type.create_BorrowedMut(_845_dt__update_hunderlying_h5); - } else if ((_844_dt__update__tmp_h7).is_Pointer) { - return RAST.Type.create_Pointer(_845_dt__update_hunderlying_h5); - } else if ((_844_dt__update__tmp_h7).is_PointerMut) { - return RAST.Type.create_PointerMut(_845_dt__update_hunderlying_h5); - } else if ((_844_dt__update__tmp_h7).is_ImplType) { - return RAST.Type.create_ImplType(_845_dt__update_hunderlying_h5); - } else if ((_844_dt__update__tmp_h7).is_DynType) { - return RAST.Type.create_DynType(_845_dt__update_hunderlying_h5); + RAST._IType _844_underlying = _source28.dtor_underlying; + RAST._IType _845_dt__update__tmp_h7 = this; + RAST._IType _846_dt__update_hunderlying_h5 = (_844_underlying).Replace(mapping); + if ((_845_dt__update__tmp_h7).is_Borrowed) { + return RAST.Type.create_Borrowed(_846_dt__update_hunderlying_h5); + } else if ((_845_dt__update__tmp_h7).is_BorrowedMut) { + return RAST.Type.create_BorrowedMut(_846_dt__update_hunderlying_h5); + } else if ((_845_dt__update__tmp_h7).is_Pointer) { + return RAST.Type.create_Pointer(_846_dt__update_hunderlying_h5); + } else if ((_845_dt__update__tmp_h7).is_PointerMut) { + return RAST.Type.create_PointerMut(_846_dt__update_hunderlying_h5); + } else if ((_845_dt__update__tmp_h7).is_ImplType) { + return RAST.Type.create_ImplType(_846_dt__update_hunderlying_h5); + } else if ((_845_dt__update__tmp_h7).is_DynType) { + return RAST.Type.create_DynType(_846_dt__update_hunderlying_h5); } else { - return RAST.Type.create_Array(_845_dt__update_hunderlying_h5, (_844_dt__update__tmp_h7).dtor_size); + return RAST.Type.create_Array(_846_dt__update_hunderlying_h5, (_845_dt__update__tmp_h7).dtor_size); } } } { if (_source28.is_TupleType) { - Dafny.ISequence _846_arguments = _source28.dtor_arguments; - RAST._IType _847_dt__update__tmp_h8 = this; - Dafny.ISequence _848_dt__update_harguments_h1 = Std.Collections.Seq.__default.Map(Dafny.Helpers.Id, Dafny.ISequence, Func>>((_849_mapping, _850_arguments) => ((System.Func)((_851_t) => { - return (_851_t).Replace(_849_mapping); - })))(mapping, _846_arguments), _846_arguments); - if ((_847_dt__update__tmp_h8).is_TypeApp) { - return RAST.Type.create_TypeApp((_847_dt__update__tmp_h8).dtor_baseName, _848_dt__update_harguments_h1); - } else if ((_847_dt__update__tmp_h8).is_TupleType) { - return RAST.Type.create_TupleType(_848_dt__update_harguments_h1); + Dafny.ISequence _847_arguments = _source28.dtor_arguments; + RAST._IType _848_dt__update__tmp_h8 = this; + Dafny.ISequence _849_dt__update_harguments_h1 = Std.Collections.Seq.__default.Map(Dafny.Helpers.Id, Dafny.ISequence, Func>>((_850_mapping, _851_arguments) => ((System.Func)((_852_t) => { + return (_852_t).Replace(_850_mapping); + })))(mapping, _847_arguments), _847_arguments); + if ((_848_dt__update__tmp_h8).is_TypeApp) { + return RAST.Type.create_TypeApp((_848_dt__update__tmp_h8).dtor_baseName, _849_dt__update_harguments_h1); + } else if ((_848_dt__update__tmp_h8).is_TupleType) { + return RAST.Type.create_TupleType(_849_dt__update_harguments_h1); } else { - return RAST.Type.create_FnType(_848_dt__update_harguments_h1, (_847_dt__update__tmp_h8).dtor_returnType); + return RAST.Type.create_FnType(_849_dt__update_harguments_h1, (_848_dt__update__tmp_h8).dtor_returnType); } } } { if (_source28.is_FnType) { - Dafny.ISequence _852_arguments = _source28.dtor_arguments; - RAST._IType _853_returnType = _source28.dtor_returnType; - RAST._IType _854_dt__update__tmp_h9 = this; - RAST._IType _855_dt__update_hreturnType_h0 = (_853_returnType).Replace(mapping); - Dafny.ISequence _856_dt__update_harguments_h2 = Std.Collections.Seq.__default.Map(Dafny.Helpers.Id, Dafny.ISequence, Func>>((_857_mapping, _858_arguments) => ((System.Func)((_859_t) => { - return (_859_t).Replace(_857_mapping); - })))(mapping, _852_arguments), _852_arguments); - return RAST.Type.create_FnType(_856_dt__update_harguments_h2, _855_dt__update_hreturnType_h0); + Dafny.ISequence _853_arguments = _source28.dtor_arguments; + RAST._IType _854_returnType = _source28.dtor_returnType; + RAST._IType _855_dt__update__tmp_h9 = this; + RAST._IType _856_dt__update_hreturnType_h0 = (_854_returnType).Replace(mapping); + Dafny.ISequence _857_dt__update_harguments_h2 = Std.Collections.Seq.__default.Map(Dafny.Helpers.Id, Dafny.ISequence, Func>>((_858_mapping, _859_arguments) => ((System.Func)((_860_t) => { + return (_860_t).Replace(_858_mapping); + })))(mapping, _853_arguments), _853_arguments); + return RAST.Type.create_FnType(_857_dt__update_harguments_h2, _856_dt__update_hreturnType_h0); } } { if (_source28.is_IntersectionType) { - RAST._IType _860_left = _source28.dtor_left; - RAST._IType _861_right = _source28.dtor_right; - RAST._IType _862_dt__update__tmp_h10 = this; - RAST._IType _863_dt__update_hright_h0 = (_861_right).Replace(mapping); - RAST._IType _864_dt__update_hleft_h0 = (_860_left).Replace(mapping); - return RAST.Type.create_IntersectionType(_864_dt__update_hleft_h0, _863_dt__update_hright_h0); + RAST._IType _861_left = _source28.dtor_left; + RAST._IType _862_right = _source28.dtor_right; + RAST._IType _863_dt__update__tmp_h10 = this; + RAST._IType _864_dt__update_hright_h0 = (_862_right).Replace(mapping); + RAST._IType _865_dt__update_hleft_h0 = (_861_left).Replace(mapping); + return RAST.Type.create_IntersectionType(_865_dt__update_hleft_h0, _864_dt__update_hright_h0); } } { - RAST._IType _865_underlying = _source28.dtor_underlying; - Std.Wrappers._IOption> _866_size = _source28.dtor_size; - RAST._IType _867_dt__update__tmp_h11 = this; - RAST._IType _868_dt__update_hunderlying_h6 = (_865_underlying).Replace(mapping); - if ((_867_dt__update__tmp_h11).is_Borrowed) { - return RAST.Type.create_Borrowed(_868_dt__update_hunderlying_h6); - } else if ((_867_dt__update__tmp_h11).is_BorrowedMut) { - return RAST.Type.create_BorrowedMut(_868_dt__update_hunderlying_h6); - } else if ((_867_dt__update__tmp_h11).is_Pointer) { - return RAST.Type.create_Pointer(_868_dt__update_hunderlying_h6); - } else if ((_867_dt__update__tmp_h11).is_PointerMut) { - return RAST.Type.create_PointerMut(_868_dt__update_hunderlying_h6); - } else if ((_867_dt__update__tmp_h11).is_ImplType) { - return RAST.Type.create_ImplType(_868_dt__update_hunderlying_h6); - } else if ((_867_dt__update__tmp_h11).is_DynType) { - return RAST.Type.create_DynType(_868_dt__update_hunderlying_h6); + RAST._IType _866_underlying = _source28.dtor_underlying; + Std.Wrappers._IOption> _867_size = _source28.dtor_size; + RAST._IType _868_dt__update__tmp_h11 = this; + RAST._IType _869_dt__update_hunderlying_h6 = (_866_underlying).Replace(mapping); + if ((_868_dt__update__tmp_h11).is_Borrowed) { + return RAST.Type.create_Borrowed(_869_dt__update_hunderlying_h6); + } else if ((_868_dt__update__tmp_h11).is_BorrowedMut) { + return RAST.Type.create_BorrowedMut(_869_dt__update_hunderlying_h6); + } else if ((_868_dt__update__tmp_h11).is_Pointer) { + return RAST.Type.create_Pointer(_869_dt__update_hunderlying_h6); + } else if ((_868_dt__update__tmp_h11).is_PointerMut) { + return RAST.Type.create_PointerMut(_869_dt__update_hunderlying_h6); + } else if ((_868_dt__update__tmp_h11).is_ImplType) { + return RAST.Type.create_ImplType(_869_dt__update_hunderlying_h6); + } else if ((_868_dt__update__tmp_h11).is_DynType) { + return RAST.Type.create_DynType(_869_dt__update_hunderlying_h6); } else { - return RAST.Type.create_Array(_868_dt__update_hunderlying_h6, (_867_dt__update__tmp_h11).dtor_size); + return RAST.Type.create_Array(_869_dt__update_hunderlying_h6, (_868_dt__update__tmp_h11).dtor_size); } } } @@ -2220,10 +2233,10 @@ public bool IsRcOrBorrowedRc() { RAST._IType _source29 = this; { if (_source29.is_TypeApp) { - RAST._IType _869_wrapper = _source29.dtor_baseName; - Dafny.ISequence _870_arguments = _source29.dtor_arguments; - if (((object.Equals(_869_wrapper, RAST.Type.create_TIdentifier(Dafny.Sequence.UnicodeFromString("MaybePlacebo")))) || (object.Equals(_869_wrapper, (RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("MaybePlacebo"))))) && ((new BigInteger((_870_arguments).Count)) == (BigInteger.One))) { - return Std.Wrappers.Option.create_Some((_870_arguments).Select(BigInteger.Zero)); + RAST._IType _870_wrapper = _source29.dtor_baseName; + Dafny.ISequence _871_arguments = _source29.dtor_arguments; + if (((object.Equals(_870_wrapper, RAST.Type.create_TIdentifier(Dafny.Sequence.UnicodeFromString("MaybePlacebo")))) || (object.Equals(_870_wrapper, (RAST.__default.dafny__runtime__type).MSel(Dafny.Sequence.UnicodeFromString("MaybePlacebo"))))) && ((new BigInteger((_871_arguments).Count)) == (BigInteger.One))) { + return Std.Wrappers.Option.create_Some((_871_arguments).Select(BigInteger.Zero)); } else { return Std.Wrappers.Option.create_None(); } @@ -2235,11 +2248,11 @@ public bool IsRcOrBorrowedRc() { } public Std.Wrappers._IOption ExtractMaybeUninitArrayElement() { if ((this).IsObjectOrPointer()) { - RAST._IType _871_s = (this).ObjectOrPointerUnderlying(); - if (((_871_s).is_Array) && (RAST.__default.IsMaybeUninitType((_871_s).dtor_underlying))) { - return Std.Wrappers.Option.create_Some(RAST.__default.MaybeUninitTypeUnderlying((_871_s).dtor_underlying)); - } else if (((_871_s).IsMultiArray()) && (RAST.__default.IsMaybeUninitType((_871_s).MultiArrayUnderlying()))) { - return Std.Wrappers.Option.create_Some(RAST.__default.MaybeUninitTypeUnderlying((_871_s).MultiArrayUnderlying())); + RAST._IType _872_s = (this).ObjectOrPointerUnderlying(); + if (((_872_s).is_Array) && (RAST.__default.IsMaybeUninitType((_872_s).dtor_underlying))) { + return Std.Wrappers.Option.create_Some(RAST.__default.MaybeUninitTypeUnderlying((_872_s).dtor_underlying)); + } else if (((_872_s).IsMultiArray()) && (RAST.__default.IsMaybeUninitType((_872_s).MultiArrayUnderlying()))) { + return Std.Wrappers.Option.create_Some(RAST.__default.MaybeUninitTypeUnderlying((_872_s).MultiArrayUnderlying())); } else { return Std.Wrappers.Option.create_None(); } @@ -2256,87 +2269,87 @@ public bool IsRcOrBorrowedRc() { } { if (_source30.is_TIdentifier) { - Dafny.ISequence _872_underlying = _source30.dtor_name; - return _872_underlying; + Dafny.ISequence _873_underlying = _source30.dtor_name; + return _873_underlying; } } { if (_source30.is_TMemberSelect) { - RAST._IType _873_underlying = _source30.dtor_base; - Dafny.ISequence _874_name = _source30.dtor_name; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat((_873_underlying)._ToString(ind), Dafny.Sequence.UnicodeFromString("::")), _874_name); + RAST._IType _874_underlying = _source30.dtor_base; + Dafny.ISequence _875_name = _source30.dtor_name; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat((_874_underlying)._ToString(ind), Dafny.Sequence.UnicodeFromString("::")), _875_name); } } { if (_source30.is_Borrowed) { - RAST._IType _875_underlying = _source30.dtor_underlying; - return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("&"), (_875_underlying)._ToString(ind)); + RAST._IType _876_underlying = _source30.dtor_underlying; + return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("&"), (_876_underlying)._ToString(ind)); } } { if (_source30.is_BorrowedMut) { - RAST._IType _876_underlying = _source30.dtor_underlying; - return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("&mut "), (_876_underlying)._ToString(ind)); + RAST._IType _877_underlying = _source30.dtor_underlying; + return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("&mut "), (_877_underlying)._ToString(ind)); } } { if (_source30.is_Pointer) { - RAST._IType _877_underlying = _source30.dtor_underlying; - return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("*const "), (_877_underlying)._ToString(ind)); + RAST._IType _878_underlying = _source30.dtor_underlying; + return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("*const "), (_878_underlying)._ToString(ind)); } } { if (_source30.is_PointerMut) { - RAST._IType _878_underlying = _source30.dtor_underlying; - return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("*mut "), (_878_underlying)._ToString(ind)); + RAST._IType _879_underlying = _source30.dtor_underlying; + return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("*mut "), (_879_underlying)._ToString(ind)); } } { if (_source30.is_ImplType) { - RAST._IType _879_underlying = _source30.dtor_underlying; - return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("impl "), (_879_underlying)._ToString(ind)); + RAST._IType _880_underlying = _source30.dtor_underlying; + return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("impl "), (_880_underlying)._ToString(ind)); } } { if (_source30.is_DynType) { - RAST._IType _880_underlying = _source30.dtor_underlying; - return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("dyn "), (_880_underlying)._ToString(ind)); + RAST._IType _881_underlying = _source30.dtor_underlying; + return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("dyn "), (_881_underlying)._ToString(ind)); } } { if (_source30.is_FnType) { - Dafny.ISequence _881_arguments = _source30.dtor_arguments; - RAST._IType _882_returnType = _source30.dtor_returnType; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::std::ops::Fn("), RAST.__default.SeqToString(_881_arguments, Dafny.Helpers.Id, Func>>>((_883_ind) => ((System.Func>)((_884_arg) => { - return (_884_arg)._ToString(Dafny.Sequence.Concat(_883_ind, RAST.__default.IND)); - })))(ind), Dafny.Sequence.UnicodeFromString(", "))), Dafny.Sequence.UnicodeFromString(") -> ")), (_882_returnType)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))); + Dafny.ISequence _882_arguments = _source30.dtor_arguments; + RAST._IType _883_returnType = _source30.dtor_returnType; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("::std::ops::Fn("), RAST.__default.SeqToString(_882_arguments, Dafny.Helpers.Id, Func>>>((_884_ind) => ((System.Func>)((_885_arg) => { + return (_885_arg)._ToString(Dafny.Sequence.Concat(_884_ind, RAST.__default.IND)); + })))(ind), Dafny.Sequence.UnicodeFromString(", "))), Dafny.Sequence.UnicodeFromString(") -> ")), (_883_returnType)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))); } } { if (_source30.is_IntersectionType) { - RAST._IType _885_left = _source30.dtor_left; - RAST._IType _886_right = _source30.dtor_right; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat((_885_left)._ToString(ind), Dafny.Sequence.UnicodeFromString(" + ")), (_886_right)._ToString(ind)); + RAST._IType _886_left = _source30.dtor_left; + RAST._IType _887_right = _source30.dtor_right; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat((_886_left)._ToString(ind), Dafny.Sequence.UnicodeFromString(" + ")), (_887_right)._ToString(ind)); } } { if (_source30.is_TupleType) { - Dafny.ISequence _887_args = _source30.dtor_arguments; - if ((_887_args).Equals(Dafny.Sequence.FromElements())) { + Dafny.ISequence _888_args = _source30.dtor_arguments; + if ((_888_args).Equals(Dafny.Sequence.FromElements())) { return Dafny.Sequence.UnicodeFromString("()"); } else { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("("), RAST.__default.SeqToString(_887_args, Dafny.Helpers.Id, Func>>>((_888_ind) => ((System.Func>)((_889_arg) => { - return (_889_arg)._ToString(Dafny.Sequence.Concat(_888_ind, RAST.__default.IND)); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("("), RAST.__default.SeqToString(_888_args, Dafny.Helpers.Id, Func>>>((_889_ind) => ((System.Func>)((_890_arg) => { + return (_890_arg)._ToString(Dafny.Sequence.Concat(_889_ind, RAST.__default.IND)); })))(ind), Dafny.Sequence.UnicodeFromString(", "))), Dafny.Sequence.UnicodeFromString(")")); } } } { if (_source30.is_TypeApp) { - RAST._IType _890_base = _source30.dtor_baseName; - Dafny.ISequence _891_args = _source30.dtor_arguments; - return Dafny.Sequence.Concat((_890_base)._ToString(ind), (((_891_args).Equals(Dafny.Sequence.FromElements())) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("<"), RAST.__default.SeqToString(_891_args, Dafny.Helpers.Id, Func>>>((_892_ind) => ((System.Func>)((_893_arg) => { - return (_893_arg)._ToString(Dafny.Sequence.Concat(_892_ind, RAST.__default.IND)); + RAST._IType _891_base = _source30.dtor_baseName; + Dafny.ISequence _892_args = _source30.dtor_arguments; + return Dafny.Sequence.Concat((_891_base)._ToString(ind), (((_892_args).Equals(Dafny.Sequence.FromElements())) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("<"), RAST.__default.SeqToString(_892_args, Dafny.Helpers.Id, Func>>>((_893_ind) => ((System.Func>)((_894_arg) => { + return (_894_arg)._ToString(Dafny.Sequence.Concat(_893_ind, RAST.__default.IND)); })))(ind), Dafny.Sequence.UnicodeFromString(", "))), Dafny.Sequence.UnicodeFromString(">"))))); } } @@ -2396,9 +2409,9 @@ public bool IsRcOrBorrowedRc() { } } { - RAST._IType _894_underlying = _source30.dtor_underlying; - Std.Wrappers._IOption> _895_size = _source30.dtor_size; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("["), (_894_underlying)._ToString(ind)), (((_895_size).is_Some) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("; "), (_895_size).dtor_value)) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString("]")); + RAST._IType _895_underlying = _source30.dtor_underlying; + Std.Wrappers._IOption> _896_size = _source30.dtor_size; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("["), (_895_underlying)._ToString(ind)), (((_896_size).is_Some) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("; "), (_896_size).dtor_value)) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString("]")); } } public RAST._IType MSel(Dafny.ISequence name) { @@ -2414,36 +2427,36 @@ public RAST._IType ToOwned() { RAST._IType _source31 = this; { if (_source31.is_Borrowed) { - RAST._IType _896_x = _source31.dtor_underlying; - return _896_x; + RAST._IType _897_x = _source31.dtor_underlying; + return _897_x; } } { if (_source31.is_BorrowedMut) { - RAST._IType _897_x = _source31.dtor_underlying; - return _897_x; + RAST._IType _898_x = _source31.dtor_underlying; + return _898_x; } } { - RAST._IType _898_x = _source31; - return _898_x; + RAST._IType _899_x = _source31; + return _899_x; } } public RAST._IExpr ToNullExpr() { if ((this).IsObject()) { return ((RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("Object"))).Apply1((((RAST.__default.std).MSel(Dafny.Sequence.UnicodeFromString("option"))).MSel(Dafny.Sequence.UnicodeFromString("Option"))).MSel(Dafny.Sequence.UnicodeFromString("None"))); } else { - RAST._IType _899_underlying = (this).dtor_underlying; - Dafny.ISequence _900_n = (((this).is_PointerMut) ? (Dafny.Sequence.UnicodeFromString("null_mut")) : (Dafny.Sequence.UnicodeFromString("null"))); - if (((_899_underlying).is_Array) && (((_899_underlying).dtor_size).is_None)) { - return ((((RAST.__default.std).MSel(Dafny.Sequence.UnicodeFromString("ptr"))).MSel(_900_n)).ApplyType(Dafny.Sequence.FromElements(RAST.Type.create_Array((_899_underlying).dtor_underlying, Std.Wrappers.Option>.create_Some(Dafny.Sequence.UnicodeFromString("0")))))).Apply(Dafny.Sequence.FromElements()); + RAST._IType _900_underlying = (this).dtor_underlying; + Dafny.ISequence _901_n = (((this).is_PointerMut) ? (Dafny.Sequence.UnicodeFromString("null_mut")) : (Dafny.Sequence.UnicodeFromString("null"))); + if (((_900_underlying).is_Array) && (((_900_underlying).dtor_size).is_None)) { + return ((((RAST.__default.std).MSel(Dafny.Sequence.UnicodeFromString("ptr"))).MSel(_901_n)).ApplyType(Dafny.Sequence.FromElements(RAST.Type.create_Array((_900_underlying).dtor_underlying, Std.Wrappers.Option>.create_Some(Dafny.Sequence.UnicodeFromString("0")))))).Apply(Dafny.Sequence.FromElements()); } else { - return (((RAST.__default.std).MSel(Dafny.Sequence.UnicodeFromString("ptr"))).MSel(_900_n)).Apply(Dafny.Sequence.FromElements()); + return (((RAST.__default.std).MSel(Dafny.Sequence.UnicodeFromString("ptr"))).MSel(_901_n)).Apply(Dafny.Sequence.FromElements()); } } } public bool IsMultiArray() { - return ((this).is_TypeApp) && (Dafny.Helpers.Let((this).dtor_baseName, _pat_let5_0 => Dafny.Helpers.Let(_pat_let5_0, _901_baseName => Dafny.Helpers.Let, bool>((this).dtor_arguments, _pat_let6_0 => Dafny.Helpers.Let, bool>(_pat_let6_0, _902_args => (((((new BigInteger((_902_args).Count)) == (BigInteger.One)) && ((_901_baseName).is_TMemberSelect)) && (object.Equals((_901_baseName).dtor_base, RAST.__default.dafny__runtime__type))) && ((new BigInteger(((_901_baseName).dtor_name).Count)) >= (new BigInteger(5)))) && ((((_901_baseName).dtor_name).Subsequence(BigInteger.Zero, new BigInteger(5))).Equals(Dafny.Sequence.UnicodeFromString("Array")))))))); + return ((this).is_TypeApp) && (Dafny.Helpers.Let((this).dtor_baseName, _pat_let5_0 => Dafny.Helpers.Let(_pat_let5_0, _902_baseName => Dafny.Helpers.Let, bool>((this).dtor_arguments, _pat_let6_0 => Dafny.Helpers.Let, bool>(_pat_let6_0, _903_args => (((((new BigInteger((_903_args).Count)) == (BigInteger.One)) && ((_902_baseName).is_TMemberSelect)) && (object.Equals((_902_baseName).dtor_base, RAST.__default.dafny__runtime__type))) && ((new BigInteger(((_902_baseName).dtor_name).Count)) >= (new BigInteger(5)))) && ((((_902_baseName).dtor_name).Subsequence(BigInteger.Zero, new BigInteger(5))).Equals(Dafny.Sequence.UnicodeFromString("Array")))))))); } public Dafny.ISequence MultiArrayClass() { return ((this).dtor_baseName).dtor_name; @@ -2453,20 +2466,20 @@ public RAST._IType MultiArrayUnderlying() { } public RAST._IType TypeAtInitialization() { if ((this).IsObjectOrPointer()) { - RAST._IType _903_s = (this).ObjectOrPointerUnderlying(); - if (((_903_s).is_Array) && (((_903_s).dtor_size).is_None)) { - RAST._IType _904_newUnderlying = RAST.Type.create_Array(RAST.__default.MaybeUninitType((_903_s).dtor_underlying), Std.Wrappers.Option>.create_None()); + RAST._IType _904_s = (this).ObjectOrPointerUnderlying(); + if (((_904_s).is_Array) && (((_904_s).dtor_size).is_None)) { + RAST._IType _905_newUnderlying = RAST.Type.create_Array(RAST.__default.MaybeUninitType((_904_s).dtor_underlying), Std.Wrappers.Option>.create_None()); if ((this).IsObject()) { - return RAST.__default.ObjectType(_904_newUnderlying); + return RAST.__default.ObjectType(_905_newUnderlying); } else { - return RAST.Type.create_PointerMut(_904_newUnderlying); + return RAST.Type.create_PointerMut(_905_newUnderlying); } - } else if ((_903_s).IsMultiArray()) { - RAST._IType _905_newUnderlying = RAST.Type.create_TypeApp((_903_s).dtor_baseName, Dafny.Sequence.FromElements(RAST.__default.MaybeUninitType(((_903_s).dtor_arguments).Select(BigInteger.Zero)))); + } else if ((_904_s).IsMultiArray()) { + RAST._IType _906_newUnderlying = RAST.Type.create_TypeApp((_904_s).dtor_baseName, Dafny.Sequence.FromElements(RAST.__default.MaybeUninitType(((_904_s).dtor_arguments).Select(BigInteger.Zero)))); if ((this).IsObject()) { - return RAST.__default.ObjectType(_905_newUnderlying); + return RAST.__default.ObjectType(_906_newUnderlying); } else { - return RAST.Type.create_PointerMut(_905_newUnderlying); + return RAST.Type.create_PointerMut(_906_newUnderlying); } } else { return this; @@ -2480,11 +2493,11 @@ public bool IsMaybeUninit() { } public bool IsUninitArray() { if ((this).IsObjectOrPointer()) { - RAST._IType _906_s = (this).ObjectOrPointerUnderlying(); - if (((_906_s).is_Array) && (((_906_s).dtor_size).is_None)) { - return ((_906_s).dtor_underlying).IsMaybeUninit(); - } else if ((_906_s).IsMultiArray()) { - return (((_906_s).dtor_arguments).Select(BigInteger.Zero)).IsMaybeUninit(); + RAST._IType _907_s = (this).ObjectOrPointerUnderlying(); + if (((_907_s).is_Array) && (((_907_s).dtor_size).is_None)) { + return ((_907_s).dtor_underlying).IsMaybeUninit(); + } else if ((_907_s).IsMultiArray()) { + return (((_907_s).dtor_arguments).Select(BigInteger.Zero)).IsMaybeUninit(); } else { return false; } @@ -2508,8 +2521,8 @@ public bool IsObject() { if (object.Equals(name1, Dafny.Sequence.UnicodeFromString("dafny_runtime"))) { Dafny.ISequence name2 = baseName0.dtor_name; if (object.Equals(name2, Dafny.Sequence.UnicodeFromString("Object"))) { - Dafny.ISequence _907_elems1 = _source32.dtor_arguments; - return (new BigInteger((_907_elems1).Count)) == (BigInteger.One); + Dafny.ISequence _908_elems1 = _source32.dtor_arguments; + return (new BigInteger((_908_elems1).Count)) == (BigInteger.One); } } } @@ -2539,8 +2552,8 @@ public RAST._IType ObjectOrPointerUnderlying() { RAST._IType base3 = base2.dtor_base; Dafny.ISequence name3 = base3.dtor_name; Dafny.ISequence name4 = base2.dtor_name; - Dafny.ISequence _908_elems1 = _source33.dtor_arguments; - return (_908_elems1).Select(BigInteger.Zero); + Dafny.ISequence _909_elems1 = _source33.dtor_arguments; + return (_909_elems1).Select(BigInteger.Zero); } } } @@ -2558,9 +2571,9 @@ public bool IsBuiltinCollection() { if (object.Equals(name5, Dafny.Sequence.UnicodeFromString(""))) { Dafny.ISequence name6 = base4.dtor_name; if (object.Equals(name6, Dafny.Sequence.UnicodeFromString("dafny_runtime"))) { - Dafny.ISequence _909_tpe = baseName2.dtor_name; - Dafny.ISequence _910_elems1 = _source34.dtor_arguments; - return (((((_909_tpe).Equals(Dafny.Sequence.UnicodeFromString("Set"))) || ((_909_tpe).Equals(Dafny.Sequence.UnicodeFromString("Sequence")))) || ((_909_tpe).Equals(Dafny.Sequence.UnicodeFromString("Multiset")))) && ((new BigInteger((_910_elems1).Count)) == (BigInteger.One))) || (((_909_tpe).Equals(Dafny.Sequence.UnicodeFromString("Map"))) && ((new BigInteger((_910_elems1).Count)) == (new BigInteger(2)))); + Dafny.ISequence _910_tpe = baseName2.dtor_name; + Dafny.ISequence _911_elems1 = _source34.dtor_arguments; + return (((((_910_tpe).Equals(Dafny.Sequence.UnicodeFromString("Set"))) || ((_910_tpe).Equals(Dafny.Sequence.UnicodeFromString("Sequence")))) || ((_910_tpe).Equals(Dafny.Sequence.UnicodeFromString("Multiset")))) && ((new BigInteger((_911_elems1).Count)) == (BigInteger.One))) || (((_910_tpe).Equals(Dafny.Sequence.UnicodeFromString("Map"))) && ((new BigInteger((_911_elems1).Count)) == (new BigInteger(2)))); } } } @@ -2580,12 +2593,12 @@ public RAST._IType GetBuiltinCollectionElement() { RAST._IType base7 = base6.dtor_base; Dafny.ISequence name7 = base7.dtor_name; Dafny.ISequence name8 = base6.dtor_name; - Dafny.ISequence _911_tpe = baseName3.dtor_name; - Dafny.ISequence _912_elems = _source35.dtor_arguments; - if ((_911_tpe).Equals(Dafny.Sequence.UnicodeFromString("Map"))) { - return (_912_elems).Select(BigInteger.One); + Dafny.ISequence _912_tpe = baseName3.dtor_name; + Dafny.ISequence _913_elems = _source35.dtor_arguments; + if ((_912_tpe).Equals(Dafny.Sequence.UnicodeFromString("Map"))) { + return (_913_elems).Select(BigInteger.One); } else { - return (_912_elems).Select(BigInteger.Zero); + return (_913_elems).Select(BigInteger.Zero); } } } @@ -3311,18 +3324,18 @@ public Dafny.ISequence dtor_body { } } public Dafny.ISequence _ToString(Dafny.ISequence ind) { - Dafny.ISequence _913_tpConstraints = Std.Collections.Seq.__default.Filter(((System.Func)((_914_typeParamDecl) => { - return (new BigInteger(((_914_typeParamDecl).dtor_constraints).Count)).Sign == 1; + Dafny.ISequence _914_tpConstraints = Std.Collections.Seq.__default.Filter(((System.Func)((_915_typeParamDecl) => { + return (new BigInteger(((_915_typeParamDecl).dtor_constraints).Count)).Sign == 1; })), (this).dtor_typeParams); - Dafny.ISequence _915_additionalConstraints = RAST.__default.SeqToString(_913_tpConstraints, Dafny.Helpers.Id, Func>>>((_916_ind) => ((System.Func>)((_917_t) => { - return (_917_t)._ToString(Dafny.Sequence.Concat(_916_ind, RAST.__default.IND)); + Dafny.ISequence _916_additionalConstraints = RAST.__default.SeqToString(_914_tpConstraints, Dafny.Helpers.Id, Func>>>((_917_ind) => ((System.Func>)((_918_t) => { + return (_918_t)._ToString(Dafny.Sequence.Concat(_917_ind, RAST.__default.IND)); })))(ind), Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(",\n"), ind), RAST.__default.IND)); - Dafny.ISequence _918_parents = (((new BigInteger(((this).dtor_parents).Count)).Sign == 0) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(": "), RAST.__default.SeqToString((this).dtor_parents, Dafny.Helpers.Id, Func>>>((_919_ind) => ((System.Func>)((_920_t) => { - return (_920_t)._ToString(Dafny.Sequence.Concat(_919_ind, RAST.__default.IND)); + Dafny.ISequence _919_parents = (((new BigInteger(((this).dtor_parents).Count)).Sign == 0) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(": "), RAST.__default.SeqToString((this).dtor_parents, Dafny.Helpers.Id, Func>>>((_920_ind) => ((System.Func>)((_921_t) => { + return (_921_t)._ToString(Dafny.Sequence.Concat(_920_ind, RAST.__default.IND)); })))(ind), Dafny.Sequence.UnicodeFromString(" + "))))); - Dafny.ISequence _921_where = (((_915_additionalConstraints).Equals(Dafny.Sequence.UnicodeFromString(""))) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind), RAST.__default.IND), Dafny.Sequence.UnicodeFromString("where\n")), ind), RAST.__default.IND), _915_additionalConstraints))); - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("pub trait "), ((this).dtor_tpe)._ToString(ind)), _918_parents), _921_where), Dafny.Sequence.UnicodeFromString(" {")), RAST.__default.SeqToString((this).dtor_body, Dafny.Helpers.Id, Func>>>((_922_ind) => ((System.Func>)((_923_member) => { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _922_ind), RAST.__default.IND), (_923_member)._ToString(Dafny.Sequence.Concat(_922_ind, RAST.__default.IND))); + Dafny.ISequence _922_where = (((_916_additionalConstraints).Equals(Dafny.Sequence.UnicodeFromString(""))) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind), RAST.__default.IND), Dafny.Sequence.UnicodeFromString("where\n")), ind), RAST.__default.IND), _916_additionalConstraints))); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("pub trait "), ((this).dtor_tpe)._ToString(ind)), _919_parents), _922_where), Dafny.Sequence.UnicodeFromString(" {")), RAST.__default.SeqToString((this).dtor_body, Dafny.Helpers.Id, Func>>>((_923_ind) => ((System.Func>)((_924_member) => { + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _923_ind), RAST.__default.IND), (_924_member)._ToString(Dafny.Sequence.Concat(_923_ind, RAST.__default.IND))); })))(ind), Dafny.Sequence.UnicodeFromString(""))), (((new BigInteger(((this).dtor_body).Count)).Sign == 0) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind)))), Dafny.Sequence.UnicodeFromString("}")); } } @@ -3393,8 +3406,8 @@ public Dafny.ISequence dtor_body { } public abstract _IImpl DowncastClone(); public Dafny.ISequence _ToString(Dafny.ISequence ind) { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("impl"), RAST.TypeParamDecl.ToStringMultiple((this).dtor_typeParams, ind)), Dafny.Sequence.UnicodeFromString(" ")), ((this).dtor_tpe)._ToString(ind)), (((this).is_ImplFor) ? (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind), RAST.__default.IND), Dafny.Sequence.UnicodeFromString("for ")), ((this).dtor_forType)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND)))) : (Dafny.Sequence.UnicodeFromString("")))), ((!((this).dtor_where).Equals(Dafny.Sequence.UnicodeFromString(""))) ? (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind), RAST.__default.IND), (this).dtor_where)) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString(" {")), RAST.__default.SeqToString((this).dtor_body, Dafny.Helpers.Id, Func>>>((_924_ind) => ((System.Func>)((_925_member) => { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _924_ind), RAST.__default.IND), (_925_member)._ToString(Dafny.Sequence.Concat(_924_ind, RAST.__default.IND))); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("impl"), RAST.TypeParamDecl.ToStringMultiple((this).dtor_typeParams, ind)), Dafny.Sequence.UnicodeFromString(" ")), ((this).dtor_tpe)._ToString(ind)), (((this).is_ImplFor) ? (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind), RAST.__default.IND), Dafny.Sequence.UnicodeFromString("for ")), ((this).dtor_forType)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND)))) : (Dafny.Sequence.UnicodeFromString("")))), ((!((this).dtor_where).Equals(Dafny.Sequence.UnicodeFromString(""))) ? (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind), RAST.__default.IND), (this).dtor_where)) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString(" {")), RAST.__default.SeqToString((this).dtor_body, Dafny.Helpers.Id, Func>>>((_925_ind) => ((System.Func>)((_926_member) => { + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _925_ind), RAST.__default.IND), (_926_member)._ToString(Dafny.Sequence.Concat(_925_ind, RAST.__default.IND))); })))(ind), Dafny.Sequence.UnicodeFromString(""))), (((new BigInteger(((this).dtor_body).Count)).Sign == 0) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind)))), Dafny.Sequence.UnicodeFromString("}")); } } @@ -3930,9 +3943,9 @@ public RAST._IExpr dtor_rhs { } } public Dafny.ISequence _ToString(Dafny.ISequence ind) { - Dafny.ISequence _926_newIndent = ((((this).dtor_rhs).is_Block) ? (ind) : (Dafny.Sequence.Concat(ind, RAST.__default.IND))); - Dafny.ISequence _927_rhsString = ((this).dtor_rhs)._ToString(_926_newIndent); - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(RAST.Pattern._ToString((this).dtor_pattern, ind), Dafny.Sequence.UnicodeFromString(" =>")), ((((_927_rhsString).Contains(new Dafny.Rune('\n'))) && (((_927_rhsString).Select(BigInteger.Zero)) != (new Dafny.Rune('{')))) ? (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind), RAST.__default.IND), _927_rhsString)) : (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" "), _927_rhsString)))); + Dafny.ISequence _927_newIndent = ((((this).dtor_rhs).is_Block) ? (ind) : (Dafny.Sequence.Concat(ind, RAST.__default.IND))); + Dafny.ISequence _928_rhsString = ((this).dtor_rhs)._ToString(_927_newIndent); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(RAST.Pattern._ToString((this).dtor_pattern, ind), Dafny.Sequence.UnicodeFromString(" =>")), ((((_928_rhsString).Contains(new Dafny.Rune('\n'))) && (((_928_rhsString).Select(BigInteger.Zero)) != (new Dafny.Rune('{')))) ? (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind), RAST.__default.IND), _928_rhsString)) : (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" "), _928_rhsString)))); } } @@ -5045,12 +5058,12 @@ public RAST._IExpr Optimize() { if (underlying0.is_BinaryOp) { Dafny.ISequence op20 = underlying0.dtor_op2; if (object.Equals(op20, Dafny.Sequence.UnicodeFromString("=="))) { - RAST._IExpr _928_left = underlying0.dtor_left; - RAST._IExpr _929_right = underlying0.dtor_right; - DAST.Format._IBinaryOpFormat _930_format = underlying0.dtor_format2; + RAST._IExpr _929_left = underlying0.dtor_left; + RAST._IExpr _930_right = underlying0.dtor_right; + DAST.Format._IBinaryOpFormat _931_format = underlying0.dtor_format2; DAST.Format._IUnaryOpFormat format0 = _source36.dtor_format; if (format0.is_CombineFormat) { - return RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("!="), _928_left, _929_right, DAST.Format.BinaryOpFormat.create_NoFormat()); + return RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("!="), _929_left, _930_right, DAST.Format.BinaryOpFormat.create_NoFormat()); } } } @@ -5065,13 +5078,13 @@ public RAST._IExpr Optimize() { if (underlying1.is_BinaryOp) { Dafny.ISequence op21 = underlying1.dtor_op2; if (object.Equals(op21, Dafny.Sequence.UnicodeFromString("<"))) { - RAST._IExpr _931_left = underlying1.dtor_left; - RAST._IExpr _932_right = underlying1.dtor_right; + RAST._IExpr _932_left = underlying1.dtor_left; + RAST._IExpr _933_right = underlying1.dtor_right; DAST.Format._IBinaryOpFormat format20 = underlying1.dtor_format2; if (format20.is_NoFormat) { DAST.Format._IUnaryOpFormat format1 = _source36.dtor_format; if (format1.is_CombineFormat) { - return RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(">="), _931_left, _932_right, DAST.Format.BinaryOpFormat.create_NoFormat()); + return RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString(">="), _932_left, _933_right, DAST.Format.BinaryOpFormat.create_NoFormat()); } } } @@ -5087,13 +5100,13 @@ public RAST._IExpr Optimize() { if (underlying2.is_BinaryOp) { Dafny.ISequence op22 = underlying2.dtor_op2; if (object.Equals(op22, Dafny.Sequence.UnicodeFromString("<"))) { - RAST._IExpr _933_left = underlying2.dtor_left; - RAST._IExpr _934_right = underlying2.dtor_right; + RAST._IExpr _934_left = underlying2.dtor_left; + RAST._IExpr _935_right = underlying2.dtor_right; DAST.Format._IBinaryOpFormat format21 = underlying2.dtor_format2; if (format21.is_ReverseFormat) { DAST.Format._IUnaryOpFormat format2 = _source36.dtor_format; if (format2.is_CombineFormat) { - return RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<="), _934_right, _933_left, DAST.Format.BinaryOpFormat.create_NoFormat()); + return RAST.Expr.create_BinaryOp(Dafny.Sequence.UnicodeFromString("<="), _935_right, _934_left, DAST.Format.BinaryOpFormat.create_NoFormat()); } } } @@ -5105,41 +5118,41 @@ public RAST._IExpr Optimize() { if (_source36.is_Call) { RAST._IExpr obj0 = _source36.dtor_obj; if (obj0.is_MemberSelect) { - RAST._IExpr _935_r = obj0.dtor_obj; + RAST._IExpr _936_r = obj0.dtor_obj; Dafny.ISequence name9 = obj0.dtor_name; if (object.Equals(name9, Dafny.Sequence.UnicodeFromString("truncate!"))) { - Dafny.ISequence _936_args = _source36.dtor_arguments; - if (((!object.Equals(_935_r, RAST.__default.dafny__runtime)) && (!object.Equals(_935_r, RAST.__default.@global))) || ((new BigInteger((_936_args).Count)) != (new BigInteger(2)))) { + Dafny.ISequence _937_args = _source36.dtor_arguments; + if (((!object.Equals(_936_r, RAST.__default.dafny__runtime)) && (!object.Equals(_936_r, RAST.__default.@global))) || ((new BigInteger((_937_args).Count)) != (new BigInteger(2)))) { return this; } else { - RAST._IExpr _937_expr = (_936_args).Select(BigInteger.Zero); - RAST._IExpr _938_tpeExpr = (_936_args).Select(BigInteger.One); - if (!((_938_tpeExpr).is_ExprFromType)) { + RAST._IExpr _938_expr = (_937_args).Select(BigInteger.Zero); + RAST._IExpr _939_tpeExpr = (_937_args).Select(BigInteger.One); + if (!((_939_tpeExpr).is_ExprFromType)) { return this; } else { - RAST._IType _939_tpe = (_938_tpeExpr).dtor_tpe; - if (((((((((((_939_tpe).is_U8) || ((_939_tpe).is_U16)) || ((_939_tpe).is_U32)) || ((_939_tpe).is_U64)) || ((_939_tpe).is_U128)) || ((_939_tpe).is_I8)) || ((_939_tpe).is_I16)) || ((_939_tpe).is_I32)) || ((_939_tpe).is_I64)) || ((_939_tpe).is_I128)) { - RAST._IExpr _source37 = _937_expr; + RAST._IType _940_tpe = (_939_tpeExpr).dtor_tpe; + if (((((((((((_940_tpe).is_U8) || ((_940_tpe).is_U16)) || ((_940_tpe).is_U32)) || ((_940_tpe).is_U64)) || ((_940_tpe).is_U128)) || ((_940_tpe).is_I8)) || ((_940_tpe).is_I16)) || ((_940_tpe).is_I32)) || ((_940_tpe).is_I64)) || ((_940_tpe).is_I128)) { + RAST._IExpr _source37 = _938_expr; { if (_source37.is_Call) { RAST._IExpr obj1 = _source37.dtor_obj; if (obj1.is_MemberSelect) { - RAST._IExpr _940_base = obj1.dtor_obj; + RAST._IExpr _941_base = obj1.dtor_obj; Dafny.ISequence name10 = obj1.dtor_name; if (object.Equals(name10, Dafny.Sequence.UnicodeFromString("int!"))) { - Dafny.ISequence _941_args = _source37.dtor_arguments; - if (((new BigInteger((_941_args).Count)) == (BigInteger.One)) && ((object.Equals(_940_base, RAST.__default.dafny__runtime)) || (object.Equals(_940_base, RAST.__default.@global)))) { - RAST._IExpr _source38 = (_941_args).Select(BigInteger.Zero); + Dafny.ISequence _942_args = _source37.dtor_arguments; + if (((new BigInteger((_942_args).Count)) == (BigInteger.One)) && ((object.Equals(_941_base, RAST.__default.dafny__runtime)) || (object.Equals(_941_base, RAST.__default.@global)))) { + RAST._IExpr _source38 = (_942_args).Select(BigInteger.Zero); { if (_source38.is_LiteralInt) { - Dafny.ISequence _942_number = _source38.dtor_value; - return RAST.Expr.create_LiteralInt(_942_number); + Dafny.ISequence _943_number = _source38.dtor_value; + return RAST.Expr.create_LiteralInt(_943_number); } } { if (_source38.is_LiteralString) { - Dafny.ISequence _943_number = _source38.dtor_value; - return RAST.Expr.create_LiteralInt(_943_number); + Dafny.ISequence _944_number = _source38.dtor_value; + return RAST.Expr.create_LiteralInt(_944_number); } } { @@ -5168,23 +5181,23 @@ public RAST._IExpr Optimize() { if (_source36.is_StmtExpr) { RAST._IExpr stmt0 = _source36.dtor_stmt; if (stmt0.is_DeclareVar) { - RAST._IDeclareType _944_mod = stmt0.dtor_declareType; - Dafny.ISequence _945_name = stmt0.dtor_name; + RAST._IDeclareType _945_mod = stmt0.dtor_declareType; + Dafny.ISequence _946_name = stmt0.dtor_name; Std.Wrappers._IOption optType0 = stmt0.dtor_optType; if (optType0.is_Some) { - RAST._IType _946_tpe = optType0.dtor_value; + RAST._IType _947_tpe = optType0.dtor_value; Std.Wrappers._IOption optRhs0 = stmt0.dtor_optRhs; if (optRhs0.is_None) { RAST._IExpr rhs0 = _source36.dtor_rhs; if (rhs0.is_StmtExpr) { RAST._IExpr stmt1 = rhs0.dtor_stmt; if (stmt1.is_Assign) { - Std.Wrappers._IOption _947_name2 = stmt1.dtor_names; - RAST._IExpr _948_rhs = stmt1.dtor_rhs; - RAST._IExpr _949_last = rhs0.dtor_rhs; - if (object.Equals(_947_name2, Std.Wrappers.Option.create_Some(RAST.AssignLhs.create_LocalVar(_945_name)))) { - RAST._IExpr _950_rewriting = RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(_944_mod, _945_name, Std.Wrappers.Option.create_Some(_946_tpe), Std.Wrappers.Option.create_Some(_948_rhs)), _949_last); - return _950_rewriting; + Std.Wrappers._IOption _948_name2 = stmt1.dtor_names; + RAST._IExpr _949_rhs = stmt1.dtor_rhs; + RAST._IExpr _950_last = rhs0.dtor_rhs; + if (object.Equals(_948_name2, Std.Wrappers.Option.create_Some(RAST.AssignLhs.create_LocalVar(_946_name)))) { + RAST._IExpr _951_rewriting = RAST.Expr.create_StmtExpr(RAST.Expr.create_DeclareVar(_945_mod, _946_name, Std.Wrappers.Option.create_Some(_947_tpe), Std.Wrappers.Option.create_Some(_949_rhs)), _950_last); + return _951_rewriting; } else { return this; } @@ -5207,10 +5220,10 @@ public RAST._IExpr Optimize() { if (underlying3.is_BinaryOp) { Dafny.ISequence op23 = underlying3.dtor_op2; if (object.Equals(op23, Dafny.Sequence.UnicodeFromString("=="))) { - RAST._IExpr _951_a = underlying3.dtor_left; - RAST._IExpr _952_b = underlying3.dtor_right; - DAST.Format._IBinaryOpFormat _953_f = underlying3.dtor_format2; - DAST.Format._IUnaryOpFormat _954_of = cond0.dtor_format; + RAST._IExpr _952_a = underlying3.dtor_left; + RAST._IExpr _953_b = underlying3.dtor_right; + DAST.Format._IBinaryOpFormat _954_f = underlying3.dtor_format2; + DAST.Format._IUnaryOpFormat _955_of = cond0.dtor_format; RAST._IExpr thn0 = stmt2.dtor_thn; if (thn0.is_RawExpr) { Dafny.ISequence content0 = thn0.dtor_content; @@ -5219,9 +5232,9 @@ public RAST._IExpr Optimize() { if (els0.is_RawExpr) { Dafny.ISequence content1 = els0.dtor_content; if (object.Equals(content1, Dafny.Sequence.UnicodeFromString(""))) { - RAST._IExpr _955_last = _source36.dtor_rhs; - RAST._IExpr _956_rewriting = RAST.Expr.create_StmtExpr((RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("assert_eq!"))).Apply(Dafny.Sequence.FromElements(_951_a, _952_b)), _955_last); - return _956_rewriting; + RAST._IExpr _956_last = _source36.dtor_rhs; + RAST._IExpr _957_rewriting = RAST.Expr.create_StmtExpr((RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("assert_eq!"))).Apply(Dafny.Sequence.FromElements(_952_a, _953_b)), _956_last); + return _957_rewriting; } } } @@ -5261,8 +5274,8 @@ public bool RightRequiresParentheses(RAST._IExpr right) { RAST._IExpr _source39 = this; { if (_source39.is_MemberSelect) { - Dafny.ISequence _957_id = _source39.dtor_name; - return Std.Wrappers.Option>.create_Some(_957_id); + Dafny.ISequence _958_id = _source39.dtor_name; + return Std.Wrappers.Option>.create_Some(_958_id); } } { @@ -5297,17 +5310,17 @@ public bool RightRequiresParentheses(RAST._IExpr right) { } } public static Dafny.ISequence RemoveDoubleQuotes(Dafny.ISequence s) { - Dafny.ISequence _958___accumulator = Dafny.Sequence.FromElements(); + Dafny.ISequence _959___accumulator = Dafny.Sequence.FromElements(); TAIL_CALL_START: ; if ((new BigInteger((s).Count)) <= (BigInteger.One)) { - return Dafny.Sequence.Concat(_958___accumulator, s); + return Dafny.Sequence.Concat(_959___accumulator, s); } else if (((s).Subsequence(BigInteger.Zero, new BigInteger(2))).Equals(Dafny.Sequence.UnicodeFromString(@""""""))) { - _958___accumulator = Dafny.Sequence.Concat(_958___accumulator, Dafny.Sequence.UnicodeFromString(@"""")); + _959___accumulator = Dafny.Sequence.Concat(_959___accumulator, Dafny.Sequence.UnicodeFromString(@"""")); Dafny.ISequence _in119 = (s).Drop(new BigInteger(2)); s = _in119; goto TAIL_CALL_START; } else { - _958___accumulator = Dafny.Sequence.Concat(_958___accumulator, (s).Subsequence(BigInteger.Zero, BigInteger.One)); + _959___accumulator = Dafny.Sequence.Concat(_959___accumulator, (s).Subsequence(BigInteger.Zero, BigInteger.One)); Dafny.ISequence _in120 = (s).Drop(BigInteger.One); s = _in120; goto TAIL_CALL_START; @@ -5317,26 +5330,26 @@ public bool RightRequiresParentheses(RAST._IExpr right) { RAST._IExpr _source40 = (this).Optimize(); { if (_source40.is_Identifier) { - Dafny.ISequence _959_name = _source40.dtor_name; - return _959_name; + Dafny.ISequence _960_name = _source40.dtor_name; + return _960_name; } } { if (_source40.is_ExprFromType) { - RAST._IType _960_t = _source40.dtor_tpe; - return (_960_t)._ToString(ind); + RAST._IType _961_t = _source40.dtor_tpe; + return (_961_t)._ToString(ind); } } { if (_source40.is_LiteralInt) { - Dafny.ISequence _961_number = _source40.dtor_value; - return _961_number; + Dafny.ISequence _962_number = _source40.dtor_value; + return _962_number; } } { if (_source40.is_LiteralBool) { - bool _962_b = _source40.dtor_bvalue; - if (_962_b) { + bool _963_b = _source40.dtor_bvalue; + if (_963_b) { return Dafny.Sequence.UnicodeFromString("true"); } else { return Dafny.Sequence.UnicodeFromString("false"); @@ -5345,132 +5358,132 @@ public bool RightRequiresParentheses(RAST._IExpr right) { } { if (_source40.is_LiteralString) { - Dafny.ISequence _963_characters = _source40.dtor_value; - bool _964_binary = _source40.dtor_binary; - bool _965_verbatim = _source40.dtor_verbatim; - Dafny.ISequence _966_hashes = ((_965_verbatim) ? (Dafny.Sequence.Concat(RAST.Expr.MaxHashes(_963_characters, Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.UnicodeFromString("")), Dafny.Sequence.UnicodeFromString("#"))) : (Dafny.Sequence.UnicodeFromString(""))); - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(((_964_binary) ? (Dafny.Sequence.UnicodeFromString("b")) : (Dafny.Sequence.UnicodeFromString(""))), ((_965_verbatim) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("r"), _966_hashes)) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString("\"")), ((_965_verbatim) ? (RAST.Expr.RemoveDoubleQuotes(_963_characters)) : (_963_characters))), Dafny.Sequence.UnicodeFromString("\"")), _966_hashes); + Dafny.ISequence _964_characters = _source40.dtor_value; + bool _965_binary = _source40.dtor_binary; + bool _966_verbatim = _source40.dtor_verbatim; + Dafny.ISequence _967_hashes = ((_966_verbatim) ? (Dafny.Sequence.Concat(RAST.Expr.MaxHashes(_964_characters, Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.UnicodeFromString("")), Dafny.Sequence.UnicodeFromString("#"))) : (Dafny.Sequence.UnicodeFromString(""))); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(((_965_binary) ? (Dafny.Sequence.UnicodeFromString("b")) : (Dafny.Sequence.UnicodeFromString(""))), ((_966_verbatim) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("r"), _967_hashes)) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString("\"")), ((_966_verbatim) ? (RAST.Expr.RemoveDoubleQuotes(_964_characters)) : (_964_characters))), Dafny.Sequence.UnicodeFromString("\"")), _967_hashes); } } { if (_source40.is_Match) { - RAST._IExpr _967_matchee = _source40.dtor_matchee; - Dafny.ISequence _968_cases = _source40.dtor_cases; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("match "), (_967_matchee)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString(" {")), RAST.__default.SeqToString(_968_cases, Dafny.Helpers.Id, Func>>>((_969_ind) => ((System.Func>)((_970_c) => { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _969_ind), RAST.__default.IND), (_970_c)._ToString(Dafny.Sequence.Concat(_969_ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString(",")); + RAST._IExpr _968_matchee = _source40.dtor_matchee; + Dafny.ISequence _969_cases = _source40.dtor_cases; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("match "), (_968_matchee)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString(" {")), RAST.__default.SeqToString(_969_cases, Dafny.Helpers.Id, Func>>>((_970_ind) => ((System.Func>)((_971_c) => { + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _970_ind), RAST.__default.IND), (_971_c)._ToString(Dafny.Sequence.Concat(_970_ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString(",")); })))(ind), Dafny.Sequence.UnicodeFromString(""))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}")); } } { if (_source40.is_StmtExpr) { - RAST._IExpr _971_stmt = _source40.dtor_stmt; - RAST._IExpr _972_rhs = _source40.dtor_rhs; - if (((_971_stmt).is_RawExpr) && (((_971_stmt).dtor_content).Equals(Dafny.Sequence.UnicodeFromString("")))) { - return (_972_rhs)._ToString(ind); + RAST._IExpr _972_stmt = _source40.dtor_stmt; + RAST._IExpr _973_rhs = _source40.dtor_rhs; + if (((_972_stmt).is_RawExpr) && (((_972_stmt).dtor_content).Equals(Dafny.Sequence.UnicodeFromString("")))) { + return (_973_rhs)._ToString(ind); } else { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat((_971_stmt)._ToString(ind), (((_971_stmt).NoExtraSemicolonAfter()) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.UnicodeFromString(";")))), Dafny.Sequence.UnicodeFromString("\n")), ind), (_972_rhs)._ToString(ind)); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat((_972_stmt)._ToString(ind), (((_972_stmt).NoExtraSemicolonAfter()) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.UnicodeFromString(";")))), Dafny.Sequence.UnicodeFromString("\n")), ind), (_973_rhs)._ToString(ind)); } } } { if (_source40.is_Block) { - RAST._IExpr _973_underlying = _source40.dtor_underlying; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("{\n"), ind), RAST.__default.IND), (_973_underlying)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}")); + RAST._IExpr _974_underlying = _source40.dtor_underlying; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("{\n"), ind), RAST.__default.IND), (_974_underlying)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}")); } } { if (_source40.is_IfExpr) { - RAST._IExpr _974_cond = _source40.dtor_cond; - RAST._IExpr _975_thn = _source40.dtor_thn; - RAST._IExpr _976_els = _source40.dtor_els; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("if "), (_974_cond)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString(" {\n")), ind), RAST.__default.IND), (_975_thn)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}")), ((object.Equals(_976_els, RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")))) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" else {\n"), ind), RAST.__default.IND), (_976_els)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}"))))); + RAST._IExpr _975_cond = _source40.dtor_cond; + RAST._IExpr _976_thn = _source40.dtor_thn; + RAST._IExpr _977_els = _source40.dtor_els; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("if "), (_975_cond)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString(" {\n")), ind), RAST.__default.IND), (_976_thn)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}")), ((object.Equals(_977_els, RAST.Expr.create_RawExpr(Dafny.Sequence.UnicodeFromString("")))) ? (Dafny.Sequence.UnicodeFromString("")) : (Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" else {\n"), ind), RAST.__default.IND), (_977_els)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}"))))); } } { if (_source40.is_StructBuild) { - RAST._IExpr _977_name = _source40.dtor_underlying; - Dafny.ISequence _978_assignments = _source40.dtor_assignments; - if (((new BigInteger((_978_assignments).Count)).Sign == 1) && ((((_978_assignments).Select(BigInteger.Zero)).dtor_identifier).Equals(Dafny.Sequence.UnicodeFromString("0")))) { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat((_977_name)._ToString(ind), Dafny.Sequence.UnicodeFromString(" (")), RAST.__default.SeqToString(_978_assignments, Dafny.Helpers.Id, Func>>>((_979_ind) => ((System.Func>)((_980_assignment) => { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _979_ind), RAST.__default.IND), ((_980_assignment).dtor_rhs)._ToString(Dafny.Sequence.Concat(_979_ind, RAST.__default.IND))); - })))(ind), Dafny.Sequence.UnicodeFromString(","))), (((new BigInteger((_978_assignments).Count)) > (BigInteger.One)) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind)) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString(")")); + RAST._IExpr _978_name = _source40.dtor_underlying; + Dafny.ISequence _979_assignments = _source40.dtor_assignments; + if (((new BigInteger((_979_assignments).Count)).Sign == 1) && ((((_979_assignments).Select(BigInteger.Zero)).dtor_identifier).Equals(Dafny.Sequence.UnicodeFromString("0")))) { + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat((_978_name)._ToString(ind), Dafny.Sequence.UnicodeFromString(" (")), RAST.__default.SeqToString(_979_assignments, Dafny.Helpers.Id, Func>>>((_980_ind) => ((System.Func>)((_981_assignment) => { + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _980_ind), RAST.__default.IND), ((_981_assignment).dtor_rhs)._ToString(Dafny.Sequence.Concat(_980_ind, RAST.__default.IND))); + })))(ind), Dafny.Sequence.UnicodeFromString(","))), (((new BigInteger((_979_assignments).Count)) > (BigInteger.One)) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind)) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString(")")); } else { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat((_977_name)._ToString(ind), Dafny.Sequence.UnicodeFromString(" {")), RAST.__default.SeqToString(_978_assignments, Dafny.Helpers.Id, Func>>>((_981_ind) => ((System.Func>)((_982_assignment) => { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _981_ind), RAST.__default.IND), (_982_assignment)._ToString(Dafny.Sequence.Concat(_981_ind, RAST.__default.IND))); - })))(ind), Dafny.Sequence.UnicodeFromString(","))), (((new BigInteger((_978_assignments).Count)).Sign == 1) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind)) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString("}")); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat((_978_name)._ToString(ind), Dafny.Sequence.UnicodeFromString(" {")), RAST.__default.SeqToString(_979_assignments, Dafny.Helpers.Id, Func>>>((_982_ind) => ((System.Func>)((_983_assignment) => { + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _982_ind), RAST.__default.IND), (_983_assignment)._ToString(Dafny.Sequence.Concat(_982_ind, RAST.__default.IND))); + })))(ind), Dafny.Sequence.UnicodeFromString(","))), (((new BigInteger((_979_assignments).Count)).Sign == 1) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind)) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString("}")); } } } { if (_source40.is_Tuple) { - Dafny.ISequence _983_arguments = _source40.dtor_arguments; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("("), RAST.__default.SeqToString(_983_arguments, Dafny.Helpers.Id, Func>>>((_984_ind) => ((System.Func>)((_985_arg) => { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _984_ind), RAST.__default.IND), (_985_arg)._ToString(Dafny.Sequence.Concat(_984_ind, RAST.__default.IND))); - })))(ind), Dafny.Sequence.UnicodeFromString(","))), (((new BigInteger((_983_arguments).Count)).Sign == 1) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind)) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString(")")); + Dafny.ISequence _984_arguments = _source40.dtor_arguments; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("("), RAST.__default.SeqToString(_984_arguments, Dafny.Helpers.Id, Func>>>((_985_ind) => ((System.Func>)((_986_arg) => { + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), _985_ind), RAST.__default.IND), (_986_arg)._ToString(Dafny.Sequence.Concat(_985_ind, RAST.__default.IND))); + })))(ind), Dafny.Sequence.UnicodeFromString(","))), (((new BigInteger((_984_arguments).Count)).Sign == 1) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("\n"), ind)) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString(")")); } } { if (_source40.is_UnaryOp) { - Dafny.ISequence _986_op = _source40.dtor_op1; - RAST._IExpr _987_underlying = _source40.dtor_underlying; - DAST.Format._IUnaryOpFormat _988_format = _source40.dtor_format; - _System._ITuple2, Dafny.ISequence> _let_tmp_rhs41 = ((((this).printingInfo).NeedParenthesesFor((_987_underlying).printingInfo)) ? (_System.Tuple2, Dafny.ISequence>.create(Dafny.Sequence.UnicodeFromString("("), Dafny.Sequence.UnicodeFromString(")"))) : (_System.Tuple2, Dafny.ISequence>.create(Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.UnicodeFromString("")))); - Dafny.ISequence _989_leftP = _let_tmp_rhs41.dtor__0; - Dafny.ISequence _990_rightP = _let_tmp_rhs41.dtor__1; - Dafny.ISequence _991_leftOp = ((((_986_op).Equals(Dafny.Sequence.UnicodeFromString("&mut"))) && (!(_989_leftP).Equals(Dafny.Sequence.UnicodeFromString("(")))) ? (Dafny.Sequence.Concat(_986_op, Dafny.Sequence.UnicodeFromString(" "))) : ((((_986_op).Equals(Dafny.Sequence.UnicodeFromString("?"))) ? (Dafny.Sequence.UnicodeFromString("")) : (_986_op)))); - Dafny.ISequence _992_rightOp = (((_986_op).Equals(Dafny.Sequence.UnicodeFromString("?"))) ? (_986_op) : (Dafny.Sequence.UnicodeFromString(""))); - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_991_leftOp, _989_leftP), (_987_underlying)._ToString(ind)), _990_rightP), _992_rightOp); + Dafny.ISequence _987_op = _source40.dtor_op1; + RAST._IExpr _988_underlying = _source40.dtor_underlying; + DAST.Format._IUnaryOpFormat _989_format = _source40.dtor_format; + _System._ITuple2, Dafny.ISequence> _let_tmp_rhs41 = ((((this).printingInfo).NeedParenthesesFor((_988_underlying).printingInfo)) ? (_System.Tuple2, Dafny.ISequence>.create(Dafny.Sequence.UnicodeFromString("("), Dafny.Sequence.UnicodeFromString(")"))) : (_System.Tuple2, Dafny.ISequence>.create(Dafny.Sequence.UnicodeFromString(""), Dafny.Sequence.UnicodeFromString("")))); + Dafny.ISequence _990_leftP = _let_tmp_rhs41.dtor__0; + Dafny.ISequence _991_rightP = _let_tmp_rhs41.dtor__1; + Dafny.ISequence _992_leftOp = ((((_987_op).Equals(Dafny.Sequence.UnicodeFromString("&mut"))) && (!(_990_leftP).Equals(Dafny.Sequence.UnicodeFromString("(")))) ? (Dafny.Sequence.Concat(_987_op, Dafny.Sequence.UnicodeFromString(" "))) : ((((_987_op).Equals(Dafny.Sequence.UnicodeFromString("?"))) ? (Dafny.Sequence.UnicodeFromString("")) : (_987_op)))); + Dafny.ISequence _993_rightOp = (((_987_op).Equals(Dafny.Sequence.UnicodeFromString("?"))) ? (_987_op) : (Dafny.Sequence.UnicodeFromString(""))); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_992_leftOp, _990_leftP), (_988_underlying)._ToString(ind)), _991_rightP), _993_rightOp); } } { if (_source40.is_TypeAscription) { - RAST._IExpr _993_left = _source40.dtor_left; - RAST._IType _994_tpe = _source40.dtor_tpe; - _System._ITuple2, Dafny.ISequence> _let_tmp_rhs42 = (this).LeftParentheses(_993_left); - Dafny.ISequence _995_leftLeftP = _let_tmp_rhs42.dtor__0; - Dafny.ISequence _996_leftRightP = _let_tmp_rhs42.dtor__1; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_995_leftLeftP, (_993_left)._ToString(RAST.__default.IND)), _996_leftRightP), Dafny.Sequence.UnicodeFromString(" as ")), (_994_tpe)._ToString(RAST.__default.IND)); + RAST._IExpr _994_left = _source40.dtor_left; + RAST._IType _995_tpe = _source40.dtor_tpe; + _System._ITuple2, Dafny.ISequence> _let_tmp_rhs42 = (this).LeftParentheses(_994_left); + Dafny.ISequence _996_leftLeftP = _let_tmp_rhs42.dtor__0; + Dafny.ISequence _997_leftRightP = _let_tmp_rhs42.dtor__1; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_996_leftLeftP, (_994_left)._ToString(RAST.__default.IND)), _997_leftRightP), Dafny.Sequence.UnicodeFromString(" as ")), (_995_tpe)._ToString(RAST.__default.IND)); } } { if (_source40.is_BinaryOp) { - Dafny.ISequence _997_op2 = _source40.dtor_op2; - RAST._IExpr _998_left = _source40.dtor_left; - RAST._IExpr _999_right = _source40.dtor_right; - DAST.Format._IBinaryOpFormat _1000_format = _source40.dtor_format2; - _System._ITuple2, Dafny.ISequence> _let_tmp_rhs43 = (this).LeftParentheses(_998_left); - Dafny.ISequence _1001_leftLeftP = _let_tmp_rhs43.dtor__0; - Dafny.ISequence _1002_leftRighP = _let_tmp_rhs43.dtor__1; - _System._ITuple2, Dafny.ISequence> _let_tmp_rhs44 = (this).RightParentheses(_999_right); - Dafny.ISequence _1003_rightLeftP = _let_tmp_rhs44.dtor__0; - Dafny.ISequence _1004_rightRightP = _let_tmp_rhs44.dtor__1; - Dafny.ISequence _1005_opRendered = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" "), _997_op2), Dafny.Sequence.UnicodeFromString(" ")); - Dafny.ISequence _1006_indLeft = (((_1001_leftLeftP).Equals(Dafny.Sequence.UnicodeFromString("("))) ? (Dafny.Sequence.Concat(ind, RAST.__default.IND)) : (ind)); - Dafny.ISequence _1007_indRight = (((_1003_rightLeftP).Equals(Dafny.Sequence.UnicodeFromString("("))) ? (Dafny.Sequence.Concat(ind, RAST.__default.IND)) : (ind)); - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1001_leftLeftP, (_998_left)._ToString(_1006_indLeft)), _1002_leftRighP), _1005_opRendered), _1003_rightLeftP), (_999_right)._ToString(_1007_indRight)), _1004_rightRightP); + Dafny.ISequence _998_op2 = _source40.dtor_op2; + RAST._IExpr _999_left = _source40.dtor_left; + RAST._IExpr _1000_right = _source40.dtor_right; + DAST.Format._IBinaryOpFormat _1001_format = _source40.dtor_format2; + _System._ITuple2, Dafny.ISequence> _let_tmp_rhs43 = (this).LeftParentheses(_999_left); + Dafny.ISequence _1002_leftLeftP = _let_tmp_rhs43.dtor__0; + Dafny.ISequence _1003_leftRighP = _let_tmp_rhs43.dtor__1; + _System._ITuple2, Dafny.ISequence> _let_tmp_rhs44 = (this).RightParentheses(_1000_right); + Dafny.ISequence _1004_rightLeftP = _let_tmp_rhs44.dtor__0; + Dafny.ISequence _1005_rightRightP = _let_tmp_rhs44.dtor__1; + Dafny.ISequence _1006_opRendered = Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" "), _998_op2), Dafny.Sequence.UnicodeFromString(" ")); + Dafny.ISequence _1007_indLeft = (((_1002_leftLeftP).Equals(Dafny.Sequence.UnicodeFromString("("))) ? (Dafny.Sequence.Concat(ind, RAST.__default.IND)) : (ind)); + Dafny.ISequence _1008_indRight = (((_1004_rightLeftP).Equals(Dafny.Sequence.UnicodeFromString("("))) ? (Dafny.Sequence.Concat(ind, RAST.__default.IND)) : (ind)); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1002_leftLeftP, (_999_left)._ToString(_1007_indLeft)), _1003_leftRighP), _1006_opRendered), _1004_rightLeftP), (_1000_right)._ToString(_1008_indRight)), _1005_rightRightP); } } { if (_source40.is_DeclareVar) { - RAST._IDeclareType _1008_declareType = _source40.dtor_declareType; - Dafny.ISequence _1009_name = _source40.dtor_name; - Std.Wrappers._IOption _1010_optType = _source40.dtor_optType; - Std.Wrappers._IOption _1011_optExpr = _source40.dtor_optRhs; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("let "), ((object.Equals(_1008_declareType, RAST.DeclareType.create_MUT())) ? (Dafny.Sequence.UnicodeFromString("mut ")) : (Dafny.Sequence.UnicodeFromString("")))), _1009_name), (((_1010_optType).is_Some) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(": "), ((_1010_optType).dtor_value)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND)))) : (Dafny.Sequence.UnicodeFromString("")))), (((_1011_optExpr).is_Some) ? (Dafny.Helpers.Let, Dafny.ISequence>(((_1011_optExpr).dtor_value)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND)), _pat_let7_0 => Dafny.Helpers.Let, Dafny.ISequence>(_pat_let7_0, _1012_optExprString => (((_1012_optExprString).Equals(Dafny.Sequence.UnicodeFromString(""))) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("= /*issue with empty RHS*/"), ((((_1011_optExpr).dtor_value).is_RawExpr) ? (Dafny.Sequence.UnicodeFromString("Empty Raw expr")) : (((((_1011_optExpr).dtor_value).is_LiteralString) ? (Dafny.Sequence.UnicodeFromString("Empty string literal")) : (((((_1011_optExpr).dtor_value).is_LiteralInt) ? (Dafny.Sequence.UnicodeFromString("Empty int literal")) : (Dafny.Sequence.UnicodeFromString("Another case"))))))))) : (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" = "), _1012_optExprString)))))) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString(";")); + RAST._IDeclareType _1009_declareType = _source40.dtor_declareType; + Dafny.ISequence _1010_name = _source40.dtor_name; + Std.Wrappers._IOption _1011_optType = _source40.dtor_optType; + Std.Wrappers._IOption _1012_optExpr = _source40.dtor_optRhs; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("let "), ((object.Equals(_1009_declareType, RAST.DeclareType.create_MUT())) ? (Dafny.Sequence.UnicodeFromString("mut ")) : (Dafny.Sequence.UnicodeFromString("")))), _1010_name), (((_1011_optType).is_Some) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(": "), ((_1011_optType).dtor_value)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND)))) : (Dafny.Sequence.UnicodeFromString("")))), (((_1012_optExpr).is_Some) ? (Dafny.Helpers.Let, Dafny.ISequence>(((_1012_optExpr).dtor_value)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND)), _pat_let7_0 => Dafny.Helpers.Let, Dafny.ISequence>(_pat_let7_0, _1013_optExprString => (((_1013_optExprString).Equals(Dafny.Sequence.UnicodeFromString(""))) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("= /*issue with empty RHS*/"), ((((_1012_optExpr).dtor_value).is_RawExpr) ? (Dafny.Sequence.UnicodeFromString("Empty Raw expr")) : (((((_1012_optExpr).dtor_value).is_LiteralString) ? (Dafny.Sequence.UnicodeFromString("Empty string literal")) : (((((_1012_optExpr).dtor_value).is_LiteralInt) ? (Dafny.Sequence.UnicodeFromString("Empty int literal")) : (Dafny.Sequence.UnicodeFromString("Another case"))))))))) : (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" = "), _1013_optExprString)))))) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString(";")); } } { if (_source40.is_Assign) { - Std.Wrappers._IOption _1013_names = _source40.dtor_names; - RAST._IExpr _1014_expr = _source40.dtor_rhs; - Dafny.ISequence _1015_lhs = ((System.Func>)(() => { - Std.Wrappers._IOption _source41 = _1013_names; + Std.Wrappers._IOption _1014_names = _source40.dtor_names; + RAST._IExpr _1015_expr = _source40.dtor_rhs; + Dafny.ISequence _1016_lhs = ((System.Func>)(() => { + Std.Wrappers._IOption _source41 = _1014_names; { if (_source41.is_Some) { RAST._IAssignLhs value0 = _source41.dtor_value; if (value0.is_LocalVar) { - Dafny.ISequence _1016_name = value0.dtor_name; - return Dafny.Sequence.Concat(_1016_name, Dafny.Sequence.UnicodeFromString(" = ")); + Dafny.ISequence _1017_name = value0.dtor_name; + return Dafny.Sequence.Concat(_1017_name, Dafny.Sequence.UnicodeFromString(" = ")); } } } @@ -5478,12 +5491,12 @@ public bool RightRequiresParentheses(RAST._IExpr right) { if (_source41.is_Some) { RAST._IAssignLhs value1 = _source41.dtor_value; if (value1.is_SelectMember) { - RAST._IExpr _1017_member = value1.dtor_on; - Dafny.ISequence _1018_field = value1.dtor_field; - _System._ITuple2, Dafny.ISequence> _let_tmp_rhs45 = (RAST.Expr.create_Select(_1017_member, _1018_field)).LeftParentheses(_1017_member); - Dafny.ISequence _1019_leftP = _let_tmp_rhs45.dtor__0; - Dafny.ISequence _1020_rightP = _let_tmp_rhs45.dtor__1; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1019_leftP, (_1017_member)._ToString(ind)), _1020_rightP), Dafny.Sequence.UnicodeFromString(".")), _1018_field), Dafny.Sequence.UnicodeFromString(" = ")); + RAST._IExpr _1018_member = value1.dtor_on; + Dafny.ISequence _1019_field = value1.dtor_field; + _System._ITuple2, Dafny.ISequence> _let_tmp_rhs45 = (RAST.Expr.create_Select(_1018_member, _1019_field)).LeftParentheses(_1018_member); + Dafny.ISequence _1020_leftP = _let_tmp_rhs45.dtor__0; + Dafny.ISequence _1021_rightP = _let_tmp_rhs45.dtor__1; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1020_leftP, (_1018_member)._ToString(ind)), _1021_rightP), Dafny.Sequence.UnicodeFromString(".")), _1019_field), Dafny.Sequence.UnicodeFromString(" = ")); } } } @@ -5491,9 +5504,9 @@ public bool RightRequiresParentheses(RAST._IExpr right) { if (_source41.is_Some) { RAST._IAssignLhs value2 = _source41.dtor_value; if (value2.is_ExtractTuple) { - Dafny.ISequence> _1021_names = value2.dtor_names; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("("), RAST.__default.SeqToString>(_1021_names, ((System.Func, Dafny.ISequence>)((_1022_name) => { - return _1022_name; + Dafny.ISequence> _1022_names = value2.dtor_names; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("("), RAST.__default.SeqToString>(_1022_names, ((System.Func, Dafny.ISequence>)((_1023_name) => { + return _1023_name; })), Dafny.Sequence.UnicodeFromString(","))), Dafny.Sequence.UnicodeFromString(") = ")); } } @@ -5502,13 +5515,13 @@ public bool RightRequiresParentheses(RAST._IExpr right) { if (_source41.is_Some) { RAST._IAssignLhs value3 = _source41.dtor_value; if (value3.is_Index) { - RAST._IExpr _1023_e = value3.dtor_expr; - Dafny.ISequence _1024_indices = value3.dtor_indices; - _System._ITuple2, Dafny.ISequence> _let_tmp_rhs46 = (RAST.Expr.create_Call(_1023_e, _1024_indices)).LeftParentheses(_1023_e); - Dafny.ISequence _1025_leftP = _let_tmp_rhs46.dtor__0; - Dafny.ISequence _1026_rightP = _let_tmp_rhs46.dtor__1; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1025_leftP, (_1023_e)._ToString(ind)), _1026_rightP), Dafny.Sequence.UnicodeFromString("[")), RAST.__default.SeqToString(_1024_indices, Dafny.Helpers.Id, Func>>>((_1027_ind) => ((System.Func>)((_1028_index) => { - return (_1028_index)._ToString(Dafny.Sequence.Concat(_1027_ind, RAST.__default.IND)); + RAST._IExpr _1024_e = value3.dtor_expr; + Dafny.ISequence _1025_indices = value3.dtor_indices; + _System._ITuple2, Dafny.ISequence> _let_tmp_rhs46 = (RAST.Expr.create_Call(_1024_e, _1025_indices)).LeftParentheses(_1024_e); + Dafny.ISequence _1026_leftP = _let_tmp_rhs46.dtor__0; + Dafny.ISequence _1027_rightP = _let_tmp_rhs46.dtor__1; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1026_leftP, (_1024_e)._ToString(ind)), _1027_rightP), Dafny.Sequence.UnicodeFromString("[")), RAST.__default.SeqToString(_1025_indices, Dafny.Helpers.Id, Func>>>((_1028_ind) => ((System.Func>)((_1029_index) => { + return (_1029_index)._ToString(Dafny.Sequence.Concat(_1028_ind, RAST.__default.IND)); })))(ind), Dafny.Sequence.UnicodeFromString("]["))), Dafny.Sequence.UnicodeFromString("] = ")); } } @@ -5517,24 +5530,24 @@ public bool RightRequiresParentheses(RAST._IExpr right) { return Dafny.Sequence.UnicodeFromString("_ = "); } }))(); - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1015_lhs, (_1014_expr)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString(";")); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1016_lhs, (_1015_expr)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString(";")); } } { if (_source40.is_Labelled) { - Dafny.ISequence _1029_name = _source40.dtor_lbl; - RAST._IExpr _1030_underlying = _source40.dtor_underlying; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("'"), _1029_name), Dafny.Sequence.UnicodeFromString(": ")), (_1030_underlying)._ToString(ind)); + Dafny.ISequence _1030_name = _source40.dtor_lbl; + RAST._IExpr _1031_underlying = _source40.dtor_underlying; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("'"), _1030_name), Dafny.Sequence.UnicodeFromString(": ")), (_1031_underlying)._ToString(ind)); } } { if (_source40.is_Break) { - Std.Wrappers._IOption> _1031_optLbl = _source40.dtor_optLbl; - Std.Wrappers._IOption> _source42 = _1031_optLbl; + Std.Wrappers._IOption> _1032_optLbl = _source40.dtor_optLbl; + Std.Wrappers._IOption> _source42 = _1032_optLbl; { if (_source42.is_Some) { - Dafny.ISequence _1032_lbl = _source42.dtor_value; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("break '"), _1032_lbl), Dafny.Sequence.UnicodeFromString(";")); + Dafny.ISequence _1033_lbl = _source42.dtor_value; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("break '"), _1033_lbl), Dafny.Sequence.UnicodeFromString(";")); } } { @@ -5544,12 +5557,12 @@ public bool RightRequiresParentheses(RAST._IExpr right) { } { if (_source40.is_Continue) { - Std.Wrappers._IOption> _1033_optLbl = _source40.dtor_optLbl; - Std.Wrappers._IOption> _source43 = _1033_optLbl; + Std.Wrappers._IOption> _1034_optLbl = _source40.dtor_optLbl; + Std.Wrappers._IOption> _source43 = _1034_optLbl; { if (_source43.is_Some) { - Dafny.ISequence _1034_lbl = _source43.dtor_value; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("continue '"), _1034_lbl), Dafny.Sequence.UnicodeFromString(";")); + Dafny.ISequence _1035_lbl = _source43.dtor_value; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("continue '"), _1035_lbl), Dafny.Sequence.UnicodeFromString(";")); } } { @@ -5559,61 +5572,61 @@ public bool RightRequiresParentheses(RAST._IExpr right) { } { if (_source40.is_Loop) { - Std.Wrappers._IOption _1035_optCond = _source40.dtor_optCond; - RAST._IExpr _1036_underlying = _source40.dtor_underlying; + Std.Wrappers._IOption _1036_optCond = _source40.dtor_optCond; + RAST._IExpr _1037_underlying = _source40.dtor_underlying; return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(((System.Func>)(() => { - Std.Wrappers._IOption _source44 = _1035_optCond; + Std.Wrappers._IOption _source44 = _1036_optCond; { if (_source44.is_None) { return Dafny.Sequence.UnicodeFromString("loop"); } } { - RAST._IExpr _1037_c = _source44.dtor_value; - return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("while "), (_1037_c)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))); + RAST._IExpr _1038_c = _source44.dtor_value; + return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("while "), (_1038_c)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))); } - }))(), Dafny.Sequence.UnicodeFromString(" {\n")), ind), RAST.__default.IND), (_1036_underlying)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}")); + }))(), Dafny.Sequence.UnicodeFromString(" {\n")), ind), RAST.__default.IND), (_1037_underlying)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}")); } } { if (_source40.is_For) { - Dafny.ISequence _1038_name = _source40.dtor_name; - RAST._IExpr _1039_range = _source40.dtor_range; - RAST._IExpr _1040_body = _source40.dtor_body; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("for "), _1038_name), Dafny.Sequence.UnicodeFromString(" in ")), (_1039_range)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString(" {\n")), ind), RAST.__default.IND), (_1040_body)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}")); + Dafny.ISequence _1039_name = _source40.dtor_name; + RAST._IExpr _1040_range = _source40.dtor_range; + RAST._IExpr _1041_body = _source40.dtor_body; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("for "), _1039_name), Dafny.Sequence.UnicodeFromString(" in ")), (_1040_range)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString(" {\n")), ind), RAST.__default.IND), (_1041_body)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}")); } } { if (_source40.is_Return) { - Std.Wrappers._IOption _1041_optExpr = _source40.dtor_optExpr; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("return"), (((_1041_optExpr).is_Some) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" "), ((_1041_optExpr).dtor_value)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND)))) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString(";")); + Std.Wrappers._IOption _1042_optExpr = _source40.dtor_optExpr; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("return"), (((_1042_optExpr).is_Some) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" "), ((_1042_optExpr).dtor_value)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND)))) : (Dafny.Sequence.UnicodeFromString("")))), Dafny.Sequence.UnicodeFromString(";")); } } { if (_source40.is_CallType) { - RAST._IExpr _1042_expr = _source40.dtor_obj; - Dafny.ISequence _1043_tpes = _source40.dtor_typeParameters; - _System._ITuple2, Dafny.ISequence> _let_tmp_rhs47 = (this).LeftParentheses(_1042_expr); - Dafny.ISequence _1044_leftP = _let_tmp_rhs47.dtor__0; - Dafny.ISequence _1045_rightP = _let_tmp_rhs47.dtor__1; - if ((_1043_tpes).Equals(Dafny.Sequence.FromElements())) { - return (_1042_expr)._ToString(ind); + RAST._IExpr _1043_expr = _source40.dtor_obj; + Dafny.ISequence _1044_tpes = _source40.dtor_typeParameters; + _System._ITuple2, Dafny.ISequence> _let_tmp_rhs47 = (this).LeftParentheses(_1043_expr); + Dafny.ISequence _1045_leftP = _let_tmp_rhs47.dtor__0; + Dafny.ISequence _1046_rightP = _let_tmp_rhs47.dtor__1; + if ((_1044_tpes).Equals(Dafny.Sequence.FromElements())) { + return (_1043_expr)._ToString(ind); } else { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1044_leftP, (_1042_expr)._ToString(ind)), _1045_rightP), Dafny.Sequence.UnicodeFromString("::<")), RAST.__default.SeqToString(_1043_tpes, Dafny.Helpers.Id, Func>>>((_1046_ind) => ((System.Func>)((_1047_tpe) => { - return (_1047_tpe)._ToString(Dafny.Sequence.Concat(_1046_ind, RAST.__default.IND)); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1045_leftP, (_1043_expr)._ToString(ind)), _1046_rightP), Dafny.Sequence.UnicodeFromString("::<")), RAST.__default.SeqToString(_1044_tpes, Dafny.Helpers.Id, Func>>>((_1047_ind) => ((System.Func>)((_1048_tpe) => { + return (_1048_tpe)._ToString(Dafny.Sequence.Concat(_1047_ind, RAST.__default.IND)); })))(ind), Dafny.Sequence.UnicodeFromString(", "))), Dafny.Sequence.UnicodeFromString(">")); } } } { if (_source40.is_Call) { - RAST._IExpr _1048_expr = _source40.dtor_obj; - Dafny.ISequence _1049_args = _source40.dtor_arguments; - _System._ITuple2, Dafny.ISequence> _let_tmp_rhs48 = (this).LeftParentheses(_1048_expr); - Dafny.ISequence _1050_leftP = _let_tmp_rhs48.dtor__0; - Dafny.ISequence _1051_rightP = _let_tmp_rhs48.dtor__1; + RAST._IExpr _1049_expr = _source40.dtor_obj; + Dafny.ISequence _1050_args = _source40.dtor_arguments; + _System._ITuple2, Dafny.ISequence> _let_tmp_rhs48 = (this).LeftParentheses(_1049_expr); + Dafny.ISequence _1051_leftP = _let_tmp_rhs48.dtor__0; + Dafny.ISequence _1052_rightP = _let_tmp_rhs48.dtor__1; _System._ITuple2, Dafny.ISequence> _let_tmp_rhs49 = ((System.Func<_System._ITuple2, Dafny.ISequence>>)(() => { - Std.Wrappers._IOption> _source45 = (_1048_expr).RightMostIdentifier(); + Std.Wrappers._IOption> _source45 = (_1049_expr).RightMostIdentifier(); { bool disjunctiveMatch1 = false; if (_source45.is_Some) { @@ -5654,57 +5667,57 @@ public bool RightRequiresParentheses(RAST._IExpr right) { return _System.Tuple2, Dafny.ISequence>.create(Dafny.Sequence.UnicodeFromString("("), Dafny.Sequence.UnicodeFromString(")")); } }))(); - Dafny.ISequence _1052_leftCallP = _let_tmp_rhs49.dtor__0; - Dafny.ISequence _1053_rightCallP = _let_tmp_rhs49.dtor__1; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1050_leftP, (_1048_expr)._ToString(ind)), _1051_rightP), _1052_leftCallP), RAST.__default.SeqToString(_1049_args, Dafny.Helpers.Id, Func>>>((_1054_ind) => ((System.Func>)((_1055_arg) => { - return (_1055_arg)._ToString(Dafny.Sequence.Concat(_1054_ind, RAST.__default.IND)); - })))(ind), Dafny.Sequence.UnicodeFromString(", "))), _1053_rightCallP); + Dafny.ISequence _1053_leftCallP = _let_tmp_rhs49.dtor__0; + Dafny.ISequence _1054_rightCallP = _let_tmp_rhs49.dtor__1; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1051_leftP, (_1049_expr)._ToString(ind)), _1052_rightP), _1053_leftCallP), RAST.__default.SeqToString(_1050_args, Dafny.Helpers.Id, Func>>>((_1055_ind) => ((System.Func>)((_1056_arg) => { + return (_1056_arg)._ToString(Dafny.Sequence.Concat(_1055_ind, RAST.__default.IND)); + })))(ind), Dafny.Sequence.UnicodeFromString(", "))), _1054_rightCallP); } } { if (_source40.is_Select) { - RAST._IExpr _1056_expression = _source40.dtor_obj; - Dafny.ISequence _1057_name = _source40.dtor_name; - _System._ITuple2, Dafny.ISequence> _let_tmp_rhs50 = (this).LeftParentheses(_1056_expression); - Dafny.ISequence _1058_leftP = _let_tmp_rhs50.dtor__0; - Dafny.ISequence _1059_rightP = _let_tmp_rhs50.dtor__1; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1058_leftP, (_1056_expression)._ToString(ind)), _1059_rightP), Dafny.Sequence.UnicodeFromString(".")), _1057_name); + RAST._IExpr _1057_expression = _source40.dtor_obj; + Dafny.ISequence _1058_name = _source40.dtor_name; + _System._ITuple2, Dafny.ISequence> _let_tmp_rhs50 = (this).LeftParentheses(_1057_expression); + Dafny.ISequence _1059_leftP = _let_tmp_rhs50.dtor__0; + Dafny.ISequence _1060_rightP = _let_tmp_rhs50.dtor__1; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1059_leftP, (_1057_expression)._ToString(ind)), _1060_rightP), Dafny.Sequence.UnicodeFromString(".")), _1058_name); } } { if (_source40.is_SelectIndex) { - RAST._IExpr _1060_expression = _source40.dtor_obj; - RAST._IExpr _1061_range = _source40.dtor_range; - _System._ITuple2, Dafny.ISequence> _let_tmp_rhs51 = (this).LeftParentheses(_1060_expression); - Dafny.ISequence _1062_leftP = _let_tmp_rhs51.dtor__0; - Dafny.ISequence _1063_rightP = _let_tmp_rhs51.dtor__1; - Dafny.ISequence _1064_rangeStr = (_1061_range)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND)); - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1062_leftP, (_1060_expression)._ToString(ind)), _1063_rightP), Dafny.Sequence.UnicodeFromString("[")), _1064_rangeStr), Dafny.Sequence.UnicodeFromString("]")); + RAST._IExpr _1061_expression = _source40.dtor_obj; + RAST._IExpr _1062_range = _source40.dtor_range; + _System._ITuple2, Dafny.ISequence> _let_tmp_rhs51 = (this).LeftParentheses(_1061_expression); + Dafny.ISequence _1063_leftP = _let_tmp_rhs51.dtor__0; + Dafny.ISequence _1064_rightP = _let_tmp_rhs51.dtor__1; + Dafny.ISequence _1065_rangeStr = (_1062_range)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND)); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1063_leftP, (_1061_expression)._ToString(ind)), _1064_rightP), Dafny.Sequence.UnicodeFromString("[")), _1065_rangeStr), Dafny.Sequence.UnicodeFromString("]")); } } { if (_source40.is_MemberSelect) { - RAST._IExpr _1065_expression = _source40.dtor_obj; - Dafny.ISequence _1066_name = _source40.dtor_name; - _System._ITuple2, Dafny.ISequence> _let_tmp_rhs52 = (this).LeftParentheses(_1065_expression); - Dafny.ISequence _1067_leftP = _let_tmp_rhs52.dtor__0; - Dafny.ISequence _1068_rightP = _let_tmp_rhs52.dtor__1; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1067_leftP, (_1065_expression)._ToString(ind)), _1068_rightP), Dafny.Sequence.UnicodeFromString("::")), _1066_name); + RAST._IExpr _1066_expression = _source40.dtor_obj; + Dafny.ISequence _1067_name = _source40.dtor_name; + _System._ITuple2, Dafny.ISequence> _let_tmp_rhs52 = (this).LeftParentheses(_1066_expression); + Dafny.ISequence _1068_leftP = _let_tmp_rhs52.dtor__0; + Dafny.ISequence _1069_rightP = _let_tmp_rhs52.dtor__1; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(_1068_leftP, (_1066_expression)._ToString(ind)), _1069_rightP), Dafny.Sequence.UnicodeFromString("::")), _1067_name); } } { if (_source40.is_Lambda) { - Dafny.ISequence _1069_params = _source40.dtor_params; - Std.Wrappers._IOption _1070_retType = _source40.dtor_retType; - RAST._IExpr _1071_body = _source40.dtor_body; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("move |"), RAST.__default.SeqToString(_1069_params, Dafny.Helpers.Id, Func>>>((_1072_ind) => ((System.Func>)((_1073_arg) => { - return (_1073_arg)._ToString(_1072_ind); - })))(ind), Dafny.Sequence.UnicodeFromString(","))), Dafny.Sequence.UnicodeFromString("| ")), (((_1070_retType).is_Some) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("-> "), ((_1070_retType).dtor_value)._ToString(ind))) : (Dafny.Sequence.UnicodeFromString("")))), ((((_1070_retType).is_Some) && (!((_1071_body).is_Block))) ? ((RAST.Expr.create_Block(_1071_body))._ToString(ind)) : ((_1071_body)._ToString(ind)))); + Dafny.ISequence _1070_params = _source40.dtor_params; + Std.Wrappers._IOption _1071_retType = _source40.dtor_retType; + RAST._IExpr _1072_body = _source40.dtor_body; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("move |"), RAST.__default.SeqToString(_1070_params, Dafny.Helpers.Id, Func>>>((_1073_ind) => ((System.Func>)((_1074_arg) => { + return (_1074_arg)._ToString(_1073_ind); + })))(ind), Dafny.Sequence.UnicodeFromString(","))), Dafny.Sequence.UnicodeFromString("| ")), (((_1071_retType).is_Some) ? (Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("-> "), ((_1071_retType).dtor_value)._ToString(ind))) : (Dafny.Sequence.UnicodeFromString("")))), ((((_1071_retType).is_Some) && (!((_1072_body).is_Block))) ? ((RAST.Expr.create_Block(_1072_body))._ToString(ind)) : ((_1072_body)._ToString(ind)))); } } { - RAST._IExpr _1074_r = _source40; - return RAST.__default.AddIndent((_1074_r).dtor_content, ind); + RAST._IExpr _1075_r = _source40; + return RAST.__default.AddIndent((_1075_r).dtor_content, ind); } } public RAST._IExpr Then(RAST._IExpr rhs2) { @@ -5739,7 +5752,7 @@ public RAST._IExpr Apply1(RAST._IExpr argument) { return RAST.Expr.create_Call(this, Dafny.Sequence.FromElements(argument)); } public bool IsLhsIdentifier() { - return ((this).is_Identifier) || (((this).is_Call) && ((((object.Equals((this).dtor_obj, (RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("modify!")))) && ((new BigInteger(((this).dtor_arguments).Count)) == (BigInteger.One))) && ((((this).dtor_arguments).Select(BigInteger.Zero)).is_Identifier)) || (((object.Equals((this).dtor_obj, (RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("md!")))) && ((new BigInteger(((this).dtor_arguments).Count)) == (BigInteger.One))) && (Dafny.Helpers.Let(((this).dtor_arguments).Select(BigInteger.Zero), _pat_let8_0 => Dafny.Helpers.Let(_pat_let8_0, _1075_lhs => (((_1075_lhs).is_Call) && (((_1075_lhs).dtor_obj).is_Select)) && ((((_1075_lhs).dtor_obj).dtor_obj).is_Identifier))))))); + return ((this).is_Identifier) || (((this).is_Call) && ((((object.Equals((this).dtor_obj, (RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("modify!")))) && ((new BigInteger(((this).dtor_arguments).Count)) == (BigInteger.One))) && ((((this).dtor_arguments).Select(BigInteger.Zero)).is_Identifier)) || (((object.Equals((this).dtor_obj, (RAST.__default.dafny__runtime).MSel(Dafny.Sequence.UnicodeFromString("md!")))) && ((new BigInteger(((this).dtor_arguments).Count)) == (BigInteger.One))) && (Dafny.Helpers.Let(((this).dtor_arguments).Select(BigInteger.Zero), _pat_let8_0 => Dafny.Helpers.Let(_pat_let8_0, _1076_lhs => (((_1076_lhs).is_Call) && (((_1076_lhs).dtor_obj).is_Select)) && ((((_1076_lhs).dtor_obj).dtor_obj).is_Identifier))))))); } public Dafny.ISequence LhsIdentifierName() { if ((this).is_Identifier) { @@ -5787,10 +5800,10 @@ public RAST._IPrintingInfo printingInfo { get { } { if (_source46.is_UnaryOp) { - Dafny.ISequence _1076_op = _source46.dtor_op1; - RAST._IExpr _1077_underlying = _source46.dtor_underlying; - DAST.Format._IUnaryOpFormat _1078_format = _source46.dtor_format; - Dafny.ISequence _source47 = _1076_op; + Dafny.ISequence _1077_op = _source46.dtor_op1; + RAST._IExpr _1078_underlying = _source46.dtor_underlying; + DAST.Format._IUnaryOpFormat _1079_format = _source46.dtor_format; + Dafny.ISequence _source47 = _1077_op; { if (object.Equals(_source47, Dafny.Sequence.UnicodeFromString("?"))) { return RAST.PrintingInfo.create_SuffixPrecedence(new BigInteger(5)); @@ -5824,22 +5837,22 @@ public RAST._IPrintingInfo printingInfo { get { } { if (_source46.is_Select) { - RAST._IExpr _1079_underlying = _source46.dtor_obj; - Dafny.ISequence _1080_name = _source46.dtor_name; + RAST._IExpr _1080_underlying = _source46.dtor_obj; + Dafny.ISequence _1081_name = _source46.dtor_name; return RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(2), RAST.Associativity.create_LeftToRight()); } } { if (_source46.is_SelectIndex) { - RAST._IExpr _1081_underlying = _source46.dtor_obj; - RAST._IExpr _1082_range = _source46.dtor_range; + RAST._IExpr _1082_underlying = _source46.dtor_obj; + RAST._IExpr _1083_range = _source46.dtor_range; return RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(2), RAST.Associativity.create_LeftToRight()); } } { if (_source46.is_MemberSelect) { - RAST._IExpr _1083_underlying = _source46.dtor_obj; - Dafny.ISequence _1084_name = _source46.dtor_name; + RAST._IExpr _1084_underlying = _source46.dtor_obj; + Dafny.ISequence _1085_name = _source46.dtor_name; return RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(2), RAST.Associativity.create_LeftToRight()); } } @@ -5855,18 +5868,18 @@ public RAST._IPrintingInfo printingInfo { get { } { if (_source46.is_TypeAscription) { - RAST._IExpr _1085_left = _source46.dtor_left; - RAST._IType _1086_tpe = _source46.dtor_tpe; + RAST._IExpr _1086_left = _source46.dtor_left; + RAST._IType _1087_tpe = _source46.dtor_tpe; return RAST.PrintingInfo.create_PrecedenceAssociativity(new BigInteger(10), RAST.Associativity.create_LeftToRight()); } } { if (_source46.is_BinaryOp) { - Dafny.ISequence _1087_op2 = _source46.dtor_op2; - RAST._IExpr _1088_left = _source46.dtor_left; - RAST._IExpr _1089_right = _source46.dtor_right; - DAST.Format._IBinaryOpFormat _1090_format = _source46.dtor_format2; - Dafny.ISequence _source48 = _1087_op2; + Dafny.ISequence _1088_op2 = _source46.dtor_op2; + RAST._IExpr _1089_left = _source46.dtor_left; + RAST._IExpr _1090_right = _source46.dtor_right; + DAST.Format._IBinaryOpFormat _1091_format = _source46.dtor_format2; + Dafny.ISequence _source48 = _1088_op2; { bool disjunctiveMatch4 = false; if (object.Equals(_source48, Dafny.Sequence.UnicodeFromString("*"))) { @@ -7053,14 +7066,14 @@ public Std.Wrappers._IOption dtor_body { } } public Dafny.ISequence _ToString(Dafny.ISequence ind) { - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("fn "), (this).dtor_name), RAST.TypeParamDecl.ToStringMultiple((this).dtor_typeParams, ind)), Dafny.Sequence.UnicodeFromString("(")), RAST.__default.SeqToString((this).dtor_formals, Dafny.Helpers.Id, Func>>>((_1091_ind) => ((System.Func>)((_1092_formal) => { - return (_1092_formal)._ToString(_1091_ind); + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString("fn "), (this).dtor_name), RAST.TypeParamDecl.ToStringMultiple((this).dtor_typeParams, ind)), Dafny.Sequence.UnicodeFromString("(")), RAST.__default.SeqToString((this).dtor_formals, Dafny.Helpers.Id, Func>>>((_1092_ind) => ((System.Func>)((_1093_formal) => { + return (_1093_formal)._ToString(_1092_ind); })))(ind), Dafny.Sequence.UnicodeFromString(", "))), Dafny.Sequence.UnicodeFromString(")")), ((System.Func>)(() => { Std.Wrappers._IOption _source49 = (this).dtor_returnType; { if (_source49.is_Some) { - RAST._IType _1093_t = _source49.dtor_value; - return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" -> "), (_1093_t)._ToString(ind)); + RAST._IType _1094_t = _source49.dtor_value; + return Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" -> "), (_1094_t)._ToString(ind)); } } { @@ -7074,8 +7087,8 @@ public Std.Wrappers._IOption dtor_body { } } { - RAST._IExpr _1094_body = _source50.dtor_value; - return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" {\n"), ind), RAST.__default.IND), (_1094_body)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}")); + RAST._IExpr _1095_body = _source50.dtor_value; + return Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.Concat(Dafny.Sequence.UnicodeFromString(" {\n"), ind), RAST.__default.IND), (_1095_body)._ToString(Dafny.Sequence.Concat(ind, RAST.__default.IND))), Dafny.Sequence.UnicodeFromString("\n")), ind), Dafny.Sequence.UnicodeFromString("}")); } }))()); } diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy new file mode 100644 index 00000000000..3f454a3c4b4 --- /dev/null +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy @@ -0,0 +1,22 @@ +// NONUNIFORM: Test of cargo test to support Dafny tests +// RUN: %baredafny build --target=rs "%s" > "%t" +// RUN: %exits-with 101 "%S/cargotest-rust/cargo" test >> "%t" +// RUN: %OutputCheck --file-to-check "%t" "%s" +// CHECK: test Tests::TestFail1 ... FAILED +// CHECK: test Tests::TestFail2 ... FAILED +// CHECK: test Tests::TestSucceed3 ... ok +// RUN: %OutputCheck --file-to-check "%S/cargotest-rust/src/cargotest.rs" "%S/cargotestoutput.check" + +module {:test} Tests { + method {:test} TestFail1() { + expect true == false; + } + + method {:test} TestFail2() { + expect false == true; + } + + method {:test} TestSucceed3() { + expect true == true; + } +} \ No newline at end of file diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotestoutput.check b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotestoutput.check new file mode 100644 index 00000000000..3b60de400f9 --- /dev/null +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotestoutput.check @@ -0,0 +1 @@ +// CHECK-L: #[cfg(test)] \ No newline at end of file diff --git a/Source/XUnitExtensions/Lit/ShellLitCommand.cs b/Source/XUnitExtensions/Lit/ShellLitCommand.cs index 3a3cd052ecc..a10a46abd14 100644 --- a/Source/XUnitExtensions/Lit/ShellLitCommand.cs +++ b/Source/XUnitExtensions/Lit/ShellLitCommand.cs @@ -23,6 +23,12 @@ public async Task Execute(TextReader inputReader, TextWriter outputWriter, TextWriter errorWriter) { using var process = new Process(); + if (shellCommand.Contains('/')) { + var workingDir = Path.GetDirectoryName(shellCommand); + process.StartInfo.WorkingDirectory = workingDir; + shellCommand = Path.GetFileName(shellCommand); + } + process.StartInfo.FileName = shellCommand; foreach (var argument in Arguments) { process.StartInfo.ArgumentList.Add(argument); diff --git a/docs/dev/news/5666.feat b/docs/dev/news/5666.feat new file mode 100644 index 00000000000..e69de29bb2d From 231398699951709b6aa82bb575132d7d44ac0c99 Mon Sep 17 00:00:00 2001 From: Mikael Mayer Date: Thu, 8 Aug 2024 08:31:11 -0500 Subject: [PATCH 02/10] Ran make pr --- Source/DafnyCore/Backends/Dafny/DafnyCodeGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/DafnyCore/Backends/Dafny/DafnyCodeGenerator.cs b/Source/DafnyCore/Backends/Dafny/DafnyCodeGenerator.cs index 12416191146..f64fb46562b 100644 --- a/Source/DafnyCore/Backends/Dafny/DafnyCodeGenerator.cs +++ b/Source/DafnyCore/Backends/Dafny/DafnyCodeGenerator.cs @@ -585,7 +585,7 @@ public ConcreteSyntaxTree CreateGetter(string name, TopLevelDecl enclosingDecl, } var overridingTrait = member.OverriddenMember?.EnclosingClass; - + var attributes = compiler.ParseAttributes(enclosingDecl.Attributes); var builder = this.builder.Method( From a7b0708267cb683cc212d0a387299035c4498826 Mon Sep 17 00:00:00 2001 From: Mikael Mayer Date: Thu, 8 Aug 2024 10:37:20 -0500 Subject: [PATCH 03/10] Setting working directory only for cargo command --- Source/XUnitExtensions/Lit/ShellLitCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/XUnitExtensions/Lit/ShellLitCommand.cs b/Source/XUnitExtensions/Lit/ShellLitCommand.cs index a10a46abd14..b546279a4db 100644 --- a/Source/XUnitExtensions/Lit/ShellLitCommand.cs +++ b/Source/XUnitExtensions/Lit/ShellLitCommand.cs @@ -23,10 +23,10 @@ public async Task Execute(TextReader inputReader, TextWriter outputWriter, TextWriter errorWriter) { using var process = new Process(); - if (shellCommand.Contains('/')) { + if (shellCommand.Contains('/') && Path.GetFileName(shellCommand) is var command and "cargo") { var workingDir = Path.GetDirectoryName(shellCommand); process.StartInfo.WorkingDirectory = workingDir; - shellCommand = Path.GetFileName(shellCommand); + shellCommand = command; } process.StartInfo.FileName = shellCommand; From 2f23e61936fc93a6458b42c05c67864245cfd14b Mon Sep 17 00:00:00 2001 From: Mikael Mayer Date: Wed, 4 Sep 2024 15:36:53 -0500 Subject: [PATCH 04/10] Ensure determinism in test file --- .../TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy | 7 +++---- .../TestFiles/LitTests/LitTest/comp/rust/cargotest1.check | 1 + .../TestFiles/LitTests/LitTest/comp/rust/cargotest2.check | 1 + .../TestFiles/LitTests/LitTest/comp/rust/cargotest3.check | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest1.check create mode 100644 Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest2.check create mode 100644 Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest3.check diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy index 3f454a3c4b4..53e04e09c65 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy @@ -1,10 +1,9 @@ // NONUNIFORM: Test of cargo test to support Dafny tests // RUN: %baredafny build --target=rs "%s" > "%t" // RUN: %exits-with 101 "%S/cargotest-rust/cargo" test >> "%t" -// RUN: %OutputCheck --file-to-check "%t" "%s" -// CHECK: test Tests::TestFail1 ... FAILED -// CHECK: test Tests::TestFail2 ... FAILED -// CHECK: test Tests::TestSucceed3 ... ok +// RUN: %OutputCheck --file-to-check "%t" "%S/cargotest1.check" +// RUN: %OutputCheck --file-to-check "%t" "%S/cargotest2.check" +// RUN: %OutputCheck --file-to-check "%t" "%S/cargotest3.check" // RUN: %OutputCheck --file-to-check "%S/cargotest-rust/src/cargotest.rs" "%S/cargotestoutput.check" module {:test} Tests { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest1.check b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest1.check new file mode 100644 index 00000000000..d5ad83a98a8 --- /dev/null +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest1.check @@ -0,0 +1 @@ +// CHECK: test Tests::TestFail1 ... FAILED \ No newline at end of file diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest2.check b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest2.check new file mode 100644 index 00000000000..932619e778b --- /dev/null +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest2.check @@ -0,0 +1 @@ +// CHECK: test Tests::TestFail2 ... FAILED \ No newline at end of file diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest3.check b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest3.check new file mode 100644 index 00000000000..10d9d0f1dc8 --- /dev/null +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest3.check @@ -0,0 +1 @@ +// CHECK: test Tests::TestSucceed3 ... ok \ No newline at end of file From cc1984f43310e78e39a0b572a72965af7ab5ada7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Mayer?= Date: Thu, 12 Sep 2024 12:04:10 -0500 Subject: [PATCH 05/10] Update 5666.feat A bit more exciting than an empty file --- docs/dev/news/5666.feat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/dev/news/5666.feat b/docs/dev/news/5666.feat index e69de29bb2d..971563ad5a9 100644 --- a/docs/dev/news/5666.feat +++ b/docs/dev/news/5666.feat @@ -0,0 +1,2 @@ +Dafny-to-Rust: `{:test}` methods generate `#[test]` wrappers in Rust that can be invoked using `cargo test`. +Similarly, `{:test}` on modules generates a `#[cfg(test)]` in the compiled code. From 5b8836f4f31825785a50fd668da8122f2b81d533 Mon Sep 17 00:00:00 2001 From: Mikael Mayer Date: Thu, 12 Sep 2024 14:05:47 -0500 Subject: [PATCH 06/10] Renamed test option --- .../Backends/Rust/Dafny-compiler-rust.dfy | 8 ++++---- Source/DafnyCore/GeneratedFromDafny/DCOMP.cs | 15 ++++++++------- .../DafnyRef/integration- rust/IntegrationRust.md | 5 +++++ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Source/DafnyCore/Backends/Rust/Dafny-compiler-rust.dfy b/Source/DafnyCore/Backends/Rust/Dafny-compiler-rust.dfy index 12c2bff4f0e..e46014287b9 100644 --- a/Source/DafnyCore/Backends/Rust/Dafny-compiler-rust.dfy +++ b/Source/DafnyCore/Backends/Rust/Dafny-compiler-rust.dfy @@ -1849,8 +1849,8 @@ module {:extern "DCOMP"} DafnyToRustCompiler { Std.Collections.Seq.Map((i: Ident) => escapeName(i.id), containingPath) } - predicate HasTestAttribute(attributes: seq) { - exists attribute <- attributes :: attribute.name == "test" && |attribute.args| == 0 + predicate HasAttribute(attributes: seq, name: string) { + exists attribute <- attributes :: attribute.name == name && |attribute.args| == 0 } // Returns a top-level gathering module that can be merged with other gathering modules @@ -1867,7 +1867,7 @@ module {:extern "DCOMP"} DafnyToRustCompiler { assume {:axiom} forall m: ModuleItem <- mod.body.value :: m < mod; var optExtern: ExternAttribute := ExtractExternMod(mod); var attributes := []; - if HasTestAttribute(mod.attributes) { + if HasAttribute(mod.attributes, "rust_cfg_test") { attributes := [R.RawAttribute("#[cfg(test)]")]; } var body, allmodules := GenModuleBody(mod, mod.body.value, containingPath + [Ident.Ident(innerName)]); @@ -2098,7 +2098,7 @@ module {:extern "DCOMP"} DafnyToRustCompiler { if className == "_default" { for i := 0 to |c.body| { var m := match c.body[i] case Method(m) => m; - if HasTestAttribute(m.attributes) && |m.params| == 0 { + if HasAttribute(m.attributes, "test") && |m.params| == 0 { var fnName := escapeName(m.name); testMethods := testMethods + [ R.TopFnDecl( diff --git a/Source/DafnyCore/GeneratedFromDafny/DCOMP.cs b/Source/DafnyCore/GeneratedFromDafny/DCOMP.cs index 55ce62b204d..51824995fd8 100644 --- a/Source/DafnyCore/GeneratedFromDafny/DCOMP.cs +++ b/Source/DafnyCore/GeneratedFromDafny/DCOMP.cs @@ -946,11 +946,12 @@ public void __ctor(bool unicodeChars, DCOMP._IObjectType objectType) return DCOMP.__default.escapeName((_0_i)); })), containingPath); } - public bool HasTestAttribute(Dafny.ISequence attributes) { - return Dafny.Helpers.Id, bool>>((_0_attributes) => Dafny.Helpers.Quantifier((_0_attributes).UniqueElements, false, (((_exists_var_0) => { - DAST._IAttribute _1_attribute = (DAST._IAttribute)_exists_var_0; - return ((_0_attributes).Contains(_1_attribute)) && ((((_1_attribute).dtor_name).Equals(Dafny.Sequence.UnicodeFromString("test"))) && ((new BigInteger(((_1_attribute).dtor_args).Count)).Sign == 0)); - }))))(attributes); + public bool HasAttribute(Dafny.ISequence attributes, Dafny.ISequence name) + { + return Dafny.Helpers.Id, Dafny.ISequence, bool>>((_0_attributes, _1_name) => Dafny.Helpers.Quantifier((_0_attributes).UniqueElements, false, (((_exists_var_0) => { + DAST._IAttribute _2_attribute = (DAST._IAttribute)_exists_var_0; + return ((_0_attributes).Contains(_2_attribute)) && ((((_2_attribute).dtor_name).Equals(_1_name)) && ((new BigInteger(((_2_attribute).dtor_args).Count)).Sign == 0)); + }))))(attributes, name); } public DafnyCompilerRustUtils._ISeqMap, DafnyCompilerRustUtils._IGatheringModule> GenModule(DAST._IModule mod, Dafny.ISequence> containingPath) { @@ -969,7 +970,7 @@ public bool HasTestAttribute(Dafny.ISequence attributes) { _4_optExtern = DCOMP.__default.ExtractExternMod(mod); Dafny.ISequence> _5_attributes; _5_attributes = Dafny.Sequence>.FromElements(); - if ((this).HasTestAttribute((mod).dtor_attributes)) { + if ((this).HasAttribute((mod).dtor_attributes, Dafny.Sequence.UnicodeFromString("rust_cfg_test"))) { _5_attributes = Dafny.Sequence>.FromElements(Dafny.Sequence.UnicodeFromString("#[cfg(test)]")); } Dafny.ISequence _6_body; @@ -1263,7 +1264,7 @@ public bool IsSameResolvedType(DAST._IResolvedType r1, DAST._IResolvedType r2) _30_m = _31_m; } after_match1: ; - if (((this).HasTestAttribute((_30_m).dtor_attributes)) && ((new BigInteger(((_30_m).dtor_params).Count)).Sign == 0)) { + if (((this).HasAttribute((_30_m).dtor_attributes, Dafny.Sequence.UnicodeFromString("test"))) && ((new BigInteger(((_30_m).dtor_params).Count)).Sign == 0)) { Dafny.ISequence _32_fnName; _32_fnName = DCOMP.__default.escapeName((_30_m).dtor_name); _28_testMethods = Dafny.Sequence.Concat(_28_testMethods, Dafny.Sequence.FromElements(RAST.ModDecl.create_TopFnDecl(RAST.TopFnDecl.create(Dafny.Sequence>.FromElements(Dafny.Sequence.UnicodeFromString("#[test]")), RAST.Visibility.create_PUB(), RAST.Fn.create(_32_fnName, Dafny.Sequence.FromElements(), Dafny.Sequence.FromElements(), Std.Wrappers.Option.create_None(), Dafny.Sequence.UnicodeFromString(""), Std.Wrappers.Option.create_Some(((RAST.Expr.create_Identifier(Dafny.Sequence.UnicodeFromString("_default"))).FSel(_32_fnName)).Apply(Dafny.Sequence.FromElements()))))))); diff --git a/docs/DafnyRef/integration- rust/IntegrationRust.md b/docs/DafnyRef/integration- rust/IntegrationRust.md index ab78e8b09e9..e85f9589c3d 100644 --- a/docs/DafnyRef/integration- rust/IntegrationRust.md +++ b/docs/DafnyRef/integration- rust/IntegrationRust.md @@ -177,3 +177,8 @@ fn main() { super::Test::_default::extern_y(); } ``` + +# Tests + +* Methods with the `{:test}` attribute will produce an equivalent `#[test]` method that can be run via `cargo test` on the code produced by `dafny build`. +* Modules with the `{:rust_cfg_test}` attribute will have the attribute`#[cfg(test)]` when translated to Rust \ No newline at end of file From ecfb6e4f86fb2ae22c58db0084f27f3224eed7bf Mon Sep 17 00:00:00 2001 From: Mikael Mayer Date: Thu, 12 Sep 2024 14:13:58 -0500 Subject: [PATCH 07/10] Updated release notes --- docs/dev/news/5666.feat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/news/5666.feat b/docs/dev/news/5666.feat index 971563ad5a9..0617d12494a 100644 --- a/docs/dev/news/5666.feat +++ b/docs/dev/news/5666.feat @@ -1,2 +1,2 @@ Dafny-to-Rust: `{:test}` methods generate `#[test]` wrappers in Rust that can be invoked using `cargo test`. -Similarly, `{:test}` on modules generates a `#[cfg(test)]` in the compiled code. +Similarly, `{:rust_cfg_test}` on modules generates a `#[cfg(test)]` in the resulting rust module. From d2d082cefce6b28e11844b1a5a90ee095daae8ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Mayer?= Date: Thu, 12 Sep 2024 15:06:44 -0500 Subject: [PATCH 08/10] Update docs/DafnyRef/integration- rust/IntegrationRust.md Co-authored-by: Robin Salkeld --- docs/DafnyRef/integration- rust/IntegrationRust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/DafnyRef/integration- rust/IntegrationRust.md b/docs/DafnyRef/integration- rust/IntegrationRust.md index e85f9589c3d..6eb44ff9d4b 100644 --- a/docs/DafnyRef/integration- rust/IntegrationRust.md +++ b/docs/DafnyRef/integration- rust/IntegrationRust.md @@ -181,4 +181,4 @@ fn main() { # Tests * Methods with the `{:test}` attribute will produce an equivalent `#[test]` method that can be run via `cargo test` on the code produced by `dafny build`. -* Modules with the `{:rust_cfg_test}` attribute will have the attribute`#[cfg(test)]` when translated to Rust \ No newline at end of file +* Modules with the `{:rust_cfg_test}` attribute will have the attribute `#[cfg(test)]` when translated to Rust. \ No newline at end of file From f3b20d25c445f33afd41e10c5f544b8281dd4d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Mayer?= Date: Thu, 12 Sep 2024 15:07:18 -0500 Subject: [PATCH 09/10] Update and rename 5666.feat to 5676.feat --- docs/dev/news/{5666.feat => 5676.feat} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/dev/news/{5666.feat => 5676.feat} (100%) diff --git a/docs/dev/news/5666.feat b/docs/dev/news/5676.feat similarity index 100% rename from docs/dev/news/5666.feat rename to docs/dev/news/5676.feat From 32f7db6c46f90c6f52ac3e896e3eb56983b2af4e Mon Sep 17 00:00:00 2001 From: Mikael Mayer Date: Thu, 12 Sep 2024 16:59:35 -0500 Subject: [PATCH 10/10] Updated the test annotation --- .../TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy index 53e04e09c65..be2eee7921d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/rust/cargotest.dfy @@ -6,7 +6,7 @@ // RUN: %OutputCheck --file-to-check "%t" "%S/cargotest3.check" // RUN: %OutputCheck --file-to-check "%S/cargotest-rust/src/cargotest.rs" "%S/cargotestoutput.check" -module {:test} Tests { +module {:rust_cfg_test} Tests { method {:test} TestFail1() { expect true == false; }