Commit c340a012 authored by Andrei Paskevich's avatar Andrei Paskevich

register_meta returns the meta name (i.e. its first argument).

This allows to have one line less in transformations.
parent 0ad4d18e
......@@ -136,18 +136,13 @@ let add_ls_syntax ls s sm =
let query_syntax sm id =
try Some (Mid.find id sm) with Not_found -> None
let meta_remove_type = "remove_type"
let meta_remove_logic = "remove_logic"
let meta_remove_prop = "remove_prop"
let meta_remove_type = register_meta "remove_type" [MTtysymbol]
let meta_remove_logic = register_meta "remove_logic" [MTlsymbol]
let meta_remove_prop = register_meta "remove_prop" [MTprsymbol]
let () =
register_meta meta_remove_type [MTtysymbol];
register_meta meta_remove_logic [MTlsymbol];
register_meta meta_remove_prop [MTprsymbol]
let remove_type ts = create_meta meta_remove_type [MAts ts]
let remove_type ts = create_meta meta_remove_type [MAts ts]
let remove_logic ls = create_meta meta_remove_logic [MAls ls]
let remove_prop pr = create_meta meta_remove_prop [MApr pr]
let remove_prop pr = create_meta meta_remove_prop [MApr pr]
let get_remove_set task =
let add td s = match td.td_node with
......
......@@ -110,12 +110,15 @@ let meta_table = Hashtbl.create 17
let meta_exc = Hashtbl.create 17
let register_meta s al =
try let al' = Hashtbl.find meta_table s in
if al <> al' then raise (KnownMeta s)
with Not_found -> Hashtbl.add meta_table s al
begin try
let al' = Hashtbl.find meta_table s in
if al <> al' then raise (KnownMeta s)
with Not_found -> Hashtbl.add meta_table s al end;
s
let register_meta_exc s al =
register_meta s al; Hashtbl.add meta_exc s ()
Hashtbl.add meta_exc s ();
register_meta s al
let lookup_meta s =
try Hashtbl.find meta_table s
......
......@@ -59,8 +59,8 @@ type meta_arg_real =
| MARstr of string
| MARint of int
val register_meta : string -> meta_arg_type list -> unit
val register_meta_exc : string -> meta_arg_type list -> unit
val register_meta : string -> meta_arg_type list -> string
val register_meta_exc : string -> meta_arg_type list -> string
val lookup_meta : string -> meta_arg_type list
val is_meta_exc : string -> bool
......
......@@ -26,9 +26,7 @@ open Decl
open Task
open Printer
let meta_ac = "AC"
let () = Theory.register_meta meta_ac [Theory.MTlsymbol]
let meta_ac = Theory.register_meta "AC" [Theory.MTlsymbol]
let ident_printer =
let bls = [
......
......@@ -28,9 +28,7 @@ open Decl
let why_filename = ["transform" ; "encoding_decorate"]
let meta_kept = "encoding_decorate : kept"
let () = Theory.register_meta meta_kept [Theory.MTtysymbol]
let meta_kept = register_meta "encoding_decorate : kept" [MTtysymbol]
(* From Encoding Polymorphism CADE07*)
......
......@@ -31,9 +31,7 @@ open Decl
let why_filename = ["transform" ; "encoding_decorate"]
let meta_kept = "encoding_decorate : kept"
let () = Theory.register_meta meta_kept [Theory.MTtysymbol]
let meta_kept = register_meta "encoding_decorate : kept" [MTtysymbol]
(* From Encoding Polymorphism CADE07*)
type tenv = {rem_ls : Sid.t;
......
......@@ -563,8 +563,7 @@ let hypothesis_selection = (* create lots of hashtables... *)
let symbTbl = SymbHashtbl.create 17 in
Trans.store (transformation fmlaTable fTbl tTbl symbTbl)
let _ = Trans.register_transform
"hypothesis_selection" (fun _ -> hypothesis_selection)
let _ = Trans.register_transform "hypothesis_selection" hypothesis_selection
(*
Local Variables:
......
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