Skip to content

Commit

Permalink
Reset to clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevendeo committed Nov 24, 2023
1 parent c9be279 commit 4d7dc46
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/bin/common/solving_loop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ let enable_maxsmt b =
let cmd_on_modes st modes cmd =
if O.get_input_format () = Some Options.Smtlib2 then begin
let curr_mode = DO.Mode.get st in
if not (List.exists (Util.equal_mode curr_mode)) modes then
if not @@ (List.exists (Util.equal_mode curr_mode)) modes then
Errors.forbidden_command curr_mode cmd
end

Expand Down Expand Up @@ -884,9 +884,9 @@ let main () =
st
|> State.set partial_model_key None
|> State.set solver_ctx_key empty_solver_ctx
|> DO.Mode.reset
|> DO.Optimize.reset
|> DO.ProduceAssignment.reset
|> DO.Mode.clear
|> DO.Optimize.clear
|> DO.ProduceAssignment.clear
|> DO.init
|> State.set named_terms Util.MS.empty

Expand Down
8 changes: 4 additions & 4 deletions src/lib/frontend/d_state_option.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ module type S = sig
(** Sets the option on the dolmen state. *)
val set : t -> D_loop.Typer.state -> D_loop.Typer.state

(** Resets the option to its default value in Options. *)
val reset : D_loop.Typer.state -> D_loop.Typer.state
(** Clears the option from the state. *)
val clear : D_loop.Typer.state -> D_loop.Typer.state
end

let create_opt
Expand All @@ -68,7 +68,7 @@ let create_opt

let unsafe_get st = State.get key st

let reset st = State.update_opt key (fun _ -> None) st
let clear st = State.update_opt key (fun _ -> None) st

let get st =
try unsafe_get st with
Expand Down Expand Up @@ -133,6 +133,6 @@ let options_requiring_initialization = [

let init st =
List.fold_left
(fun st (module S : S) -> S.set (S.get (S.reset st)) st)
(fun st (module S : S) -> S.set (S.get (S.clear st)) st)
st
options_requiring_initialization
2 changes: 1 addition & 1 deletion src/lib/frontend/d_state_option.mli
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module type S = sig
val set : t -> D_loop.Typer.state -> D_loop.Typer.state

(** Resets the option to its default value in Options. *)
val reset : D_loop.Typer.state -> D_loop.Typer.state
val clear : D_loop.Typer.state -> D_loop.Typer.state
end

(** The current mode of the solver. *)
Expand Down

0 comments on commit 4d7dc46

Please sign in to comment.