Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate unicode-char #5302

Merged
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f5e07b6
Deprecate unicode-char
keyboardDrummer Apr 5, 2024
ae3414d
Add release note
keyboardDrummer Apr 5, 2024
24e8c4f
Fix bugs
keyboardDrummer Apr 5, 2024
00ba51f
Update expect files
keyboardDrummer Apr 8, 2024
d105494
Merge branch 'master' into deprecateUnicodeChar
keyboardDrummer Apr 8, 2024
2e7a50b
Remove --unicode-code false where possible
keyboardDrummer Apr 8, 2024
fd3a1b9
Changes
keyboardDrummer Apr 8, 2024
b95edb6
Merge branch 'deprecateUnicodeChar' of github.com:keyboardDrummer/daf…
keyboardDrummer Apr 8, 2024
e930eea
Updates
keyboardDrummer Apr 8, 2024
3f8a047
Fixes
keyboardDrummer Apr 9, 2024
8cddd7b
Cleanup
keyboardDrummer Apr 9, 2024
c36aedc
Merge branch 'master' into deprecateUnicodeChar
keyboardDrummer Apr 9, 2024
59fa798
Update expect files
keyboardDrummer Apr 10, 2024
347caed
Fix tests
keyboardDrummer Apr 10, 2024
3dd25c7
Fix ExternDafnyString
keyboardDrummer Apr 10, 2024
92a8e88
Test fixes
keyboardDrummer Apr 10, 2024
1402c5e
Fix tests
keyboardDrummer Apr 10, 2024
8c012ba
Merge branch 'master' into deprecateUnicodeChar
keyboardDrummer Apr 10, 2024
bf383c4
Fixes
keyboardDrummer Apr 10, 2024
2fe991d
Update refman
keyboardDrummer Apr 10, 2024
607c79c
Let TestGeneration CLI tests use unicode-char=true
keyboardDrummer Apr 12, 2024
aef2aaf
Remove unicode-char deprecated warning when using c++ back-end
keyboardDrummer Apr 12, 2024
4bb9ea1
Merge branch 'master' into deprecateUnicodeChar
keyboardDrummer Apr 12, 2024
4f558ea
Fix docs
keyboardDrummer Apr 12, 2024
f667d86
Remove —unicode-char false from as many tests as possible
robin-aws Apr 16, 2024
77fc899
Fix tests
robin-aws Apr 16, 2024
4f5371c
Rename unicodechar directory to unicodecharFalse
keyboardDrummer Apr 17, 2024
1d60806
Remove code that might not be needed any more
keyboardDrummer Apr 17, 2024
20e42b3
Merge branch 'master' into deprecateUnicodeChar
keyboardDrummer Apr 17, 2024
d06492e
Do not migrate ErasableTypeWrappers to use --unicode-char
keyboardDrummer Apr 17, 2024
18d7059
Use SimplifyTypeAndTrimNewtypes consistently in EmitPrintStmt
robin-aws Apr 17, 2024
43283b3
Merge branch 'deprecateUnicodeChar' of github.com:keyboardDrummer/daf…
robin-aws Apr 17, 2024
87dcec4
Undo change
keyboardDrummer Apr 18, 2024
eea5913
Merge branch 'master' into deprecateUnicodeChar
keyboardDrummer Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1993,8 +1993,9 @@ protected override void EmitActualTypeArgs(List<Type> typeArgs, IToken tok, Conc

protected override void EmitPrintStmt(ConcreteSyntaxTree wr, Expression arg) {
var wStmts = wr.Fork();
var typeArgs = arg.Type.AsArrowType == null ? "" : $"<{TypeName(arg.Type, wr, null, null)}>";
var suffix = arg.Type.IsStringType && UnicodeCharEnabled ? ".ToVerbatimString(false)" : "";
var type = DatatypeWrapperEraser.SimplifyTypeAndTrimNewtypes(Options, arg.Type);
var typeArgs = type.AsArrowType == null ? "" : $"<{TypeName(type, wr, null, null)}>";
var suffix = type.IsStringType && UnicodeCharEnabled ? ".ToVerbatimString(false)" : "";
wr.WriteLine($"{DafnyHelpersClass}.Print{typeArgs}(({Expr(arg, false, wStmts)}){suffix});");
}

Expand Down
2 changes: 1 addition & 1 deletion Source/DafnyCore/Backends/GoLang/GoCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,7 @@ protected override void EmitMultiAssignment(List<Expression> lhsExprs, List<ILva
}

protected override void EmitPrintStmt(ConcreteSyntaxTree wr, Expression arg) {
var isString = arg.Type.IsStringType;
var isString = DatatypeWrapperEraser.SimplifyTypeAndTrimNewtypes(Options, arg.Type).IsStringType;
var wStmts = wr.Fork();
if (isString && UnicodeCharEnabled) {
wr.Write("_dafny.Print(");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ protected override void EmitActualTypeArgs(List<Type> typeArgs, IToken tok, Conc
// ----- Statements -------------------------------------------------------------

protected override void EmitPrintStmt(ConcreteSyntaxTree wr, Expression arg) {
bool isString = arg.Type.NormalizeToAncestorType().IsStringType;
bool isString = DatatypeWrapperEraser.SimplifyTypeAndTrimNewtypes(Options, arg.Type).IsStringType;
bool isStringLiteral = arg is StringLiteralExpr;
bool isGeneric = arg.Type.NormalizeToAncestorType().AsSeqType is { Arg.IsTypeParameter: true };
var wStmts = wr.Fork();
Expand Down
2 changes: 1 addition & 1 deletion Source/DafnyCore/Backends/Python/PythonCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ protected override void EmitPrintStmt(ConcreteSyntaxTree wr, Expression arg) {
}

private void EmitToString(ConcreteSyntaxTree wr, Expression arg, ConcreteSyntaxTree wStmts) {
if (UnicodeCharEnabled && arg.Type.IsStringType) {
if (UnicodeCharEnabled && DatatypeWrapperEraser.SimplifyTypeAndTrimNewtypes(Options, arg.Type).IsStringType) {
TrParenExpr(arg, wr, false, wStmts);
wr.Write(".VerbatimString(False)");
} else {
Expand Down
10 changes: 10 additions & 0 deletions Source/DafnyCore/Generic/ErrorReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ public void Warning(MessageSource source, string errorId, IToken tok, string msg
Message(source, ErrorLevel.Warning, errorId, tok, msg);
}

public void Deprecated(MessageSource source, string errorId, IToken tok, string msg) {
Contract.Requires(tok != null);
Contract.Requires(msg != null);
if (Options.DeprecationNoise != 0) {
Warning(source, errorId, tok, msg);
} else {
Info(source, tok, msg, errorId);
}
}

public void Deprecated(MessageSource source, Enum errorId, IToken tok, string msg) {
Contract.Requires(tok != null);
Contract.Requires(msg != null);
Expand Down
3 changes: 2 additions & 1 deletion Source/DafnyCore/Options/CommonOptionBag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Note that quantifier variable domains (<- <Domain>) are available in both syntax
js - Compile to JavaScript.
java - Compile to Java.
py - Compile to Python.
cpp - Compile to C++.
cpp - (experimental) Compile to C++.

Note that the C++ backend has various limitations (see Docs/Compilation/Cpp.md). This includes lack of support for BigIntegers (aka int), most higher order functions, and advanced features like traits or co-inductive types.".TrimStart()
) {
Expand All @@ -195,6 +195,7 @@ Note that quantifier variable domains (<- <Domain>) are available in both syntax
@"
false - The char type represents any UTF-16 code unit.
true - The char type represents any Unicode scalar value.".TrimStart()) {
IsHidden = true
};

public static readonly Option<bool> AllowAxioms = new("--allow-axioms", () => false,
Expand Down
6 changes: 6 additions & 0 deletions Source/DafnyDriver/CliCompilation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Threading.Tasks;
using Microsoft.Boogie;
using Microsoft.Dafny;
using Microsoft.Dafny.Compilers;
using Microsoft.Dafny.LanguageServer.Language;
using Microsoft.Dafny.LanguageServer.Language.Symbols;
using Microsoft.Dafny.LanguageServer.Workspace;
Expand Down Expand Up @@ -152,6 +153,11 @@ public void Start() {
public bool VerifiedAssertions { get; private set; }

public async IAsyncEnumerable<CanVerifyResult> VerifyAllLazily(int? randomSeed) {
if (!Options.Get(CommonOptionBag.UnicodeCharacters) && Options.Backend is not CppBackend) {
Compilation.Reporter.Deprecated(MessageSource.Verifier, "unicodeCharDeprecated", Token.Cli,
"the option unicode-char has been deprecated.");
}

var canVerifyResults = new Dictionary<ICanVerify, CliCanVerifyState>();
using var subscription = Compilation.Updates.Subscribe(ev => {

Expand Down
3 changes: 2 additions & 1 deletion Source/DafnyDriver/Legacy/SynchronousCliCompilation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,8 @@ public static async Task<bool> CompileDafnyProgram(Program dafnyProgram, string
}

// compile the program into an assembly
var (compiledCorrectly, compilationResult) = await compiler.CompileTargetProgram(dafnyProgramName, targetProgramText, callToMain, targetPaths.Filename, otherFileNames,
var (compiledCorrectly, compilationResult) = await compiler.CompileTargetProgram(dafnyProgramName,
targetProgramText, callToMain, targetPaths.Filename, otherFileNames,
hasMain && options.RunAfterCompile, outputWriter);
if (compiledCorrectly && options.RunAfterCompile) {
if (hasMain) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* of the `char` type and hence the `string` type,
* this module must be implemented differently for each option value.
* Currently, the only available implementation is for `--unicode-char:true`,
* and the implementation for `--unicode-char:false` is upcoming.
* and the implementation for `--unicode-char false` is upcoming.
*
* If you also want to maintain code that works for either `--unicode-char` value,
* implement your logic in an abstract module that imports this one.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// RUN: %verify "%s" > "%t"
// RUN: %translate cs %args %s --include-runtime --include-test-runner --unicode-char false --no-verify --output %S/Output/manual/program.cs >> "%t"
// RUN: %translate cs %args %s --include-runtime --include-test-runner --no-verify --output %S/Output/manual/program.cs >> "%t"
// RUN: ! dotnet run -v q --property WarningLevel=0 --project %S/RunAllTests.csproj >> "%t"
// RUN: ! %baredafny test %args --unicode-char:false --no-verify --target:cs "%s" >> "%t"
// RUN: ! %baredafny test %args --unicode-char:false --no-verify --target:java "%s" >> "%t"
// RUN: ! %baredafny test %args --unicode-char:false --no-verify --target:go "%s" >> "%t"
// RUN: ! %baredafny test %args --unicode-char:false --no-verify --target:js "%s" >> "%t"
// RUN: ! %baredafny test %args --unicode-char:false --no-verify --target:py "%s" >> "%t"
// RUN: ! %baredafny test %args --no-verify --target:cs "%s" >> "%t"
// RUN: ! %baredafny test %args --no-verify --target:java "%s" >> "%t"
// RUN: ! %baredafny test %args --no-verify --target:go "%s" >> "%t"
// RUN: ! %baredafny test %args --no-verify --target:js "%s" >> "%t"
// RUN: ! %baredafny test %args --no-verify --target:py "%s" >> "%t"
// RUN: %diff "%s.expect" "%t"

include "../../exceptions/VoidOutcomeDt.dfy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Passing3: PASSED
Failing2: FAILED
RunAllTestsOption.dfy(31,2): expectation violation
FailingReturnValue: FAILED
VoidOutcome.VoidFailure(Whoopsie)
VoidOutcome.VoidFailure("Whoopsie")
[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above.


Expand All @@ -25,7 +25,7 @@ Passing3: PASSED
Failing2: FAILED
RunAllTestsOption.dfy(31,2): expectation violation
FailingReturnValue: FAILED
VoidOutcome.VoidFailure(Whoopsie)
VoidOutcome.VoidFailure("Whoopsie")
[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above.


Expand All @@ -39,7 +39,7 @@ Passing3: PASSED
Failing2: FAILED
RunAllTestsOption.dfy(31,2): expectation violation
FailingReturnValue: FAILED
VoidOutcome.VoidFailure(Whoopsie)
VoidOutcome.VoidFailure("Whoopsie")
[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above.


Expand All @@ -53,7 +53,7 @@ Passing3: PASSED
Failing2: FAILED
RunAllTestsOption.dfy(31,2): expectation violation
FailingReturnValue: FAILED
VoidOutcome.VoidFailure(Whoopsie)
VoidOutcome.VoidFailure("Whoopsie")
[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above.


Expand All @@ -67,7 +67,7 @@ Passing3: PASSED
Failing2: FAILED
RunAllTestsOption.dfy(31,2): expectation violation
FailingReturnValue: FAILED
VoidOutcome.VoidFailure(Whoopsie)
VoidOutcome.VoidFailure("Whoopsie")
[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above.


Expand All @@ -81,6 +81,6 @@ Passing3: PASSED
Failing2: FAILED
RunAllTestsOption.dfy(31,2): expectation violation
FailingReturnValue: FAILED
VoidOutcome.VoidFailure(Whoopsie)
VoidOutcome.VoidFailure("Whoopsie")
[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

// Generating and Running Block-Based Tests:
// RUN: %baredafny generate-tests %args Block %S/TestGenerationNoInliningEnumerativeDefinitions.dfy > %t-tests.dfy
// RUN: %baredafny test %args --unicode-char:false --target:cs "%t-tests.dfy" >> "%t"
// RUN: %baredafny test %args --target:cs "%t-tests.dfy" >> "%t"

// Generating and Running Path-Based Tests:
// RUN: %baredafny generate-tests %args Path %S/TestGenerationNoInliningEnumerativeDefinitions.dfy > %t-tests.dfy
// RUN: %baredafny test %args --unicode-char:false --target:cs "%t-tests.dfy" >> "%t"
// RUN: %baredafny test %args --target:cs "%t-tests.dfy" >> "%t"

// RUN: %OutputCheck --file-to-check "%t" "%s"
// CHECK: .*Dafny program verifier finished with 2 verified, 0 errors*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Generating and Running Path-Based Tests:
// RUN: %baredafny generate-tests %args Path %S/TestGenerationWithInliningQuantifiedDefinitions.dfy > %t-tests.dfy
// RUN: %baredafny test %args --unicode-char:false --target:cs "%t-tests.dfy" >> "%t"
// RUN: %baredafny test %args --target:cs "%t-tests.dfy" >> "%t"

// RUN: %OutputCheck --file-to-check "%t" "%s"
// CHECK: .*Dafny program verifier finished with 5 verified, 0 errors*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char false

newtype uint32 = i:int | 0 <= i < 0x100000000

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false

newtype uint64 = i:int | 0 <= i < 0x10000000000000000

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false

newtype uint32 = i:int | 0 <= i < 0x100000000

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false

module Holder {
const x:bool := false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false

newtype uint32 = i:int | 0 <= i < 0x100000000

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false

class Test<T> {
var t:T
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false

method Main() {
print "Hello world\n";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false

newtype sbyte = i:int | -0x80 <= i < 0x80
newtype byte = i:int | 0 <= i < 0x100
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false

newtype uint32 = i:int | 0 <= i < 0x100000000

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false

newtype uint32 = i:int | 0 <= i < 0x100000000

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false

newtype uint64 = i:int | 0 <= i < 0x10000000000000000

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false

newtype uint8 = i:int | 0 <= i < 0x100
newtype uint32 = i:int | 0 <= i < 0x100000000
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false

newtype uint32 = i:int | 0 <= i < 0x100000000

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false

newtype uint32 = i:int | 0 <= i < 0x100000000

Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change! And this makes Arrays.dfy.go.expect unnecessary now, so we should delete it.

That also says to me that %testDafnyForEachCompiler should probably fail if a test passes for a backend but one of those expect files exists! That might be worth adding so that we can delete all the unused files, otherwise folks will get confused in the future.

Copy link
Member Author

@keyboardDrummer keyboardDrummer Apr 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't change anything, besides swapping comp/Arrays and unicodechars/comp/Arrays and their related files, and adding --allow-warnings to the version that has --unicode-char false, and updating its expect file to include the new warning

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// NONUNIFORM: https://github.com/dafny-lang/dafny/issues/2582
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment

method LinearSearch(a: array<int>, key: int) returns (n: nat)
ensures 0 <= n <= a.Length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
[20, 21, 22]
[0, 1, 2, 3, 4, 5, 6, 7]
[0, 1, 2, 3, 4, 5, 6, 7]
d d d
h e l l o
'd' 'd' 'd'
'h' 'e' 'l' 'l' 'o'
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
1 0 0 0 0
Expand All @@ -18,34 +18,34 @@ It's null
hi hello tjena hej hola
hi hello tjena hej hola
hi hello tjena hej hola
d d d
h e l l o
'd' 'd' 'd'
'h' 'e' 'l' 'l' 'o'
8 8 8 8
true true true
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
4 4 4 4 4
(d, 8, true, 1, 2, 3, 4)
D D D
('d', 8, true, 1, 2, 3, 4)
'D' 'D' 'D'
0 0 0 0
false false false
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
(D, 0, false, 0, 0, 0, 0)
('D', 0, false, 0, 0, 0, 0)
8 0
false 0 null null
8 8
8 8
8 8
8 8
D D D
D D D
D D D
D D r (D, D, r)
D D r
'D' 'D' 'D'
'D' 'D' 'D'
'D' 'D' 'D'
'D' 'D' 'r' ('D', 'D', 'r')
'D' 'D' 'r'
[19, 18, 9, 8]
true
false
Expand Down Expand Up @@ -81,14 +81,14 @@ hello [0, 1, 2, 3, 4] [2, 2, 2, 2, 2]
[0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 60, 60, 60, 60, 60]
[0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 60, 60, 60, 60, 60]
DDDDDabcdeabcdeggggg
DDDDDabcdeabcdeggggg
['D', 'D', 'D', 'D', 'D', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'g', 'g', 'g', 'g', 'g']
[77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 50, 78, 78, 78, 78, 78, 50, 78, 78, 78]
[77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 50, 78, 78, 78, 78, 78, 50, 78, 78, 78]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 60, 60, 60, 60, 60, 50, 60, 60, 60]
DDDDDDDDDDagggggaggg
['D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'a', 'g', 'g', 'g', 'g', 'g', 'a', 'g', 'g', 'g']
0 69 50
0 69 50
D k n
'D' 'k' 'n'
false false
true true
false false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation

method Main() {
Sets();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Sets: {} {17, 82} {12, 17}
eq covariance: 1 true true
false true
|s|=4 |S|=16
{{}, {a}, {b}, {c}, {d}, {a, b}, {a, c}, {b, c}, {a, d}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}, {a, b, c, d}}
{{}, {'a'}, {'b'}, {'c'}, {'d'}, {'a', 'b'}, {'a', 'c'}, {'b', 'c'}, {'a', 'd'}, {'b', 'd'}, {'c', 'd'}, {'a', 'b', 'c'}, {'a', 'b', 'd'}, {'a', 'c', 'd'}, {'b', 'c', 'd'}, {'a', 'b', 'c', 'd'}}
Multisets: multiset{} multiset{17, 17, 82, 82} multiset{12, 17}
cardinality: 0 4 2
union: multiset{17, 17, 82, 82} multiset{12, 17, 17, 17, 82, 82}
Expand Down Expand Up @@ -48,7 +48,7 @@ Sequences: [] [17, 82, 17, 82] [12, 17]
membership: false true true
Bound Bound Bound Bound Bound Bound
ed ed ed ed ed ed
e e e e e e
'e' 'e' 'e' 'e' 'e' 'e'
hello
hEllo
[2, 4, 6, 8, 10]
Expand Down
Loading