aboutsummaryrefslogtreecommitdiff
path: root/motus/js/reload.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2022-02-11 09:22:18 +0100
committerSébastien Dailly <sebastien@dailly.me>2022-02-11 09:28:26 +0100
commit82bb54622a47bb092094c8efab8200b12817c5b4 (patch)
treef160d66a09d2bf0e8f2bdbef5dbec17126ecd4a1 /motus/js/reload.ml
parentd20d14b4f4a903ef9aea4c01dd46fab5ecbab6ae (diff)
Hide structure in motus solver
Diffstat (limited to 'motus/js/reload.ml')
-rw-r--r--motus/js/reload.ml16
1 files changed, 9 insertions, 7 deletions
diff --git a/motus/js/reload.ml b/motus/js/reload.ml
index 3a461ee..cfdfa2a 100644
--- a/motus/js/reload.ml
+++ b/motus/js/reload.ml
@@ -1,3 +1,5 @@
+(** Reload the list without the current proposition *)
+
open StdLabels
type t = unit
@@ -15,15 +17,15 @@ let process : t -> State.state -> State.state =
|> String.of_seq
in
- let element =
- List.filter
- ~f:(fun w -> not (String.equal w word))
- state.State.analysis.element
+ let new_state =
+ { state with
+ analysis = Motus_lib.Persistence.remove_word state.analysis word
+ }
in
- let analysis = { state.analysis with element } in
- let new_state = { state with analysis } in
(* Get the new proposition if any *)
- let current_prop = Initialize.get_proposition analysis state.rules in
+ let current_prop =
+ Initialize.get_proposition new_state.analysis state.rules
+ in
match current_prop with
| None -> new_state
| Some prop ->