Declarative graph algorithms via Knuth-Bendix completion
- We propose combined and cooperating Knuth-Bendix completion procedures for equalities and inequalities. They serve as metaprocedures for developing rule-based declarative algorithms. Here, we present algorithms for memoization, cycle detection and strongly connected components. The specifications of algorithms are highly non-deterministic and generic. Refinements via evaluation strategies yield efficient implementations. Data structures and implementation details are largely hidden in the metaprocedure. Our algorithms easily adapt to dynamically changing environments. Main applications are constraint systems and the constraint-based analysis and verification of programs and finite and infinite state systems.