Skip to content

Commit c1468ae

Browse files
authored
Fix issue 1024 (#1026)
This PR fixes issue #1024 .
1 parent c41faab commit c1468ae

File tree

5 files changed

+36
-5
lines changed

5 files changed

+36
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ input, optionally infers some invariants in the given Boogie program, and then
2020
generates verification conditions that are passed to an SMT solver. The default
2121
SMT solver is [Z3](https://github.com/Z3Prover/z3).
2222

23-
A tutorial for Boogie is available in this [paper](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/12/krml178.pdf).
24-
The documentation in this paper, even though slightly out-of-date, still captures the essence of the Boogie language and tool.
23+
A tutorial for Boogie is available [here](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/12/krml178.pdf).
24+
The documentation in this tutorial, although slightly out-of-date, captures the essence of the Boogie language and tool.
2525

2626
Boogie has long been used for modeling and verifying sequential programs.
2727
Recently, through its [Civl](https://civl-verifier.github.io/) extension, Boogie

Source/Core/AST/Expression/AbsyExpr.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public static Expr And(Expr e1, Expr e2)
240240
else
241241
{
242242
var res = Binary(BinaryOperator.Opcode.And, e1, e2);
243-
res.Type = Microsoft.Boogie.Type.Bool;
243+
res.Type = Type.Bool;
244244
res.TypeParameters = SimpleTypeParamInstantiation.EMPTY;
245245
return res;
246246
}
@@ -265,7 +265,10 @@ public static Expr Or(Expr e1, Expr e2)
265265
}
266266
else
267267
{
268-
return Binary(BinaryOperator.Opcode.Or, e1, e2);
268+
var res = Binary(BinaryOperator.Opcode.Or, e1, e2);
269+
res.Type = Type.Bool;
270+
res.TypeParameters = SimpleTypeParamInstantiation.EMPTY;
271+
return res;
269272
}
270273
}
271274

Source/Core/Monomorphization.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ class PolymorphicMapAndBinderSubstituter : VarDeclOnceStandardVisitor
600600
/*
601601
* This visitor finalizes the monomorphization of polymorphic maps and binders once
602602
* all instantiations have been discovered. It accomplishes the following substitutions:
603-
* - ach access to a polymorphic map with an access to corresponding datatype
603+
* - each access to a polymorphic map with an access to corresponding datatype
604604
* - each occurrence of a polymorphic map type with the corresponding datatype
605605
* - each polymorphic lambda with a constructor call of the corresponding datatype
606606
* - each polymorphic forall quantifier with a conjunction

Test/monomorphize/issue-1024.bpl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// RUN: %parallel-boogie "%s" > "%t"
2+
// RUN: %diff "%s.expect" "%t"
3+
4+
type Ref;
5+
6+
type Field T;
7+
8+
const allocated: Field bool;
9+
10+
const owner: Field Ref;
11+
12+
type Frame = <alpha>[Ref, Field alpha]bool;
13+
14+
function { :inline } closed_under_domains(frame: Frame): bool
15+
{
16+
(exists <V> o: Ref, f: Field V :: frame[o, f])
17+
}
18+
19+
const writable: Frame;
20+
21+
procedure GCD.divides(d: int, n: int) returns (Result: bool);
22+
free requires closed_under_domains(writable);
23+
24+
implementation GCD.divides(d: int, n: int) returns (Result: bool)
25+
{
26+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
Boogie program verifier finished with 1 verified, 0 errors

0 commit comments

Comments
 (0)