From e928d370587e97e2a9988536a69fc5b649b6c5d9 Mon Sep 17 00:00:00 2001
From: Hans-Peter Deifel <hans-peter.deifel@fau.de>
Date: Sun, 26 Feb 2017 01:37:28 +0100
Subject: [PATCH] Improve 'verify' subcommand of main program

- Show a prompt before each input.
- Don't die if the verification of a formula fails. Show an error
  instead and accept the next input.
---
 src/coalg/coalg.ml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/coalg/coalg.ml b/src/coalg/coalg.ml
index 0d3beb4..1a1d445 100644
--- a/src/coalg/coalg.ml
+++ b/src/coalg/coalg.ml
@@ -195,6 +195,7 @@ let choiceGraph () =
 let choiceVerify () =
     try
       while true do
+        print_string "> ";
         let input = read_line () in
         if not (GenAndComp.isEmptyString input) then
           let f = CoAlgFormula.importFormula input in
@@ -202,7 +203,8 @@ let choiceVerify () =
           incr counter;
           print_string ("\nFormula " ^ (string_of_int !counter) ^ ": " ^ str ^ "\n");
           flush stdout;
-          CoAlgFormula.verifyFormula f;
+          try CoAlgFormula.verifyFormula f;
+          with CoAlgFormula.CoAlgException s -> print_string (s ^ "\n")
         else ()
       done
     with End_of_file -> ()
-- 
GitLab