Cutting wLists Off #
Take the prefix ending at the first vertex satisfying a predicate P
(or the entire wList if nothing satisfies P).
Equations
- (WList.nil x).prefixUntil P = WList.nil x
- (WList.cons x e w_2).prefixUntil P = if P x then WList.nil x else WList.cons x e (w_2.prefixUntil P)
Instances For
The prefix of w ending at a vertex x. Equal to w if x ∉ w.
Equations
- w.prefixUntilVertex x = w.prefixUntil fun (x_1 : α) => x_1 = x
Instances For
Take the suffix starting at the first vertex satisfying a predicate P,
(or the Nil wList on the last vertex if nothing satisfies P)
Equations
- (WList.nil x).suffixFrom P = WList.nil x
- (WList.cons x e w_2).suffixFrom P = if P x then WList.cons x e w_2 else w_2.suffixFrom P
Instances For
The suffix of w starting at the first occurence of a vertex x.
Equal to [w.last] if x ∉ w.
Equations
- w.suffixFromVertex x = w.suffixFrom fun (x_1 : α) => x_1 = x
Instances For
Take the prefix ending at the tail of the first edge satisfying Q.
Equal to w if no edge satisfies Q.
Equations
- (WList.nil x).prefixUntilEdge Q = WList.nil x
- (WList.cons x e w_2).prefixUntilEdge Q = if Q e then WList.nil x else WList.cons x e (w_2.prefixUntilEdge Q)
Instances For
Take the suffix starting at the head of the first edge satisfying Q.
Equal to nil w.last if no edge satisfies Q.
Equations
- (WList.nil x).suffixFromEdge Q = WList.nil x
- (WList.cons x e w_2).suffixFromEdge Q = if Q e then w_2 else w_2.suffixFromEdge Q
Instances For
The prefix of w ending just before the first occurrence of edge e.
Equal to w if e ∉ w.edge.
Equations
- w.prefixUntilEdgeLabel e = w.prefixUntilEdge fun (x : β) => x = e
Instances For
The suffix of w starting just after the first occurrence of edge e.
Equal to nil w.last if e ∉ w.edge.
Equations
- w.suffixFromEdgeLabel e = w.suffixFromEdge fun (x : β) => x = e
Instances For
Take the prefix of w ending at the last occurence of x in w.
Equal to w if x ∉ w.
Equations
- w.prefixUntilLast P = (w.reverse.suffixFrom P).reverse
Instances For
Take the suffix of w starting at the last occurence of P in w.
If P never occurs, this is all of w.
Equations
- w.suffixFromLast P = (w.reverse.prefixUntil P).reverse
Instances For
Remove the last edge and vertex from a wList. This is the reverse of the reversed tail.
Equations
- (WList.nil x_1).dropLast = WList.nil x_1
- (WList.cons x_1 e (WList.nil u)).dropLast = WList.nil x_1
- (WList.cons x_1 e (WList.cons y e' w)).dropLast = WList.cons x_1 e (WList.cons y e' w).dropLast
Instances For
Take the first n vertices from a WList. Returns the entire list if n ≥ w.length + 1.
Equations
- (WList.nil x_2).take x✝ = WList.nil x_2
- (WList.cons x_2 e w).take 0 = WList.nil x_2
- (WList.cons x_2 e w).take n.succ = WList.cons x_2 e (w.take n)