diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-07-12 09:59:59 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-07-12 17:56:10 -0300 |
| commit | e92c8e00290bab8db328058c437b471c0f1671a4 (patch) | |
| tree | f4ff85923298f70b7e66c3ec8e9e780bab784d7b /test/test_vm.ml | |
| parent | c3b4c7aee1f0d4beb078938d330e982e752927a1 (diff) | |
| download | SOL-e92c8e00290bab8db328058c437b471c0f1671a4.tar.gz SOL-e92c8e00290bab8db328058c437b471c0f1671a4.zip | |
algebraic identities of plus and times discharge symbolically
Diffstat (limited to 'test/test_vm.ml')
| -rw-r--r-- | test/test_vm.ml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_vm.ml b/test/test_vm.ml index 16ca63c..4729841 100644 --- a/test/test_vm.ml +++ b/test/test_vm.ml @@ -292,6 +292,20 @@ let test_symbolic_interval_entailment () = (holds {| Query expression: [ForAll variable: X quantifier: ([Natural value: X] :and [GreaterEqual left: X right: 10]) body: [GreaterThan left: X right: 5]] |}) +let test_symbolic_algebraic_identity () = + (* The specification's flagship symbolic example, in the flat + membership form of decision 14. *) + Alcotest.(check bool) "adding zero is the identity, over all integers" true + (holds + {| Query expression: [ForAll variable: X quantifier: [Integer value: X] body: [Plus left: X right: 0 result: X]] |}); + Alcotest.(check bool) "multiplying by one is the identity, over all rationals" + true + (holds + {| Query expression: [ForAll variable: X quantifier: [Rational value: X] body: [Times left: 1 right: X result: X]] |}); + Alcotest.(check bool) "strings do not add" false + (holds + {| Query expression: [ForAll variable: X quantifier: [String value: X] body: [Plus left: X right: 0 result: X]] |}) + let test_forall_outside_fragment_still_rejected () = match load @@ -489,6 +503,8 @@ let () = Alcotest.test_case "inclusion" `Quick test_symbolic_inclusion; Alcotest.test_case "interval entailment" `Quick test_symbolic_interval_entailment; + Alcotest.test_case "algebraic identity" `Quick + test_symbolic_algebraic_identity; Alcotest.test_case "outside fragment still rejected" `Quick test_forall_outside_fragment_still_rejected; ] ); |
