step :: Equations -> Maybe Equations
step equations = do let reduced = termReduction equations
                    guard (not (hasOffendingEquations reduced))
                    let filteredAndFlipped = (flipEquations . filterOutIdentities) reduced
                    substituteSet filteredAndFlipped

-- Applies the unification algorithm to find the most general unifier for a set
-- of equations. If it fails, returns Nothing and no unifier exists.
step :: Equations -> Maybe Equations
step equations = do let reduced = termReduction equations
                    guard (not (hasOffendingEquations reduced))
                    let filteredAndFlipped = (flipEquations . filterOutIdentities) reduced
                    substituteSet filteredAndFlipped

-- Applies the unification algorithm to find the most general unifier for a set
-- of equations. If it fails, returns Nothing and no unifier exists.
step equations = do let reduced = termReduction equations
                    guard (not (hasOffendingEquations reduced))
                    let filteredAndFlipped = (flipEquations . filterOutIdentities) reduced
                    substituteSet filteredAndFlipped

-- Applies the unification algorithm to find the most general unifier for a set
-- of equations. If it fails, returns Nothing and no unifier exists.