Skip to content

Commit a384ea0

Browse files
committed
Merged in fstreun_default_plugin_decreases (pull request #137)
Decreases Plugin (Termination Check) Approved-by: Malte Schwerhoff Approved-by: Fábio Pakk Selmi-Dei
2 parents 972704b + 025699a commit a384ea0

33 files changed

Lines changed: 2347 additions & 11 deletions
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
import "bool.vpr"
5+
import "int.vpr"
6+
import "multiset.vpr"
7+
import "predicate_instance.vpr"
8+
import "rational.vpr"
9+
import "ref.vpr"
10+
import "seq.vpr"
11+
import "set.vpr"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
import "declaration.vpr"
5+
6+
domain BoolWellFoundedOrder{
7+
//Booleans
8+
axiom bool_ax_dec{
9+
decreasing(false, true)
10+
}
11+
axiom bool_ax_bound{
12+
forall bool1: Bool :: {bounded(bool1)}
13+
bounded(bool1)
14+
}
15+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
domain WellFoundedOrder[T]{
5+
// arg1 is smaller then arg2
6+
function decreasing(arg1:T, arg2:T):Bool
7+
function bounded(arg1:T):Bool
8+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
import "declaration.vpr"
5+
6+
domain IntWellFoundedOrder{
7+
//Integers
8+
axiom integer_ax_dec{
9+
forall int1: Int, int2: Int :: {decreasing(int1, int2)}
10+
(int1 < int2) ==> decreasing(int1, int2)
11+
}
12+
axiom integer_ax_bound{
13+
forall int1: Int :: {bounded(int1)}
14+
int1 >= 0 ==> bounded(int1)
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
import "declaration.vpr"
5+
6+
domain MuliSetWellFoundedOrder[S]{
7+
//MultiSet
8+
axiom multiset_ax_dec{
9+
forall mSet1: Multiset[S], mSet2: Multiset[S] :: {decreasing(mSet1, mSet2)}
10+
(|mSet1| < |mSet2|) ==> decreasing(mSet1, mSet2)
11+
}
12+
axiom multiset_ax_bound{
13+
forall mSet1: Multiset[S] :: {bounded(mSet1)}
14+
bounded(mSet1)
15+
}
16+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
import "declaration.vpr"
5+
import "predicate_instance_nested.vpr"
6+
import <predicateinstance/pi.vpr>
7+
8+
domain PredicateInstancesWellFoundedOrder {
9+
axiom predicate_instances_ax_dec{
10+
forall l1: PredicateInstance, l2: PredicateInstance :: {nestedPredicates(l1,l2)}
11+
decreasing(l1, l2) <==> nestedPredicates(l1,l2)
12+
}
13+
14+
axiom predicate_instances_ax_bound{
15+
forall l1: PredicateInstance :: {bounded(l1)}
16+
bounded(l1)
17+
}
18+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
import <predicateinstance/pi.vpr>
5+
6+
domain PredicateInstancesNestedRelation{
7+
function nestedPredicates(l1: PredicateInstance, l2: PredicateInstance) : Bool
8+
9+
//Transitivity of the nested-Function
10+
axiom nestedTrans{
11+
forall l1: PredicateInstance, l2: PredicateInstance, l3: PredicateInstance :: {nestedPredicates(l1, l2), nestedPredicates(l2, l3)}
12+
nestedPredicates(l1,l2) && nestedPredicates(l2,l3) ==> nestedPredicates(l1,l3)
13+
}
14+
15+
//A predicate cannot be nested inside itself
16+
axiom nestedReflex{
17+
forall l1: PredicateInstance ::
18+
!nestedPredicates(l1, l1)
19+
}
20+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
import "declaration.vpr"
5+
6+
domain RationalWellFoundedOrder{
7+
//Rationals
8+
axiom rational_ax_dec{
9+
forall int1: Rational, int2: Rational :: {decreasing(int1, int2)}
10+
(int1 <= int2 - 1/1) ==> decreasing(int1, int2)
11+
}
12+
axiom rational_ax_bound{
13+
forall int1: Rational :: {bounded(int1)}
14+
int1 >= 0/1 ==> bounded(int1)
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
import "declaration.vpr"
5+
6+
domain RefWellFoundedOrder{
7+
//References
8+
axiom ref_ax_dec{
9+
forall ref1: Ref :: {decreasing(null,ref1)}
10+
ref1 != null ==> decreasing(null, ref1)
11+
}
12+
axiom ref_ax_bound{
13+
forall ref1: Ref :: {bounded(ref1)}
14+
bounded(ref1)
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
import "declaration.vpr"
5+
6+
domain SeqWellFoundedOrder[S]{
7+
//Sequences
8+
axiom seq_ax_dec{
9+
forall seq1: Seq[S], seq2: Seq[S] :: {decreasing(seq1,seq2)}
10+
(|seq1| < |seq2|) ==> decreasing(seq1, seq2)
11+
}
12+
axiom seq_ax_bound{
13+
forall seq1: Seq[S] :: {bounded(seq1)}
14+
(|seq1| >= 0) ==> bounded(seq1)
15+
}
16+
}

0 commit comments

Comments
 (0)