Graphs for the order tactic #
This module defines the Graph structure and basic operations on it. The order tactic uses
≤-graphs, where the vertices represent atoms, and an edge (x, y) exists if x ≤ y.
@[reducible, inline]
If g is a Graph, then for a vertex with index v, g[v] is an array containing
the edges starting from this vertex.
Instances For
Adds an edge to the graph.
Equations
- g.addEdge edge = Array.modify g edge.src fun (edges : Array Mathlib.Tactic.Order.Edge) => edges.push edge
Instances For
def
Mathlib.Tactic.Order.Graph.constructLeGraph
(nVertexes : ℕ)
(facts : Array AtomicFact)
(idxToAtom : Std.HashMap ℕ Lean.Expr)
:
Constructs a directed Graph using ≤ facts. It also creates edges from ⊥
(if present) to all vertices and from all vertices to ⊤ (if present).
Equations
- One or more equations did not get rendered due to their size.
Instances For
State for the DFS algorithm.
visited[v] = trueif and only if the algorithm has already entered vertexv.
Instances For
partial def
Mathlib.Tactic.Order.Graph.buildTransitiveLeProofDFS
(g : Graph)
(v t : ℕ)
(tExpr : Lean.Expr)
:
DFS algorithm for constructing a proof that x ≤ y by finding a path from x to y in the
≤-graph.
def
Mathlib.Tactic.Order.Graph.buildTransitiveLeProof
(g : Graph)
(idxToAtom : Std.HashMap ℕ Lean.Expr)
(s t : ℕ)
:
Given a ≤-graph g, finds a proof of s ≤ t using transitivity.
Equations
- g.buildTransitiveLeProof idxToAtom s t = (g.buildTransitiveLeProofDFS s t (idxToAtom.get! t)).run' { visited := Array.replicate (Array.size g) false }