Simplify trigger notifications in equality engine (#4921)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Thu, 20 Aug 2020 01:34:39 +0000 (20:34 -0500)
committerGitHub <noreply@github.com>
Thu, 20 Aug 2020 01:34:39 +0000 (20:34 -0500)
commiteee14382af077bd043d53b75c038050b325dd04a
treec82bcec6f2144b6c225f434fe86d86748a3146bd
parent45412d0158992ae193f8e26b25a21e735ac7be8b
Simplify trigger notifications in equality engine (#4921)

This is further work towards a centralized approach for equality engines.

This PR merges the eqNotifyTriggerEquality callback with the eqNotifyTriggerPredicate callback, and adds assertions that capture the current behavior. It furthermore makes addTriggerEquality private in equality engine and invoked as a special case of addTriggerPredicate. Note this PR does not impact the internal implementation of these methods in equality engine, which indeed is different.

There are two reasons to merge these callbacks:
(1) all theories implement exactly the same method for the two callbacks, whenever they implement both. It would be trivial to do something different (by case splitting on the kind of predicate that is being notified), and moreover it is not recommended they do anything other than immediately propagate the predicate (regardless of whether it is an equality).
(2) It leads to some confusion with eqNotifyTriggerTermEquality, which is invoked when two trigger terms are merged.
25 files changed:
src/theory/arith/congruence_manager.cpp
src/theory/arith/congruence_manager.h
src/theory/arrays/theory_arrays.cpp
src/theory/arrays/theory_arrays.h
src/theory/bv/bv_subtheory_core.cpp
src/theory/bv/bv_subtheory_core.h
src/theory/datatypes/theory_datatypes.cpp
src/theory/datatypes/theory_datatypes.h
src/theory/ee_manager_distributed.h
src/theory/fp/theory_fp.cpp
src/theory/fp/theory_fp.h
src/theory/quantifiers/conjecture_generator.h
src/theory/sep/theory_sep.h
src/theory/sets/theory_sets.cpp
src/theory/sets/theory_sets.h
src/theory/sets/theory_sets_private.cpp
src/theory/shared_terms_database.cpp
src/theory/shared_terms_database.h
src/theory/strings/term_registry.cpp
src/theory/strings/theory_strings.h
src/theory/uf/equality_engine.cpp
src/theory/uf/equality_engine.h
src/theory/uf/equality_engine_notify.h
src/theory/uf/theory_uf.cpp
src/theory/uf/theory_uf.h