Skip to content

Commit aaf7653

Browse files
committed
fixing some issues related to tau_ba and its testing
1 parent 8228b04 commit aaf7653

File tree

3 files changed

+38
-15
lines changed

3 files changed

+38
-15
lines changed

src/tau.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ struct tau_ba {
167167
auto vars = get_free_vars_from_nso(rr_nso.main);
168168
auto wff = rr_nso.main;
169169
for(auto& v: vars) wff = build_wff_all<BAs...>(v, wff);
170-
auto rr_nso = rr<nso<tau_ba<BAs...>, BAs...>>(rr_nso.rec_relations, wff);
171-
auto normalized = normalizer<tau_ba<BAs...>, BAs...>(rr_nso);
170+
auto nrr_nso = rr<nso<tau_ba<BAs...>, BAs...>>(rr_nso.rec_relations, wff);
171+
auto normalized = normalizer<tau_ba<BAs...>, BAs...>(nrr_nso);
172172
auto check = normalized | tau_parser::wff_f;
173173
return check.has_value();
174174
}
@@ -178,8 +178,8 @@ struct tau_ba {
178178
auto vars = get_free_vars_from_nso(rr_nso.main);
179179
auto wff = build_wff_neg(rr_nso.main);
180180
for(auto& v: vars) wff = build_wff_all<BAs...>(v, wff);
181-
auto rr_nso = rr<nso<tau_ba<BAs...>, BAs...>>(rr_nso.rec_relations, wff);
182-
auto normalized = normalizer<tau_ba<BAs...>, BAs...>(rr_nso);
181+
auto nrr_nso = rr<nso<tau_ba<BAs...>, BAs...>>(rr_nso.rec_relations, wff);
182+
auto normalized = normalizer<tau_ba<BAs...>, BAs...>(nrr_nso);
183183
auto check = normalized | tau_parser::wff_f;
184184
return check.has_value();
185185
}

tests/integration/test_integration-tau_ba1.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ TEST_SUITE("operators: negation") {
4545
}
4646
}
4747

48+
// TODO (HIGH) add tests for is_zero
49+
// TODO (HIGH) add tests for is_one
50+
4851
TEST_SUITE("operators: conjunction") {
4952

5053
TEST_CASE("(({ : T. } & { : T. }) = 0)") {

tests/integration/test_integration-tau_ba2.cpp

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,36 @@ TEST_SUITE("complex tau_ba formulas") {
5959
CHECK( check.has_value() );
6060
}*/
6161

62-
TEST_CASE("tau_ba operators") {
63-
auto T = get_tau_ba("( { : ({ : F.} = 0). } = 0 ).");
64-
auto F = get_tau_ba("( { : ({ : T.} = 0). } = 0 ).");
65-
auto TorF = T | F;
66-
auto TandF = T & F;
67-
cout << "T: " << T << " \n\tnormal: " << normal(T) << "\n";
68-
cout << "F: " << F << " \n\tnormal: " << normal(F) << "\n";
69-
cout << "T | F: " << TorF << " \n\tnormal: " << normal(TorF) << "\n";
70-
cout << "T & F: " << TandF << " \n\tnormal: " << normal(TandF) << "\n";
71-
72-
CHECK( true );
62+
static auto T = get_tau_ba("( { : ({ : F.} = 0). } = 0 ).");
63+
static auto F = get_tau_ba("( { : ({ : T.} = 0). } = 0 ).");
64+
65+
TEST_CASE("T") {
66+
auto normalized = normalizer<tau_ba<bdd_test>, bdd_test>(T.rr_nso);
67+
auto check = normalized | tau_parser::wff_t;
68+
CHECK( check.has_value() );
69+
}
70+
71+
TEST_CASE("F") {
72+
auto normalized = normalizer<tau_ba<bdd_test>, bdd_test>(F.rr_nso);
73+
auto check = normalized | tau_parser::wff_f;
74+
CHECK( check.has_value() );
75+
}
76+
77+
TEST_CASE("T | F") {
78+
auto normalized = normalizer<tau_ba<bdd_test>, bdd_test>((T|F).rr_nso);
79+
auto check = normalized | tau_parser::wff_t;
80+
CHECK( check.has_value() );
81+
}
82+
83+
TEST_CASE("T & F") {
84+
auto normalized = normalizer<tau_ba<bdd_test>, bdd_test>((T&F).rr_nso);
85+
auto check = normalized | tau_parser::wff_f;
86+
CHECK( check.has_value() );
87+
}
88+
89+
TEST_CASE("T & T") {
90+
auto normalized = normalizer<tau_ba<bdd_test>, bdd_test>((T&T).rr_nso);
91+
auto check = normalized | tau_parser::wff_t;
92+
CHECK( check.has_value() );
7393
}
7494
}

0 commit comments

Comments
 (0)