From: acondolu Date: Sat, 15 Jul 2017 14:41:53 +0000 (+0200) Subject: Code clean-up X-Git-Tag: weak-reduction-separation~26 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=b9e5cc50618b83f4069608c62be8c4a173c9446f;p=fireball-separation.git Code clean-up (cherry picked from commit 5d8249a042beefbe21bfeed48619ed1917ebbcb7) --- diff --git a/ocaml/problems.ml b/ocaml/problems.ml index 5f86177..9ff4778 100644 --- a/ocaml/problems.ml +++ b/ocaml/problems.ml @@ -17,25 +17,15 @@ open Util;; *) -let assert_separable x = - match solve x with - | `Separable _ -> () - | `Unseparable s -> - failwith ("assert_separable: unseparable because: " ^ s ^ ".") -;; - -let assert_unseparable x = - match solve x with - | `Unseparable _ -> () - | `Separable _ -> - failwith ("assert_unseparable: separable.") -;; - +(* assert_depends solves the problem, and checks if the result was expected *) let assert_depends x = - let c = String.sub (Lambda4.label_of_problem x) 0 1 in - if c = "!" then assert_separable x - else if c = "?" then assert_unseparable x - else (solve x; ()) + let c = String.sub (label_of_problem x) 0 1 in + match solve x with + | `Unseparable s when c = "!" -> + failwith ("assert_depends: unseparable because: " ^ s ^ ".") + | `Separable _ when c = "?" -> + failwith ("assert_depends: separable.") + | _ -> () ;; (* TODO *)