open Boolean

let rec print_expr c = function
  | EFalse -> Printf.fprintf c "false"
  | ETrue -> Printf.fprintf c "true"
  | EVar x -> Printf.fprintf c "%s" x
  | EAnd(e1, e2) -> Printf.fprintf c "(%a) & (%a)" print_expr e1 print_expr e2
  | EOr(e1, e2) -> Printf.fprintf c "(%a) | (%a)" print_expr e1 print_expr e2
  | ENot(e) -> Printf.fprintf c "!(%a)" print_expr e
  | EForall(x, e) -> Printf.fprintf c "forall %s . (%a)" x print_expr e
  | EExists(x, e) -> Printf.fprintf c "exists %s . (%a)" x print_expr e

let rec print_bvec_body c = function
  | [] -> Printf.fprintf c ""
  | [e] -> Printf.fprintf c "%a" print_expr e
  | h::t -> Printf.fprintf c "%a, %a" print_expr h print_bvec_body t

let print_bvec c (bv:bvec) = Printf.fprintf c "[%a]" print_bvec_body bv

(* print to standard out by calling:

   print_expr stdout expr

   or

  print_bvec stdout bvec
*)
