Skip to content

Commit 61741b3

Browse files
committed
update the simplifier
1 parent 6bbd426 commit 61741b3

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

patronus/src/expr/simplify.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,6 @@ fn simplify_sum_of_products(
401401
match (prods[0], prods[1]) {
402402
// !a & b | a & !b
403403
((false, true), (true, false)) => Some(ctx.xor(a, b)),
404-
// !a & !b | a & b
405-
// TODO: this currently cannot be triggered, because !a & !b gets converted with demorgan first!
406-
((false, false), (true, true)) => Some(ctx.equal(a, b)),
407404
_ => None,
408405
}
409406
} else {

patronus/tests/simplify.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ fn test_simplify_and() {
4444
"and(not(and(not(a:bv<3>), b:bv<3>)), not(and(not(b), a)))",
4545
"not(xor(a:bv<3>, b:bv<3>))",
4646
);
47+
ts(
48+
"not(and(not(and(not(a:bv<3>), b:bv<3>)), not(and(not(b), a))))",
49+
"xor(a:bv<3>, b:bv<3>)",
50+
);
51+
ts(
52+
"not(and(not(and(b:bv<3>, not(a:bv<3>))), not(and(not(b), a))))",
53+
"xor(b:bv<3>, a:bv<3>)",
54+
);
4755
}
4856

4957
#[test]
@@ -68,9 +76,6 @@ fn test_simplify_or() {
6876
"or(and(not(a:bv<3>), b:bv<3>), and(not(b), a))",
6977
"xor(a:bv<3>, b:bv<3>)",
7078
);
71-
72-
// equality truth table (sum of products)
73-
// ts("or(and(a:bv<3>, b:bv<3>), and(not(b), not(a)))", "eq(a:bv<3>, b:bv<3>)");
7479
}
7580

7681
#[test]

0 commit comments

Comments
 (0)