|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
#include <gtest/gtest.h>#include <random>#include <limits>#include <Two_Sat.H>#include <tpl_sgraph.H>#include <tpl_agraph.H>Go to the source code of this file.
Functions | |
| static bool | verify_assignment (const Array< bool > &assignment, const Array< std::pair< long, long > > &clauses) |
| TEST (TwoSat, EmptyFormula) | |
| TEST (TwoSat, SingleClause) | |
| TEST (TwoSat, UnitClauseTrue) | |
| TEST (TwoSat, UnitClauseFalse) | |
| TEST (TwoSat, Contradiction) | |
| TEST (TwoSat, SimpleImplication) | |
| TEST (TwoSat, ImplicationChain) | |
| TEST (TwoSat, ImplicationChainContradiction) | |
| TEST (TwoSat, Equivalence) | |
| TEST (TwoSat, Xor) | |
| TEST (TwoSat, XorContradiction) | |
| TEST (TwoSat, SignedApi) | |
| TEST (TwoSat, SignedApiUnsat) | |
| TEST (TwoSat, AtMostOne) | |
| TEST (TwoSat, AtMostOneWithForced) | |
| TEST (TwoSat, AtMostOneConflict) | |
| TEST (TwoSat, AtMostOneEdgeCases) | |
| TEST (TwoSat, GraphColoring2Colors) | |
| TEST (TwoSat, GraphColoring2ColorsPath) | |
| TEST (TwoSat, AllClausesSame) | |
| TEST (TwoSat, BoundsChecking) | |
| TEST (TwoSat, StressBruteForce) | |
| TEST (TwoSat, WithListSDigraph) | |
| TEST (TwoSat, WithArrayDigraph) | |
| TEST (TwoSat, LargerSatisfiable) | |
| TEST (TwoSat, LargerUnsatisfiable) | |
| TEST (TwoSat, LiteralHelpers) | |
| TEST | ( | TwoSat | , |
| AllClausesSame | |||
| ) |
Definition at line 330 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_clause(), Aleph::Two_Sat< GT >::pos_lit(), and Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| AtMostOne | |||
| ) |
Definition at line 230 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_at_most_one(), Aleph::count(), Aleph::Two_Sat< GT >::pos_lit(), and Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| AtMostOneConflict | |||
| ) |
Definition at line 263 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_at_most_one(), Aleph::Two_Sat< GT >::is_satisfiable(), Aleph::Two_Sat< GT >::pos_lit(), and Aleph::Two_Sat< GT >::set_true().
| TEST | ( | TwoSat | , |
| AtMostOneEdgeCases | |||
| ) |
Definition at line 275 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_at_most_one(), Aleph::Two_Sat< GT >::is_satisfiable(), Aleph::Two_Sat< GT >::pos_lit(), and Aleph::Two_Sat< GT >::set_true().
| TEST | ( | TwoSat | , |
| AtMostOneWithForced | |||
| ) |
Definition at line 247 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_at_most_one(), Aleph::Two_Sat< GT >::pos_lit(), Aleph::Two_Sat< GT >::set_true(), and Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| BoundsChecking | |||
| ) |
Definition at line 345 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_clause(), Aleph::Two_Sat< GT >::add_clause_signed(), Aleph::Two_Sat< GT >::neg_lit(), and Aleph::Two_Sat< GT >::pos_lit().
| TEST | ( | TwoSat | , |
| Contradiction | |||
| ) |
Definition at line 111 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::neg_lit(), Aleph::Two_Sat< GT >::pos_lit(), Aleph::Two_Sat< GT >::set_true(), and Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| EmptyFormula | |||
| ) |
Definition at line 67 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| Equivalence | |||
| ) |
Definition at line 162 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_equiv(), Aleph::Two_Sat< GT >::pos_lit(), Aleph::Two_Sat< GT >::set_true(), and Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| GraphColoring2Colors | |||
| ) |
Definition at line 300 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_xor(), Aleph::Two_Sat< GT >::is_satisfiable(), and Aleph::Two_Sat< GT >::pos_lit().
| TEST | ( | TwoSat | , |
| GraphColoring2ColorsPath | |||
| ) |
Definition at line 313 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_xor(), Aleph::Two_Sat< GT >::pos_lit(), and Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| ImplicationChain | |||
| ) |
Definition at line 135 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_implication(), Aleph::Two_Sat< GT >::pos_lit(), Aleph::Two_Sat< GT >::set_true(), and Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| ImplicationChainContradiction | |||
| ) |
Definition at line 150 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_implication(), Aleph::Two_Sat< GT >::is_satisfiable(), Aleph::Two_Sat< GT >::pos_lit(), Aleph::Two_Sat< GT >::set_false(), and Aleph::Two_Sat< GT >::set_true().
| TEST | ( | TwoSat | , |
| LargerSatisfiable | |||
| ) |
Definition at line 460 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_clause(), Aleph::Array< T >::append(), Aleph::Array< T >::create(), Aleph::Two_Sat< GT >::is_pos_lit(), l1, l2, Aleph::Two_Sat< GT >::lit_var(), N, Aleph::Two_Sat< GT >::neg_lit(), Aleph::Two_Sat< GT >::pos_lit(), rng, Aleph::Array< T >::size(), and Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| LargerUnsatisfiable | |||
| ) |
Definition at line 505 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_implication(), Aleph::Two_Sat< GT >::is_satisfiable(), N, Aleph::Two_Sat< GT >::neg_lit(), Aleph::Two_Sat< GT >::pos_lit(), and Aleph::Two_Sat< GT >::set_true().
| TEST | ( | TwoSat | , |
| LiteralHelpers | |||
| ) |
Definition at line 527 of file two_sat_test.cc.
| TEST | ( | TwoSat | , |
| SignedApi | |||
| ) |
Definition at line 201 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_clause_signed(), Aleph::Two_Sat< GT >::solve(), and verify_assignment().
| TEST | ( | TwoSat | , |
| SignedApiUnsat | |||
| ) |
Definition at line 216 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_clause_signed(), and Aleph::Two_Sat< GT >::is_satisfiable().
| TEST | ( | TwoSat | , |
| SimpleImplication | |||
| ) |
Definition at line 122 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_implication(), Aleph::Two_Sat< GT >::pos_lit(), Aleph::Two_Sat< GT >::set_true(), and Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| SingleClause | |||
| ) |
Definition at line 76 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_clause(), Aleph::Two_Sat< GT >::pos_lit(), and Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| StressBruteForce | |||
| ) |
Definition at line 365 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_clause_signed(), Aleph::Array< T >::append(), Aleph::Array< T >::create(), N, rng, Aleph::Two_Sat< GT >::solve(), and verify_assignment().
| TEST | ( | TwoSat | , |
| UnitClauseFalse | |||
| ) |
Definition at line 100 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::pos_lit(), Aleph::Two_Sat< GT >::set_false(), and Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| UnitClauseTrue | |||
| ) |
Definition at line 89 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::pos_lit(), Aleph::Two_Sat< GT >::set_true(), and Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| WithArrayDigraph | |||
| ) |
Definition at line 440 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_clause(), Aleph::Two_Sat< GT >::neg_lit(), Aleph::Two_Sat< GT >::pos_lit(), Aleph::Two_Sat< GT >::solve(), and verify_assignment().
| TEST | ( | TwoSat | , |
| WithListSDigraph | |||
| ) |
Definition at line 423 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_clause(), Aleph::Two_Sat< GT >::neg_lit(), Aleph::Two_Sat< GT >::pos_lit(), Aleph::Two_Sat< GT >::solve(), and verify_assignment().
| TEST | ( | TwoSat | , |
| Xor | |||
| ) |
Definition at line 175 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_xor(), Aleph::Two_Sat< GT >::pos_lit(), and Aleph::Two_Sat< GT >::solve().
| TEST | ( | TwoSat | , |
| XorContradiction | |||
| ) |
Definition at line 186 of file two_sat_test.cc.
References Aleph::Two_Sat< GT >::add_xor(), Aleph::Two_Sat< GT >::is_satisfiable(), Aleph::Two_Sat< GT >::pos_lit(), and Aleph::Two_Sat< GT >::set_true().
|
static |
Definition at line 46 of file two_sat_test.cc.
References Aleph::and.