Skip to main content

difference_graph

Function difference_graph 

Source
pub fn difference_graph(
    graph: &Graph,
    file: &str,
    position: Position,
) -> Result<DiffGraph, Error>
Expand description

Rewrites graph over differences of coordinates, checking that every sum and difference combines nodes of the same degree.

A leaf is a difference of the same coordinate of two different points. A leaf used twice is one node; a.x - d.x and d.x - a.x are different leaves. A negation is 0 - x, kept as a Neg node. The graph is walked iteratively in node order.

ยงErrors

Returns an error, at position (the name of the predicate), when a coordinate is used outside a difference, a difference mixes axes or subtracts a point from itself, a sum or difference combines nodes of different degree, a degree exceeds u32::MAX, or an integer literal appears other than as the zero of a negation.