Skip to content

Commit

Permalink
Merge pull request #679 from viperproject/meilers_reenable_tests
Browse files Browse the repository at this point in the history
Reenabling tests for some examples
  • Loading branch information
marcoeilers committed Apr 20, 2023
2 parents 47c42ac + 6364d76 commit 747ded6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* VerifyThis@FM2012: http://fm2012.verifythis.org/challenges
*/

//:: IgnoreFile(/silicon/issue/398/)

define access(a) forall k: Int :: 0 <= k && k < len(a) ==> acc(loc(a, k).val)
define untouched(a) forall k: Int :: 0 <= k && k < len(a) ==> loc(a, k).val == old(loc(a, k).val)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/

//:: IgnoreFile(/carbon/issue/280/)

/* This example shows how magic wands can be used to specify the
* imperative version of challenge 3 from the VerifyThis@FM2012
Expand Down
2 changes: 0 additions & 2 deletions src/test/resources/examples/vmcai2016/encoding-adts.vpr
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
* properties of functions over such a data type can proved.
*/

//:: IgnoreFile(/carbon/issue/280/)

domain list {

/* Constructors */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// http://creativecommons.org/publicdomain/zero/1.0/

//:: IgnoreFile(/carbon/issue/102/)
//:: IgnoreFile(/silicon/issue/208/)

/*****************************************************************
* List Nodes
Expand All @@ -21,7 +20,7 @@ predicate lseg(this: Ref, end: Ref)
function contentNodes(this: Ref, end: Ref): Seq[Int]
requires acc(lseg(this, end))
ensures this == end ==> result == Seq[Int]()
ensures this != end ==> result[0] == unfolding acc(lseg(this, end)) in this.data
ensures this != end ==> |result| > 0 && result[0] == unfolding acc(lseg(this, end)) in this.data
ensures forall i: Int, j: Int :: 0 <= i && i < j && j < |result| ==> result[i] <= result[j]
{
this == end ? Seq[Int]() :
Expand Down Expand Up @@ -138,6 +137,8 @@ method insert(this: Ref, elem: Int) returns (index: Int)
invariant ptr.next != null ==> ptr.data <= unfolding acc(lseg(ptr.next, null)) in ptr.next.data
invariant A --* B
{

assert A --* B
var prev: Ref := ptr

unfold acc(lseg(ptr.next, null))
Expand All @@ -146,7 +147,8 @@ method insert(this: Ref, elem: Int) returns (index: Int)

package (A) --* B {
fold acc(lseg(prev, null))
apply acc(lseg(prev, null)) && contentNodes(prev, null)[0] == old(content(this))[index-1] --* B
apply acc(lseg(prev, null)) && contentNodes(prev, null)[0] == old(content(this))[index-2] --*
(acc(lseg(hd, null)) && contentNodes(hd, null) == old(content(this))[0..index-2] ++ old[lhs](contentNodes(prev, null)))
}
}

Expand Down Expand Up @@ -194,7 +196,7 @@ field held: Int
field changed: Bool

method test(lock: Ref)
ensures [true, forperm[held] r :: false]
ensures [true, forperm r: Ref [r.held] :: false]
{
/* Acquire lock (without deadlock checking) */
inhale acc(List(lock)) && acc(lock.held) && acc(lock.changed)
Expand Down

0 comments on commit 747ded6

Please sign in to comment.