diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-04-04 03:02:48 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-04-04 03:02:48 +0800 |
| commit | 2713bbcb4044ca18eb3071a8efea7ad097a6693b (patch) | |
| tree | 79ae9f14168c421471628142634d2af99ec2d899 /proofsearch/src/simplify/subsumption.cc | |
| parent | c7cf051e764b43e6455fa6cceaf1dbf7f6cb841b (diff) | |
| download | rcc-project-2713bbcb4044ca18eb3071a8efea7ad097a6693b.tar.gz rcc-project-2713bbcb4044ca18eb3071a8efea7ad097a6693b.tar.xz | |
feat: implement clause subsumption and tautology detection logic with associated unit tests
Diffstat (limited to 'proofsearch/src/simplify/subsumption.cc')
| -rw-r--r-- | proofsearch/src/simplify/subsumption.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/proofsearch/src/simplify/subsumption.cc b/proofsearch/src/simplify/subsumption.cc index b62ffd0..cf243c9 100644 --- a/proofsearch/src/simplify/subsumption.cc +++ b/proofsearch/src/simplify/subsumption.cc @@ -16,4 +16,27 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +#include "atp/simplify/subsumption.h" + +namespace atp { + + bool subsumes(const Clause& general, const Clause& specific) { + if (general.size() > specific.size()) { + return false; + } + for (const auto& lit_g : general.literals) { + bool found = false; + for (const auto& lit_s : specific.literals) { + if (lit_g.atom == lit_s.atom && lit_g.is_positive == lit_s.is_positive) { + found = true; + break; + } + } + if (!found) { + return false; + } + } + return true; + } +} |
