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

Can call merge [Ignore] #6002

Draft
wants to merge 192 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
e5e3e7c
Snapshot changes
RustanLeino Jun 11, 2024
0ad2411
Merge branch 'master' into can-call-diff
RustanLeino Jun 11, 2024
facdbef
Fix parameter order to CanCallAssumption
RustanLeino Jun 11, 2024
2cd6a52
Manually merge in the changes from the old Translator.cs
RustanLeino Jun 11, 2024
702c222
Fix merge
RustanLeino Jun 12, 2024
86738d6
Add FreeRequires/FreeEnsures helper methods
RustanLeino Jun 12, 2024
e712995
chore: Remove deprecated semi-colons
RustanLeino Jun 12, 2024
bf0ec2c
Restore FunctionSpecification.dfy
RustanLeino Jun 12, 2024
73d0b5c
Move generation of req==>CanCall axiom
RustanLeino Jun 12, 2024
13aa0d9
Replace kv parameter by alwaysAssume option in Free-Requires/Ensures
RustanLeino Jun 12, 2024
e7e6c61
Don’t add CanCall _inside_ frame condition, but as free precondition
RustanLeino Jun 12, 2024
e1e695b
Assume CanCall of callee frames
RustanLeino Jun 12, 2024
500ff5c
chore: Remove deprecated semi-colons
RustanLeino Jun 13, 2024
79d3291
Generate CanCall assumptions for result of calc
RustanLeino Jun 14, 2024
ecef1e7
Generate CanCall assumptions for array/seq init expression
RustanLeino Jun 17, 2024
8f5822f
Carve pre/post-conditions up into separate conjuncts
RustanLeino Jun 17, 2024
5e697d2
Fix null dereference
RustanLeino Jun 20, 2024
8cc0ba6
chore: Remove stale comment
RustanLeino Jun 20, 2024
8f0b321
Strip any box/unbox around trigger terms
RustanLeino Jul 16, 2024
2dc5fa4
Fix casts in test case
RustanLeino Jul 16, 2024
ea774a5
Fix ConjunctsOf to not drop labels
RustanLeino Jul 16, 2024
466c1b8
Add CanCalls to primed version of comprehension uniqueness check
RustanLeino Jul 16, 2024
171939e
Reflect change in error output ordering
RustanLeino Jul 16, 2024
c7222b6
Fix Conjuncts all to include type of new LetExpr’s
RustanLeino Jul 16, 2024
94a0ccc
Add CanCall assumptions to subset-constraint checks
RustanLeino Jul 16, 2024
f059ffd
Restructure CanCallOptions and make allowances for overriding functions
RustanLeino Jul 17, 2024
d63ff0a
Add CanCan antecedent to “r” component of function handles
RustanLeino Jul 17, 2024
f7bf313
Remove deprecation
RustanLeino Jul 20, 2024
460e400
Use :induction instead of /induction:3
RustanLeino Jul 20, 2024
09be550
Add CanCall assumptions to generated let function
RustanLeino Jul 20, 2024
87b6f0f
Adjust test case, which is now passing
RustanLeino Jul 20, 2024
3127da2
Incorporate CanCall into newtype/subset-type $Is axioms
RustanLeino Jul 22, 2024
8bba9a1
Update order of error messages in expect file
RustanLeino Jul 22, 2024
567c667
Remove a redundant test file
RustanLeino Jul 22, 2024
7db4ffc
Adjust test output
RustanLeino Jul 22, 2024
e5c91dd
Fix parameters to CanCall function in override axiom
RustanLeino Jul 22, 2024
1379380
Change override axiom to use CanCall
RustanLeino Jul 23, 2024
3a8307e
Adjust resource limit (down) to make test pass
RustanLeino Jul 23, 2024
a9b195a
Fix typo in comments
RustanLeino Jul 30, 2024
afdb5c5
Add workaround for incorrect partial-arrow constraint
RustanLeino Jul 30, 2024
b657928
Merge branch 'master' into can-call-everywhere
RustanLeino Jul 30, 2024
1cb2672
Merge branch 'master' into can-call-everywhere
RustanLeino Sep 27, 2024
bcc497b
Merge branch 'master' into can-call-everywhere
RustanLeino Sep 27, 2024
6a1b106
update resource count, this is positive
typerSniper Sep 30, 2024
349a2ea
Fix bad refactoring
RustanLeino Oct 3, 2024
5cee693
Adjust test and answer
RustanLeino Oct 3, 2024
0a45814
Add CanCall assumptions in short-circuit WF-result checks
RustanLeino Oct 3, 2024
8973a0a
Fix implementations of Disjuncts and Conjuncts
RustanLeino Oct 3, 2024
74fb993
Merge branch 'can-call-everywhere' of https://github.com/RustanLeino/…
typerSniper Oct 3, 2024
9ec69b2
Change \d to [0-9], since the former apparently isn’t always supported
RustanLeino Oct 3, 2024
760fbe7
Merge branch 'can-call-everywhere' of https://github.com/RustanLeino/…
typerSniper Oct 4, 2024
ceff013
Merge branch 'master' into can-call-everywhere
RustanLeino Oct 4, 2024
f4c9588
Merge branch 'master' into can-call-everywhere
RustanLeino Oct 4, 2024
59f2e6f
Merge branch 'can-call-everywhere' of https://github.com/RustanLeino/…
typerSniper Oct 7, 2024
d7a2754
Adjust test and answer
RustanLeino Oct 8, 2024
b8332aa
Avoid triggers with nullary functions
RustanLeino Oct 9, 2024
09b3930
chore: Remove old syntax
RustanLeino Oct 9, 2024
96cd511
Reorder error output
RustanLeino Oct 9, 2024
41fa183
Update RUs in test outputs
RustanLeino Oct 9, 2024
3927069
merge
typerSniper Oct 10, 2024
522513f
Separate assertions into separate methods to avoid Z3 ordering problem
RustanLeino Oct 10, 2024
5f3cfdc
chore: Improve trigger/induction code
RustanLeino Oct 12, 2024
cd9d205
Compute triggers for automatic induction
RustanLeino Oct 12, 2024
8c4c4a6
chore: Improve trigger/induction code
RustanLeino Oct 12, 2024
e62d2b6
Compute triggers for automatic induction
RustanLeino Oct 12, 2024
ad1c724
Improve induction heuristics
RustanLeino Oct 12, 2024
29d715a
chore: Change “ghost method” to “lemma”
RustanLeino Oct 12, 2024
4cfbe21
chore: Improve C#
RustanLeino Oct 14, 2024
b17c662
Also consider codatatype equality as a greatest focal predicate
RustanLeino Oct 14, 2024
cee8d58
Show tooltips for any quantifier rewrite substitutions
RustanLeino Oct 14, 2024
dda37cb
feat!: Auto-induction for twostate lemmas but not ghost methods
RustanLeino Oct 14, 2024
fa79ba3
fix: Don’t consider arrow-typed variables for auto induction
RustanLeino Oct 16, 2024
0028a3a
feat: allow ternary expressions in triggers
RustanLeino Oct 16, 2024
394c635
Compute and use triggers for induction hypotheses
RustanLeino Oct 16, 2024
659d4ba
Tooltip named expressions from trigger selection
RustanLeino Oct 16, 2024
6b5b207
chore: Remove deprecated semi-colons
RustanLeino Oct 16, 2024
3fc56d3
Add tests for ternary expressions in triggers
RustanLeino Oct 16, 2024
73d2d61
Adjust resource count in test
RustanLeino Oct 16, 2024
73406c6
Merge branch 'master' into triggers-for-auto-induction
RustanLeino Oct 16, 2024
f4815f4
Add release notes
RustanLeino Oct 16, 2024
e4e4ce8
Help proof
RustanLeino Oct 17, 2024
3a0f1c0
Update test, which no longer exhausts resources
RustanLeino Oct 17, 2024
703c661
Improve proofs
RustanLeino Oct 17, 2024
73b5ee9
Merge branch 'can-call-everywhere' of https://github.com/RustanLeino/…
typerSniper Oct 18, 2024
8547807
Merge remote-tracking branch 'origin/master' into can-call-everywhere
keyboardDrummer Oct 18, 2024
c164820
Merge remote-tracking branch 'origin/master' into can-call-everywhere
keyboardDrummer Oct 18, 2024
9c07f8a
Improve induction heuristics
RustanLeino Oct 12, 2024
a420bc2
chore: Change “ghost method” to “lemma”
RustanLeino Oct 12, 2024
2f9a6e1
chore: Improve C#
RustanLeino Oct 14, 2024
d6bc12e
Also consider codatatype equality as a greatest focal predicate
RustanLeino Oct 14, 2024
cb0eebd
Show tooltips for any quantifier rewrite substitutions
RustanLeino Oct 14, 2024
2c4d9bc
feat!: Auto-induction for twostate lemmas but not ghost methods
RustanLeino Oct 14, 2024
5b83dfa
fix: Don’t consider arrow-typed variables for auto induction
RustanLeino Oct 16, 2024
f26466b
feat: allow ternary expressions in triggers
RustanLeino Oct 16, 2024
6b4ca54
Compute and use triggers for induction hypotheses
RustanLeino Oct 16, 2024
bc050cd
Tooltip named expressions from trigger selection
RustanLeino Oct 16, 2024
b9083e7
chore: Remove deprecated semi-colons
RustanLeino Oct 16, 2024
a2b5a6f
Add tests for ternary expressions in triggers
RustanLeino Oct 16, 2024
84bd747
Selectively exclude CanCalls from forall stmt translation
RustanLeino Oct 20, 2024
54e9ddb
Fix typo in method name
RustanLeino Oct 20, 2024
b46f0dc
Remove unnecessary assertion
RustanLeino Oct 20, 2024
022685c
Remove unnecessary $’s
RustanLeino Oct 20, 2024
4cb3f5a
Improve C# and comments
RustanLeino Oct 20, 2024
a213285
Revert tooltip printing of trigger named expressions
RustanLeino Oct 20, 2024
72c15fe
Improve and document methods that compute/report induction triggers
RustanLeino Oct 20, 2024
704af8c
Incomplete attempt at specifying behavior
RustanLeino Oct 20, 2024
9e9dd80
doc: Align :induction documentation with actual behavior
cpitclaudel Oct 23, 2024
8a792b1
Remove unnecessary $s
cpitclaudel Oct 23, 2024
7c6ab84
Move :inductionPattern attribute generation to ComputeInductionTriggers
cpitclaudel Oct 23, 2024
766ac5b
Allow users to disable trigger generation with an empty inductionTrigger
cpitclaudel Oct 23, 2024
a3702d2
Update documentation
cpitclaudel Oct 23, 2024
ffe54af
Add one more test for induction triggers
cpitclaudel Oct 23, 2024
8c7b06c
Document {:inductionTrigger}
cpitclaudel Oct 24, 2024
4c1269a
Merge branch 'can-call-everywhere' of https://github.com/RustanLeino/…
typerSniper Oct 25, 2024
24aa393
Merge branch 'can-call-everywhere' of https://github.com/RustanLeino/…
typerSniper Oct 28, 2024
769d6cd
Always report “inductionTrigger”, not just in DEBUG build
RustanLeino Oct 30, 2024
2c7fcc9
Fix format of expected test output
RustanLeino Oct 30, 2024
62e771c
Merge branch 'master' into triggers-for-auto-induction
RustanLeino Oct 30, 2024
af0223b
Use underscore name for generated attributes
RustanLeino Oct 31, 2024
6cdaa08
Update tests
RustanLeino Oct 31, 2024
a1149c9
Update tests and expected output
RustanLeino Oct 31, 2024
c447ffa
Fix previous code edit
RustanLeino Oct 31, 2024
3d8d0e7
Merge branch 'master' into triggers-for-auto-induction
RustanLeino Oct 31, 2024
63683d1
Update standard libraries
RustanLeino Oct 31, 2024
808a2b3
Merge branch 'master' into triggers-for-auto-induction
RustanLeino Oct 31, 2024
43bdbd3
Merge branch 'master' into triggers-for-auto-induction
RustanLeino Oct 31, 2024
3652ff3
Update standard library
RustanLeino Oct 31, 2024
b070751
Update standard library
RustanLeino Nov 1, 2024
a56f5f6
Merge branch 'triggers-for-auto-induction' into can-call-everywhere
RustanLeino Nov 5, 2024
2e85691
Merge branch 'master' into can-call-everywhere
RustanLeino Nov 5, 2024
99f1c6e
Fix merge
RustanLeino Nov 6, 2024
4bd711e
Merge branch 'master' into can-call-everywhere
RustanLeino Nov 6, 2024
3086933
Merge branch 'master' into can-call-everywhere
RustanLeino Nov 7, 2024
f3e2616
Fix proof
RustanLeino Nov 7, 2024
f94ccd2
Use $OneHeap in Apply if function is known to be heap independent
RustanLeino Nov 7, 2024
96d69a7
Merge branch 'can-call-everywhere' of https://github.com/RustanLeino/…
typerSniper Nov 11, 2024
1d247d1
upd rc
typerSniper Nov 11, 2024
e3dbc66
fuel expect upadte
typerSniper Nov 11, 2024
e3b27ed
update rc
typerSniper Nov 11, 2024
5947deb
Merge branch 'master' into can-call-everywhere
RustanLeino Nov 11, 2024
53bc59b
merge
typerSniper Nov 11, 2024
756ceb6
Update BoogieGenerator.Methods.cs
typerSniper Nov 11, 2024
596da12
Merge branch 'can-call-everywhere' of https://github.com/RustanLeino/…
typerSniper Nov 11, 2024
f802e72
rc
typerSniper Nov 11, 2024
83213eb
Merge branch 'master' into can-call-everywhere
typerSniper Nov 18, 2024
0409d51
expect updf
typerSniper Nov 18, 2024
3dfd94c
fix heap picked for seq#create
typerSniper Nov 18, 2024
99fc5c1
use oneheap for sequence intiailer
typerSniper Nov 18, 2024
96bdb79
fix old the heap used inside lambda body
typerSniper Nov 18, 2024
21f43ed
help verifier
typerSniper Nov 20, 2024
3cd8cf5
fighting butterflies with butterflies
typerSniper Nov 20, 2024
92b21e4
temp undo
typerSniper Nov 20, 2024
d1db55e
gcd
typerSniper Nov 20, 2024
165065e
num ver
typerSniper Nov 20, 2024
8330d54
try isolate
typerSniper Nov 25, 2024
f24e931
null based heaping
typerSniper Nov 25, 2024
2edf581
typo
typerSniper Nov 25, 2024
f266ad7
finalize heap change for lambads
typerSniper Nov 25, 2024
8ae7880
change trigger on requires to only depend on heap mentions in the spec
typerSniper Nov 25, 2024
b23d1d3
split assertions into two methods
typerSniper Nov 25, 2024
6fc4bd1
eof
typerSniper Nov 25, 2024
7131311
update resources
typerSniper Nov 25, 2024
7040b1f
upd fuel leg
typerSniper Nov 25, 2024
700d2a6
upd both
typerSniper Nov 26, 2024
c6a1d8b
Merge branch 'master' into can-call-everywhere
typerSniper Nov 26, 2024
179d8e8
Update proof
RustanLeino Nov 27, 2024
8d55b67
Merge branch 'master' into can-call-everywhere
typerSniper Nov 29, 2024
d5bd1f4
Merge branch 'master' into can-call-everywhere
typerSniper Dec 2, 2024
8753d27
Merge branch 'master' into can-call-everywhere
typerSniper Dec 2, 2024
d302167
Update expected coverage output
RustanLeino Dec 2, 2024
28452b0
Update expected resource counts
RustanLeino Dec 2, 2024
2d3cf69
Update coverage output
RustanLeino Dec 3, 2024
2006f98
Fix typos in test harness
RustanLeino Dec 3, 2024
b0ca029
Update coverage output further
RustanLeino Dec 3, 2024
6d9e3cf
Merge branch 'master' of https://github.com/dafny-lang/dafny into can…
typerSniper Dec 12, 2024
641320f
forgot
typerSniper Dec 12, 2024
b7f7dd1
update thsoe agains
typerSniper Dec 12, 2024
719a9d3
update rc
typerSniper Dec 12, 2024
432ea9a
Merge branch 'master' of https://github.com/dafny-lang/dafny into can…
typerSniper Dec 12, 2024
2e4b4a5
nc to pc is okay
typerSniper Dec 16, 2024
b88a8b2
update rc
typerSniper Dec 16, 2024
cc2e79d
Merge branch 'master' of https://github.com/dafny-lang/dafny into can…
typerSniper Dec 16, 2024
2ee1347
merge with master wagain
typerSniper Dec 16, 2024
313383c
update limited expet
typerSniper Dec 16, 2024
6b1df08
read conditions update
typerSniper Dec 17, 2024
500216f
space changes
typerSniper Dec 17, 2024
c39a975
Merge branch 'master' into can-call-everywhere
typerSniper Dec 17, 2024
913959a
Merge branch 'master' into can-call-everywhere
typerSniper Dec 18, 2024
460dcd1
Merge branch 'master' of https://github.com/dafny-lang/dafny into can…
typerSniper Dec 18, 2024
d173e1f
Merge branch 'can-call-everywhere' of https://github.com/RustanLeino/…
typerSniper Dec 23, 2024
ac574be
Merge branch 'master' of https://github.com/dafny-lang/dafny into can…
typerSniper Dec 23, 2024
2c7d72b
merge
typerSniper Dec 23, 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
44 changes: 35 additions & 9 deletions Source/DafnyCore/AST/Expressions/Expression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,41 @@ public virtual IEnumerable<Type> ComponentTypes {

public virtual bool IsImplicit => false;

public static IEnumerable<Expression> ConjunctsWithLetsOnOutside(Expression expr) {
foreach (var conjunct in Conjuncts(expr)) {
if (conjunct is LetExpr { Exact: true } letExpr) {
foreach (var letBodyConjunct in ConjunctsWithLetsOnOutside(letExpr.Body)) {
yield return new LetExpr(letExpr.tok, letExpr.LHSs, letExpr.RHSs, letBodyConjunct, letExpr.Exact, letExpr.Attributes) {
Type = letExpr.Type
};
}
} else {
yield return conjunct;
}
}
}

/// <summary>
/// Return the negation of each of the expressions in "expressions".
/// If there is just one expression in "expressions", then use the given token "tok" for the negation.
/// Otherwise, use the token from each expression.
/// </summary>
static IEnumerable<Expression> NegateEach(IOrigin tok, IEnumerable<Expression> expressions) {
var exprs = expressions.ToList();
foreach (Expression e in exprs) {
yield return Expression.CreateNot(exprs.Count == 1 ? tok : e.tok, e);
}
}

public static IEnumerable<Expression> Conjuncts(Expression expr) {
Contract.Requires(expr != null);
Contract.Requires(expr.Type.IsBoolType);
Contract.Ensures(cce.NonNullElements(Contract.Result<IEnumerable<Expression>>()));

expr = StripParens(expr);
if (expr is UnaryOpExpr unary && unary.Op == UnaryOpExpr.Opcode.Not) {
foreach (Expression e in Disjuncts(unary.E)) {
yield return Expression.CreateNot(e.Tok, e);
if (expr is UnaryOpExpr { Op: UnaryOpExpr.Opcode.Not } unary) {
foreach (Expression e in NegateEach(expr.Tok, Disjuncts(unary.E))) {
yield return e;
}
yield break;

Expand All @@ -189,26 +215,26 @@ public static IEnumerable<Expression> Disjuncts(Expression expr) {
Contract.Ensures(cce.NonNullElements(Contract.Result<IEnumerable<Expression>>()));

expr = StripParens(expr);
if (expr is UnaryOpExpr unary && unary.Op == UnaryOpExpr.Opcode.Not) {
foreach (Expression e in Conjuncts(unary.E)) {
yield return Expression.CreateNot(e.Tok, e);
if (expr is UnaryOpExpr { Op: UnaryOpExpr.Opcode.Not } unary) {
foreach (Expression e in NegateEach(expr.Tok, Conjuncts(unary.E))) {
yield return e;
}
yield break;

} else if (expr is BinaryExpr bin) {
if (bin.ResolvedOp == BinaryExpr.ResolvedOpcode.Or) {
foreach (Expression e in Conjuncts(bin.E0)) {
foreach (Expression e in Disjuncts(bin.E0)) {
yield return e;
}
foreach (Expression e in Conjuncts(bin.E1)) {
foreach (Expression e in Disjuncts(bin.E1)) {
yield return e;
}
yield break;
} else if (bin.ResolvedOp == BinaryExpr.ResolvedOpcode.Imp) {
foreach (Expression e in Conjuncts(bin.E0)) {
yield return Expression.CreateNot(e.Tok, e);
}
foreach (Expression e in Conjuncts(bin.E1)) {
foreach (Expression e in Disjuncts(bin.E1)) {
yield return e;
}
yield break;
Expand Down
4 changes: 2 additions & 2 deletions Source/DafnyCore/CounterExampleGeneration/DafnyModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public DafnyModel(Model model, DafnyOptions options) {
fMapEmpty = new ModelFuncWrapper(this, "Map#Empty", 0, 0);
fIs = new ModelFuncWrapper(this, "$Is", 2, tyArgMultiplier);
fIsBox = new ModelFuncWrapper(this, "$IsBox", 2, 0);
fBox = new ModelFuncWrapper(this, "$Box", 1, tyArgMultiplier);
fBox = new ModelFuncWrapper(this, BoogieGenerator.BoxFunctionName, 1, tyArgMultiplier);
fDim = new ModelFuncWrapper(this, "FDim", 1, 0);
fIndexField = new ModelFuncWrapper(this, "IndexField", 1, 0);
fMultiIndexField = new ModelFuncWrapper(this, "MultiIndexField", 2, 0);
Expand All @@ -85,7 +85,7 @@ public DafnyModel(Model model, DafnyOptions options) {
fU2Int = new ModelFuncWrapper(this, "U_2_int", 1, 0);
fTag = new ModelFuncWrapper(this, "Tag", 1, 0);
fBv = new ModelFuncWrapper(this, "TBitvector", 1, 0);
fUnbox = new ModelFuncWrapper(this, "$Unbox", 2, 0);
fUnbox = new ModelFuncWrapper(this, BoogieGenerator.UnboxFunctionName, 2, 0);
fLs = new ModelFuncWrapper(this, "$LS", 1, 0);
fLz = new ModelFuncWrapper(this, "$LZ", 0, 0);
InitDataTypes();
Expand Down
2 changes: 1 addition & 1 deletion Source/DafnyCore/Rewriters/InductionHeuristic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,4 @@ expr is BoxingCastExpr ||
return false;
}
}
}
}
3 changes: 2 additions & 1 deletion Source/DafnyCore/Triggers/SplitPartTriggerWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ string InfoFirstLineEnd(int count) {
messages.Add($"Part #{splitPartIndex} is '{Comprehension.Term}'");
}
if (Candidates.Any()) {
messages.Add($"Selected triggers:{InfoFirstLineEnd(Candidates.Count)}{string.Join(", ", Candidates)}");
var subst = Util.Comma("", NamedExpressions, pair => $" where {pair.Item2} := {pair.Item1}");
messages.Add($"Selected triggers:{InfoFirstLineEnd(Candidates.Count)}{string.Join(", ", Candidates)}{subst}");
}
if (RejectedCandidates.Any()) {
messages.Add($"Rejected triggers:{InfoFirstLineEnd(RejectedCandidates.Count)}{string.Join("\n ", RejectedCandidates)}");
Expand Down
7 changes: 5 additions & 2 deletions Source/DafnyCore/Verifier/BoogieGenerator.BoogieFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ enum BuiltinFunction {
AtLayer
}

public const string BoxFunctionName = "$Box";
public const string UnboxFunctionName = "$Unbox";

Bpl.Expr Lit(Bpl.Expr expr, Bpl.Type typ) {
Contract.Requires(expr != null);
Contract.Requires(typ != null);
Expand Down Expand Up @@ -506,11 +509,11 @@ Bpl.NAryExpr FunctionCall(Bpl.IToken tok, BuiltinFunction f, Bpl.Type typeInstan
case BuiltinFunction.Box:
Contract.Assert(args.Length == 1);
Contract.Assert(typeInstantiation == null);
return FunctionCall(tok, "$Box", Predef.BoxType, args);
return FunctionCall(tok, BoxFunctionName, Predef.BoxType, args);
case BuiltinFunction.Unbox:
Contract.Assert(args.Length == 1);
Contract.Assert(typeInstantiation != null);
return Bpl.Expr.CoerceType(tok, FunctionCall(tok, "$Unbox", typeInstantiation, args), typeInstantiation);
return Bpl.Expr.CoerceType(tok, FunctionCall(tok, UnboxFunctionName, typeInstantiation, args), typeInstantiation);

case BuiltinFunction.RealToInt:
Contract.Assume(args.Length == 1);
Expand Down
Loading
Loading