Proof Assistant Projects
Collection
Digesting proof assistant libraries for AI ingestion. • 103 items • Updated • 3
statement stringlengths 1 1.67k | proof stringlengths 0 2.35k | type stringclasses 7
values | symbolic_name stringlengths 1 32 | library stringclasses 44
values | filename stringclasses 114
values | imports listlengths 0 0 | deps listlengths 0 16 | docstring stringclasses 1
value | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
Attribute | {} | sig | Attribute | algorithms.discovery | algorithms/discovery/ins.als | [] | [] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Value | {} | sig | Value | algorithms.discovery | algorithms/discovery/ins.als | [] | [] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Record | {} | sig | Record | algorithms.discovery | algorithms/discovery/ins.als | [] | [] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Wildcard extends Value | {} | sig | Wildcard | algorithms.discovery | algorithms/discovery/ins.als | [] | [
"Value"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
AVTree {
values: set Value,
attributes: set Attribute,
root: values - Wildcard,
av: attributes one -> some (values - root),
va: (values - Wildcard) one -> attributes
} | {
// values (and attributes) of tree are those reachable from root
values = root.*(va.av)
} | sig | AVTree | algorithms.discovery | algorithms/discovery/ins.als | [] | [
"Attribute",
"Value",
"Wildcard"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Query extends AVTree {} | {all a:attributes | one a.av} | sig | Query | algorithms.discovery | algorithms/discovery/ins.als | [] | [
"AVTree"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
DB extends AVTree {
records : set Record,
recs: (values - root) some -> records,
lookup : Query -> (values -> records)
} | {
Wildcard !in values
} | sig | DB | algorithms.discovery | algorithms/discovery/ins.als | [] | [
"AVTree",
"Query",
"Record",
"Wildcard",
"lookup"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
AddInvariants | {
all db: DB {
all v: db.values | no v.(db.recs) & v.^(~(db.av).~(db.va)).(db.recs)
all a: db.attributes | all disj v1, v2: a.(db.av) |
(some rr: *((db.va).(db.av)).(db.recs) | no v1.rr & v2.rr)
}
} | fact | AddInvariants | algorithms.discovery | algorithms/discovery/ins.als | [] | [
"DB"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Get [db: DB, r: Record, q: Query] | {
q.values = r.~(db.recs).*(~(db.av).~(db.va))
q.attributes = q.values.~(db.av)
q.root = db.root
all a : attributes| a.~(q.va) = a.~(db.va)
all v : values | v.~(q.av) = v.~(db.av)
} | pred | Get | algorithms.discovery | algorithms/discovery/ins.als | [] | [
"DB",
"Query",
"Record"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Conforms [db: DB, q: Query, r: Record] | {
some p: Query {
db.Get[r, p]
q.va in p.va
(q.av - Attribute -> Wildcard) in p.av
}
} | pred | Conforms | algorithms.discovery | algorithms/discovery/ins.als | [] | [
"Attribute",
"DB",
"Query",
"Record",
"Wildcard"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
indSubset[db : DB, q: Query, r: set Record, v: Value] | {
all a : v.(q.va) |
(a.(q.av) in a.(db.av) => r in (a.(q.av)).(q.(db.lookup))) &&
(a.(q.av) = Wildcard => r in a.(db.av).*((db.va).(db.av)).(db.recs))
} | pred | indSubset | algorithms.discovery | algorithms/discovery/ins.als | [] | [
"DB",
"Query",
"Record",
"Value",
"Wildcard"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Lookup[db: DB, q: Query, found: set Record] | {
all v: Value | not v.(q.va) in v.(db.va) => no v.(q.(db.lookup))
all v: Value | all a : v.(q.va) |
a.(q.av) != Wildcard && not a.(q.av) in a.(db.av) => no v.(q.(db.lookup))
all v: Value - Wildcard |
no v.(q.va) => v.(q.(db.lookup)) = v.*((db.va).(db.av)).(db.recs)
all v: Value |
some v.(q.va) => i... | pred | Lookup | algorithms.discovery | algorithms/discovery/ins.als | [] | [
"DB",
"Query",
"Record",
"Value",
"Wildcard",
"indSubset"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
CorrectLookup | {
all db: DB | all q : Query | all r : Record |
Conforms [db,q,r] <=> db.Lookup[q, r]
} | assert | CorrectLookup | algorithms.discovery | algorithms/discovery/ins.als | [] | [
"Conforms",
"DB",
"Query",
"Record"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Add [me: DB, adv: Query, r: Record, db: DB] | {
// restricted version - only advertisements with fresh attributes and values added
no me.attributes & adv.attributes
me.values & adv.values = me.root
me.root = adv.root
Wildcard !in adv.values
r !in me.records
db.values = me.values + adv.values
db.attributes = me.attributes + adv.attributes
db.root ... | pred | Add | algorithms.discovery | algorithms/discovery/ins.als | [] | [
"DB",
"Query",
"Record",
"Wildcard",
"dom"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
RemoveWildCard[me: Query, q: Query] | {
q.values = me.values - Wildcard
q.attributes = me.attributes - Wildcard.~(me.av)
q.root = me.root
q.av = me.av - Attribute -> Wildcard
q.va = me.va - Value -> Wildcard.~(me.av)
} | pred | RemoveWildCard | algorithms.discovery | algorithms/discovery/ins.als | [] | [
"Attribute",
"Query",
"Value",
"Wildcard"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
MissingAttributeAsWildcard | {
all db : DB, q, q" : Query, found: set Record |
db.Lookup[q, found] && q.RemoveWildCard[q"] => db.Lookup[q", found]
} | assert | MissingAttributeAsWildcard | algorithms.discovery | algorithms/discovery/ins.als | [] | [
"DB",
"Query",
"Record"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Label | {} | sig | Label | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Node | {
label: Label
} | sig | Node | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"Label"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
LabelTree {
root: Node,
nodes: set Node,
children: nodes one -> (nodes - root)
} | { // connected
nodes = root.*children
some root.children
} | sig | LabelTree | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"Node"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Get[db: DB, r: Record, a:Advertisement] | {
root[a] = root[db]
nodes[a] =
nodes[db] & r.~(db.recs).*(~(db.children))
anodes[a] =
anodes[db] & r.~(db.recs).*(~(db.children))
vnodes[a] =
vnodes[db] & r.~(db.recs).*(~(db.children))
all n: a.nodes |
n.~(a.children) = n.~(db.children)
} | pred | Get | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"Advertisement",
"DB",
"Record"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Attribute extends Label | {} | sig | Attribute | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"Label"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Value extends Label | {} | sig | Value | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"Label"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Wildcard, Null extends Value | {} | sig | Wildcard | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"Null",
"Value"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
AVTree extends LabelTree {
vnodes, anodes: set nodes
} | {
root in vnodes
root.label = Null
Null !in (vnodes - root).label + anodes.label
anodes.label in Attribute
vnodes.label in Value
all n: nodes | all /* disj */ c,c": n.children |
c.label != c".label
all a: anodes | a.children in vnodes && some a.children
all v: vnodes | v.children in anodes
no Wild... | sig | AVTree | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"Attribute",
"LabelTree",
"Null",
"Value"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Query extends AVTree {} | {
all a: anodes | one a.children
} | sig | Query | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"AVTree"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Advertisement extends AVTree {} | {
Wildcard !in vnodes.label
} | sig | Advertisement | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"AVTree",
"Wildcard"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
DB extends AVTree {
records: set Record,
recs: (vnodes - root) some -> records
} | {
Wildcard !in vnodes.label
all a: anodes | no a.recs
all v: vnodes {
no v.children => some v.recs
no v.recs & v.^(~children).recs }
all a: anodes | all disj v,v": a.children |
(no v.*children.recs & v".*children.recs)
} | sig | DB | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"AVTree",
"Record",
"Wildcard"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
State | {
conforms: Query -> Advertisement -> Node -> Node,
lookup: DB -> Query -> Node -> Node -> Record
} | sig | State | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"Advertisement",
"DB",
"Node",
"Query",
"Record",
"lookup"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
ConformsFixPoint | {
all q: Query | all a: Advertisement |
all nq: Node | all na: Node |
q.ConformsAux[a,nq,na] <=>
{
nq.label in Wildcard + na.label
all nq": q.children[nq] | some na": a.children[na] |
q.ConformsAux[a,nq",na"]
}
} | fact | ConformsFixPoint | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"Advertisement",
"Node",
"Query",
"Wildcard"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Query.ConformsAux[a: Advertisement, nq: Node, na: Node] | {
na in State.conforms[this][a][nq]
} | pred | Query.ConformsAux | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"Advertisement",
"Node"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Conforms[q: Query, a:Advertisement] | {
q.ConformsAux[a, q.root, a.root]
} | pred | Conforms | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"Advertisement",
"Query"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
LookupFixPoint | {
all db: DB, q: Query, T: Node, n: Node, r: Record |
r in db.LookupAux[q,T,n] <=> // record r is in the result if and only if
{
all na: n.(q.children) | all nv: na.(q.children) | // for all child av-pairs (na,nv) of av-pair n in q
some Ta: T.(db.children... | fact | LookupFixPoint | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"DB",
"Node",
"Query",
"Record",
"Wildcard"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
DB.LookupAux[q: Query, vd: Node, vq: Node]: set Record | { // helper function for Lookup
State.lookup[this][q][vd][vq]
} | fun | DB.LookupAux | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"Node",
"Query",
"Record"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Lookup[db: DB, q: Query]: set Record | { // models Lookup-Name algorithm invocation
db.LookupAux[q, db.root, q.root]
} | fun | Lookup | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"DB",
"Query",
"Record"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
LookupConforms2 | { //soundness and completeness
all q: Query | all db: DB | all r: Record | all a: Advertisement |
Get[db,r,a] => // all n: a.nodes | n.~(db.children)
{r in db.Lookup[q] <=> q.Conforms[a]}
} | assert | LookupConforms2 | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"Advertisement",
"DB",
"Get",
"Query",
"Record"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
LookupConforms2 for 4 but 1 State, 3 LabelTree, 2 Record expect 0 | check | LookupConforms2 | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [
"LabelTree",
"Record",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
Lookup for 3 expect 0 | run | Lookup | algorithms.discovery | algorithms/discovery/INSLabel.als | [] | [] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
Id | {next: Id} | sig | Id | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
{all i: Id | Id in i.*next} | fact | all | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"Id",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
less_than [from, i,j: Id] | {
let next" = Id<:next - (Id->from) | j in i.^next" // if from=j, returns true if # nodes > 1
} | pred | less_than | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"Id",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
less_than_eq [from, i,j: Id] | {
let next" = Id<:next - (Id->from) | j in i.*next"
} | pred | less_than_eq | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"Id",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Node | {id: Id} | sig | Node | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"Id"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
{all m,n: Node | m!=n => m.id != n.id} | fact | all | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"Node"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
NodeData | {
prev, next: Node,
finger: Id -> lone Node,
closest_preceding_finger: Id -> one Node,
find_predecessor: Id -> one Node,
find_successor: Id -> one Node
} | sig | NodeData | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"Id",
"Node",
"next",
"prev"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
State | {
active: set Node,
data: active -> one NodeData
} | sig | State | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"Node",
"NodeData"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
{all s: State | all n: s.active | n.(s.data).next = n.(s.data).finger[n.id.next]} | fact | all | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"State",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
NextCorrect [s: State] | {
all n: s.active {
-- no intervening node (ie, close enough)
no n": s.active - n | less_than [n.id, n".id, n.(s.data).next.id]
-- can reach all other active nodes (ie, far enough)
-- need this because can"t rule out case of next being node itself ... | pred | NextCorrect | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"State",
"less_than",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
NextCorrect" [s: State] {
-- next seems to be correct for 1,2,3 nodes
all n: s.active | let nd = (s.data)[n] {
let next" = Id<:next - (Id -> nd.next.id) | {
no n" : s.active { n".id in n.id.^next" }
}}
}
// valid
assert Same1 {all s: State | NextCorrect[s] => NextCorrect"[s]} | pred | NextCorrect | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"Id",
"Same1",
"State",
"correct",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Same1 for 3 but 1 State expect 0 | check | Same1 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
Same2 | {all s: State | s.active = Node => (NextCorrect"[s] => NextCorrect[s])}
check Same2 for 3 but 1 State expect 0
-- assert NextInFinger {all s: State | all n: s.active | some n.s.data.finger[n.id.next] }
-- says that finger entry maps an id to a node so that there are no intervening nodes
-- between the id and the nod... | assert | Same2 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"FingersCorrect",
"Id",
"NextCorrect",
"Node",
"State",
"entry",
"less_than",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
SameFC | {all s: State | FingersCorrect [s] iff FingersCorrect"[s]}
check SameFC for 3 but 1 State expect 0
pred ShowMeFC {
all s : State | s.active = Node && FingersCorrect[s]
}
run ShowMeFC for 2 but 1 State expect 1
pred ClosestPrecedingFinger[s: State] {
all n: s.active | let nd = n.(s.data) |
... | assert | SameFC | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"ClosestPrecedingFinger",
"FingersCorrect",
"Id",
"Node",
"State",
"less_than",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
SameCPF | {all s: State | FingersCorrect[s] => (ClosestPrecedingFinger [s] iff ClosestPrecedingFinger" [s])}
assert SameCPF1 {all s: State | FingersCorrect[s] => (ClosestPrecedingFinger [s] => ClosestPrecedingFinger" [s])} | assert | SameCPF | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"ClosestPrecedingFinger",
"FingersCorrect",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
SameCPF2 | {
all s: State | ((s.active = Node && FingersCorrect[s] && ClosestPrecedingFinger" [s])
=> ClosestPrecedingFinger [s]) }
check SameCPF for 3 but 1 State expect 0
check SameCPF1 for 2 but 1 State expect 0
check SameCPF2 for 3 but 1 State expect 0
pred ShowMeCPF {
all s : State | s.active = No... | assert | SameCPF2 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"ClosestPrecedingFinger",
"FingersCorrect",
"Node",
"SameCPF",
"ShowMeCPF",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
ShowMeCPF for 2 but 1 State expect 1 | run | ShowMeCPF | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
FindPredecessor[s: State] | {
all n: s.active | let nd = n.(s.data) | all i: Id {
nd.find_predecessor[i] =
(less_than_eq [n.id, i, nd.next.id] && (n.id != i || # s.active = 1)
=> n
else (nd.closest_preceding_finger[i].(s.data).find_predecessor)[i])
... | pred | FindPredecessor | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"Id",
"State",
"less_than_eq"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
FPisActive | {
all s: State | FingersCorrect[s] && ClosestPrecedingFinger[s] && FindPredecessor[s]
=> (all n: s.active | all nd: n.(s.data) | nd.find_predecessor[Id] in s.active) } | assert | FPisActive | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"ClosestPrecedingFinger",
"FindPredecessor",
"FingersCorrect",
"Id",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
FPisActive for 3 but 1 State expect 1 | check | FPisActive | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
FindPredecessor"[s: State] {
all n: s.active | let nd = (s.data)[n] | all i: Id {
let next" = Id<:next - (nd.next.id -> Id) | {
one s.active or i in n.id.^next" => // *next" -> ^next" 1/8/02
nd.find_predecessor[i] = n else
nd.find_predecessor[i] =
((s.data)[nd.closest_preceding_finger[i]]).find_predecessor[i]
}}
}
assert ... | pred | FindPredecessor | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"FingersCorrect",
"Id",
"Node",
"SameFP",
"State",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
SameFP1 | {
all s: State | FingersCorrect[s] && s.active = Node
=> (FindPredecessor [s] => FindPredecessor" [s])}
assert SameFP2 {
all s: State | FingersCorrect[s] && s.active = Node
=> (FindPredecessor" [s] => FindPredecessor [s])} | assert | SameFP1 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"FindPredecessor",
"FingersCorrect",
"Node",
"SameFP2",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
SameFP for 3 but 1 State expect 1 | check | SameFP | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
SameFP1 for 3 but 1 State expect 0 | check | SameFP1 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
SameFP2 for 3 but 1 State expect 0 | check | SameFP2 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
FindSuccessor[s: State] | {
all n: s.active | let nd = (s.data)[n] | all i: Id {
nd.find_successor[i] = ((s.data)[nd.find_predecessor[i]]).next
}} | pred | FindSuccessor | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"Id",
"State",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
ShowMe1Node | {
#Node = 1
all s : State | NextCorrect[s]
State.active = Node
} | pred | ShowMe1Node | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"NextCorrect",
"Node",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
ShowMe1Node for 2 but 1 State, 1 Node expect 1 | run | ShowMe1Node | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"Node",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
ShowMe1 | {
#Node = 2
#State = 1
all s : State | NextCorrect[s]
State.active = Node
} | pred | ShowMe1 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"NextCorrect",
"Node",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
ShowMe2 | {
#Node = 3
#State = 1
all s : State | NextCorrect[s] && FingersCorrect[s]
State.active = Node
//all n: NodeData | one n.finger[Id]
} | pred | ShowMe2 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"FingersCorrect",
"NextCorrect",
"Node",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
OK1 | {
#Node = 3 &&
#State = 1 &&
(all s : State | NextCorrect[s] && FingersCorrect[s]) &&
State.active = Node
} | assert | OK1 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"FingersCorrect",
"NextCorrect",
"Node",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
ShowMe1 for 3 expect 1 | run | ShowMe1 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
ShowMe2 for 3 expect 1 | run | ShowMe2 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
InjectiveIds | {all i, j: Id | i!=j => i.next != j.next} | assert | InjectiveIds | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"Id"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
InjectiveIds for 5 expect 0 | check | InjectiveIds | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
FindSuccessorWorks | {
all s: State, i: Id |
let nd = s.active.(s.data) |
let succ = nd.find_successor [i] |
FingersCorrect [s] // && s.active = Node
=> (no n": s.active | less_than [i, n".id, succ.id])
} | assert | FindSuccessorWorks | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"FingersCorrect",
"Id",
"State",
"less_than"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
FindSuccessorWorks for 3 but 1 State expect 1 | check | FindSuccessorWorks | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord.als | [] | [
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
less_than [from, i,j: Id] | {
let next" = Id<:next - (Id->from) | j in i.^next" // if from=j, returns true if # nodes > 1
} | pred | less_than | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"Id",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
less_than_eq [from, i,j: Id] | {
let next" = Id<:next - (Id->from) | j in i.*next"
} | pred | less_than_eq | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"Id",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
NodeData | {
prev, next: Node,
finger: Id -> lone Node,
closest_preceding_finger: Id -> one Node,
find_predecessor: Id -> one Node,
find_successor: Id -> one Node
} | sig | NodeData | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"Id",
"Node",
"next",
"prev"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
State | {
active: set Node,
data: active -> one NodeData
} | sig | State | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"Node",
"NodeData"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
NextCorrect [s: State] | {
all n: s.active {
-- no intervening node (ie, close enough)
no n": s.active - n | less_than [n.id, n".id, n.(s.data).next.id]
-- can reach all other active nodes (ie, far enough)
-- need this because can"t rule out case of next being node itself (because of 1-node ring)
-- s.active in n.*(s.data... | pred | NextCorrect | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"State",
"less_than",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
NextCorrect" [s: State] {
-- next seems to be correct for 1,2,3 nodes
all n: s.active | let nd = (s.data)[n] {
let next" = Id<:next - (Id -> nd.next.id) | {
no n" : s.active { n".id in n.id.^next" }
}}
}
assert Same1 {all s: State | NextCorrect[s] => NextCorrect"[s]} | pred | NextCorrect | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"Id",
"Same1",
"State",
"correct",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
Same2 | {all s: State | s.active = Node => (NextCorrect"[s] => NextCorrect[s])}
//check Same2 for 3 but 1 State -- invalid if active condition removed
-- assert NextInFinger {all s: State | all n: s.active | some n.s.data.finger[n.id.next] }
/**
* says that finger entry maps an id to a node so that there are no intervening ... | assert | Same2 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"FingersCorrect",
"Id",
"NextCorrect",
"Node",
"State",
"entry",
"less_than",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
SameFC | {all s: State | FingersCorrect [s] iff FingersCorrect"[s]}
//check SameFC for 3 but 1 State
pred ShowMeFC {
all s : State | s.active = Node && FingersCorrect[s]
}
//run ShowMeFC for 2 but 1 State
/*
fun ClosestPrecedingFinger(s: State) {
all n: s.active | let nd = n.s.data |
all i: Id | let cpf = nd.closest_... | assert | SameFC | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"ClosestPrecedingFinger",
"FingersCorrect",
"Id",
"Node",
"NodeData",
"State",
"less_than",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
SameCPF2 | {
all s: State | ((s.active = Node && FingersCorrect[s] && ClosestPrecedingFinger" [s])
=> ClosestPrecedingFinger [s]) }
//check SameCPF for 3 but 1 State
//check SameCPF1 for 2 but 1 State
//check SameCPF2 for 3 but 1 State
pred ShowMeCPF {
all s : State | s.active = Node && FingersCorrect[s] &&
// no... | assert | SameCPF2 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"ClosestPrecedingFinger",
"FingersCorrect",
"Node",
"SameCPF",
"ShowMeCPF",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
FindPredecessor[s: State] | {
all n: s.active | let nd = n.(s.data) | all i: Id {
nd.find_predecessor[i] =
((less_than_eq [n.id, i, nd.next.id] && (n.id != i || # s.active = 1))
=> n
else (nd.closest_preceding_finger[i].(s.data).find_predecessor)[i])
}
} | pred | FindPredecessor | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"Id",
"State",
"less_than_eq"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
FPisActive | {
all s: State | FingersCorrect[s] && ClosestPrecedingFinger[s] && FindPredecessor[s]
=> (all n: s.active | all nd: n.(s.data) | nd.find_predecessor[Id] in s.active)
} | assert | FPisActive | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"ClosestPrecedingFinger",
"FindPredecessor",
"FingersCorrect",
"Id",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
FindPredecessor"[s: State] {
all n: s.active | let nd = (s.data)[n] | all i: Id {
let next" = Id<:next - (nd.next.id -> Id) | {
one s.active or i in n.id.^next" =>
nd.find_predecessor[i] = n else
nd.find_predecessor[i] =
((s.data)[nd.closest_preceding_finger[i]]).find_predecessor[i]
}}
}
assert SameFP {all s: State | FingersCorrect[s] && s.active = Node
=> (FindPredecessor [s] iff FindPredecessor" [s])} | pred | FindPredecessor | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"FingersCorrect",
"Id",
"Node",
"SameFP",
"State",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
SameFP1 | {
all s: State | FingersCorrect[s] && s.active = Node
=> (FindPredecessor [s] => FindPredecessor" [s])}
assert SameFP2 {
all s: State | FingersCorrect[s] && s.active = Node
=> (FindPredecessor" [s] => FindPredecessor [s])} | assert | SameFP1 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"FindPredecessor",
"FingersCorrect",
"Node",
"SameFP2",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
FindSuccessor[s: State] | {
all n: s.active | let nd = (s.data)[n] | all i: Id {
nd.find_successor[i] = ((s.data)[nd.find_predecessor[i]]).next
}} | pred | FindSuccessor | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"Id",
"State",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
{ all s : State {
ClosestPrecedingFinger[s]
FindPredecessor[s]
FindSuccessor[s]
}} | fact | all | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"ClosestPrecedingFinger",
"FindPredecessor",
"FindSuccessor",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
ShowMe1Node | {
#Node = 1
all s : State | NextCorrect[s]
State.active = Node
} | pred | ShowMe1Node | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"NextCorrect",
"Node",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
ShowMe1 | {
#Node = 2
#State = 1
all s : State | NextCorrect[s]
State.active = Node
} | pred | ShowMe1 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"NextCorrect",
"Node",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
ShowMe2 | {
#Node = 3
#State = 1
all s : State | NextCorrect[s] && FingersCorrect[s]
State.active = Node
//all n: NodeData | one n.finger[Id]
} | pred | ShowMe2 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"FingersCorrect",
"NextCorrect",
"Node",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
OK1 | {
#Node = 3 &&
#State = 1 &&
(all s : State | NextCorrect[s] && FingersCorrect[s]) &&
State.active = Node
} | assert | OK1 | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"FingersCorrect",
"NextCorrect",
"Node",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
FindSuccessorWorks | {
all s: State, i: Id |
let nd = s.active.(s.data) |
let succ = nd.find_successor [i] |
FingersCorrect [s]
=> {
no n": s.active | less_than [i, n".id, succ.id]
succ in s.active
}
} | assert | FindSuccessorWorks | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"FingersCorrect",
"Id",
"State",
"less_than"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
FindSuccessorWorks for 4 but 1 State, 3 Node, 3 NodeData expect 0 | check | FindSuccessorWorks | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chord2.als | [] | [
"Node",
"NodeData",
"State"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | ||
less_than [from, i,j: Id] | {
let next" = Id<:next - (Id->from) | j in i.^next"
} | pred | less_than | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chordbugmodel.als | [] | [
"Id",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
less_than_eq [from, i,j: Id] | {
let next" = Id<:next - (Id->from) | j in i.*next"
} | pred | less_than_eq | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chordbugmodel.als | [] | [
"Id",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
NodeData | {
next: Node,
finger: Id -> lone Node,
closest_preceding_finger: Id -> one Node,
find_successor: Id -> one Node
} | sig | NodeData | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chordbugmodel.als | [] | [
"Id",
"Node",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
State | {
active: set Node,
data: active -> one NodeData
} | sig | State | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chordbugmodel.als | [] | [
"Node",
"NodeData"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 | |
{
all s: State | all n: s.active |
n.(s.data).next = n.(s.data).finger[n.id.next]
} | fact | all | algorithms.distributed-hashtable | algorithms/distributed-hashtable/chordbugmodel.als | [] | [
"State",
"next"
] | https://github.com/AlloyTools/models | 886447d3369a9036aa4c3b49a82d7c557ab2e5f9 |
Declarations from Alloy.
886447d3369a9036aa4c3b49a82d7c557ab2e5f9| 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 |
|---|---|
| pred | 338 |
| sig | 288 |
| fun | 165 |
| fact | 124 |
| assert | 80 |
| check | 73 |
| run | 64 |
AVTree {
values: set Value,
attributes: set Attribute,
root: values - Wildcard,
av: attributes one -> some (values - root),
va: (values - Wildcard) one -> attributes
}
{
// values (and attributes) of tree are those reachable from root
values = root.*(va.av)
}
AVTree | algorithms/discovery/ins.alsEach 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{alloy_dataset,
title = {Alloy},
author = {Norton, Charles},
year = {2026},
note = {Extracted from https://github.com/AlloyTools/models, commit 886447d3369a},
url = {https://huggingface.co/datasets/phanerozoic/Alloy}
}