index
module components.merging.sputlink.main
ConstraintPropagator
class ConstraintPropagator
Inherits from: object

Main SputLink class. Instance variables:

filename      -  a string
graph         -  a Graph
pending       -  a queue of links to be added
compositions  -  a CompositionTable

Public Functions

__init__(self, tarsqidoc=None, constraints=None)
Read the compositions table, export the compositions to the graph, and add nodes to the graph. Either tarsqidoc or constraints has to be not None.
close_cycle_debug_file(self)
This is useful if you run the tests while debugging is on. Without it the cycles file may contain partially overwritten older cycles.
collect_edges(self)
propagate_constraints(self)
Get all constraints from the pending queue and ask the graph to propagate them one by one.
queue_constraints(self, tlinks)
Take a list of tlinks, encoded as Tag elements, and add them to the pending queue as instances of Constraint.
queue_test_constraints(self, constraints)
Take a list of test constrains, encoded as tuples, and add them to the pending queue as instances of Constraint. Same as above, but now used for testing.
reduce_graph(self)
Ask the graph to reduce itself.
reset(self)
Reset the graph and pending instance variables.

Private Functions

_debug_init_cycles_file(self)
_debug_print_compositions_file(self)
_debug_print_cycle(self, constraint=None)