Skip to content

Commit b9846cf

Browse files
hra687261filipeom
authored andcommitted
Fix the order of formulas printed by the z3 mapping printer
1 parent 7e1e145 commit b9846cf

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/smtml/z3_mappings.default.ml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ module M = struct
588588
end
589589

590590
module Smtlib = struct
591-
let pp ?name ?logic ?status fmt =
591+
let pp ?name ?logic ?status fmt l =
592592
let name = Option.value name ~default:"" in
593593
let logic =
594594
Fmt.str "%a"
@@ -601,14 +601,17 @@ module M = struct
601601
| `Unsat -> "unsat"
602602
| `Unknown -> "unknown"
603603
in
604-
function
604+
match l with
605605
| [] -> ()
606606
| [ x ] ->
607607
Fmt.pf fmt "%s"
608608
(Z3.SMT.benchmark_to_smtstring ctx name logic status "" [] x)
609-
| hd :: tl ->
610-
(* Prints formulas in correct order? *)
611-
let tl = List.rev tl in
609+
| _ :: _ ->
610+
let hd, tl =
611+
match List.rev l with
612+
| hd :: tl -> (hd, List.rev tl)
613+
| _ -> assert false
614+
in
612615
Fmt.pf fmt "%s"
613616
(Z3.SMT.benchmark_to_smtstring ctx name logic status "" tl hd)
614617
end

0 commit comments

Comments
 (0)