Skip to content

Commit

Permalink
Make opaque optional only for tclABSTRACT
Browse files Browse the repository at this point in the history
Also move named arguments to the beginning of the functions.  As per
coq#201 (comment)
  • Loading branch information
JasonGross authored and Matafou committed May 31, 2017
1 parent 3e5c177 commit 020d4fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tactics/tactics.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4907,7 +4907,7 @@ let shrink_entry sign const =
} in
(const, args)

let cache_term_by_tactic_then id gk ?(opaque=true) ?(goal_type=None) tac tacK =
let cache_term_by_tactic_then ~opaque ?(goal_type=None) id gk tac tacK =
let open Tacticals.New in
let open Tacmach.New in
let open Proofview.Notations in
Expand Down Expand Up @@ -4985,8 +4985,8 @@ let cache_term_by_tactic_then id gk ?(opaque=true) ?(goal_type=None) tac tacK =
Sigma.Unsafe.of_pair (tac, evd)
end }

let abstract_subproof id gk tac ?(opaque=true) =
cache_term_by_tactic_then id gk ~opaque:opaque tac (fun lem args -> exact_no_check (applist (lem, args)))
let abstract_subproof ~opaque id gk tac =
cache_term_by_tactic_then ~opaque:opaque id gk tac (fun lem args -> exact_no_check (applist (lem, args)))

let anon_id = Id.of_string "anonymous"

Expand All @@ -5008,7 +5008,7 @@ let tclABSTRACT ?(opaque=true) name_op tac =
let s, gk = if opaque
then name_op_to_name name_op (Proof Theorem) "_subproof"
else name_op_to_name name_op (DefinitionBody Definition) "_subterm" in
abstract_subproof s gk tac ~opaque:opaque
abstract_subproof ~opaque:opaque s gk tac

let unify ?(state=full_transparent_state) x y =
Proofview.Goal.s_enter { s_enter = begin fun gl ->
Expand Down
2 changes: 1 addition & 1 deletion tactics/tactics.mli
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ val generalize_dep : ?with_let:bool (** Don't lose let bindings *) -> constr -

val unify : ?state:Names.transparent_state -> constr -> constr -> unit Proofview.tactic

val cache_term_by_tactic_then : Id.t -> Decl_kinds.goal_kind -> ?opaque:bool -> ?goal_type:(constr option) -> unit Proofview.tactic -> (constr -> constr list -> unit Proofview.tactic) -> unit Proofview.tactic
val cache_term_by_tactic_then : opaque:bool -> ?goal_type:(constr option) -> Id.t -> Decl_kinds.goal_kind -> unit Proofview.tactic -> (constr -> constr list -> unit Proofview.tactic) -> unit Proofview.tactic

val tclABSTRACT : ?opaque:bool -> Id.t option -> unit Proofview.tactic -> unit Proofview.tactic

Expand Down

0 comments on commit 020d4fd

Please sign in to comment.