Skip to content

Commit f7c5782

Browse files
committed
dune fmt
1 parent 8b47e4e commit f7c5782

File tree

6 files changed

+35
-18
lines changed

6 files changed

+35
-18
lines changed

core/KaSa_rep/frontend/cckappa_sig.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ type compil = {
204204
(*initial graph declaration*)
205205
perturbations:
206206
(mixture, rule) Ckappa_sig.perturbation Int_storage.Nearly_inf_Imperatif.t;
207-
guard_params: string list;(*rTODO make this a Int_storage not a list*)
207+
guard_params: string list; (*rTODO make this a Int_storage not a list*)
208208
}
209209

210210
(*******************************************************)

core/KaSa_rep/frontend/handler.ml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,11 @@ let info_of_rule parameters ?(with_rates = false) ?(original = false) error
243243
| false, false -> rule.Cckappa_sig.e_rule_rule.Ckappa_sig.ast_no_rate
244244
in
245245
let guard_params = compiled.Cckappa_sig.guard_params in
246-
let guard = Option.map (LKappa_compiler.guard_param_to_string guard_params) rule.Cckappa_sig.e_rule_c_rule.Cckappa_sig.guard in
246+
let guard =
247+
Option.map
248+
(LKappa_compiler.guard_param_to_string guard_params)
249+
rule.Cckappa_sig.e_rule_c_rule.Cckappa_sig.guard
250+
in
247251
error, (label, position, direction, ast, guard, rule_id)
248252

249253
let hide rule = { rule with Public_data.rule_hidden = true }
@@ -326,10 +330,12 @@ let string_of_info ?(with_rule = true) ?(with_rule_name = true)
326330
let guard =
327331
match guard with
328332
| None -> ""
329-
| Some guard -> "#[" ^ LKappa.string_of_guard guard ^ "]" in
333+
| Some guard -> "#[" ^ LKappa.string_of_guard guard ^ "]"
334+
in
330335
let s =
331336
match label, pos, ast, id with
332-
| "", "", "", s | "", "", s, _ | "", s, "", _ | s, "", _, _ -> prefix ^ guard ^ s
337+
| "", "", "", s | "", "", s, _ | "", s, "", _ | s, "", _, _ ->
338+
prefix ^ guard ^ s
333339
| "", s2, s1, _ | s1, s2, _, _ -> prefix ^ guard ^ s1 ^ " (" ^ s2 ^ ")"
334340
in
335341
s

core/KaSa_rep/frontend/preprocess.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2329,7 +2329,7 @@ let translate_c_compil parameters error handler compil =
23292329
Cckappa_sig.observables = c_observables;
23302330
Cckappa_sig.init = c_inits;
23312331
Cckappa_sig.perturbations = c_perturbations;
2332-
Cckappa_sig.guard_params = guard_params;
2332+
Cckappa_sig.guard_params;
23332333
} )
23342334

23352335
let declare_agent parameters error ag sol =

core/KaSa_rep/remanent_state/remanent_state.mli

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ type var_id = int
3333
type dead_agents = Public_data.agent_kind list
3434

3535
val info_to_rule :
36-
string * Loc.t * Public_data.rule_direction * string * string LKappa.guard option * Ckappa_sig.c_rule_id ->
36+
string
37+
* Loc.t
38+
* Public_data.rule_direction
39+
* string
40+
* string LKappa.guard option
41+
* Ckappa_sig.c_rule_id ->
3742
Public_data.rule
3843

3944
val info_to_agent :

core/grammar/lKappa_compiler.ml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,19 +2538,25 @@ let rec guard_param_conversion convert guard_params g =
25382538
| Param p -> Param (convert p guard_params)
25392539
| Not g1 -> Not (guard_param_conversion convert guard_params g1)
25402540
| And (g1, g2) ->
2541-
And (guard_param_conversion convert guard_params g1, guard_param_conversion convert guard_params g2)
2541+
And
2542+
( guard_param_conversion convert guard_params g1,
2543+
guard_param_conversion convert guard_params g2 )
25422544
| Or (g1, g2) ->
2543-
Or (guard_param_conversion convert guard_params g1 , guard_param_conversion convert guard_params g2)
2544-
2545-
let guard_param_to_int = guard_param_conversion (fun p guard_params -> match List.find_index (fun x -> String.equal p x) guard_params with
2546-
| Some i -> i
2547-
| None ->
2548-
raise
2549-
(ExceptionDefn.Malformed_Decl ("Unknown guard parameter", Loc.dummy)))
2545+
Or
2546+
( guard_param_conversion convert guard_params g1,
2547+
guard_param_conversion convert guard_params g2 )
2548+
2549+
let guard_param_to_int =
2550+
guard_param_conversion (fun p guard_params ->
2551+
match List.find_index (fun x -> String.equal p x) guard_params with
2552+
| Some i -> i
2553+
| None ->
2554+
raise
2555+
(ExceptionDefn.Malformed_Decl ("Unknown guard parameter", Loc.dummy)))
25502556

2551-
let guard_param_to_string = guard_param_conversion (fun p guard_params ->
2552-
List.nth guard_params p (*rTODO error handling*)
2553-
)
2557+
let guard_param_to_string =
2558+
guard_param_conversion (fun p guard_params ->
2559+
List.nth guard_params p (*rTODO error handling*))
25542560

25552561
let guard_params_to_int_option guard_params g =
25562562
Option.map (guard_param_to_int guard_params) g

core/term/lKappa.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ let rec string_of_guard g =
516516
| Param i -> i
517517
| And (a, b) -> string_of_guard a ^ " && " ^ string_of_guard b
518518
| Or (a, b) -> string_of_guard a ^ " || " ^ string_of_guard b
519-
| Not a -> "[not] " ^ string_of_guard a
519+
| Not a -> "[not] " ^ string_of_guard a
520520

521521
let rec print_guard f g =
522522
match g with

0 commit comments

Comments
 (0)