Skip to content

Commit

Permalink
Script type alias
Browse files Browse the repository at this point in the history
  • Loading branch information
filipeom committed Jun 16, 2024
1 parent 5fc23a0 commit 43223d2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lib/ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ type t =
| Get_model
| Set_logic of Ty.logic

type script = t list

let pp fmt (instr : t) =
match instr with
| Assert e -> Format.fprintf fmt "(assert @[<h 2>%a@])" Expr.pp e
Expand Down
2 changes: 2 additions & 0 deletions lib/ast.mli
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ type t =
| Get_model
| Set_logic of Ty.logic

type script = t list

val pp : Format.formatter -> t -> unit

val to_string : t -> string
2 changes: 1 addition & 1 deletion lib/interpret.ml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module Make (Solver : Solver_intf.S) = struct
| [] -> state
| stmt :: stmts -> loop (eval stmt { state with stmts })

let start ?state (stmts : Ast.t list) : exec_state =
let start ?state (stmts : Ast.script) : exec_state =
let st =
match state with
| None -> init_state stmts
Expand Down
4 changes: 2 additions & 2 deletions lib/interpret_intf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
(***************************************************************************)

type 'a state =
{ stmts : Ast.t list
{ stmts : Ast.script
; smap : (string, Ty.t) Hashtbl.t
; pc : Expr.t list
; solver : 'a
Expand All @@ -28,7 +28,7 @@ module type S = sig

type exec_state

val start : ?state:exec_state -> Ast.t list -> exec_state
val start : ?state:exec_state -> Ast.script -> exec_state
end

module type Intf = sig
Expand Down
4 changes: 2 additions & 2 deletions lib/parse.mli
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
(* along with this program. If not, see <https://www.gnu.org/licenses/>. *)
(***************************************************************************)

val from_file : filename:string -> Ast.t list
val from_file : filename:string -> Ast.script

val from_string : string -> Ast.t list
val from_string : string -> Ast.script

0 comments on commit 43223d2

Please sign in to comment.