Skip to content

Commit

Permalink
Merge pull request Deducteam#149 from Deducteam/api-get-rule
Browse files Browse the repository at this point in the history
Add a way to get a function definition
  • Loading branch information
francoisthire authored Feb 2, 2019
2 parents 2685d69 + 5d79740 commit 681d97d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/signature.ml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ let get_dtree sg rule_filter l cst =
try Dtree.of_rules rules'
with Dtree.DtreeError e -> raise (SignatureError (CannotBuildDtree e))

let get_rules sg lc cst =
match (get_infos sg lc cst).rule_opt_info with
| None -> []
| Some (rs,_) -> rs

(******************************************************************************)

Expand Down
3 changes: 3 additions & 0 deletions kernel/signature.mli
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ val get_dtree : t -> (Rule.rule_name -> bool) option -> loc -> name ->
with [cst] inside the environment [sg]. When filter is specified, it is used
to select only the corresponding set of rules *)

val get_rules : t -> loc -> name -> rule_infos list
(** [get_rules sg lc cst] returns a list of rules that defines the symbol. *)

val add_declaration : t -> loc -> ident -> staticity -> term -> unit
(** [add_declaration sg l id st ty] declares the symbol [id] of type [ty]
and staticity [st] in the environment [sg]. *)
Expand Down

0 comments on commit 681d97d

Please sign in to comment.