-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Preprocessing] Generalise negation normalisation + tests
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
(* Tests for negation normalisation. | ||
* | ||
* Author: Tomas Dacik (idacik@fit.vut.cz), 2025 *) | ||
|
||
module SL = SL_testable | ||
open SL | ||
|
||
let check_apply = SL.check_apply NegationNormalisation.apply | ||
|
||
let test1 () = | ||
let lhs = SL.mk_pto x x in | ||
let rhs = SL.mk_pto y y in | ||
let input = SL.mk_and [lhs; SL.mk_not rhs] in | ||
let expected = SL.mk_gneg lhs rhs in | ||
check_apply ~input ~expected | ||
|
||
let test2 () = | ||
let psi1 = SL.mk_pto x x in | ||
let psi2 = SL.mk_pto y y in | ||
let psi3 = SL.mk_pto z z in | ||
let input = SL.mk_and [psi1; psi2; SL.mk_not psi3] in | ||
let expected = SL.mk_gneg (SL.mk_and [psi1; psi2]) psi3 in | ||
check_apply ~input ~expected | ||
|
||
let () = | ||
run "Negation normalisation" [ | ||
"apply", [ | ||
test_case "Binary" `Quick test1; | ||
test_case "N-anary" `Quick test2; | ||
]; | ||
] |