Attention une mise à jour du service Gitlab va être effectuée le mardi 14 décembre entre 13h30 et 14h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit 702e2659 authored by David Hauzar's avatar David Hauzar
Browse files

Printing counterexample arrays made compatible with json format.

parent 048d5150
...@@ -60,29 +60,31 @@ let array_add_element ~array ~index ~value = ...@@ -60,29 +60,31 @@ let array_add_element ~array ~index ~value =
arr_indices = arr_index::array.arr_indices; arr_indices = arr_index::array.arr_indices;
} }
let rec print_indices sanit_print fmt indices = let rec print_indices fmt indices =
match indices with match indices with
| [] -> () | [] -> ()
| index::tail -> | index::tail ->
fprintf fmt "; %a -> " (print_model_value_sanit sanit_print) index.arr_index_key; fprintf fmt "; %a -> " print_model_value index.arr_index_key;
print_model_value_sanit sanit_print fmt index.arr_index_value; print_model_value fmt index.arr_index_value;
print_indices sanit_print fmt tail print_indices fmt tail
and and
print_array sanit_print fmt arr = print_array fmt arr =
fprintf fmt "{others -> "; fprintf fmt "[others -> ";
print_model_value_sanit sanit_print fmt arr.arr_others; print_model_value fmt arr.arr_others;
print_indices sanit_print fmt arr.arr_indices; print_indices fmt arr.arr_indices;
fprintf fmt "}" fprintf fmt "]"
and and
print_model_value_sanit sanit_print fmt value = print_model_value_sanit sanit_print fmt value =
(* Prints model value. *) (* Prints model value. *)
match value with match value with
| Integer s -> sanit_print fmt s | Integer s -> sanit_print fmt s
| Unparsed s -> sanit_print fmt s | Unparsed s -> sanit_print fmt s
| Array a -> print_array sanit_print fmt a | Array a ->
print_array str_formatter a;
sanit_print fmt (flush_str_formatter ());
| Bitvector v -> sanit_print fmt (string_of_int v) | Bitvector v -> sanit_print fmt (string_of_int v)
and
let print_model_value fmt value = print_model_value fmt value =
print_model_value_sanit (fun fmt s -> fprintf fmt "%s" s) fmt value print_model_value_sanit (fun fmt s -> fprintf fmt "%s" s) fmt value
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment