Proof Assistant Projects
Collection
Digesting proof assistant libraries for AI ingestion. • 103 items • Updated • 3
statement stringlengths 1 11.2k | proof stringlengths 0 11.2k | type stringclasses 6
values | symbolic_name stringlengths 1 117 | library stringclasses 106
values | filename stringlengths 31 86 | imports listlengths 0 0 | deps listlengths 0 32 | docstring stringclasses 1
value | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
ContainsDomain[A,B] | {
function contains(a: A, b: B): Bool
} | domain | ContainsDomain | main.resources.import.adt | src/main/resources/import/adt/contains.vpr | [] | [
"contains"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
BoolWellFoundedOrder | {
//Booleans
axiom bool_ax_dec{
decreasing(false, true)
}
axiom bool_ax_bound{
forall bool1: Bool :: {bounded(bool1)}
bounded(bool1)
}
} | domain | BoolWellFoundedOrder | main.resources.import.decreases | src/main/resources/import/decreases/bool.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
WellFoundedOrder[T] | {
// arg1 is smaller then arg2
function decreasing(arg1:T, arg2:T):Bool
function bounded(arg1:T):Bool
} | domain | WellFoundedOrder | main.resources.import.decreases | src/main/resources/import/decreases/declaration.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
IntWellFoundedOrder | {
//Integers
axiom integer_ax_dec{
forall int1: Int, int2: Int :: {decreasing(int1, int2)}
(int1 < int2) ==> decreasing(int1, int2)
}
axiom integer_ax_bound{
forall int1: Int :: {bounded(int1)}
int1 >= 0 ==> bounded(int1)
}
} | domain | IntWellFoundedOrder | main.resources.import.decreases | src/main/resources/import/decreases/int.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
MultiSetWellFoundedOrder[S] | {
//MultiSet
axiom multiset_ax_dec{
forall mSet1: Multiset[S], mSet2: Multiset[S] :: {decreasing(mSet1, mSet2)}
(|mSet1| < |mSet2|) ==> decreasing(mSet1, mSet2)
}
axiom multiset_ax_bound{
forall mSet1: Multiset[S] :: {bounded(mSet1)}
bounded(mSet1)
}
} | domain | MultiSetWellFoundedOrder | main.resources.import.decreases | src/main/resources/import/decreases/multiset.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
PermWellFoundedOrder | {
//Rationals
axiom rational_ax_dec{
forall int1: Perm, int2: Perm :: {decreasing(int1, int2)}
(int1 <= int2 - 1/1) ==> decreasing(int1, int2)
}
axiom rational_ax_bound{
forall int1: Perm :: {bounded(int1)}
int1 >= 0/1 ==> bounded(int1)
}
} | domain | PermWellFoundedOrder | main.resources.import.decreases | src/main/resources/import/decreases/perm.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
PredicateInstancesWellFoundedOrder | {
axiom predicate_instances_ax_dec{
forall l1: PredicateInstance, l2: PredicateInstance :: {nestedPredicates(l1,l2)}
decreasing(l1, l2) <==> nestedPredicates(l1,l2)
}
axiom predicate_instances_ax_bound{
forall l1: PredicateInstance :: {bounded(l1)}
bounded(l1)
}
... | domain | PredicateInstancesWellFoundedOrder | main.resources.import.decreases | src/main/resources/import/decreases/predicate_instance.vpr | [] | [
"PredicateInstance"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
PredicateInstancesNestedRelation | {
function nestedPredicates(l1: PredicateInstance, l2: PredicateInstance) : Bool
//Transitivity of the nested-Function
axiom nestedTrans{
forall l1: PredicateInstance, l2: PredicateInstance, l3: PredicateInstance :: {nestedPredicates(l1, l2), nestedPredicates(l2, l3)}
nestedPredicates(l... | domain | PredicateInstancesNestedRelation | main.resources.import.decreases | src/main/resources/import/decreases/predicate_instance_nested.vpr | [] | [
"PredicateInstance"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
RationalWellFoundedOrder | {
//Rationals
axiom rational_ax_dec{
forall int1: Rational, int2: Rational :: {decreasing(int1, int2)}
(int1 <= int2 - 1/1) ==> decreasing(int1, int2)
}
axiom rational_ax_bound{
forall int1: Rational :: {bounded(int1)}
int1 >= 0/1 ==> bounded(int1)
}
} | domain | RationalWellFoundedOrder | main.resources.import.decreases | src/main/resources/import/decreases/rational.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
RefWellFoundedOrder | {
//References
axiom ref_ax_dec{
forall ref1: Ref :: {decreasing(null,ref1)}
ref1 != null ==> decreasing(null, ref1)
}
axiom ref_ax_bound{
forall ref1: Ref :: {bounded(ref1)}
bounded(ref1)
}
} | domain | RefWellFoundedOrder | main.resources.import.decreases | src/main/resources/import/decreases/ref.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
SeqWellFoundedOrder[S] | {
//Sequences
axiom seq_ax_dec{
forall seq1: Seq[S], seq2: Seq[S] :: {decreasing(seq1,seq2)}
(|seq1| < |seq2|) ==> decreasing(seq1, seq2)
}
axiom seq_ax_bound{
forall seq1: Seq[S] :: {bounded(seq1)}
(|seq1| >= 0) ==> bounded(seq1)
}
} | domain | SeqWellFoundedOrder | main.resources.import.decreases | src/main/resources/import/decreases/seq.vpr | [] | [
"seq1",
"seq2"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
SetWellFoundedOrder[S] | {
//Sets
axiom set_ax_dec{
forall set1: Set[S], set2: Set[S] :: {decreasing(set1, set2)}
(|set1| < |set2|) ==> decreasing(set1, set2)
}
axiom set_ax_bound{
forall set1: Set[S] :: {bounded(set1)}
bounded(set1)
}
} | domain | SetWellFoundedOrder | main.resources.import.decreases | src/main/resources/import/decreases/set.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
PredicateInstance | {} | domain | PredicateInstance | main.resources.import.predicateinstance | src/main/resources/import/predicateinstance/pi.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
List[T] | {
Nil()
Cons(value: T, tail: List[T])
} | adt | List | test.resources.adt | src/test/resources/adt/adt_as_fields_1.vpr | [] | [
"tail",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
list:List[Int] | field | list | test.resources.adt | src/test/resources/adt/adt_as_fields_1.vpr | [] | [
"List"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | ||
condtion:Bool | field | condtion | test.resources.adt | src/test/resources/adt/adt_as_fields_1.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | ||
adt_as_fields_1() | {
var f: Ref
f := new (list, condtion)
assert f.list.isNil || f.list.isCons
f.list := Cons(42, Nil())
assert !f.list.tail.isCons
f.list := Cons(42, Nil()).tail
f.condtion := Cons(42, Nil()).isCons
assert f.list == Nil()
assert f.condtion == true
} | method | adt_as_fields_1 | test.resources.adt | src/test/resources/adt/adt_as_fields_1.vpr | [] | [
"condtion",
"list",
"tail"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
constructors_1() | {
var list1: List[Int]
list1 := Cons(1, Cons(1, Cons(1, Cons(1, Cons(1, Cons(1, Nil()))))))
var list2: List[List[Bool]]
list2 := Cons(Cons(true, Cons(true, Cons(true, Cons(true, Cons(true, Cons(true, Nil())))))), Nil())
var list3: List[Seq[Int]]
list3 := Cons(Seq(1,2,3), Nil())
var list4:... | method | constructors_1 | test.resources.adt | src/test/resources/adt/constructors_1.vpr | [] | [
"List",
"list2",
"list5",
"m1",
"m2"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
constructors_2() | {
var list1: List[Int]
//:: ExpectedOutput(typechecker.error)
list1 := Cons(Cons(1, Cons(1, Cons(1, Cons(1, Cons(1, Nil()))))))
var list2: List[List[Bool]]
//:: ExpectedOutput(typechecker.error)
list2 := Cons(Cons(true, Cons(true, Cons(true, Cons(true, Cons(true, Cons(true, Nil(true))))))), Nil... | method | constructors_2 | test.resources.adt | src/test/resources/adt/constructors_2.vpr | [] | [
"List",
"list2"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
DList[T] | {
function DNil(): DList[T]
function DCons(value: T, tail: DList[T]): DList[T]
} | domain | DList | test.resources.adt | src/test/resources/adt/constructors_3.vpr | [] | [
"tail",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
constructors_3() | {
var list1: List[Int]
//:: ExpectedOutput(typechecker.error)
list1 := Cons(1, DNil())
var list2: List[DList[Int]]
//:: ExpectedOutput(typechecker.error)
list2 := Cons(DCons(1, DNil()), Nil)
} | method | constructors_3 | test.resources.adt | src/test/resources/adt/constructors_3.vpr | [] | [
"DList",
"List",
"list2"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
List[T] {
Nil()
Cons(value: T, tail: List[T])
} derives | {
contains
} | adt | List | test.resources.adt | src/test/resources/adt/contains_1.vpr | [] | [
"contains",
"tail",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
Tree[T] {
Leaf()
Node(value: T, left:Tree[T], right:Tree[T])
} derives | {
contains
} | adt | Tree | test.resources.adt | src/test/resources/adt/contains_1.vpr | [] | [
"Node",
"contains",
"left",
"right",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
contains_1a() | {
var a: List[Int]
a := Nil()
var b: List[Int]
b := Cons(2, Nil())
var c: List[Int]
c := Cons(1, Cons(2, Nil()))
assert contains(a,b)
assert contains(b,c)
assert contains(a,c)
assert contains(2,c)
} | method | contains_1a | test.resources.adt | src/test/resources/adt/contains_1.vpr | [] | [
"List",
"contains"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
contains_1b() | {
var list: List[Int]
list := Cons(42, Nil())
var tree: Tree[List[Int]]
tree := Node(list, Leaf(), Leaf())
assert contains(42, list)
assert contains(list, tree)
assert contains(42, tree)
} | method | contains_1b | test.resources.adt | src/test/resources/adt/contains_1.vpr | [] | [
"List",
"Node",
"Tree",
"contains",
"list",
"tree"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
List[T] {
Nil()
Cons(value: T, tail: List[T])
} derives | {
contains without value
} | adt | List | test.resources.adt | src/test/resources/adt/contains_2.vpr | [] | [
"contains",
"tail",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
contains_2a() | {
//:: ExpectedOutput(assert.failed:assertion.false)
assert contains(2,Cons(2, Nil()))
} | method | contains_2a | test.resources.adt | src/test/resources/adt/contains_2.vpr | [] | [
"contains"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
contains_2b() | {
var a: List[Int]
a := Nil()
var b: List[Int]
b := Cons(2, Nil())
var c: List[Int]
c := Cons(1, Cons(2, Nil()))
assert contains(a,b)
assert contains(b,c)
assert contains(a,c)
//:: ExpectedOutput(assert.failed:assertion.false)
assert contains(2,c)
} | method | contains_2b | test.resources.adt | src/test/resources/adt/contains_2.vpr | [] | [
"List",
"contains"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
SimpleList | {
SimpleNil()
SimpleCons(value: Int, tail: SimpleList)
} | adt | SimpleList | test.resources.adt | src/test/resources/adt/declarations_1.vpr | [] | [
"tail",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
Tree[T] | {
Leaf()
Node(value: T, left: Tree[T], right: Tree[T])
} | adt | Tree | test.resources.adt | src/test/resources/adt/declarations_1.vpr | [] | [
"Node",
"left",
"right",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
Tree3[T] | {
Leaf3()
Node3(value: T, left: Tree3[T], middle: Tree3[T], right: Tree3[T])
} | adt | Tree3 | test.resources.adt | src/test/resources/adt/declarations_1.vpr | [] | [
"left",
"right",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
SpecialList[T, S] | {
SpecialNil()
TCons(elemT: T, tailT: SpecialList[T,S])
SCons(elemS: S, tailS: SpecialList[T,S])
} | adt | SpecialList | test.resources.adt | src/test/resources/adt/declarations_1.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
kTree[T] | {
kLeaf()
kNode(value: T, children: Seq[kTree[T]])
} | adt | kTree | test.resources.adt | src/test/resources/adt/declarations_1.vpr | [] | [
"children",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
Mixed[T,S] | {
Entity1(sl: SimpleList, ls: List[S], lt: List[T])
Entity2(t3: Tree3[T], spl1: SpecialList[T,S], spl2: SpecialList[S,T], kt: kTree[T])
} | adt | Mixed | test.resources.adt | src/test/resources/adt/declarations_1.vpr | [] | [
"List",
"SimpleList",
"SpecialList",
"Tree3",
"kTree",
"t3"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
SimpleList | {
SimpleNil()
SimpleCons(value: Int, tail: SimpleList)
//:: ExpectedOutput(typechecker.error)
SimpleCons(value: Int, tail: SimpleList)
} | adt | SimpleList | test.resources.adt | src/test/resources/adt/declarations_2.vpr | [] | [
"tail",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
List[T] | {
Nil()
Cons(value: T, tail: List[T])
//:: ExpectedOutput(typechecker.error)
Cons(value: T, tail: List[T])
} | adt | List | test.resources.adt | src/test/resources/adt/declarations_2.vpr | [] | [
"tail",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
SimpleList | {
SimpleNil()
//:: ExpectedOutput(typechecker.error)
SimpleCons(value: Int, value: SimpleList)
} | adt | SimpleList | test.resources.adt | src/test/resources/adt/declarations_3.vpr | [] | [
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
SpecialList[T, S] | {
SpecialNil()
TCons(elemT: T, tail: SpecialList[T,S])
//:: ExpectedOutput(typechecker.error)
SCons(elemS: S, tail: SpecialList[T,S])
} | adt | SpecialList | test.resources.adt | src/test/resources/adt/declarations_4.vpr | [] | [
"tail"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
value: Int | field | value | test.resources.adt | src/test/resources/adt/declarations_5.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | ||
List[T] {
Nil()
Cons(value:T, tail:List[T])
} derives | { contains } | adt | List | test.resources.adt | src/test/resources/adt/declarations_6.vpr | [] | [
"contains",
"tail",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
SimpleList {
SimpleNil()
SimpleCons(value: Int, tail: SimpleList)
} derives | {
contains without tail
} | adt | SimpleList | test.resources.adt | src/test/resources/adt/declarations_6.vpr | [] | [
"contains",
"tail",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
Tree3[T] {
Leaf3()
Node3(value: T, left: Tree3[T], middle: Tree3[T], right: Tree3[T])
} derives | {
contains without middle, right
} | adt | Tree3 | test.resources.adt | src/test/resources/adt/declarations_6.vpr | [] | [
"contains",
"left",
"right",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
SimpleList {
SimpleNil()
SimpleCons(value: Int, tail: SimpleList)
} derives | {
//:: ExpectedOutput(typechecker.error)
contains without Leaf3
} | adt | SimpleList | test.resources.adt | src/test/resources/adt/declarations_7.vpr | [] | [
"contains",
"tail",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
Tree3[T] {
Leaf3()
Node3(value: T, left: Tree3[T], middle: Tree3[T], right: Tree3[T])
} derives | {
//:: ExpectedOutput(typechecker.error)
contains without middle, right, hello
} | adt | Tree3 | test.resources.adt | src/test/resources/adt/declarations_7.vpr | [] | [
"contains",
"left",
"right",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
destructors_1() | {
var tree: Tree[Int]
tree := Node(42, Node(420, Leaf(), Leaf()), Leaf())
var left: Tree[Int]
left := tree.left
assert left == tree.left
assert left == Node(420, Leaf(), Leaf())
var list: List[Bool]
list := Cons(true, Cons(true, Cons(true, Cons(true, Cons(true, Cons(true, Nil()))))... | method | destructors_1 | test.resources.adt | src/test/resources/adt/destructors_1.vpr | [] | [
"List",
"Node",
"Tree",
"left",
"list",
"tree"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
destructors_2() | {
assert Cons(1, Nil()).value == 1
assert Cons(1, Nil()).tail == Nil()
assert Node(42, Node(42, Leaf(), Node(42, Node(42, Leaf(), Leaf()), Leaf())), Leaf()).value == 42
assert Node(42, Node(42, Leaf(), Node(42, Node(42, Leaf(), Leaf()), Leaf())), Leaf()).left.right.left.value == 42
assert... | method | destructors_2 | test.resources.adt | src/test/resources/adt/destructors_2.vpr | [] | [
"Node",
"left",
"tail",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
this_is_a_field: Bool | field | this_is_a_field | test.resources.adt | src/test/resources/adt/destructors_3.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | ||
destructor_3() | {
//:: ExpectedOutput(typechecker.error)
assert Cons(1, Nil()).this_is_a_field
//:: ExpectedOutput(typechecker.error)
assert Cons(1, Nil()).right.value == Nil()
//:: ExpectedOutput(typechecker.error)
assert Cons(1, Nil()).right.value.left == Nil()
//:: ExpectedOutput(typechecker.e... | method | destructor_3 | test.resources.adt | src/test/resources/adt/destructors_3.vpr | [] | [
"this_is_a_field",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
destructors_4() | {
//:: ExpectedOutput(typechecker.error)
assert Cons(1, Nil()).dummy == 1
//:: ExpectedOutput(typechecker.error)
assert Cons(1, Nil()).value.right.hello.f == 1
} | method | destructors_4 | test.resources.adt | src/test/resources/adt/destructors_4.vpr | [] | [
"dummy"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
destructors_5a() | {
//:: ExpectedOutput(assert.failed:assertion.false)
assert Nil().value == 1
} | method | destructors_5a | test.resources.adt | src/test/resources/adt/destructors_5.vpr | [] | [
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
destructors_5b() | {
//:: ExpectedOutput(assert.failed:assertion.false)
assert Cons(1, Nil()).value == 2
} | method | destructors_5b | test.resources.adt | src/test/resources/adt/destructors_5.vpr | [] | [
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
destructors_5c() | {
//:: ExpectedOutput(assert.failed:assertion.false)
assert Cons(1, Cons(1, Nil())).tail == Nil()
} | method | destructors_5c | test.resources.adt | src/test/resources/adt/destructors_5.vpr | [] | [
"tail"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
destructors_6() | {
//:: ExpectedOutput(typechecker.error)
Nil().value := 1
var list: List[Int]
//:: ExpectedOutput(typechecker.error)
list.tail := Cons(1, Nil())
} | method | destructors_6 | test.resources.adt | src/test/resources/adt/destructors_6.vpr | [] | [
"List",
"list",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
discriminators_1a() | {
var list: List[Int]
list := Cons(1, Nil())
assert list.isCons
assert list.tail.isNil
assert !list.tail.isCons
} | method | discriminators_1a | test.resources.adt | src/test/resources/adt/discriminators_1.vpr | [] | [
"List",
"list"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
discriminators_1b() | {
var tree: Tree[Int]
tree := Node(42, Node(42, Leaf(), Leaf()), Node(42, Leaf(), Leaf()))
assert !tree.isLeaf
assert tree.left.left.isLeaf
assert tree.left.right.isLeaf
assert tree.left.isNode
assert !tree.right.isLeaf
} | method | discriminators_1b | test.resources.adt | src/test/resources/adt/discriminators_1.vpr | [] | [
"Node",
"Tree",
"tree"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
discriminators_2() | {
var list: List[Int]
list := Cons(1, Nil())
//:: ExpectedOutput(typechecker.error)
assert list.isLeaf
//:: ExpectedOutput(typechecker.error)
assert list.isLeaf.isLeaf
//:: ExpectedOutput(typechecker.error)
assert list.tail.tail.tail.isNode
} | method | discriminators_2 | test.resources.adt | src/test/resources/adt/discriminators_2.vpr | [] | [
"List",
"list"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
discriminators_3() | {
var list: List[Int]
list := Cons(1, Nil())
assert list.tail.isNil ? true : false
assert list.tail.isNil?true:false
assert list.tail.isNil ? list.tail.isCons ? list.tail.isNil ? true : false : list.tail.isNil ? true : false : list.tail.isNil ? true : false
} | method | discriminators_3 | test.resources.adt | src/test/resources/adt/discriminators_3.vpr | [] | [
"List",
"list"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
this_is_a_field:Int | field | this_is_a_field | test.resources.adt | src/test/resources/adt/discriminators_4.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | ||
discriminators_4() | {
var list: List[Int]
//:: ExpectedOutput(typechecker.error)
assert list.this_is_a_field
} | method | discriminators_4 | test.resources.adt | src/test/resources/adt/discriminators_4.vpr | [] | [
"List",
"list"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
List[T] | {
//:: ExpectedOutput(typechecker.error)
Nil()
Cons(value: T, tail: List[T])
} | adt | List | test.resources.adt | src/test/resources/adt/discriminators_5.vpr | [] | [
"tail",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
isNil:Int | field | isNil | test.resources.adt | src/test/resources/adt/discriminators_5.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | ||
isNil(x:Int): Bool | {
true
} | function | isNil | test.resources.adt | src/test/resources/adt/discriminators_6.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
discriminators_7() | {
var list: List[Int]
list := Cons(1, Nil())
//:: ExpectedOutput(typechecker.error)
list.isCons := true
//:: ExpectedOutput(typechecker.error)
list.isNil := true
//:: ExpectedOutput(typechecker.error)
list.isLeaf := true
//:: ExpectedOutput(typechecker.error)
list.tail.isL... | method | discriminators_7 | test.resources.adt | src/test/resources/adt/discriminators_7.vpr | [] | [
"List",
"list"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
DList[T] | {
function get_List_value(t: DList[T]): T
function get_List_tail(t: DList[T]): DList[T]
function List_tag(t: DList[T]): Int
} | domain | DList | test.resources.adt | src/test/resources/adt/encoding_1.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
encoding_1() | {
assert Cons(1, Nil()).isNil == false
assert Cons(1, Nil()).isCons
assert Cons(1, Nil()).value == 1
assert Cons(1, Nil()).tail == Nil()
var dlist: DList[Int]
var n: Int
n := get_List_value(dlist)
dlist := get_List_tail(dlist)
n := List_tag(dlist)
} | method | encoding_1 | test.resources.adt | src/test/resources/adt/encoding_1.vpr | [] | [
"DList",
"isNil",
"tail",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
ADT[T] | {
C1()
C2(p21: T, p22: ADT[T])
C3(p31: Int)
C4(p41: Bool, p42: ADT[T], p43:ADT[Int])
C5()
C6()
} | adt | ADT | test.resources.adt | src/test/resources/adt/encoding_2.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
encoding_2(a:ADT[Bool]) | {
assert a.isC1 || a.isC2 || a.isC3 || a.isC4 || a.isC5 || a.isC6
assert a.isC1 <==> a == C1()
assert a.isC2 ==> a != C1()
assert a.isC2 <==> a == C2(a.p21, a.p22)
} | method | encoding_2 | test.resources.adt | src/test/resources/adt/encoding_2.vpr | [] | [
"ADT"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
equality_1a() | {
//:: ExpectedOutput(assert.failed:assertion.false)
assert Cons(1, Nil()) != Cons(1, Nil())
} | method | equality_1a | test.resources.adt | src/test/resources/adt/equality_1.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
equality_1b() | {
//:: ExpectedOutput(assert.failed:assertion.false)
assert Cons(1, Cons(1, Nil())).tail == Nil()
} | method | equality_1b | test.resources.adt | src/test/resources/adt/equality_1.vpr | [] | [
"tail"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
equality_2a() | {
assert Cons(1, Nil()) == Cons(1, Nil())
assert Cons(1, Cons(1, Nil())).tail == Cons(1, Nil())
} | method | equality_2a | test.resources.adt | src/test/resources/adt/equality_2.vpr | [] | [
"tail"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
equality_2b() | {
var list1: List[Int]
var list2: List[Int]
//:: ExpectedOutput(assert.failed:assertion.false)
assert list1 == list2
} | method | equality_2b | test.resources.adt | src/test/resources/adt/equality_2.vpr | [] | [
"List",
"list2"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
equality_2c() | {
var list1: List[Int]
list1 := Nil()
var list2: List[Int]
list2 := Nil()
assert list1 == list2
} | method | equality_2c | test.resources.adt | src/test/resources/adt/equality_2.vpr | [] | [
"List",
"list2"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
Tree | {
Leaf()
Node(v: Int, left: Tree, right: Tree)
} | adt | Tree | test.resources.adt | src/test/resources/adt/example_1.vpr | [] | [
"Node",
"left",
"right"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
isBST(t:Tree): Bool | {
t.isLeaf
? true
: allNodesLessThan(t.left, t.v) && isBST(t.left) && allNodesGreaterThan(t.right, t.v) && isBST(t.right)
} | function | isBST | test.resources.adt | src/test/resources/adt/example_1.vpr | [] | [
"Tree",
"allNodesGreaterThan",
"allNodesLessThan"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
allNodesLessThan(t:Tree, value: Int): Bool | {
t.isLeaf
? true
: t.v < value && allNodesLessThan(t.right, value) && allNodesLessThan(t.left, value)
} | function | allNodesLessThan | test.resources.adt | src/test/resources/adt/example_1.vpr | [] | [
"Tree",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
allNodesGreaterThan(t:Tree, value: Int): Bool | {
t.isLeaf
? true
: t.v > value && allNodesGreaterThan(t.left, value) && allNodesGreaterThan(t.right, value)
} | function | allNodesGreaterThan | test.resources.adt | src/test/resources/adt/example_1.vpr | [] | [
"Tree",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
insertValue(v:Int, t:Tree) returns (res: Tree)
ensures forall i:Int :: allNodesGreaterThan(t,i) && i < v ==> allNodesGreaterThan(res, i)
ensures forall i:Int :: allNodesLessThan(t, i) && v < i ==> allNodesLessThan(res, i)
ensures isBST(t) ==> isBST(res) | {
var new_rightsubtree: Tree
var new_leftsubtree: Tree
if(t.isLeaf) {
res:= Node(v, Leaf(), Leaf())
} else {
if (v == t.v)
{
// value is already in tree so we do nothing
res:= t
}
elseif (v < t.v)
{
new_leftsubtre... | method | insertValue | test.resources.adt | src/test/resources/adt/example_1.vpr | [] | [
"Node",
"Tree",
"allNodesGreaterThan",
"allNodesLessThan",
"isBST",
"res"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
height_recursive(ts: Seq[Tree]): Int | {
|ts| == 0
? 0
: 1 + height_recursive(children_seq(ts))
} | function | height_recursive | test.resources.adt | src/test/resources/adt/example_2.vpr | [] | [
"Tree",
"children_seq"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
height(t: Tree): Int | {
t.isLeaf
? 0
: height_recursive(Seq(t))
} | function | height | test.resources.adt | src/test/resources/adt/example_2.vpr | [] | [
"Tree",
"height_recursive"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
children(t: Tree): Seq[Tree] | {
t.isLeaf || (t.isNode && t.left.isLeaf && t.right.isLeaf)
? Seq()
: t.left.isNode && t.right.isNode
? Seq(t.right) ++ Seq(t.left)
: t.left.isNode
? Seq(t.left)
: Seq(t.right)
} | function | children | test.resources.adt | src/test/resources/adt/example_2.vpr | [] | [
"Tree"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
children_seq(ts: Seq[Tree]): Seq[Tree] | {
|ts| == 0
? Seq[Tree]()
: |ts| == 1
? children(ts[0])
: children_seq(ts[1..]) ++ children(ts[0])
} | function | children_seq | test.resources.adt | src/test/resources/adt/example_2.vpr | [] | [
"Tree",
"children"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
computeTreeHeight(t: Tree) returns (res: Int)
ensures height(t) == res
{
// logical variable for invariant of the second loop
var old_current: Seq[Tree]
if (t.isLeaf){
res := 0
}else{
var current: Seq[Tree]
var next: Seq[Tree]
current := Seq(t)
next := Seq[Tree]()
res := 0
w... | {
stck := stck[1..]
} | method | computeTreeHeight | test.resources.adt | src/test/resources/adt/example_2.vpr | [] | [
"Tree",
"children_seq",
"height",
"height_recursive",
"next",
"node",
"res"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
List | {
Nil()
Cons(head: Int, tail: List)
} | adt | List | test.resources.adt | src/test/resources/adt/example_3.vpr | [] | [
"head",
"tail"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
prepend(xs: List, v: Int)
returns (ys:List)
ensures ys.head == v
ensures ys.tail == xs | {
ys := Cons(v, xs)
} | method | prepend | test.resources.adt | src/test/resources/adt/example_3.vpr | [] | [
"List"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
len(xs: List): Int
ensures result >= 0 | {
xs.isNil ? 0 : 1 + len(xs.tail)
}
define NO_VALUE (-1) | function | len | test.resources.adt | src/test/resources/adt/example_3.vpr | [] | [
"List"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
at(xs: List, pos: Int): Int | {
(xs.isNil || pos < 0)
? NO_VALUE
: pos == 0
? xs.head
: at(xs.tail, pos-1)
} | function | at | test.resources.adt | src/test/resources/adt/example_3.vpr | [] | [
"List"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
linear_search(xs: List, key: Int)
returns (pos:Int)
requires key >= 0
ensures 0 <= pos && pos <= len(xs)
ensures at(xs, pos) == key || pos == len(xs)
ensures pos == len(xs) ==> forall k:Int :: 0 <= k && k < len(xs) ==> at(xs, k) != key | {
pos := 0
var ys : List
ys := xs
while (!ys.isNil && ys.head != key)
invariant 0 <= pos
invariant pos + len(ys) == len(xs)
invariant ys.isNil ==> pos == len(xs)
invariant forall k:Int :: 0 <= k ==> at(xs, pos+k) == at(ys, k)
invariant forall k:Int :: 0 <= k && ... | method | linear_search | test.resources.adt | src/test/resources/adt/example_3.vpr | [] | [
"List",
"at",
"key",
"len"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
Option[T] | {
Some(value:T)
None()
} | adt | Option | test.resources.adt | src/test/resources/adt/example_4.vpr | [] | [
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
AddDomain[T] | {
function add(a:T, b: T): T
axiom {
forall o1:Perm, o2:Perm :: {add(o1,o2)} add(o1,o2) == (o1 + o2)
}
axiom {
forall o1:Int, o2:Int :: {add(o1,o2)} add(o1,o2) == (o1 + o2)
}
axiom {
forall o1:Seq[T], o2:Seq[T] :: {add(o1,o2)} add(o1,o2) == (o1 ++ o2)
}
axiom {
... | domain | AddDomain | test.resources.adt | src/test/resources/adt/example_4.vpr | [] | [
"Option",
"add"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
request(arg: Int) returns (res: Option[Int])
ensures arg > 0 ==> res.isSome && res == Some(2*arg)
ensures arg < 0 ==> res.isNone | {
if (arg > 0)
{
res:= add(Some(arg), Some(arg))
}
else
{
res:= None()
}
} | method | request | test.resources.adt | src/test/resources/adt/example_4.vpr | [] | [
"Option",
"add",
"res"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
client() | {
var response: Option[Int]
response := request(1)
if (response.isSome)
{
// resquest successfull
assert response.value == 2
var o: Option[Int]
o := Some(3)
assert add(response, None()) == None()
assert add(o, response).value == 5
assert add(So... | method | client | test.resources.adt | src/test/resources/adt/example_4.vpr | [] | [
"Option",
"add",
"request",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
SizeDomain[T] | {
function size(collection:T): Int
} | domain | SizeDomain | test.resources.adt | src/test/resources/adt/example_5.vpr | [] | [
"size"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
AddDomain[T] | {
function add(a:T, b: T): T
} | domain | AddDomain | test.resources.adt | src/test/resources/adt/example_5.vpr | [] | [
"add"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
ToSeqDomain[A,B] | {
function toSeq(collection: A): Seq[B]
} | domain | ToSeqDomain | test.resources.adt | src/test/resources/adt/example_5.vpr | [] | [] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
IntUtility | {
axiom {
forall o1:Int, o2:Int :: {add(o1,o2)} add(o1,o2) == (o1 + o2)
}
} | domain | IntUtility | test.resources.adt | src/test/resources/adt/example_5.vpr | [] | [
"add"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
SetUtility[T] | {
axiom {
forall set: Set[T] :: { size(set) } size(set) == |set|
}
axiom {
forall o1:Set[T], o2:Set[T] :: {add(o1,o2)} add(o1,o2) == (o1 union o2)
}
} | domain | SetUtility | test.resources.adt | src/test/resources/adt/example_5.vpr | [] | [
"add",
"set",
"size"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
SeqUtility[T] | {
axiom {
forall o1:Seq[T], o2:Seq[T] :: {add(o1,o2)} add(o1,o2) == (o1 ++ o2)
}
axiom {
forall seq: Seq[T] :: { size(seq) } size(seq) == |seq|
}
} | domain | SeqUtility | test.resources.adt | src/test/resources/adt/example_5.vpr | [] | [
"add",
"size"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
DAG[T] | {
Node(value: T, successor: Seq[DAG[T]])
} | adt | DAG | test.resources.adt | src/test/resources/adt/example_5.vpr | [] | [
"Node",
"value"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
DAGUtility[T] | {
axiom {
forall dags:Seq[DAG[T]] :: {toSeq(dags)} toSeq(dags) == (|dags| > 0 ? toSeq(dags[0]) ++ toSeq(dags[1..]) : Seq())
}
axiom {
forall dag:DAG[T] :: {toSeq(dag)} toSeq(dag) == (|dag.successor| > 0 ? Seq(dag.value) ++ toSeq(dag.successor) : Seq(dag.value))
}
} | domain | DAGUtility | test.resources.adt | src/test/resources/adt/example_5.vpr | [] | [
"DAG"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 | |
client() | {
var dag: DAG[Int]
dag := Node(1, Seq(
Node(2, Seq(Node(3, Seq()))),
Node(2, Seq(Node(3, Seq()))),
Node(2, Seq()),
Node(2, Seq()),
Node(2, Seq())
))
assert toSeq(dag) == Seq(1) ++ toSeq(dag.successor)
assert toSeq(dag) == Seq(1, 2, 3, 2, 3, 2, 2, 2)
} | method | client | test.resources.adt | src/test/resources/adt/example_5.vpr | [] | [
"DAG",
"Node"
] | https://github.com/viperproject/silver | efc0caa6f46ad79d49f337d8d640460a49cfd757 |
Declarations from Viper.
efc0caa6f46ad79d49f337d8d640460a49cfd757| Column | Type | Description |
|---|---|---|
| statement | string | Declaration signature/claim with the leading keyword removed (verbatim slice); the full declaration minus its proof |
| proof | string | Verbatim proof/body, empty if the declaration has none |
| type | string | Declaration keyword |
| symbolic_name | string | Declaration identifier |
| library | string | Sub-library |
| filename | string | Repository-relative source path |
| imports | list[string] | File-level Require/Import modules |
| deps | list[string] | Intra-corpus identifiers referenced |
| docstring | string | Preceding documentation comment, empty if absent |
| source_url | string | Upstream repository |
| commit | string | Upstream commit extracted |
| Type | Count |
|---|---|
| method | 3,328 |
| function | 1,095 |
| predicate | 551 |
| field | 459 |
| domain | 329 |
| adt | 57 |
BoolWellFoundedOrder
{
//Booleans
axiom bool_ax_dec{
decreasing(false, true)
}
axiom bool_ax_bound{
forall bool1: Bool :: {bounded(bool1)}
bounded(bool1)
}
}
BoolWellFoundedOrder | src/main/resources/import/decreases/bool.vprEach declaration is split into a statement (signature/claim) and a proof (body) that are disjoint
and together form the complete declaration, for proof modeling, autoformalization, retrieval, and
dependency analysis via deps.
@misc{viper_dataset,
title = {Viper},
author = {Norton, Charles},
year = {2026},
note = {Extracted from https://github.com/viperproject/silver, commit efc0caa6f46a},
url = {https://huggingface.co/datasets/phanerozoic/Viper}
}