pub struct FrontierGraph { /* private fields */ }Expand description
The typed claim-level graph for one frontier (or one merged multi-frontier Project).
Implementations§
Source§impl FrontierGraph
impl FrontierGraph
Sourcepub const DEPENDENCY_KINDS: [EdgeKind; 4]
pub const DEPENDENCY_KINDS: [EdgeKind; 4]
The default dependency edge kinds for a blast-radius query: the relations
where the source rests on the target, so removing the target weakens the
source. Lineage kinds (Improves/Generalizes/…) are excluded — they
are not load-bearing dependency.
Sourcepub const REQUIRED_PREMISE_KINDS: [EdgeKind; 3]
pub const REQUIRED_PREMISE_KINDS: [EdgeKind; 3]
The REQUIRED-premise kinds: a claim’s support is bottlenecked by these
(if the premise fails, the claim weakens — the calculus’s “weakest
premise” reading). Supports is corroboration (an alternative, not a
requirement), so it is NOT a bottleneck and is excluded from the graded
min-propagation: losing one corroboration does not weaken a claim that
still has another.
Sourcepub fn from_project(project: &Project) -> Self
pub fn from_project(project: &Project) -> Self
Build the typed graph from a project’s findings and links.
Every finding becomes a node; every link whose type maps to a
known EdgeKind becomes a typed edge.
Sourcepub fn from_edges<I>(raw: I) -> Self
pub fn from_edges<I>(raw: I) -> Self
Build a typed graph directly from an (source, target, kind) edge list,
for a premise graph that is NOT a findings frontier — e.g. a Mathlib
declaration-dependency graph (from --uses--> to, mapped to
DependsOn). Every endpoint becomes a minimal node (label = id, neutral
Open state, confidence 1.0). The κ-from-events graded cascade
(blast_radius_graded) is NOT meaningful here (no verifier status and no
events); use the structural blast_radius — over a CONJUNCTIVE premise
graph (every used premise is required) that is also exact, since every
transitive dependent is genuinely impacted with no alternative route.
Sourcepub fn in_degree_ranked(&self, kinds: &[EdgeKind]) -> Vec<(String, usize)>
pub fn in_degree_ranked(&self, kinds: &[EdgeKind]) -> Vec<(String, usize)>
In-degree of every node (count of edges of kinds whose target is the
node), sorted descending — the most-depended-on premises first. The
highest-in-degree node is the highest-leverage retraction target.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Number of claim nodes.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Number of typed edges.
Sourcepub fn edges_of_kind(&self, kind: EdgeKind) -> impl Iterator<Item = &Edge>
pub fn edges_of_kind(&self, kind: EdgeKind) -> impl Iterator<Item = &Edge>
All edges of a given kind.
Sourcepub fn all_edges(&self) -> &[Edge]
pub fn all_edges(&self) -> &[Edge]
All typed edges, in build order. The read accessor the boundary query and the path-finder traverse over (they live in sibling modules and cannot see the private field).
Sourcepub fn edge_kind_counts(&self) -> BTreeMap<&'static str, usize>
pub fn edge_kind_counts(&self) -> BTreeMap<&'static str, usize>
Per-edge-kind counts, for summaries.
Sourcepub fn contradiction_pairs(&self) -> Vec<(String, String)>
pub fn contradiction_pairs(&self) -> Vec<(String, String)>
Unordered, deduplicated contradiction pairs. Because
contradicts is conceptually symmetric but stored as a directed
link, an A→B and a B→A contradiction collapse to one pair.
Endpoints are sorted so the pair is stable.
Sourcepub fn closure_of_kind(&self, start: &str, kind: EdgeKind) -> BTreeSet<String>
pub fn closure_of_kind(&self, start: &str, kind: EdgeKind) -> BTreeSet<String>
The transitive closure reachable from start following only
edges of one kind (e.g. the full improves or supersedes
lineage downstream of a result). Excludes start itself.
Sourcepub fn explore(&self, start: &str, max_hops: usize) -> Exploration
pub fn explore(&self, start: &str, max_hops: usize) -> Exploration
Breadth-first exploration outward from start, treating edges
as undirected for reach, up to max_hops. Returns each reached
node’s hop distance and the edges wholly inside the explored
subgraph. This is the engine for multi-hop “deep” queries — the
counterpart to single-hop neighbor lookups.
Sourcepub fn label_of(&self, id: &str) -> Option<&str>
pub fn label_of(&self, id: &str) -> Option<&str>
Look up a node’s label (assertion snippet), if present.
Sourcepub fn support_dominators(&self, z: &str, kinds: &[EdgeKind]) -> Vec<Dominator>
pub fn support_dominators(&self, z: &str, kinds: &[EdgeKind]) -> Vec<Dominator>
The support-graph dominators of a claim (GPT §11): the load-bearing
dependencies its support funnels through. A node d (≠ z) is a
dominator with weight = how many of z’s support-reachable nodes
vanish if d is removed (including d itself). A dominator whose
weight equals the full support size is a single point of failure —
every support path out of z runs through it. Sorted by weight
descending, then id. Pure; recomputed on read.
Sourcepub fn find_node(&self, query: &str) -> Option<String>
pub fn find_node(&self, query: &str) -> Option<String>
Resolve a query to a node id: an exact id; else an id prefix (ids are
addressed by prefix, like deep_trace — a substring match would let a
bare number like “617” spuriously hit the hex tail of a content-addressed
id); else the first finding (in id order) whose assertion contains the
query, case-insensitively, so a problem number or snippet resolves.
Sourcepub fn blast_radius(
&self,
start: &str,
kinds: &[EdgeKind],
direction: BlastDirection,
) -> BlastRadius
pub fn blast_radius( &self, start: &str, kinds: &[EdgeKind], direction: BlastDirection, ) -> BlastRadius
The dependency-impact neighborhood of start (memo §7.3): upstream
(what it rests on), downstream (what rests on it — the blast radius if
it moved), and the single points of failure on its support. An empty
kinds defaults to Self::DEPENDENCY_KINDS. Pure; recomputed on read.
Sourcepub fn blast_radius_graded(
&self,
project: &Project,
start: &str,
kinds: &[EdgeKind],
direction: BlastDirection,
) -> GradedBlast
pub fn blast_radius_graded( &self, project: &Project, start: &str, kinds: &[EdgeKind], direction: BlastDirection, ) -> GradedBlast
The calculus reading of the blast radius (the licensed propagation,
project_true_math_atlas roadmap #4): the center’s canonical graded status,
and for each structural downstream dependent the drop in its support kappa
when the center’s support is retracted, min-propagated along the dependency
edges (the Bottleneck semiring — a chain is as strong as its weakest
premise). Needs project for the per-finding provenance (events).
Dependents whose kappa does not drop are pruned: they have alternative
support, so structural reachability overcounted them.
Trait Implementations§
Source§impl Clone for FrontierGraph
impl Clone for FrontierGraph
Source§fn clone(&self) -> FrontierGraph
fn clone(&self) -> FrontierGraph
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more