curry.backends.py.graph.equality module

Implements graph equality.

class curry.backends.py.graph.equality.GraphEquality(skipfwd)[source]

Bases: object

Implements equality checks between Curry expressions.

curry.backends.py.graph.equality.equal(lhs, rhs, skipfwd=False)[source]

Curry expression equality based on graph comparison. Cyclical expressions are handled by structural induction. By default, no special handling for nodes such as forward nodes is performed, so <Int 3> and <Fwd <Int 3>> are not equal by this metric.

Examples

Equivalent cyclic expressions will always compare equal. The following, for example, will all compare equal:

let a=(0:b), b=(1:a) in a let a=(0:1:a) in a let a=(0:1:b), b=(0:1:a) in a let a=(0:1:0:b), b=(1:0:1:a) in a

curry.backends.py.graph.equality.logically_equal(lhs, rhs)[source]
curry.backends.py.graph.equality.structurally_equal(lhs, rhs)[source]