Commit f9efdaec authored by Bruno Guillaume's avatar Bruno Guillaume

Separe Onf // Iter(Pick)

parent a444e011
......@@ -444,6 +444,7 @@ module New_ast = struct
| Alt of strat list (* a set of strategies to apply in parallel *)
| Seq of strat list (* a sequence of strategies to apply one after the other *)
| Iter of strat (* a strategy to apply iteratively *)
| Onf of strat (* deterministic computation of One Normal Form *)
| If of strat * strat * strat (* choose a stragegy with a test *)
| Try of strat (* ≜ If (S, S, Empty): pick one normal form a the given strategy; return input if nf *)
......@@ -461,6 +462,7 @@ module New_ast = struct
let rec strat_to_json = function
| Ref name -> `Assoc [("Ref", `String name)]
| Pick s -> `Assoc [("Pick", strat_to_json s)]
| Onf s -> `Assoc [("Onf", strat_to_json s)]
| Alt l -> `Assoc [("Alt", `List (List.map strat_to_json l))]
| Seq l -> `Assoc [("Seq", `List (List.map strat_to_json l))]
| Iter s -> `Assoc [("Iter", strat_to_json s)]
......
......@@ -250,6 +250,7 @@ module New_ast : sig
| Alt of strat list (* a set of strategies to apply in parallel *)
| Seq of strat list (* a sequence of strategies to apply one after the other *)
| Iter of strat (* a strategy to apply iteratively *)
| Onf of strat (* deterministic computation of One Normal Form *)
| If of strat * strat * strat (* choose a stragegy with a test *)
| Try of strat (* ≜ If (S, S, Empty): pick one normal form a the given strategy; return input if nf *)
......
......@@ -1011,6 +1011,8 @@ module Graph_with_history = struct
graph: G_graph.t;
}
let from_graph graph = { graph; seed=graph; delta = Delta.empty }
(* WARNING: compare is correct only on data with the same seed! *)
let compare t1 t2 = Pervasives.compare t1.delta t2.delta
end
......
......@@ -221,6 +221,8 @@ module Graph_with_history : sig
graph: G_graph.t;
}
val from_graph: G_graph.t -> t
val compare: t -> t -> int
end
......
This diff is collapsed.
......@@ -127,4 +127,7 @@ module Grs : sig
val get_strat_list: t -> string list
val at_least_one: t -> string -> bool
val at_most_one: t -> string -> bool
val gwh_simple_rewrite: t -> string -> G_graph.t -> G_graph.t list
end
......@@ -742,7 +742,7 @@ strat_desc:
| ITER LPAREN s=strat_desc RPAREN { New_ast.Iter s }
| IF LPAREN s1=strat_desc COMA s2=strat_desc COMA s3=strat_desc RPAREN { New_ast.If (s1,s2,s3) }
| TRY LPAREN s=strat_desc RPAREN { New_ast.Try s }
| ONF LPAREN s=strat_desc RPAREN { New_ast.Pick (New_ast.Iter s) }
| ONF LPAREN s=strat_desc RPAREN { New_ast.Onf s }
| EMPTY { New_ast.Seq [] }
strat_alone:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment