(* AST for Modal trees and rules *) type node = | Atom of string | List of node list type rule = { left : node; right : node } let atom s = Atom s let list xs = List xs let rec pp fmt = function | Atom s -> Format.fprintf fmt "%s" s | List xs -> Format.fprintf fmt "("; List.iteri (fun i n -> if i > 0 then Format.fprintf fmt " "; pp fmt n) xs; Format.fprintf fmt ")"