Skip to content

Commit

Permalink
Improve Format-ting of logic values
Browse files Browse the repository at this point in the history
Signed-off-by: Kakadu <[email protected]>
  • Loading branch information
Kakadu committed Aug 25, 2024
1 parent 05c20d1 commit 5b349b5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/Logic.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ let logic = {logic with
method compare = logic.plugins#compare
method foldl = logic.plugins#foldl
method foldr = logic.plugins#foldr
method fmt fa fmt l = Format.fprintf fmt "%s" (self#show (Format.asprintf "%a" fa) l)
method fmt fa =
let rec self ppf = function
| Value a -> fa ppf a
| Var (n, []) -> Format.fprintf ppf "_.%d" n
| Var (n, cs) -> Format.fprintf ppf "_.%d =/= [ %a ]" n (Format.pp_print_list self) cs
in
self

method show fa x =
GT.transform(logic)
(fun fself -> object
Expand Down

0 comments on commit 5b349b5

Please sign in to comment.