From f4cbb370c64b5ed187fa10abaed39319d5f0d28c Mon Sep 17 00:00:00 2001 From: Paul Steckler Date: Tue, 17 May 2016 12:16:15 -0400 Subject: alternate path separators in typeclass debug output (4736) --- tactics/class_tactics.ml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 4855598989..311ae19719 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -275,7 +275,16 @@ let catchable = function let pr_ev evs ev = Printer.pr_constr_env (Goal.V82.env evs ev) evs (Evarutil.nf_evar evs (Goal.V82.concl evs ev)) -let pr_depth l = prlist_with_sep (fun () -> str ".") int (List.rev l) +(* alternate separators in debug search path output *) +let debug_seps = [| "." ; "-" |] +let next_sep seps = + let num_seps = Array.length seps in + let sep_index = ref 0 in + fun () -> + let sep = seps.(!sep_index) in + sep_index := (!sep_index + 1) mod num_seps; + str sep +let pr_depth l = prlist_with_sep (next_sep debug_seps) int (List.rev l) type autoinfo = { hints : hint_db; is_evar: existential_key option; only_classes: bool; unique : bool; -- cgit v1.2.3 From 379c2403b1cd031091a2271353f26ab24afeb1e5 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sat, 22 Oct 2016 10:17:39 +0200 Subject: Port fix for bugs 4763, 5149, previously 0b417c12e Adds a compatibility flag so that the behavior of 8.5 can be obtained too. Original commit: unification.ml: fix for bug #4763, unif regression Do not force all remaining conversions problems to be solved after the _first_ solution of an evar. This was hell to track down, thanks for the help of Maxime. contribs pass and HoTT too. --- pretyping/unification.ml | 6 +++++- test-suite/bugs/closed/4763.v | 13 +++++++++++++ test-suite/bugs/closed/HoTT_coq_117.v | 21 ++++++++++++++++++++- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 test-suite/bugs/closed/4763.v diff --git a/pretyping/unification.ml b/pretyping/unification.ml index e0a81cfbb9..cec9f700af 100644 --- a/pretyping/unification.ml +++ b/pretyping/unification.ml @@ -1270,7 +1270,11 @@ let solve_simple_evar_eqn ts env evd ev rhs = | UnifFailure (evd,reason) -> error_cannot_unify env evd ~reason (mkEvar ev,rhs); | Success evd -> - Evarconv.consider_remaining_unif_problems env evd + if Flags.version_less_or_equal Flags.V8_5 then + (* We used to force solving unrelated problems at arbitrary times *) + Evarconv.consider_remaining_unif_problems env evd + else (* solve_simple_eqn calls reconsider_conv_pbs itself *) + evd (* [w_merge env sigma b metas evars] merges common instances in metas or in evars, possibly generating new unification problems; if [b] diff --git a/test-suite/bugs/closed/4763.v b/test-suite/bugs/closed/4763.v new file mode 100644 index 0000000000..ae8ed0e6e8 --- /dev/null +++ b/test-suite/bugs/closed/4763.v @@ -0,0 +1,13 @@ +Require Import Coq.Arith.Arith Coq.Classes.Morphisms Coq.Classes.RelationClasses. +Coercion is_true : bool >-> Sortclass. +Global Instance: Transitive leb. +Admitted. + +Goal forall x y z, leb x y -> leb y z -> True. + intros ??? H H'. + lazymatch goal with + | [ H : is_true (?R ?x ?y), H' : is_true (?R ?y ?z) |- _ ] + => pose proof (transitivity H H' : is_true (R x z)) + end. + exact I. +Qed. \ No newline at end of file diff --git a/test-suite/bugs/closed/HoTT_coq_117.v b/test-suite/bugs/closed/HoTT_coq_117.v index 5fbcfef4e0..de60fd0ae4 100644 --- a/test-suite/bugs/closed/HoTT_coq_117.v +++ b/test-suite/bugs/closed/HoTT_coq_117.v @@ -16,10 +16,29 @@ Definition path_forall `{Funext} {A : Type} {P : A -> Type} (f g : forall x : A, Admitted. Inductive Empty : Set := . -Instance contr_from_Empty {_ : Funext} (A : Type) : +Fail Instance contr_from_Empty {_ : Funext} (A : Type) : + Contr_internal (Empty -> A) := + BuildContr _ + (Empty_rect (fun _ => A)) + (fun f => path_forall _ f (fun x => Empty_rect _ x)). + +Fail Instance contr_from_Empty {F : Funext} (A : Type) : Contr_internal (Empty -> A) := BuildContr _ (Empty_rect (fun _ => A)) (fun f => path_forall _ f (fun x => Empty_rect _ x)). + +(** This could be disallowed, this uses the Funext argument *) +Instance contr_from_Empty {_ : Funext} (A : Type) : + Contr_internal (Empty -> A) := + BuildContr _ + (Empty_rect (fun _ => A)) + (fun f => path_forall _ f (fun x => Empty_rect (fun _ => _ x = f x) x)). + +Instance contr_from_Empty' {_ : Funext} (A : Type) : + Contr_internal (Empty -> A) := + BuildContr _ + (Empty_rect (fun _ => A)) + (fun f => path_forall _ f (fun x => Empty_rect (fun _ => _ x = f x) x)). (* Toplevel input, characters 15-220: Anomaly: unknown meta ?190. Please report. *) -- cgit v1.2.3 From ccb173a440fa2eb7105a692c979253edbfe475ee Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Wed, 19 Oct 2016 13:33:28 +0200 Subject: Unification constraint handling (#4763, #5149) Refine fix for bug #4763, fixing #5149 Tactic [Refine.solve_constraints] and global option Adds a new multi-goal tactic [Refine.solve_constraints] that forces solving of unification constraints and evar candidates to be solved. run_tactic now calls [solve_constraints] at every [.], preserving (mostly) the 8.4/8.5 behavior of tactics. The option allows to unset the forced solving unification constraints at each ".", letting the user control the places where the use of heuristics is done. Fix test-suite files too. --- engine/proofview.ml | 4 ---- engine/proofview.mli | 1 - ltac/extratactics.ml4 | 5 ++++ pretyping/unification.ml | 19 ++++----------- proofs/pfedit.ml | 16 +++++++++++++ proofs/refine.ml | 11 +++++++++ proofs/refine.mli | 5 ++++ test-suite/bugs/closed/2310.v | 6 ++++- test-suite/bugs/closed/3647.v | 3 ++- test-suite/bugs/closed/4416.v | 1 + test-suite/bugs/closed/5149.v | 47 +++++++++++++++++++++++++++++++++++++ test-suite/output/unifconstraints.v | 1 + 12 files changed, 98 insertions(+), 21 deletions(-) create mode 100644 test-suite/bugs/closed/5149.v diff --git a/engine/proofview.ml b/engine/proofview.ml index 855235d2b0..c01879765b 100644 --- a/engine/proofview.ml +++ b/engine/proofview.ml @@ -1157,10 +1157,6 @@ let tclLIFT = Proof.lift let tclCHECKINTERRUPT = tclLIFT (NonLogical.make Control.check_for_interrupt) - - - - (*** Compatibility layer with <= 8.2 tactics ***) module V82 = struct type tac = Evar.t Evd.sigma -> Evar.t list Evd.sigma diff --git a/engine/proofview.mli b/engine/proofview.mli index 725445251d..90be2f90ab 100644 --- a/engine/proofview.mli +++ b/engine/proofview.mli @@ -373,7 +373,6 @@ val mark_as_unsafe : unit tactic with given up goals cannot be closed. *) val give_up : unit tactic - (** {7 Control primitives} *) (** [tclPROGRESS t] checks the state of the proof after [t]. It it is diff --git a/ltac/extratactics.ml4 b/ltac/extratactics.ml4 index d0318fb5f6..e6498e02b2 100644 --- a/ltac/extratactics.ml4 +++ b/ltac/extratactics.ml4 @@ -370,6 +370,11 @@ TACTIC EXTEND simple_refine | [ "simple" "refine" uconstr(c) ] -> [ refine_tac ist true c ] END +(* Solve unification constraints using heuristics or fail if any remain *) +TACTIC EXTEND solve_constraints +[ "solve_constraints" ] -> [ Refine.solve_constraints ] +END + (**********************************************************************) (* Inversion lemmas (Leminv) *) diff --git a/pretyping/unification.ml b/pretyping/unification.ml index cec9f700af..fc63015a8e 100644 --- a/pretyping/unification.ml +++ b/pretyping/unification.ml @@ -1301,7 +1301,6 @@ let w_merge env with_types flags (evd,metas,evars) = if is_mimick_head flags.modulo_delta f then let evd' = mimick_undefined_evar evd flags f (Array.length cl) evk in - (* let evd' = Evarconv.consider_remaining_unif_problems env evd' in *) w_merge_rec evd' metas evars eqns else let evd' = @@ -1397,8 +1396,7 @@ let w_merge env with_types flags (evd,metas,evars) = (* Assign evars in the order of assignments during unification *) (List.rev evars) [] in - if with_types then check_types res - else res + if with_types then check_types res else res let w_unify_meta_types env ?(flags=default_unify_flags ()) evd = let metas,evd = retract_coercible_metas evd in @@ -1456,7 +1454,7 @@ let w_typed_unify_array env evd flags f1 l1 f2 l2 = let subst = Array.fold_left2 fold_subst subst l1 l2 in let evd = w_merge env true flags.merge_unify_flags subst in try_resolve_typeclasses env evd flags.resolve_evars - (mkApp(f1,l1)) (mkApp(f2,l2)) + (mkApp(f1,l1)) (mkApp(f2,l2)) (* takes a substitution s, an open term op and a closed term cl try to find a subterm of cl which matches op, if op is just a Meta @@ -1885,21 +1883,14 @@ let secondOrderAbstraction env evd flags typ (p, oplist) = error_wrong_abstraction_type env evd' (Evd.meta_name evd p) pred typp predtyp; w_merge env false flags.merge_unify_flags - (evd',[p,pred,(Conv,TypeProcessed)],[]) - - (* let evd',metas,evars = *) - (* try unify_0 env evd' CUMUL flags predtyp typp *) - (* with NotConvertible -> *) - (* error_wrong_abstraction_type env evd *) - (* (Evd.meta_name evd p) pred typp predtyp *) - (* in *) - (* w_merge env false flags (evd',(p,pred,(Conv,TypeProcessed))::metas,evars) *) + (evd',[p,pred,(Conv,TypeProcessed)],[]) let secondOrderDependentAbstraction env evd flags typ (p, oplist) = let typp = Typing.meta_type evd p in let evd, pred = abstract_list_all_with_dependencies env evd typp typ oplist in w_merge env false flags.merge_unify_flags - (evd,[p,pred,(Conv,TypeProcessed)],[]) + (evd,[p,pred,(Conv,TypeProcessed)],[]) + let secondOrderAbstractionAlgo dep = if dep then secondOrderDependentAbstraction else secondOrderAbstraction diff --git a/proofs/pfedit.ml b/proofs/pfedit.ml index a3ece19134..9c71e107cc 100644 --- a/proofs/pfedit.ml +++ b/proofs/pfedit.ml @@ -13,6 +13,17 @@ open Entries open Environ open Evd +let use_unification_heuristics_ref = ref true +let _ = Goptions.declare_bool_option { + Goptions.optsync = true; Goptions.optdepr = false; + Goptions.optname = "Unification heuristics are applied at every ."; + Goptions.optkey = ["Use";"Unification";"Heuristics"]; + Goptions.optread = (fun () -> !use_unification_heuristics_ref); + Goptions.optwrite = (fun a -> use_unification_heuristics_ref:=a); +} + +let use_unification_heuristics () = !use_unification_heuristics_ref + let refining = Proof_global.there_are_pending_proofs let check_no_pending_proofs = Proof_global.check_no_pending_proof @@ -119,6 +130,11 @@ let solve ?with_end_tac gi info_lvl tac pr = | Vernacexpr.SelectId id -> Proofview.tclFOCUSID id tac | Vernacexpr.SelectAll -> tac in + let tac = + if use_unification_heuristics () then + Proofview.tclTHEN tac Refine.solve_constraints + else tac + in let (p,(status,info)) = Proof.run_tactic (Global.env ()) tac pr in let () = match info_lvl with diff --git a/proofs/refine.ml b/proofs/refine.ml index e5114a2eca..2f21428900 100644 --- a/proofs/refine.ml +++ b/proofs/refine.ml @@ -149,3 +149,14 @@ let refine_casted ?unsafe f = Proofview.Goal.enter { enter = begin fun gl -> } in refine ?unsafe f end } + +(** {7 solve_constraints} + + Ensure no remaining unification problems are left. Run at every "." by default. *) + +let solve_constraints = + let open Proofview in + tclENV >>= fun env -> tclEVARMAP >>= fun sigma -> + try let sigma = Evarconv.consider_remaining_unif_problems env sigma in + Unsafe.tclEVARSADVANCE sigma + with e -> tclZERO e diff --git a/proofs/refine.mli b/proofs/refine.mli index 3d140f036b..a44632eff5 100644 --- a/proofs/refine.mli +++ b/proofs/refine.mli @@ -43,3 +43,8 @@ val with_type : Environ.env -> Evd.evar_map -> val refine_casted : ?unsafe:bool -> Constr.t Sigma.run -> unit tactic (** Like {!refine} except the refined term is coerced to the conclusion of the current goal. *) + +(** {7 Unification constraint handling} *) + +val solve_constraints : unit tactic +(** Solve any remaining unification problems, applying heuristics. *) diff --git a/test-suite/bugs/closed/2310.v b/test-suite/bugs/closed/2310.v index 0be859eddf..9fddede7e9 100644 --- a/test-suite/bugs/closed/2310.v +++ b/test-suite/bugs/closed/2310.v @@ -14,4 +14,8 @@ Definition replace a (y:Nest (prod a a)) : a = a -> Nest a. (P:=\a.Nest (prod a a) and P:=\_.Nest (prod a a)) and refine should either leave P as subgoal or choose itself one solution *) -intros. refine (Cons (cast H _ y)). \ No newline at end of file + intros. Fail refine (Cons (cast H _ y)). + Unset Use Unification Heuristics. (* Keep the unification constraint around *) + refine (Cons (cast H _ y)). + intros. + refine (Nest (prod X X)). Qed. \ No newline at end of file diff --git a/test-suite/bugs/closed/3647.v b/test-suite/bugs/closed/3647.v index 495e67e09e..f2cd41203c 100644 --- a/test-suite/bugs/closed/3647.v +++ b/test-suite/bugs/closed/3647.v @@ -650,4 +650,5 @@ Goal forall (ptest : program) (cond : Condition) (value : bool) Grab Existential Variables. subst_body; simpl. - refine (all_behead (projT2 _)). + Fail refine (all_behead (projT2 _)). + Unset Use Unification Heuristics. refine (all_behead (projT2 _)). diff --git a/test-suite/bugs/closed/4416.v b/test-suite/bugs/closed/4416.v index b97a8ce640..afe8c62ed0 100644 --- a/test-suite/bugs/closed/4416.v +++ b/test-suite/bugs/closed/4416.v @@ -1,3 +1,4 @@ Goal exists x, x. +Unset Use Unification Heuristics. unshelve refine (ex_intro _ _ _); match goal with _ => refine (_ _) end. (* Error: Incorrect number of goals (expected 2 tactics). *) \ No newline at end of file diff --git a/test-suite/bugs/closed/5149.v b/test-suite/bugs/closed/5149.v new file mode 100644 index 0000000000..01b9d158fe --- /dev/null +++ b/test-suite/bugs/closed/5149.v @@ -0,0 +1,47 @@ +Goal forall x x' : nat, x = x' -> S x = S x -> exists y, S y = S x. +intros. +eexists. +rewrite <- H. +eassumption. +Qed. + +Goal forall (base_type_code : Type) (t : base_type_code) (flat_type : Type) + (t' : flat_type) (exprf interp_flat_type0 interp_flat_type1 : +flat_type -> Type) + (v v' : interp_flat_type1 t'), + v = v' -> + forall (interpf : forall t0 : flat_type, exprf t0 -> interp_flat_type1 t0) + (SmartVarVar : forall t0 : flat_type, interp_flat_type1 t0 -> +interp_flat_type0 t0) + (Tbase : base_type_code -> flat_type) (x : exprf (Tbase t)) + (x' : interp_flat_type1 (Tbase t)) (T : Type) + (flatten_binding_list : forall t0 : flat_type, + interp_flat_type0 t0 -> interp_flat_type1 t0 -> list T) + (P : T -> list T -> Prop) (prod : Type -> Type -> Type) + (s : forall x0 : base_type_code, prod (exprf (Tbase x0)) +(interp_flat_type1 (Tbase x0)) -> T) + (pair : forall A B : Type, A -> B -> prod A B), + P (s t (pair (exprf (Tbase t)) (interp_flat_type1 (Tbase t)) x x')) + (flatten_binding_list t' (SmartVarVar t' v') v) -> + (forall (t0 : base_type_code) (t'0 : flat_type) (v0 : interp_flat_type1 +t'0) + (x0 : exprf (Tbase t0)) (x'0 : interp_flat_type1 (Tbase t0)), + P (s t0 (pair (exprf (Tbase t0)) (interp_flat_type1 (Tbase t0)) x0 +x'0)) + (flatten_binding_list t'0 (SmartVarVar t'0 v0) v0) -> interpf +(Tbase t0) x0 = x'0) -> + interpf (Tbase t) x = x'. +Proof. + intros ?????????????????????? interpf_SmartVarVar. + solve [ unshelve (subst; eapply interpf_SmartVarVar; eassumption) ] || fail +"too early". + Undo. + (** Implicitely at the dot. The first fails because unshelve adds a goal, and solve hence fails. The second has an ambiant unification problem that is solved after solve *) + Fail solve [ unshelve (eapply interpf_SmartVarVar; subst; eassumption) ]. + solve [eapply interpf_SmartVarVar; subst; eassumption]. + Undo. + Unset Use Unification Heuristics. + (* User control of when constraints are solved *) + solve [ unshelve (eapply interpf_SmartVarVar; subst; eassumption); solve_constraints ]. +Qed. + diff --git a/test-suite/output/unifconstraints.v b/test-suite/output/unifconstraints.v index c76fc74a0c..c7fb82adac 100644 --- a/test-suite/output/unifconstraints.v +++ b/test-suite/output/unifconstraints.v @@ -1,4 +1,5 @@ (* Set Printing Existential Instances. *) +Unset Use Unification Heuristics. Axiom veeryyyyyyyyyyyyloooooooooooooonggidentifier : nat. Goal True /\ True /\ True \/ veeryyyyyyyyyyyyloooooooooooooonggidentifier = -- cgit v1.2.3 From c9f8f7fe182decedda2e6403d502fda3aff24a6e Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sat, 22 Oct 2016 10:37:17 +0200 Subject: Add Unset Use Unif Heuristics in Compat/Coq85 --- theories/Compat/Coq85.v | 3 +++ 1 file changed, 3 insertions(+) diff --git a/theories/Compat/Coq85.v b/theories/Compat/Coq85.v index 4007536442..ba58e2d88b 100644 --- a/theories/Compat/Coq85.v +++ b/theories/Compat/Coq85.v @@ -27,3 +27,6 @@ Global Set Refolding Reduction. Global Set Typeclasses Legacy Resolution. Global Set Typeclasses Limit Intros. Global Unset Typeclasses Filtered Unification. + +(** Allow silently letting unification constraints float after a "." *) +Global Unset Use Unification Heuristics. \ No newline at end of file -- cgit v1.2.3 From be11ab322fa73804118738e7a08e9910fdf4600d Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sat, 22 Oct 2016 11:03:13 +0200 Subject: Renamings to avoid confusion deprecating old names reconsider_conv_pbs -> reconsider_unif_constraints consider_remaining_unif_problems -> solve_unif_constraints_with_heuristics --- plugins/ssrmatching/ssrmatching.ml4 | 2 +- plugins/ssrmatching/ssrmatching.mli | 2 +- pretyping/evarconv.ml | 8 +++++--- pretyping/evarconv.mli | 3 +++ pretyping/evarsolve.ml | 6 ++++-- pretyping/evarsolve.mli | 3 +++ pretyping/pretyping.ml | 2 +- pretyping/unification.ml | 6 +++--- proofs/refine.ml | 2 +- tactics/class_tactics.ml | 2 +- tactics/equality.ml | 3 ++- toplevel/command.ml | 2 +- toplevel/vernacentries.ml | 2 +- 13 files changed, 27 insertions(+), 16 deletions(-) diff --git a/plugins/ssrmatching/ssrmatching.ml4 b/plugins/ssrmatching/ssrmatching.ml4 index a34fa4cae7..88f028b4b7 100644 --- a/plugins/ssrmatching/ssrmatching.ml4 +++ b/plugins/ssrmatching/ssrmatching.ml4 @@ -355,7 +355,7 @@ let nf_open_term sigma0 ise c = !s', Evd.evar_universe_context s, c' let unif_end env sigma0 ise0 pt ok = - let ise = Evarconv.consider_remaining_unif_problems env ise0 in + let ise = Evarconv.solve_unif_constraints_with_heuristics env ise0 in let s, uc, t = nf_open_term sigma0 ise pt in let ise1 = create_evar_defs s in let ise1 = Evd.set_universe_context ise1 uc in diff --git a/plugins/ssrmatching/ssrmatching.mli b/plugins/ssrmatching/ssrmatching.mli index 74a603e51c..288a04e60a 100644 --- a/plugins/ssrmatching/ssrmatching.mli +++ b/plugins/ssrmatching/ssrmatching.mli @@ -213,7 +213,7 @@ val assert_done : 'a option ref -> 'a (** Very low level APIs. these are calls to evarconv's [the_conv_x] followed by - [consider_remaining_unif_problems] and [resolve_typeclasses]. + [solve_unif_constraints_with_heuristics] and [resolve_typeclasses]. In case of failure they raise [NoMatch] *) val unify_HO : env -> evar_map -> constr -> constr -> evar_map diff --git a/pretyping/evarconv.ml b/pretyping/evarconv.ml index 3680cd777a..07f6d9d383 100644 --- a/pretyping/evarconv.ml +++ b/pretyping/evarconv.ml @@ -1081,7 +1081,7 @@ let second_order_matching ts env_rhs evd (evk,args) argoccs rhs = match evar_conv_x ts env_evar evd CUMUL idty evty with | UnifFailure _ -> error "Cannot find an instance" | Success evd -> - match reconsider_conv_pbs (evar_conv_x ts) evd with + match reconsider_unif_constraints (evar_conv_x ts) evd with | UnifFailure _ -> error "Cannot find an instance" | Success evd -> evd @@ -1208,7 +1208,7 @@ let rec solve_unconstrained_evars_with_candidates ts evd = let conv_algo = evar_conv_x ts in let evd = check_evar_instance evd evk a conv_algo in let evd = Evd.define evk a evd in - match reconsider_conv_pbs conv_algo evd with + match reconsider_unif_constraints conv_algo evd with | Success evd -> solve_unconstrained_evars_with_candidates ts evd | UnifFailure _ -> aux l with @@ -1231,7 +1231,7 @@ let solve_unconstrained_impossible_cases env evd = Evd.define evk ty evd' | _ -> evd') evd evd -let consider_remaining_unif_problems env +let solve_unif_constraints_with_heuristics env ?(ts=Conv_oracle.get_transp_state (Environ.oracle env)) evd = let evd = solve_unconstrained_evars_with_candidates ts evd in let rec aux evd pbs progress stuck = @@ -1263,6 +1263,8 @@ let consider_remaining_unif_problems env check_problems_are_solved env heuristic_solved_evd; solve_unconstrained_impossible_cases env heuristic_solved_evd +let consider_remaining_unif_problems = solve_unif_constraints_with_heuristics + (* Main entry points *) exception UnableToUnify of evar_map * unification_error diff --git a/pretyping/evarconv.mli b/pretyping/evarconv.mli index 14947c8927..2231e5bc30 100644 --- a/pretyping/evarconv.mli +++ b/pretyping/evarconv.mli @@ -33,7 +33,10 @@ val e_cumul : env -> ?ts:transparent_state -> evar_map ref -> constr -> constr - (** Try heuristics to solve pending unification problems and to solve evars with candidates *) +val solve_unif_constraints_with_heuristics : env -> ?ts:transparent_state -> evar_map -> evar_map + val consider_remaining_unif_problems : env -> ?ts:transparent_state -> evar_map -> evar_map +(** @deprecated Alias for [solve_unif_constraints_with_heuristics] *) (** Check all pending unification problems are solved and raise an error otherwise *) diff --git a/pretyping/evarsolve.ml b/pretyping/evarsolve.ml index f1526faccc..f0aa9b564f 100644 --- a/pretyping/evarsolve.ml +++ b/pretyping/evarsolve.ml @@ -1603,7 +1603,7 @@ let status_changed lev (pbty,_,t1,t2) = (try Evar.Set.mem (head_evar t1) lev with NoHeadEvar -> false) || (try Evar.Set.mem (head_evar t2) lev with NoHeadEvar -> false) -let reconsider_conv_pbs conv_algo evd = +let reconsider_unif_constraints conv_algo evd = let (evd,pbs) = extract_changed_conv_pbs evd status_changed in List.fold_left (fun p (pbty,env,t1,t2 as x) -> @@ -1616,6 +1616,8 @@ let reconsider_conv_pbs conv_algo evd = (Success evd) pbs +let reconsider_conv_pbs = reconsider_unif_constraints + (* Tries to solve problem t1 = t2. * Precondition: t1 is an uninstantiated evar * Returns an optional list of evars that were instantiated, or None @@ -1626,7 +1628,7 @@ let solve_simple_eqn conv_algo ?(choose=false) env evd (pbty,(evk1,args1 as ev1) try let t2 = whd_betaiota evd t2 in (* includes whd_evar *) let evd = evar_define conv_algo ~choose env evd pbty ev1 t2 in - reconsider_conv_pbs conv_algo evd + reconsider_unif_constraints conv_algo evd with | NotInvertibleUsingOurAlgorithm t -> UnifFailure (evd,NotClean (ev1,env,t)) diff --git a/pretyping/evarsolve.mli b/pretyping/evarsolve.mli index f94c83b6dc..b6bdc07889 100644 --- a/pretyping/evarsolve.mli +++ b/pretyping/evarsolve.mli @@ -54,7 +54,10 @@ val solve_evar_evar : ?force:bool -> val solve_simple_eqn : conv_fun -> ?choose:bool -> env -> evar_map -> bool option * existential * constr -> unification_result +val reconsider_unif_constraints : conv_fun -> evar_map -> unification_result + val reconsider_conv_pbs : conv_fun -> evar_map -> unification_result +(** @deprecated Alias for [reconsider_unif_constraints] *) val is_unification_pattern_evar : env -> evar_map -> existential -> constr list -> constr -> constr list option diff --git a/pretyping/pretyping.ml b/pretyping/pretyping.ml index 6afa55862f..95d854323a 100644 --- a/pretyping/pretyping.ml +++ b/pretyping/pretyping.ml @@ -290,7 +290,7 @@ let apply_inference_hook hook evdref pending = let apply_heuristics env evdref fail_evar = (* Resolve eagerly, potentially making wrong choices *) - try evdref := consider_remaining_unif_problems + try evdref := solve_unif_constraints_with_heuristics ~ts:(Typeclasses.classes_transparent_state ()) env !evdref with e when CErrors.noncritical e -> let e = CErrors.push e in if fail_evar then iraise e diff --git a/pretyping/unification.ml b/pretyping/unification.ml index fc63015a8e..259318693f 100644 --- a/pretyping/unification.ml +++ b/pretyping/unification.ml @@ -1220,7 +1220,7 @@ let is_mimick_head ts f = let try_to_coerce env evd c cty tycon = let j = make_judge c cty in let (evd',j') = inh_conv_coerce_rigid_to true Loc.ghost env evd j tycon in - let evd' = Evarconv.consider_remaining_unif_problems env evd' in + let evd' = Evarconv.solve_unif_constraints_with_heuristics env evd' in let evd' = Evd.map_metas_fvalue (nf_evar evd') evd' in (evd',j'.uj_val) @@ -1272,8 +1272,8 @@ let solve_simple_evar_eqn ts env evd ev rhs = | Success evd -> if Flags.version_less_or_equal Flags.V8_5 then (* We used to force solving unrelated problems at arbitrary times *) - Evarconv.consider_remaining_unif_problems env evd - else (* solve_simple_eqn calls reconsider_conv_pbs itself *) + Evarconv.solve_unif_constraints_with_heuristics env evd + else (* solve_simple_eqn calls reconsider_unif_constraints itself *) evd (* [w_merge env sigma b metas evars] merges common instances in metas diff --git a/proofs/refine.ml b/proofs/refine.ml index 2f21428900..3f55270609 100644 --- a/proofs/refine.ml +++ b/proofs/refine.ml @@ -157,6 +157,6 @@ end } let solve_constraints = let open Proofview in tclENV >>= fun env -> tclEVARMAP >>= fun sigma -> - try let sigma = Evarconv.consider_remaining_unif_problems env sigma in + try let sigma = Evarconv.solve_unif_constraints_with_heuristics env sigma in Unsafe.tclEVARSADVANCE sigma with e -> tclZERO e diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 0944cbe38f..9ea4027263 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -1437,7 +1437,7 @@ let initial_select_evars filter = let resolve_typeclass_evars debug depth unique env evd filter split fail = let evd = - try Evarconv.consider_remaining_unif_problems + try Evarconv.solve_unif_constraints_with_heuristics ~ts:(Typeclasses.classes_transparent_state ()) env evd with e when CErrors.noncritical e -> evd in diff --git a/tactics/equality.ml b/tactics/equality.ml index e9d08d7375..bb3cbad92b 100644 --- a/tactics/equality.ml +++ b/tactics/equality.ml @@ -1163,7 +1163,8 @@ let sig_clausal_form env sigma sort_of_ty siglen ty dflt = let dflt_typ = unsafe_type_of env sigma dflt in try let () = evdref := Evarconv.the_conv_x_leq env dflt_typ p_i !evdref in - let () = evdref := Evarconv.consider_remaining_unif_problems env !evdref in + let () = + evdref := Evarconv.solve_unif_constraints_with_heuristics env !evdref in dflt with Evarconv.UnableToUnify _ -> error "Cannot solve a unification problem." diff --git a/toplevel/command.ml b/toplevel/command.ml index 12c387dcf3..7ffe680e5e 100644 --- a/toplevel/command.ml +++ b/toplevel/command.ml @@ -1129,7 +1129,7 @@ let interp_recursive isfix fixl notations = () in (* Instantiate evars and check all are resolved *) - let evd = consider_remaining_unif_problems env_rec !evdref in + let evd = solve_unif_constraints_with_heuristics env_rec !evdref in let evd, nf = nf_evars_and_universes evd in let fixdefs = List.map (Option.map nf) fixdefs in let fixtypes = List.map nf fixtypes in diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index f69bac437e..9d3837d2e2 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -1497,7 +1497,7 @@ let get_current_context_of_args = function let vernac_check_may_eval redexp glopt rc = let (sigma, env) = get_current_context_of_args glopt in let sigma', c = interp_open_constr env sigma rc in - let sigma' = Evarconv.consider_remaining_unif_problems env sigma' in + let sigma' = Evarconv.solve_unif_constraints_with_heuristics env sigma' in Evarconv.check_problems_are_solved env sigma'; let sigma',nf = Evarutil.nf_evars_and_universes sigma' in let pl, uctx = Evd.universe_context sigma' in -- cgit v1.2.3 From 13738c4afd217ea7d71e654c38fc6a661bd2953c Mon Sep 17 00:00:00 2001 From: Théo Zimmermann Date: Mon, 24 Oct 2016 13:38:07 +0200 Subject: Fix printing of typeclasses eauto debug wrt intro. --- tactics/class_tactics.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 0944cbe38f..248635b4e4 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -1141,7 +1141,8 @@ module Search = struct (true,false,false) info.search_only_classes None decl in let ldb = Hint_db.add_list env s hint info.search_hints in let info' = - { info with search_hints = ldb; last_tac = lazy (str"intro") } + { info with search_hints = ldb; last_tac = lazy (str"intro"); + search_depth = 1 :: 1 :: info.search_depth } in kont info' let intro info kont = -- cgit v1.2.3 From 7e38b6627caaab7d19c4fc0ee542a67d9f8970c2 Mon Sep 17 00:00:00 2001 From: Théo Zimmermann Date: Mon, 24 Oct 2016 17:28:51 +0200 Subject: Remove v62 from stdlib. This old compatibility hint database can be safely removed now that coq-contribs do not depend on it anymore. --- theories/Arith/Between.v | 24 ++++++++++++------------ theories/Arith/EqNat.v | 4 ++-- theories/Arith/Gt.v | 16 ++++++++-------- theories/Arith/Le.v | 12 ++++++------ theories/Arith/Lt.v | 26 +++++++++++++------------- theories/Arith/Max.v | 4 ++-- theories/Arith/Minus.v | 20 ++++++++++---------- theories/Arith/Mult.v | 16 ++++++++-------- theories/Arith/Plus.v | 12 ++++++------ theories/Bool/Bool.v | 30 +++++++++++++++--------------- theories/Bool/IfProp.v | 2 +- theories/Init/Logic_Type.v | 2 +- theories/Init/Peano.v | 3 --- theories/Init/Specif.v | 2 +- theories/Lists/List.v | 16 ++++++++-------- theories/Lists/Streams.v | 2 +- theories/Logic/Eqdep.v | 2 +- theories/Reals/RIneq.v | 12 +++++------- theories/Reals/Raxioms.v | 8 ++++---- theories/Relations/Relation_Definitions.v | 6 +++--- theories/Relations/Relation_Operators.v | 6 +++--- theories/Sets/Classical_sets.v | 2 +- theories/Sets/Constructive_sets.v | 2 +- theories/Sets/Ensembles.v | 5 ++--- theories/Sets/Finite_sets.v | 4 ++-- theories/Sets/Image.v | 2 +- theories/Sets/Multiset.v | 6 +++--- theories/Sets/Partial_Order.v | 4 ++-- theories/Sets/Powerset.v | 22 +++++++++++----------- theories/Sets/Powerset_Classical_facts.v | 14 +++++++------- theories/Sets/Powerset_facts.v | 2 +- theories/Sets/Relations_1.v | 4 ++-- theories/Sets/Relations_2.v | 8 ++++---- theories/Sets/Relations_3.v | 12 ++++++------ theories/ZArith/Zwf.v | 4 ++-- 35 files changed, 155 insertions(+), 161 deletions(-) diff --git a/theories/Arith/Between.v b/theories/Arith/Between.v index f998e86192..58d3a2b38c 100644 --- a/theories/Arith/Between.v +++ b/theories/Arith/Between.v @@ -20,20 +20,20 @@ Section Between. | bet_emp : between k k | bet_S : forall l, between k l -> P l -> between k (S l). - Hint Constructors between: arith v62. + Hint Constructors between: arith. Lemma bet_eq : forall k l, l = k -> between k l. Proof. induction 1; auto with arith. Qed. - Hint Resolve bet_eq: arith v62. + Hint Resolve bet_eq: arith. Lemma between_le : forall k l, between k l -> k <= l. Proof. induction 1; auto with arith. Qed. - Hint Immediate between_le: arith v62. + Hint Immediate between_le: arith. Lemma between_Sk_l : forall k l, between k l -> S k <= l -> between (S k) l. Proof. @@ -41,7 +41,7 @@ Section Between. intros; absurd (S k <= k); auto with arith. destruct H; auto with arith. Qed. - Hint Resolve between_Sk_l: arith v62. + Hint Resolve between_Sk_l: arith. Lemma between_restr : forall k l (m:nat), k <= l -> l <= m -> between k m -> between l m. @@ -53,7 +53,7 @@ Section Between. | exists_S : forall l, exists_between k l -> exists_between k (S l) | exists_le : forall l, k <= l -> Q l -> exists_between k (S l). - Hint Constructors exists_between: arith v62. + Hint Constructors exists_between: arith. Lemma exists_le_S : forall k l, exists_between k l -> S k <= l. Proof. @@ -62,13 +62,13 @@ Section Between. Lemma exists_lt : forall k l, exists_between k l -> k < l. Proof exists_le_S. - Hint Immediate exists_le_S exists_lt: arith v62. + Hint Immediate exists_le_S exists_lt: arith. Lemma exists_S_le : forall k l, exists_between k (S l) -> k <= l. Proof. intros; apply le_S_n; auto with arith. Qed. - Hint Immediate exists_S_le: arith v62. + Hint Immediate exists_S_le: arith. Definition in_int p q r := p <= r /\ r < q. @@ -76,7 +76,7 @@ Section Between. Proof. red; auto with arith. Qed. - Hint Resolve in_int_intro: arith v62. + Hint Resolve in_int_intro: arith. Lemma in_int_lt : forall p q r, in_int p q r -> p < q. Proof. @@ -95,13 +95,13 @@ Section Between. Proof. induction 1; auto with arith. Qed. - Hint Resolve in_int_S: arith v62. + Hint Resolve in_int_S: arith. Lemma in_int_Sp_q : forall p q r, in_int (S p) q r -> in_int p q r. Proof. induction 1; auto with arith. Qed. - Hint Immediate in_int_Sp_q: arith v62. + Hint Immediate in_int_Sp_q: arith. Lemma between_in_int : forall k l, between k l -> forall r, in_int k l r -> P r. @@ -183,5 +183,5 @@ Section Between. End Between. Hint Resolve nth_O bet_S bet_emp bet_eq between_Sk_l exists_S exists_le - in_int_S in_int_intro: arith v62. -Hint Immediate in_int_Sp_q exists_le_S exists_S_le: arith v62. + in_int_S in_int_intro: arith. +Hint Immediate in_int_Sp_q exists_le_S exists_S_le: arith. diff --git a/theories/Arith/EqNat.v b/theories/Arith/EqNat.v index 206fc0ab5d..f998c19fc7 100644 --- a/theories/Arith/EqNat.v +++ b/theories/Arith/EqNat.v @@ -25,7 +25,7 @@ Theorem eq_nat_refl n : eq_nat n n. Proof. induction n; simpl; auto. Qed. -Hint Resolve eq_nat_refl: arith v62. +Hint Resolve eq_nat_refl: arith. (** [eq] restricted to [nat] and [eq_nat] are equivalent *) @@ -46,7 +46,7 @@ Proof. apply eq_nat_is_eq. Qed. -Hint Immediate eq_eq_nat eq_nat_eq: arith v62. +Hint Immediate eq_eq_nat eq_nat_eq: arith. Theorem eq_nat_elim : forall n (P:nat -> Prop), P n -> forall m, eq_nat n m -> P m. diff --git a/theories/Arith/Gt.v b/theories/Arith/Gt.v index dfd5769464..67c94fdf64 100644 --- a/theories/Arith/Gt.v +++ b/theories/Arith/Gt.v @@ -133,14 +133,14 @@ Qed. (** * Hints *) -Hint Resolve gt_Sn_O gt_Sn_n gt_n_S : arith v62. -Hint Immediate gt_S_n gt_pred : arith v62. -Hint Resolve gt_irrefl gt_asym : arith v62. -Hint Resolve le_not_gt gt_not_le : arith v62. -Hint Immediate le_S_gt gt_S_le : arith v62. -Hint Resolve gt_le_S le_gt_S : arith v62. -Hint Resolve gt_trans_S le_gt_trans gt_le_trans: arith v62. -Hint Resolve plus_gt_compat_l: arith v62. +Hint Resolve gt_Sn_O gt_Sn_n gt_n_S : arith. +Hint Immediate gt_S_n gt_pred : arith. +Hint Resolve gt_irrefl gt_asym : arith. +Hint Resolve le_not_gt gt_not_le : arith. +Hint Immediate le_S_gt gt_S_le : arith. +Hint Resolve gt_le_S le_gt_S : arith. +Hint Resolve gt_trans_S le_gt_trans gt_le_trans: arith. +Hint Resolve plus_gt_compat_l: arith. (* begin hide *) Notation gt_O_eq := gt_0_eq (only parsing). diff --git a/theories/Arith/Le.v b/theories/Arith/Le.v index ceb91187ba..0fbcec5721 100644 --- a/theories/Arith/Le.v +++ b/theories/Arith/Le.v @@ -30,8 +30,8 @@ Notation le_refl := Nat.le_refl (compat "8.4"). Notation le_trans := Nat.le_trans (compat "8.4"). Notation le_antisym := Nat.le_antisymm (compat "8.4"). -Hint Resolve le_trans: arith v62. -Hint Immediate le_antisym: arith v62. +Hint Resolve le_trans: arith. +Hint Immediate le_antisym: arith. (** * Properties of [le] w.r.t 0 *) @@ -59,16 +59,16 @@ Notation le_Sn_n := Nat.nle_succ_diag_l (compat "8.4"). (* ~ S n <= n *) Theorem le_Sn_le : forall n m, S n <= m -> n <= m. Proof Nat.lt_le_incl. -Hint Resolve le_0_n le_Sn_0: arith v62. -Hint Resolve le_n_S le_n_Sn le_Sn_n : arith v62. -Hint Immediate le_n_0_eq le_Sn_le le_S_n : arith v62. +Hint Resolve le_0_n le_Sn_0: arith. +Hint Resolve le_n_S le_n_Sn le_Sn_n : arith. +Hint Immediate le_n_0_eq le_Sn_le le_S_n : arith. (** * Properties of [le] w.r.t predecessor *) Notation le_pred_n := Nat.le_pred_l (compat "8.4"). (* pred n <= n *) Notation le_pred := Nat.pred_le_mono (compat "8.4"). (* n<=m -> pred n <= pred m *) -Hint Resolve le_pred_n: arith v62. +Hint Resolve le_pred_n: arith. (** * A different elimination principle for the order on natural numbers *) diff --git a/theories/Arith/Lt.v b/theories/Arith/Lt.v index f824ee6fbe..bfc2b91a9f 100644 --- a/theories/Arith/Lt.v +++ b/theories/Arith/Lt.v @@ -25,7 +25,7 @@ Local Open Scope nat_scope. Notation lt_irrefl := Nat.lt_irrefl (compat "8.4"). (* ~ x < x *) -Hint Resolve lt_irrefl: arith v62. +Hint Resolve lt_irrefl: arith. (** * Relationship between [le] and [lt] *) @@ -44,9 +44,9 @@ Proof. apply Nat.lt_succ_r. Qed. -Hint Immediate lt_le_S: arith v62. -Hint Immediate lt_n_Sm_le: arith v62. -Hint Immediate le_lt_n_Sm: arith v62. +Hint Immediate lt_le_S: arith. +Hint Immediate lt_n_Sm_le: arith. +Hint Immediate le_lt_n_Sm: arith. Theorem le_not_lt n m : n <= m -> ~ m < n. Proof. @@ -58,7 +58,7 @@ Proof. apply Nat.lt_nge. Qed. -Hint Immediate le_not_lt lt_not_le: arith v62. +Hint Immediate le_not_lt lt_not_le: arith. (** * Asymmetry *) @@ -79,8 +79,8 @@ Proof. intros. now apply Nat.neq_sym, Nat.neq_0_lt_0. Qed. -Hint Resolve lt_0_Sn lt_n_0 : arith v62. -Hint Immediate neq_0_lt lt_0_neq: arith v62. +Hint Resolve lt_0_Sn lt_n_0 : arith. +Hint Immediate neq_0_lt lt_0_neq: arith. (** * Order and successor *) @@ -97,8 +97,8 @@ Proof. apply Nat.succ_lt_mono. Qed. -Hint Resolve lt_n_Sn lt_S lt_n_S : arith v62. -Hint Immediate lt_S_n : arith v62. +Hint Resolve lt_n_Sn lt_S lt_n_S : arith. +Hint Immediate lt_S_n : arith. (** * Predecessor *) @@ -117,8 +117,8 @@ Proof. intros. now apply Nat.lt_pred_l, Nat.neq_0_lt_0. Qed. -Hint Immediate lt_pred: arith v62. -Hint Resolve lt_pred_n_n: arith v62. +Hint Immediate lt_pred: arith. +Hint Resolve lt_pred_n_n: arith. (** * Transitivity properties *) @@ -126,7 +126,7 @@ Notation lt_trans := Nat.lt_trans (compat "8.4"). Notation lt_le_trans := Nat.lt_le_trans (compat "8.4"). Notation le_lt_trans := Nat.le_lt_trans (compat "8.4"). -Hint Resolve lt_trans lt_le_trans le_lt_trans: arith v62. +Hint Resolve lt_trans lt_le_trans le_lt_trans: arith. (** * Large = strict or equal *) @@ -139,7 +139,7 @@ Qed. Notation lt_le_weak := Nat.lt_le_incl (compat "8.4"). -Hint Immediate lt_le_weak: arith v62. +Hint Immediate lt_le_weak: arith. (** * Dichotomy *) diff --git a/theories/Arith/Max.v b/theories/Arith/Max.v index 65534b2e3c..49152549a4 100644 --- a/theories/Arith/Max.v +++ b/theories/Arith/Max.v @@ -42,7 +42,7 @@ Notation max_SS := Nat.succ_max_distr (only parsing). (* end hide *) Hint Resolve - Nat.max_l Nat.max_r Nat.le_max_l Nat.le_max_r : arith v62. + Nat.max_l Nat.max_r Nat.le_max_l Nat.le_max_r : arith. Hint Resolve - Nat.min_l Nat.min_r Nat.le_min_l Nat.le_min_r : arith v62. + Nat.min_l Nat.min_r Nat.le_min_l Nat.le_min_r : arith. diff --git a/theories/Arith/Minus.v b/theories/Arith/Minus.v index bc3a318cf3..1fc8f7907a 100644 --- a/theories/Arith/Minus.v +++ b/theories/Arith/Minus.v @@ -107,13 +107,13 @@ Qed. (** * Hints *) -Hint Resolve minus_n_O: arith v62. -Hint Resolve minus_Sn_m: arith v62. -Hint Resolve minus_diag_reverse: arith v62. -Hint Resolve minus_plus_simpl_l_reverse: arith v62. -Hint Immediate plus_minus: arith v62. -Hint Resolve minus_plus: arith v62. -Hint Resolve le_plus_minus: arith v62. -Hint Resolve le_plus_minus_r: arith v62. -Hint Resolve lt_minus: arith v62. -Hint Immediate lt_O_minus_lt: arith v62. +Hint Resolve minus_n_O: arith. +Hint Resolve minus_Sn_m: arith. +Hint Resolve minus_diag_reverse: arith. +Hint Resolve minus_plus_simpl_l_reverse: arith. +Hint Immediate plus_minus: arith. +Hint Resolve minus_plus: arith. +Hint Resolve le_plus_minus: arith. +Hint Resolve le_plus_minus_r: arith. +Hint Resolve lt_minus: arith. +Hint Immediate lt_O_minus_lt: arith. diff --git a/theories/Arith/Mult.v b/theories/Arith/Mult.v index 9658124320..a173efc10a 100644 --- a/theories/Arith/Mult.v +++ b/theories/Arith/Mult.v @@ -31,13 +31,13 @@ Notation mult_0_r := Nat.mul_0_r (compat "8.4"). (* n * 0 = 0 *) Notation mult_1_l := Nat.mul_1_l (compat "8.4"). (* 1 * n = n *) Notation mult_1_r := Nat.mul_1_r (compat "8.4"). (* n * 1 = n *) -Hint Resolve mult_1_l mult_1_r: arith v62. +Hint Resolve mult_1_l mult_1_r: arith. (** ** Commutativity *) Notation mult_comm := Nat.mul_comm (compat "8.4"). (* n * m = m * n *) -Hint Resolve mult_comm: arith v62. +Hint Resolve mult_comm: arith. (** ** Distributivity *) @@ -53,9 +53,9 @@ Notation mult_minus_distr_r := Notation mult_minus_distr_l := Nat.mul_sub_distr_l (compat "8.4"). (* n*(m-p) = n*m - n*p *) -Hint Resolve mult_plus_distr_r: arith v62. -Hint Resolve mult_minus_distr_r: arith v62. -Hint Resolve mult_minus_distr_l: arith v62. +Hint Resolve mult_plus_distr_r: arith. +Hint Resolve mult_minus_distr_r: arith. +Hint Resolve mult_minus_distr_l: arith. (** ** Associativity *) @@ -66,8 +66,8 @@ Proof. symmetry. apply Nat.mul_assoc. Qed. -Hint Resolve mult_assoc_reverse: arith v62. -Hint Resolve mult_assoc: arith v62. +Hint Resolve mult_assoc_reverse: arith. +Hint Resolve mult_assoc: arith. (** ** Inversion lemmas *) @@ -92,7 +92,7 @@ Lemma mult_O_le n m : m = 0 \/ n <= m * n. Proof. destruct m; [left|right]; simpl; trivial using Nat.le_add_r. Qed. -Hint Resolve mult_O_le: arith v62. +Hint Resolve mult_O_le: arith. Lemma mult_le_compat_l n m p : n <= m -> p * n <= p * m. Proof. diff --git a/theories/Arith/Plus.v b/theories/Arith/Plus.v index 3b823da6f3..600e5e518d 100644 --- a/theories/Arith/Plus.v +++ b/theories/Arith/Plus.v @@ -177,12 +177,12 @@ Proof (succ_plus_discr n 3). (** * Compatibility Hints *) -Hint Immediate plus_comm : arith v62. -Hint Resolve plus_assoc plus_assoc_reverse : arith v62. -Hint Resolve plus_le_compat_l plus_le_compat_r : arith v62. -Hint Resolve le_plus_l le_plus_r le_plus_trans : arith v62. -Hint Immediate lt_plus_trans : arith v62. -Hint Resolve plus_lt_compat_l plus_lt_compat_r : arith v62. +Hint Immediate plus_comm : arith. +Hint Resolve plus_assoc plus_assoc_reverse : arith. +Hint Resolve plus_le_compat_l plus_le_compat_r : arith. +Hint Resolve le_plus_l le_plus_r le_plus_trans : arith. +Hint Immediate lt_plus_trans : arith. +Hint Resolve plus_lt_compat_l plus_lt_compat_r : arith. (** For compatibility, we "Require" the same files as before *) diff --git a/theories/Bool/Bool.v b/theories/Bool/Bool.v index 721ab69328..06096c66ac 100644 --- a/theories/Bool/Bool.v +++ b/theories/Bool/Bool.v @@ -39,13 +39,13 @@ Lemma diff_true_false : true <> false. Proof. discriminate. Qed. -Hint Resolve diff_true_false : bool v62. +Hint Resolve diff_true_false : bool. Lemma diff_false_true : false <> true. Proof. discriminate. Qed. -Hint Resolve diff_false_true : bool v62. +Hint Resolve diff_false_true : bool. Hint Extern 1 (false <> true) => exact diff_false_true. Lemma eq_true_false_abs : forall b:bool, b = true -> b = false -> False. @@ -82,7 +82,7 @@ Definition leb (b1 b2:bool) := | true => b2 = true | false => True end. -Hint Unfold leb: bool v62. +Hint Unfold leb: bool. Lemma leb_implb : forall b1 b2, leb b1 b2 <-> implb b1 b2 = true. Proof. @@ -242,14 +242,14 @@ Lemma orb_true_intro : Proof. intros; apply orb_true_iff; trivial. Qed. -Hint Resolve orb_true_intro: bool v62. +Hint Resolve orb_true_intro: bool. Lemma orb_false_intro : forall b1 b2:bool, b1 = false -> b2 = false -> b1 || b2 = false. Proof. intros. subst. reflexivity. Qed. -Hint Resolve orb_false_intro: bool v62. +Hint Resolve orb_false_intro: bool. Lemma orb_false_elim : forall b1 b2:bool, b1 || b2 = false -> b1 = false /\ b2 = false. @@ -268,7 +268,7 @@ Lemma orb_true_r : forall b:bool, b || true = true. Proof. destr_bool. Qed. -Hint Resolve orb_true_r: bool v62. +Hint Resolve orb_true_r: bool. Lemma orb_true_l : forall b:bool, true || b = true. Proof. @@ -284,13 +284,13 @@ Lemma orb_false_r : forall b:bool, b || false = b. Proof. destr_bool. Qed. -Hint Resolve orb_false_r: bool v62. +Hint Resolve orb_false_r: bool. Lemma orb_false_l : forall b:bool, false || b = b. Proof. destr_bool. Qed. -Hint Resolve orb_false_l: bool v62. +Hint Resolve orb_false_l: bool. Notation orb_b_false := orb_false_r (only parsing). Notation orb_false_b := orb_false_l (only parsing). @@ -301,7 +301,7 @@ Lemma orb_negb_r : forall b:bool, b || negb b = true. Proof. destr_bool. Qed. -Hint Resolve orb_negb_r: bool v62. +Hint Resolve orb_negb_r: bool. Notation orb_neg_b := orb_negb_r (only parsing). @@ -318,7 +318,7 @@ Lemma orb_assoc : forall b1 b2 b3:bool, b1 || (b2 || b3) = b1 || b2 || b3. Proof. destr_bool. Qed. -Hint Resolve orb_comm orb_assoc: bool v62. +Hint Resolve orb_comm orb_assoc: bool. (*******************************) (** * Properties of [andb] *) @@ -392,7 +392,7 @@ Lemma andb_false_elim : Proof. destruct b1; simpl; auto. Defined. -Hint Resolve andb_false_elim: bool v62. +Hint Resolve andb_false_elim: bool. (** Complementation *) @@ -400,7 +400,7 @@ Lemma andb_negb_r : forall b:bool, b && negb b = false. Proof. destr_bool. Qed. -Hint Resolve andb_negb_r: bool v62. +Hint Resolve andb_negb_r: bool. Notation andb_neg_b := andb_negb_r (only parsing). @@ -418,7 +418,7 @@ Proof. destr_bool. Qed. -Hint Resolve andb_comm andb_assoc: bool v62. +Hint Resolve andb_comm andb_assoc: bool. (*******************************************) (** * Properties mixing [andb] and [orb] *) @@ -688,7 +688,7 @@ Lemma andb_prop_intro : Proof. destr_bool; tauto. Qed. -Hint Resolve andb_prop_intro: bool v62. +Hint Resolve andb_prop_intro: bool. Notation andb_true_intro2 := (fun b1 b2 H1 H2 => andb_prop_intro b1 b2 (conj H1 H2)) @@ -699,7 +699,7 @@ Lemma andb_prop_elim : Proof. destr_bool; auto. Qed. -Hint Resolve andb_prop_elim: bool v62. +Hint Resolve andb_prop_elim: bool. Notation andb_prop2 := andb_prop_elim (only parsing). diff --git a/theories/Bool/IfProp.v b/theories/Bool/IfProp.v index 11f3d1d6fe..4257b4bc1a 100644 --- a/theories/Bool/IfProp.v +++ b/theories/Bool/IfProp.v @@ -12,7 +12,7 @@ Inductive IfProp (A B:Prop) : bool -> Prop := | Iftrue : A -> IfProp A B true | Iffalse : B -> IfProp A B false. -Hint Resolve Iftrue Iffalse: bool v62. +Hint Resolve Iftrue Iffalse: bool. Lemma Iftrue_inv : forall (A B:Prop) (b:bool), IfProp A B b -> b = true -> A. destruct 1; intros; auto with bool. diff --git a/theories/Init/Logic_Type.v b/theories/Init/Logic_Type.v index 4a5f2ad696..4536dfc0fd 100644 --- a/theories/Init/Logic_Type.v +++ b/theories/Init/Logic_Type.v @@ -64,7 +64,7 @@ Definition identity_rect_r : intros A x P H y H0; case identity_sym with (1 := H0); trivial. Defined. -Hint Immediate identity_sym not_identity_sym: core v62. +Hint Immediate identity_sym not_identity_sym: core. Notation refl_id := identity_refl (compat "8.3"). Notation sym_id := identity_sym (compat "8.3"). diff --git a/theories/Init/Peano.v b/theories/Init/Peano.v index 3749baf61c..6c4a63501d 100644 --- a/theories/Init/Peano.v +++ b/theories/Init/Peano.v @@ -33,7 +33,6 @@ Open Scope nat_scope. Definition eq_S := f_equal S. Definition f_equal_nat := f_equal (A:=nat). -Hint Resolve eq_S: v62. Hint Resolve f_equal_nat: core. (** The predecessor function *) @@ -41,7 +40,6 @@ Hint Resolve f_equal_nat: core. Notation pred := Nat.pred (compat "8.4"). Definition f_equal_pred := f_equal pred. -Hint Resolve f_equal_pred: v62. Theorem pred_Sn : forall n:nat, n = pred (S n). Proof. @@ -85,7 +83,6 @@ Notation plus := Nat.add (compat "8.4"). Infix "+" := Nat.add : nat_scope. Definition f_equal2_plus := f_equal2 plus. -Hint Resolve f_equal2_plus: v62. Definition f_equal2_nat := f_equal2 (A1:=nat) (A2:=nat). Hint Resolve f_equal2_nat: core. diff --git a/theories/Init/Specif.v b/theories/Init/Specif.v index d1038186e3..9fc00e80c1 100644 --- a/theories/Init/Specif.v +++ b/theories/Init/Specif.v @@ -299,7 +299,7 @@ Proof. apply (h2 h1). Defined. -Hint Resolve left right inleft inright: core v62. +Hint Resolve left right inleft inright: core. Hint Resolve exist exist2 existT existT2: core. (* Compatibility *) diff --git a/theories/Lists/List.v b/theories/Lists/List.v index bf21ffb47b..30f1dec22c 100644 --- a/theories/Lists/List.v +++ b/theories/Lists/List.v @@ -340,11 +340,11 @@ Section Facts. End Facts. -Hint Resolve app_assoc app_assoc_reverse: datatypes v62. -Hint Resolve app_comm_cons app_cons_not_nil: datatypes v62. -Hint Immediate app_eq_nil: datatypes v62. -Hint Resolve app_eq_unit app_inj_tail: datatypes v62. -Hint Resolve in_eq in_cons in_inv in_nil in_app_or in_or_app: datatypes v62. +Hint Resolve app_assoc app_assoc_reverse: datatypes. +Hint Resolve app_comm_cons app_cons_not_nil: datatypes. +Hint Immediate app_eq_nil: datatypes. +Hint Resolve app_eq_unit app_inj_tail: datatypes. +Hint Resolve in_eq in_cons in_inv in_nil in_app_or in_or_app: datatypes. @@ -1544,7 +1544,7 @@ Section length_order. End length_order. Hint Resolve lel_refl lel_cons_cons lel_cons lel_nil lel_nil nil_cons: - datatypes v62. + datatypes. (******************************) @@ -1613,7 +1613,7 @@ Section SetIncl. End SetIncl. Hint Resolve incl_refl incl_tl incl_tran incl_appl incl_appr incl_cons - incl_app: datatypes v62. + incl_app: datatypes. (**************************************) @@ -2365,7 +2365,7 @@ Notation rev_acc := rev_append (only parsing). Notation rev_acc_rev := rev_append_rev (only parsing). Notation AllS := Forall (only parsing). (* was formerly in TheoryList *) -Hint Resolve app_nil_end : datatypes v62. +Hint Resolve app_nil_end : datatypes. (* end hide *) Section Repeat. diff --git a/theories/Lists/Streams.v b/theories/Lists/Streams.v index 7ec3d2503f..1c302b22f4 100644 --- a/theories/Lists/Streams.v +++ b/theories/Lists/Streams.v @@ -51,7 +51,7 @@ Lemma tl_nth_tl : Proof. simple induction n; simpl; auto. Qed. -Hint Resolve tl_nth_tl: datatypes v62. +Hint Resolve tl_nth_tl: datatypes. Lemma Str_nth_tl_plus : forall (n m:nat) (s:Stream), diff --git a/theories/Logic/Eqdep.v b/theories/Logic/Eqdep.v index f3a2783e1b..5ef86b8e77 100644 --- a/theories/Logic/Eqdep.v +++ b/theories/Logic/Eqdep.v @@ -33,5 +33,5 @@ Export EqdepTheory. (** Exported hints *) -Hint Resolve eq_dep_eq: eqdep v62. +Hint Resolve eq_dep_eq: eqdep. Hint Resolve inj_pair2 inj_pairT2: eqdep. diff --git a/theories/Reals/RIneq.v b/theories/Reals/RIneq.v index f26bac2bb4..379fee6f49 100644 --- a/theories/Reals/RIneq.v +++ b/theories/Reals/RIneq.v @@ -389,7 +389,7 @@ Lemma Rplus_ne : forall r, r + 0 = r /\ 0 + r = r. Proof. split; ring. Qed. -Hint Resolve Rplus_ne: real v62. +Hint Resolve Rplus_ne: real. (**********) @@ -425,7 +425,6 @@ Proof. apply (f_equal (fun v => v + r)). Qed. -(*i Old i*)Hint Resolve Rplus_eq_compat_l: v62. (**********) Lemma Rplus_eq_reg_l : forall r r1 r2, r + r1 = r + r2 -> r1 = r2. @@ -501,21 +500,21 @@ Lemma Rmult_0_r : forall r, r * 0 = 0. Proof. intro; ring. Qed. -Hint Resolve Rmult_0_r: real v62. +Hint Resolve Rmult_0_r: real. (**********) Lemma Rmult_0_l : forall r, 0 * r = 0. Proof. intro; ring. Qed. -Hint Resolve Rmult_0_l: real v62. +Hint Resolve Rmult_0_l: real. (**********) Lemma Rmult_ne : forall r, r * 1 = r /\ 1 * r = r. Proof. intro; split; ring. Qed. -Hint Resolve Rmult_ne: real v62. +Hint Resolve Rmult_ne: real. (**********) Lemma Rmult_1_r : forall r, r * 1 = r. @@ -530,7 +529,6 @@ Proof. auto with real. Qed. -(*i Old i*)Hint Resolve Rmult_eq_compat_l: v62. Lemma Rmult_eq_compat_r : forall r r1 r2, r1 = r2 -> r1 * r = r2 * r. Proof. @@ -646,7 +644,7 @@ Lemma Ropp_0 : -0 = 0. Proof. ring. Qed. -Hint Resolve Ropp_0: real v62. +Hint Resolve Ropp_0: real. (**********) Lemma Ropp_eq_0_compat : forall r, r = 0 -> - r = 0. diff --git a/theories/Reals/Raxioms.v b/theories/Reals/Raxioms.v index 9d55e4e639..9fbda92a2f 100644 --- a/theories/Reals/Raxioms.v +++ b/theories/Reals/Raxioms.v @@ -32,7 +32,7 @@ Hint Resolve Rplus_assoc: real. (**********) Axiom Rplus_opp_r : forall r:R, r + - r = 0. -Hint Resolve Rplus_opp_r: real v62. +Hint Resolve Rplus_opp_r: real. (**********) Axiom Rplus_0_l : forall r:R, 0 + r = r. @@ -44,11 +44,11 @@ Hint Resolve Rplus_0_l: real. (**********) Axiom Rmult_comm : forall r1 r2:R, r1 * r2 = r2 * r1. -Hint Resolve Rmult_comm: real v62. +Hint Resolve Rmult_comm: real. (**********) Axiom Rmult_assoc : forall r1 r2 r3:R, r1 * r2 * r3 = r1 * (r2 * r3). -Hint Resolve Rmult_assoc: real v62. +Hint Resolve Rmult_assoc: real. (**********) Axiom Rinv_l : forall r:R, r <> 0 -> / r * r = 1. @@ -69,7 +69,7 @@ Hint Resolve R1_neq_R0: real. (**********) Axiom Rmult_plus_distr_l : forall r1 r2 r3:R, r1 * (r2 + r3) = r1 * r2 + r1 * r3. -Hint Resolve Rmult_plus_distr_l: real v62. +Hint Resolve Rmult_plus_distr_l: real. (*********************************************************) (** * Order axioms *) diff --git a/theories/Relations/Relation_Definitions.v b/theories/Relations/Relation_Definitions.v index b6005b9d11..9c98879cea 100644 --- a/theories/Relations/Relation_Definitions.v +++ b/theories/Relations/Relation_Definitions.v @@ -66,10 +66,10 @@ Section Relation_Definition. End Relation_Definition. -Hint Unfold reflexive transitive antisymmetric symmetric: sets v62. +Hint Unfold reflexive transitive antisymmetric symmetric: sets. Hint Resolve Build_preorder Build_order Build_equivalence Build_PER preord_refl preord_trans ord_refl ord_trans ord_antisym equiv_refl - equiv_trans equiv_sym per_sym per_trans: sets v62. + equiv_trans equiv_sym per_sym per_trans: sets. -Hint Unfold inclusion same_relation commut: sets v62. +Hint Unfold inclusion same_relation commut: sets. diff --git a/theories/Relations/Relation_Operators.v b/theories/Relations/Relation_Operators.v index ffd682d62c..88239475c3 100644 --- a/theories/Relations/Relation_Operators.v +++ b/theories/Relations/Relation_Operators.v @@ -226,9 +226,9 @@ Section Lexicographic_Exponentiation. End Lexicographic_Exponentiation. -Hint Unfold transp union: sets v62. -Hint Resolve t_step rt_step rt_refl rst_step rst_refl: sets v62. -Hint Immediate rst_sym: sets v62. +Hint Unfold transp union: sets. +Hint Resolve t_step rt_step rt_refl rst_step rst_refl: sets. +Hint Immediate rst_sym: sets. (* begin hide *) (* Compatibility *) diff --git a/theories/Sets/Classical_sets.v b/theories/Sets/Classical_sets.v index 8a4bb9f424..837437a227 100644 --- a/theories/Sets/Classical_sets.v +++ b/theories/Sets/Classical_sets.v @@ -122,4 +122,4 @@ Section Ensembles_classical. End Ensembles_classical. Hint Resolve Strict_super_set_contains_new_element Subtract_intro - not_SIncl_empty: sets v62. + not_SIncl_empty: sets. diff --git a/theories/Sets/Constructive_sets.v b/theories/Sets/Constructive_sets.v index 8d2344f931..6291248eb5 100644 --- a/theories/Sets/Constructive_sets.v +++ b/theories/Sets/Constructive_sets.v @@ -141,4 +141,4 @@ End Ensembles_facts. Hint Resolve Singleton_inv Singleton_intro Add_intro1 Add_intro2 Intersection_inv Couple_inv Setminus_intro Strict_Included_intro Strict_Included_strict Noone_in_empty Inhabited_not_empty Add_not_Empty - not_Empty_Add Inhabited_add Included_Empty: sets v62. + not_Empty_Add Inhabited_add Included_Empty: sets. diff --git a/theories/Sets/Ensembles.v b/theories/Sets/Ensembles.v index 8f579214ad..0fefb354b2 100644 --- a/theories/Sets/Ensembles.v +++ b/theories/Sets/Ensembles.v @@ -90,9 +90,8 @@ Section Ensembles. End Ensembles. -Hint Unfold In Included Same_set Strict_Included Add Setminus Subtract: sets - v62. +Hint Unfold In Included Same_set Strict_Included Add Setminus Subtract: sets. Hint Resolve Union_introl Union_intror Intersection_intro In_singleton Couple_l Couple_r Triple_l Triple_m Triple_r Disjoint_intro - Extensionality_Ensembles: sets v62. + Extensionality_Ensembles: sets. diff --git a/theories/Sets/Finite_sets.v b/theories/Sets/Finite_sets.v index f38dd6fdf7..edbc1efec0 100644 --- a/theories/Sets/Finite_sets.v +++ b/theories/Sets/Finite_sets.v @@ -43,8 +43,8 @@ Section Ensembles_finis. End Ensembles_finis. -Hint Resolve Empty_is_finite Union_is_finite: sets v62. -Hint Resolve card_empty card_add: sets v62. +Hint Resolve Empty_is_finite Union_is_finite: sets. +Hint Resolve card_empty card_add: sets. Require Import Constructive_sets. diff --git a/theories/Sets/Image.v b/theories/Sets/Image.v index 34ea857d17..e74ef41e4b 100644 --- a/theories/Sets/Image.v +++ b/theories/Sets/Image.v @@ -200,4 +200,4 @@ Section Image. End Image. -Hint Resolve Im_def image_empty finite_image: sets v62. +Hint Resolve Im_def image_empty finite_image: sets. diff --git a/theories/Sets/Multiset.v b/theories/Sets/Multiset.v index ec38b8923f..42d0c76dcc 100644 --- a/theories/Sets/Multiset.v +++ b/theories/Sets/Multiset.v @@ -187,7 +187,7 @@ End multiset_defs. Unset Implicit Arguments. -Hint Unfold meq multiplicity: v62 datatypes. +Hint Unfold meq multiplicity: datatypes. Hint Resolve munion_empty_right munion_comm munion_ass meq_left meq_right - munion_empty_left: v62 datatypes. -Hint Immediate meq_sym: v62 datatypes. + munion_empty_left: datatypes. +Hint Immediate meq_sym: datatypes. diff --git a/theories/Sets/Partial_Order.v b/theories/Sets/Partial_Order.v index 3610ebce6e..335fec5b09 100644 --- a/theories/Sets/Partial_Order.v +++ b/theories/Sets/Partial_Order.v @@ -51,8 +51,8 @@ Section Partial_orders. End Partial_orders. -Hint Unfold Carrier_of Rel_of Strict_Rel_of: sets v62. -Hint Resolve Definition_of_covers: sets v62. +Hint Unfold Carrier_of Rel_of Strict_Rel_of: sets. +Hint Resolve Definition_of_covers: sets. Section Partial_order_facts. diff --git a/theories/Sets/Powerset.v b/theories/Sets/Powerset.v index d636e0468a..7c2435da04 100644 --- a/theories/Sets/Powerset.v +++ b/theories/Sets/Powerset.v @@ -175,14 +175,14 @@ Qed. End The_power_set_partial_order. -Hint Resolve Empty_set_minimal: sets v62. -Hint Resolve Power_set_Inhabited: sets v62. -Hint Resolve Inclusion_is_an_order: sets v62. -Hint Resolve Inclusion_is_transitive: sets v62. -Hint Resolve Union_minimal: sets v62. -Hint Resolve Union_increases_l: sets v62. -Hint Resolve Union_increases_r: sets v62. -Hint Resolve Intersection_decreases_l: sets v62. -Hint Resolve Intersection_decreases_r: sets v62. -Hint Resolve Empty_set_is_Bottom: sets v62. -Hint Resolve Strict_inclusion_is_transitive: sets v62. +Hint Resolve Empty_set_minimal: sets. +Hint Resolve Power_set_Inhabited: sets. +Hint Resolve Inclusion_is_an_order: sets. +Hint Resolve Inclusion_is_transitive: sets. +Hint Resolve Union_minimal: sets. +Hint Resolve Union_increases_l: sets. +Hint Resolve Union_increases_r: sets. +Hint Resolve Intersection_decreases_l: sets. +Hint Resolve Intersection_decreases_r: sets. +Hint Resolve Empty_set_is_Bottom: sets. +Hint Resolve Strict_inclusion_is_transitive: sets. diff --git a/theories/Sets/Powerset_Classical_facts.v b/theories/Sets/Powerset_Classical_facts.v index 09c90506bc..e802beac9a 100644 --- a/theories/Sets/Powerset_Classical_facts.v +++ b/theories/Sets/Powerset_Classical_facts.v @@ -90,7 +90,7 @@ Section Sets_as_an_algebra. apply Subtract_intro; auto with sets. red; intro H'1; apply H'; rewrite H'1; auto with sets. Qed. - Hint Resolve incl_soustr_add_r: sets v62. + Hint Resolve incl_soustr_add_r: sets. Lemma add_soustr_2 : forall (X:Ensemble U) (x:U), @@ -328,9 +328,9 @@ Section Sets_as_an_algebra. End Sets_as_an_algebra. -Hint Resolve incl_soustr_in: sets v62. -Hint Resolve incl_soustr: sets v62. -Hint Resolve incl_soustr_add_l: sets v62. -Hint Resolve incl_soustr_add_r: sets v62. -Hint Resolve add_soustr_1 add_soustr_2: sets v62. -Hint Resolve add_soustr_xy: sets v62. +Hint Resolve incl_soustr_in: sets. +Hint Resolve incl_soustr: sets. +Hint Resolve incl_soustr_add_l: sets. +Hint Resolve incl_soustr_add_r: sets. +Hint Resolve add_soustr_1 add_soustr_2: sets. +Hint Resolve add_soustr_xy: sets. diff --git a/theories/Sets/Powerset_facts.v b/theories/Sets/Powerset_facts.v index 63e84199d6..e9696a1cad 100644 --- a/theories/Sets/Powerset_facts.v +++ b/theories/Sets/Powerset_facts.v @@ -254,5 +254,5 @@ Section Sets_as_an_algebra. End Sets_as_an_algebra. Hint Resolve Empty_set_zero Empty_set_zero' Union_associative Union_add - singlx incl_add: sets v62. + singlx incl_add: sets. diff --git a/theories/Sets/Relations_1.v b/theories/Sets/Relations_1.v index de96fa560e..45fb8134c8 100644 --- a/theories/Sets/Relations_1.v +++ b/theories/Sets/Relations_1.v @@ -60,6 +60,6 @@ Section Relations_1. End Relations_1. Hint Unfold Reflexive Transitive Antisymmetric Symmetric contains - same_relation: sets v62. + same_relation: sets. Hint Resolve Definition_of_preorder Definition_of_order - Definition_of_equivalence Definition_of_PER: sets v62. + Definition_of_equivalence Definition_of_PER: sets. diff --git a/theories/Sets/Relations_2.v b/theories/Sets/Relations_2.v index f1026e31a1..1e0b83fe51 100644 --- a/theories/Sets/Relations_2.v +++ b/theories/Sets/Relations_2.v @@ -48,7 +48,7 @@ Definition Strongly_confluent : Prop := End Relations_2. -Hint Resolve Rstar_0: sets v62. -Hint Resolve Rstar1_0: sets v62. -Hint Resolve Rstar1_1: sets v62. -Hint Resolve Rplus_0: sets v62. +Hint Resolve Rstar_0: sets. +Hint Resolve Rstar1_0: sets. +Hint Resolve Rstar1_1: sets. +Hint Resolve Rplus_0: sets. diff --git a/theories/Sets/Relations_3.v b/theories/Sets/Relations_3.v index 92b2998855..c05b5ee76a 100644 --- a/theories/Sets/Relations_3.v +++ b/theories/Sets/Relations_3.v @@ -51,10 +51,10 @@ Section Relations_3. Definition Noetherian : Prop := forall x:U, noetherian x. End Relations_3. -Hint Unfold coherent: sets v62. -Hint Unfold locally_confluent: sets v62. -Hint Unfold confluent: sets v62. -Hint Unfold Confluent: sets v62. -Hint Resolve definition_of_noetherian: sets v62. -Hint Unfold Noetherian: sets v62. +Hint Unfold coherent: sets. +Hint Unfold locally_confluent: sets. +Hint Unfold confluent: sets. +Hint Unfold Confluent: sets. +Hint Resolve definition_of_noetherian: sets. +Hint Unfold Noetherian: sets. diff --git a/theories/ZArith/Zwf.v b/theories/ZArith/Zwf.v index 1ac00bddd0..90754af3b4 100644 --- a/theories/ZArith/Zwf.v +++ b/theories/ZArith/Zwf.v @@ -56,7 +56,7 @@ Section wf_proof. End wf_proof. -Hint Resolve Zwf_well_founded: datatypes v62. +Hint Resolve Zwf_well_founded: datatypes. (** We also define the other family of relations: @@ -88,4 +88,4 @@ Section wf_proof_up. End wf_proof_up. -Hint Resolve Zwf_up_well_founded: datatypes v62. +Hint Resolve Zwf_up_well_founded: datatypes. -- cgit v1.2.3 From 2d687dec5709695942aa6a92197a5e5e2a91b616 Mon Sep 17 00:00:00 2001 From: Théo Zimmermann Date: Mon, 24 Oct 2016 17:35:04 +0200 Subject: Remove v62 from the codebase. --- tactics/auto.mli | 8 +++----- tactics/eauto.ml | 4 +--- tactics/hints.ml | 3 +-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/tactics/auto.mli b/tactics/auto.mli index 5384140c2a..04791a526e 100644 --- a/tactics/auto.mli +++ b/tactics/auto.mli @@ -48,17 +48,15 @@ val new_auto : ?debug:Tacexpr.debug -> (** auto with default search depth and with the hint database "core" *) val default_auto : unit Proofview.tactic -(** auto with all hint databases except the "v62" compatibility database *) +(** auto with all hint databases *) val full_auto : ?debug:Tacexpr.debug -> int -> Tacexpr.delayed_open_constr list -> unit Proofview.tactic -(** auto with all hint databases except the "v62" compatibility database - and doing delta *) +(** auto with all hint databases and doing delta *) val new_full_auto : ?debug:Tacexpr.debug -> int -> Tacexpr.delayed_open_constr list -> unit Proofview.tactic -(** auto with default search depth and with all hint databases - except the "v62" compatibility database *) +(** auto with default search depth and with all hint databases *) val default_full_auto : unit Proofview.tactic (** The generic form of auto (second arg [None] means all bases) *) diff --git a/tactics/eauto.ml b/tactics/eauto.ml index c6d2448679..480185337b 100644 --- a/tactics/eauto.ml +++ b/tactics/eauto.ml @@ -410,9 +410,7 @@ let eauto ?(debug=Off) np lems dbnames = tclTRY (e_search_auto debug np lems db_list) let full_eauto ?(debug=Off) n lems gl = - let dbnames = current_db_names () in - let dbnames = String.Set.remove "v62" dbnames in - let db_list = List.map searchtable_map (String.Set.elements dbnames) in + let db_list = current_pure_db () in tclTRY (e_search_auto debug n lems db_list) gl let gen_eauto ?(debug=Off) np lems = function diff --git a/tactics/hints.ml b/tactics/hints.ml index 89ecc6c0b2..1ebd32c378 100644 --- a/tactics/hints.ml +++ b/tactics/hints.ml @@ -657,8 +657,7 @@ let searchtable_add (name,db) = let current_db_names () = Hintdbmap.domain !searchtable let current_db () = Hintdbmap.bindings !searchtable -let current_pure_db () = - List.map snd (Hintdbmap.bindings (Hintdbmap.remove "v62" !searchtable)) +let current_pure_db () = List.map snd (current_db ()) let error_no_such_hint_database x = errorlabstrm "Hints" (str "No such Hint database: " ++ str x ++ str ".") -- cgit v1.2.3 From 5737c8a41782ee66e96f4e855b00e396a23e8479 Mon Sep 17 00:00:00 2001 From: Théo Zimmermann Date: Mon, 24 Oct 2016 17:39:06 +0200 Subject: Remove v62 from the refman. --- doc/refman/RefMan-tac.tex | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex index 2da12c8d69..0aabaf6a87 100644 --- a/doc/refman/RefMan-tac.tex +++ b/doc/refman/RefMan-tac.tex @@ -3493,8 +3493,7 @@ hints of the database named {\tt core}. \item {\tt auto with *} - Uses all existing hint databases, minus the special database - {\tt v62}. See Section~\ref{Hints-databases} + Uses all existing hint databases. See Section~\ref{Hints-databases} \item \texttt{auto using} \nterm{lemma}$_1$ {\tt ,} {\ldots} {\tt ,} \nterm{lemma}$_n$ @@ -3962,8 +3961,8 @@ Several hint databases are defined in the \Coq\ standard library. The actual content of a database is the collection of the hints declared to belong to this database in each of the various modules currently loaded. Especially, requiring new modules potentially extend a -database. At {\Coq} startup, only the {\tt core} and {\tt v62} -databases are non empty and can be used. +database. At {\Coq} startup, only the {\tt core} database is non empty +and can be used. \begin{description} @@ -3998,18 +3997,8 @@ databases are non empty and can be used. from the \texttt{Classes} directory. \end{description} -There is also a special database called {\tt v62}. It collects all -hints that were declared in the versions of {\Coq} prior to version -6.2.4 when the databases {\tt core}, {\tt arith}, and so on were -introduced. The purpose of the database {\tt v62} is to ensure -compatibility with further versions of {\Coq} for developments done in -versions prior to 6.2.4 ({\tt auto} being replaced by {\tt auto with v62}). -The database {\tt v62} is intended not to be extended (!). It is not -included in the hint databases list used in the {\tt auto with *} tactic. - -Furthermore, you are advised not to put your own hints in the -{\tt core} database, but use one or several databases specific to your -development. +You are advised not to put your own hints in the {\tt core} database, +but use one or several databases specific to your development. \subsection{\tt Remove Hints \term$_1$ \mbox{\dots} \term$_n$ :~ \ident$_1$ \mbox{\dots} \ident$_m$} -- cgit v1.2.3 From e807f3407fb19f481dac332e7650eddfa9b5fd5d Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Fri, 14 Oct 2016 16:53:19 +0200 Subject: Documenting changes in typeclasses --- doc/refman/Classes.tex | 144 +++++++++++++++++++++++++++++++++++++++++++--- doc/refman/RefMan-tac.tex | 2 +- tactics/tactics.ml | 2 +- 3 files changed, 139 insertions(+), 9 deletions(-) diff --git a/doc/refman/Classes.tex b/doc/refman/Classes.tex index e8ebb9f995..e90621f046 100644 --- a/doc/refman/Classes.tex +++ b/doc/refman/Classes.tex @@ -9,10 +9,6 @@ \aauthor{Matthieu Sozeau} \label{typeclasses} -\begin{flushleft} - \em The status of Type Classes is experimental. -\end{flushleft} - This chapter presents a quick reference of the commands related to type classes. For an actual introduction to type classes, there is a description of the system \cite{sozeau08} and the literature on type @@ -382,6 +378,55 @@ projections as instances. This is almost equivalent to {\tt Hint Resolve Declares variables according to the given binding context, which might use implicit generalization (see \ref{SectionContext}). +\asubsection{\tt typeclasses eauto} +\tacindex{typeclasseseauto} + +The {\tt typeclasses eauto} tactic uses a different resolution engine +than {\tt eauto} and {\tt auto}. The main differences are the following: +\begin{itemize} +\item Contrary to {\tt eauto} and {\tt auto}, the resolution is done + entirely in the new proof engine (as of Coq v8.6), meaning that + backtracking is available among dependent subgoals, and shelving goals + is supported. It analyses the dependencies between subgoals to avoid + backtracking on subgoals that are entirely independent. +\item When called with no arguments, {\tt typeclasses eauto} uses the + {\tt typeclass\_instances} database by default (instead of {\tt core}) + and will try to solve \emph{only} typeclass goals. Other subgoals are + automatically shelved and \emph{must be} resolved entirely when the + other typeclass subgoals are resolved. +\item The transparency information of databases is used consistently. + When considering the local hypotheses, we use the transparent + state of the first hint database given. Using an empty database + (created with {\tt Create HintDb} for example) with + unfoldable variables and constants as the first argument of + typeclasses eauto hence makes resolution with the local hypotheses use + full conversion during unification. +\end{itemize} + +\begin{Variants} +\item \label{depth} {\tt typeclasses eauto \zeroone{\num}} + \emph{Warning:} The semantics for the limit {\num} is different than + for {\tt auto}. By default, if no limit is given the search is + unbounded. Contrary to {\tt auto}, introduction steps ({\tt intro}) + are counted, which might result in larger limits being necessary + when searching with {\tt typeclasses eauto} than {\tt auto}. + +\item \label{with} {\tt typeclasses eauto with {\ident}$_1$ \ldots {\ident}$_n$}. + This variant runs resolution with the given hint databases. It does + not treat typeclass subgoals differently than others. +\end{Variants} + +\asubsection{\tt autoapply {\term} with {\ident}} +\tacindex{autoapply} + +The tactic {\tt autoapply} applies a term using the transparency +information of the hint database {\ident}, and does \emph{no} typeclass +resolution. This can be used in {\tt Hint Extern}'s for typeclasse +instances (in hint db {\tt typeclass\_instances}) to +allow backtracking on the typeclass subgoals created by the lemma +application, rather than doing type class resolution locally at the hint +application time. + \subsection{\tt Typeclasses Transparent, Opaque {\ident$_1$ \ldots \ident$_n$}} \comindex{Typeclasses Transparent} \comindex{Typeclasses Opaque} @@ -400,18 +445,103 @@ abbreviate a type, like {\tt relation A := A -> A -> Prop}. This is equivalent to {\tt Hint Transparent,Opaque} {\ident} {\tt: typeclass\_instances}. +\subsection{\tt Set Typeclasses Module Eta} +\optindex{Typeclasses Modulo Eta} + +This allows eta-conversion during unification of type-classes. + +\subsection{\tt Set Typeclasses Dependency Order} +\optindex{Typeclasses Dependency Order} + +This option (now on by default) respects the dependency order between +subgoals, meaning that subgoals which are depended on by other subgoals +come first, while the non-dependent subgoals were put before the +dependent ones previously (Coq v8.5 and below). This can result in quite +different performance behaviors of proof search. + +\subsection{\tt Set Typeclasses Legacy Resolution} +\optindex{Typeclasses Legacy Resolution} + +This option (off by default) uses the 8.5 implementation of resolution. +Use for compatibility purposes only (porting and debugging). + +\subsection{\tt Set Typeclasses Limit Intros} +\optindex{Typeclasses Limit Intros} + +This option (on by default in Coq 8.6 and below), controls the ability +to apply hints while avoiding eta-expansions in the proof term +generated. It does so by allowing hints that conclude in an product to +apply to a goal with a matching product directly, avoiding an +introduction. \emph{Warning:} can be expensive as it requires rebuilding +hint clauses dynamically, and does not benefit from the invertibility +status of the product introduction rule, resulting in more expensive +proof-search (i.e. more useless backtracking). + +\subsection{\tt Set Typeclasses Filtered Unification} +\optindex{Typeclasses Filtered Unification} + +This option, available since Coq 8.6, switches the hint application +procedure to a filter-then-unify strategy. To apply a hint, we first +check that it \emph{matches} syntactically the inferred pattern of the +hint, and only then try to \emph{unify} the goal with the conclusion of +the hint. This can drastically improve performance by calling +unification less often, matching syntactic patterns being very +quick. This also provides more control on the triggering of instances. +For example, forcing a constant to explicitely appear in the pattern +will make it never apply on a goal where there is a hole in that place. + +\subsection{\tt Set Typeclass Resolution After Apply} +\optindex{Typeclasses Resolution After Apply} +\emph{Deprecated since 8.6} + +This option (off by default in Coq 8.6 and 8.5) controls the resolution +of typeclass subgoals generated by the {\tt apply} tactic. + +\subsection{\tt Set Typeclass Resolution For Conversion} +\optindex{Typeclasses Resolution For Conversion} + +This option (on by default) controls the use of typeclass resolution +when a unification problem cannot be solved during +elaboration/type-inference. With this option on, when a unification +fails, typeclass resolution is tried before launching unification once again. + +\subsection{\tt Set Typeclasses Strict Resolution} +\optindex{Typeclasses Strict Resolution} + +Typeclass declarations introduced when this option is set have a +stricter resolution behavior (the option is off by default). When +looking for unifications of a goal with an instance of this class, we +``freeze'' all the existentials appearing in the goals, meaning that +they are considered rigid during unification and cannot be instantiated. + +\subsection{\tt Set Typeclasses Unique Solutions} +\optindex{Typeclasses Unique Solutions} + +When a typeclass resolution is launched we ensure that it has a single +solution or fail. This ensures that the resolution is canonical, but can +make proof search much more expensive. + +\subsection{\tt Set Typeclasses Unique Instances} +\optindex{Typeclasses Unique Instances} + +Typeclass declarations introduced when this option is set have a +more efficient resolution behavior (the option is off by default). When +a solution to the typeclass goal of this class is found, we never +backtrack on it, assuming that it is canonical. + \subsection{\tt Typeclasses eauto := [debug] [dfs | bfs] [\emph{depth}]} \comindex{Typeclasses eauto} \label{TypeclassesEauto} -This command allows customization of the type class resolution tactic, -based on a variant of eauto. The flags semantics are: +This command allows more global customization of the type class +resolution tactic. +The semantics of the options are: \begin{itemize} \item {\tt debug} In debug mode, the trace of successfully applied tactics is printed. \item {\tt dfs, bfs} This sets the search strategy to depth-first search (the default) or breadth-first search. -\item {\emph{depth}} This sets the depth of the search (the default is 100). +\item {\emph{depth}} This sets the depth limit of the search. \end{itemize} \subsection{\tt Set Refine Instance Mode} diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex index dd45feebc6..c659e19e6b 100644 --- a/doc/refman/RefMan-tac.tex +++ b/doc/refman/RefMan-tac.tex @@ -3907,7 +3907,7 @@ Abort. \comindex{Hint Cut} \textit{Warning:} these hints currently only apply to typeclass proof search and - the \texttt{typeclasses eauto} tactic. + the \texttt{typeclasses eauto} tactic (\ref{typeclasseseauto}). This command can be used to cut the proof-search tree according to a regular expression matching paths to be cut. The grammar for regular diff --git a/tactics/tactics.ml b/tactics/tactics.ml index d2e5d8525d..88e84f4183 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -83,7 +83,7 @@ let _ = let apply_solve_class_goals = ref (false) let _ = Goptions.declare_bool_option { - Goptions.optsync = true; Goptions.optdepr = false; + Goptions.optsync = true; Goptions.optdepr = true; Goptions.optname = "Perform typeclass resolution on apply-generated subgoals."; Goptions.optkey = ["Typeclass";"Resolution";"After";"Apply"]; -- cgit v1.2.3 From 7ba82ed9f595c7d93bd40846993c2447572a817a Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Wed, 2 Nov 2016 15:54:37 +0100 Subject: Put string between quotes when printing an option value. This is a better (more generic) fix to #5061 than my e8b9ee76. --- library/goptions.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/goptions.ml b/library/goptions.ml index 35616558a6..dfb3c0e698 100644 --- a/library/goptions.ml +++ b/library/goptions.ml @@ -381,9 +381,9 @@ let msg_option_value (name,v) = | BoolValue false -> str "off" | IntValue (Some n) -> int n | IntValue None -> str "undefined" - | StringValue s -> str s + | StringValue s -> str "\"" ++ str s ++ str "\"" | StringOptValue None -> str"undefined" - | StringOptValue (Some s) -> str s + | StringOptValue (Some s) -> str "\"" ++ str s ++ str "\"" (* | IdentValue r -> pr_global_env Id.Set.empty r *) let print_option_value key = -- cgit v1.2.3 From 2c5eef988f11979175de6d1983bc533ce18b1095 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Wed, 2 Nov 2016 15:57:19 +0100 Subject: Fix various shortcomings of the warnings infrastructure. - The flags are now interpreted from left to right, without any other precedence rule. The previous one did not make much sense in interactive mode. - Set Warnings and Set Warnings Append are now synonyms, and have the "append" semantics, which is the most natural one for warnings. - Warnings on unknown warnings are now printed only once (previously the would be repeated on further calls to Set Warnings, sections closing, module requiring...). - Warning status strings are normalized, so that e.g. "+foo,-foo" is reduced to "-foo" (if foo exists, "" otherwise). --- lib/cWarnings.ml | 116 +++++++++++++++++++++++++++++++++++----------- lib/cWarnings.mli | 23 ++------- library/goptions.ml | 7 +-- library/goptions.mli | 14 ++++-- parsing/g_vernac.ml4 | 13 ++++-- toplevel/vernacentries.ml | 2 +- 6 files changed, 118 insertions(+), 57 deletions(-) diff --git a/lib/cWarnings.ml b/lib/cWarnings.ml index 720f54606c..68664d1ab2 100644 --- a/lib/cWarnings.ml +++ b/lib/cWarnings.ml @@ -21,7 +21,7 @@ let warnings : (string, t) Hashtbl.t = Hashtbl.create 97 let categories : (string, string list) Hashtbl.t = Hashtbl.create 97 let current_loc = ref Loc.ghost -let flags = ref "default" +let flags = ref "" let set_current_loc = (:=) current_loc @@ -62,7 +62,7 @@ let set_warning_status ~name status = try let w = Hashtbl.find warnings name in Hashtbl.replace warnings name { w with status = status } - with Not_found -> warn_unknown_warning name + with Not_found -> () let reset_default_warnings () = Hashtbl.iter (fun name w -> @@ -74,6 +74,13 @@ let set_all_warnings_status status = Hashtbl.replace warnings name { w with status }) warnings +let set_category_status ~name status = + let names = Hashtbl.find categories name in + List.iter (fun name -> set_warning_status name status) names + +let is_all_keyword name = CString.equal name "all" +let is_none_keyword s = CString.equal s "none" + let parse_flag s = if String.length s > 1 then match String.get s 0 with @@ -82,39 +89,94 @@ let parse_flag s = | _ -> (Enabled, s) else CErrors.error "Invalid warnings flag" -let rec do_all_keyword = function - | [] -> [] - | (status, name as item) :: items -> - if CString.equal name "all" then - (set_all_warnings_status status; do_all_keyword items) - else item :: do_all_keyword items - -let rec do_categories = function - | [] -> [] - | (status, name as item) :: items -> - try - let names = Hashtbl.find categories name in - List.iter (fun name -> set_warning_status name status) names; - do_categories items - with Not_found -> item :: do_categories items +let string_of_flag (status,name) = + match status with + | AsError -> "+" ^ name + | Disabled -> "-" ^ name + | Enabled -> name + +let string_of_flags flags = + String.concat "," (List.map string_of_flag flags) + +let set_status ~name status = + if is_all_keyword name then + set_all_warnings_status status + else + try + set_category_status ~name status + with Not_found -> + try + set_warning_status ~name status + with Not_found -> () + +let split_flags s = + let reg = Str.regexp "[ ,]+" in Str.split reg s + +let check_warning ~silent (_status,name) = + is_all_keyword name || + Hashtbl.mem categories name || + Hashtbl.mem warnings name || + (if not silent then warn_unknown_warning name; false) + +(** [cut_before_all_rev] removes all flags subsumed by a later occurrence of the + "all" flag, and reverses the list. *) +let rec cut_before_all_rev acc = function + | [] -> acc + | (_status,name as w) :: warnings -> + cut_before_all_rev (w :: if is_all_keyword name then [] else acc) warnings + +let cut_before_all_rev warnings = cut_before_all_rev [] warnings + +(** [uniquize_flags_rev] removes flags that are subsumed by later occurrences of + themselves or their categories, and reverses the list. *) +let uniquize_flags_rev flags = + let rec aux acc visited = function + | (_,name as flag)::flags -> + if CString.Set.mem name visited then aux acc visited flags else + let visited = + try + let warnings = Hashtbl.find categories name in + CString.Set.union visited (CString.Set.of_list warnings) + with Not_found -> + visited + in + aux (flag::acc) (CString.Set.add name visited) flags + | [] -> acc + in aux [] CString.Set.empty flags + +(** [normalize_flags] removes unknown or redundant warnings. If [silent] is + true, it emits a warning when an unknown warning is met. *) +let normalize_flags ~silent warnings = + let warnings = List.filter (check_warning ~silent) warnings in + let warnings = cut_before_all_rev warnings in + uniquize_flags_rev warnings + +let flags_of_string s = List.map parse_flag (split_flags s) + +let normalize_flags_string s = + if is_none_keyword s then s + else + let flags = flags_of_string s in + let flags = normalize_flags ~silent:false flags in + string_of_flags flags let rec parse_warnings items = - List.iter (fun (status, name) -> set_warning_status ~name status) items + CList.iter (fun (status, name) -> set_status ~name status) items (* For compatibility, we accept "none" *) -let parse_flags s = - if CString.equal s "none" then begin +let parse_flags s = + if is_none_keyword s then begin Flags.make_warn false; - set_all_warnings_status Disabled + set_all_warnings_status Disabled; + "none" end else begin Flags.make_warn true; - let reg = Str.regexp "[ ,]+" in - let items = List.map parse_flag (Str.split reg s) in - let items = do_all_keyword items in - let items = do_categories items in - parse_warnings items + let flags = flags_of_string s in + let flags = normalize_flags ~silent:true flags in + parse_warnings flags; + string_of_flags flags end let set_flags s = - flags := s; reset_default_warnings (); parse_flags s + reset_default_warnings (); let s = parse_flags s in flags := s diff --git a/lib/cWarnings.mli b/lib/cWarnings.mli index 3515542840..3f6cee31b7 100644 --- a/lib/cWarnings.mli +++ b/lib/cWarnings.mli @@ -6,29 +6,16 @@ (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) -type status = - Disabled | Enabled | AsError - -(* -type 'a repr = { - print : 'a -> Pp.std_ppcmds; - kind : string; - enabled : bool; -} - *) +type status = Disabled | Enabled | AsError val set_current_loc : Loc.t -> unit val create : name:string -> category:string -> ?default:status -> ('a -> Pp.std_ppcmds) -> ?loc:Loc.t -> 'a -> unit -(* -val emit : 'a t -> 'a -> unit - -type any = Any : string * string * 'a repr -> any - -val dump : unit -> any list - *) - val get_flags : unit -> string val set_flags : string -> unit + +(** Cleans up a user provided warnings status string, e.g. removing unknown + warnings (in which case a warning is emitted) or subsumed warnings . *) +val normalize_flags_string : string -> string diff --git a/library/goptions.ml b/library/goptions.ml index dfb3c0e698..9dc0f40588 100644 --- a/library/goptions.ml +++ b/library/goptions.ml @@ -247,7 +247,7 @@ let get_locality = function | Some false -> OptGlobal | None -> OptDefault -let declare_option cast uncast append +let declare_option cast uncast append ?(preprocess = fun x -> x) { optsync=sync; optdepr=depr; optname=name; optkey=key; optread=read; optwrite=write } = check_key key; let default = read() in @@ -275,10 +275,11 @@ let declare_option cast uncast append subst_function = subst_options; discharge_function = discharge_options; classify_function = classify_options } in - (fun l m v -> Lib.add_anonymous_leaf (options (l, m, v))) + (fun l m v -> let v = preprocess v in Lib.add_anonymous_leaf (options (l, m, v))) else (fun _ m v -> - match m with + let v = preprocess v in + match m with | OptSet -> write v | OptAppend -> write (append (read ()) v)) in diff --git a/library/goptions.mli b/library/goptions.mli index ca2df07104..3b3651f393 100644 --- a/library/goptions.mli +++ b/library/goptions.mli @@ -122,13 +122,19 @@ type 'a option_sig = { (** When an option is declared synchronous ([optsync] is [true]), the output is a synchronous write function. Otherwise it is [optwrite] *) +(** The [preprocess] function is triggered before setting the option. It can be + used to emit a warning on certain values, and clean-up the final value. *) type 'a write_function = 'a -> unit -val declare_int_option : int option option_sig -> int option write_function -val declare_bool_option : bool option_sig -> bool write_function -val declare_string_option: string option_sig -> string write_function -val declare_stringopt_option: string option option_sig -> string option write_function +val declare_int_option : ?preprocess:(int option -> int option) -> + int option option_sig -> int option write_function +val declare_bool_option : ?preprocess:(bool -> bool) -> + bool option_sig -> bool write_function +val declare_string_option: ?preprocess:(string -> string) -> + string option_sig -> string write_function +val declare_stringopt_option: ?preprocess:(string option -> string option) -> + string option option_sig -> string option write_function (** {6 Special functions supposed to be used only in vernacentries.ml } *) diff --git a/parsing/g_vernac.ml4 b/parsing/g_vernac.ml4 index e0d836df80..a33e7257ae 100644 --- a/parsing/g_vernac.ml4 +++ b/parsing/g_vernac.ml4 @@ -866,11 +866,16 @@ GEXTEND Gram | "Set"; table = option_table; v = option_value -> begin match v with | StringValue s -> - let (last, prefix) = List.sep_last table in - if String.equal last "Append" && not (List.is_empty prefix) then - VernacSetAppendOption (prefix, s) + (* We make a special case for warnings because appending is their + natural semantics *) + if CString.List.equal table ["Warnings"] then + VernacSetAppendOption (table, s) else - VernacSetOption (table, v) + let (last, prefix) = List.sep_last table in + if String.equal last "Append" && not (List.is_empty prefix) then + VernacSetAppendOption (prefix, s) + else + VernacSetOption (table, v) | _ -> VernacSetOption (table, v) end | "Set"; table = option_table -> diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index 4de1d95959..c03f183ff5 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -1491,7 +1491,7 @@ let _ = optwrite = (fun b -> Constrintern.parsing_explicit := b) } let _ = - declare_string_option + declare_string_option ~preprocess:CWarnings.normalize_flags_string { optsync = true; optdepr = false; optname = "warnings display"; -- cgit v1.2.3 From 6ec511721efc9235f6c2fa922a21dcb9b041bbfd Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Thu, 3 Nov 2016 15:51:39 +0100 Subject: Document options of typeclasses (eauto) With update after J. Gross comments --- doc/refman/Classes.tex | 85 +++++++++++++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 32 deletions(-) diff --git a/doc/refman/Classes.tex b/doc/refman/Classes.tex index e90621f046..144fc22b96 100644 --- a/doc/refman/Classes.tex +++ b/doc/refman/Classes.tex @@ -387,14 +387,16 @@ than {\tt eauto} and {\tt auto}. The main differences are the following: \item Contrary to {\tt eauto} and {\tt auto}, the resolution is done entirely in the new proof engine (as of Coq v8.6), meaning that backtracking is available among dependent subgoals, and shelving goals - is supported. It analyses the dependencies between subgoals to avoid + is supported. {\tt typeclasses eauto} is a multi-goal tactic. + It analyses the dependencies between subgoals to avoid backtracking on subgoals that are entirely independent. \item When called with no arguments, {\tt typeclasses eauto} uses the {\tt typeclass\_instances} database by default (instead of {\tt core}) and will try to solve \emph{only} typeclass goals. Other subgoals are automatically shelved and \emph{must be} resolved entirely when the - other typeclass subgoals are resolved. -\item The transparency information of databases is used consistently. + other typeclass subgoals are resolved or the proof search will fail. +\item The transparency information of databases is used consistently for + all hints declared in them. It is always used when calling the unifier. When considering the local hypotheses, we use the transparent state of the first hint database given. Using an empty database (created with {\tt Create HintDb} for example) with @@ -412,8 +414,9 @@ than {\tt eauto} and {\tt auto}. The main differences are the following: when searching with {\tt typeclasses eauto} than {\tt auto}. \item \label{with} {\tt typeclasses eauto with {\ident}$_1$ \ldots {\ident}$_n$}. - This variant runs resolution with the given hint databases. It does - not treat typeclass subgoals differently than others. + This variant runs resolution with the given hint databases. It treats + typeclass subgoals the same as other subgoals (no shelving of + non-typeclass goals in particular). \end{Variants} \asubsection{\tt autoapply {\term} with {\ident}} @@ -421,7 +424,7 @@ than {\tt eauto} and {\tt auto}. The main differences are the following: The tactic {\tt autoapply} applies a term using the transparency information of the hint database {\ident}, and does \emph{no} typeclass -resolution. This can be used in {\tt Hint Extern}'s for typeclasse +resolution. This can be used in {\tt Hint Extern}'s for typeclass instances (in hint db {\tt typeclass\_instances}) to allow backtracking on the typeclass subgoals created by the lemma application, rather than doing type class resolution locally at the hint @@ -445,50 +448,59 @@ abbreviate a type, like {\tt relation A := A -> A -> Prop}. This is equivalent to {\tt Hint Transparent,Opaque} {\ident} {\tt: typeclass\_instances}. -\subsection{\tt Set Typeclasses Module Eta} -\optindex{Typeclasses Modulo Eta} - -This allows eta-conversion during unification of type-classes. - \subsection{\tt Set Typeclasses Dependency Order} \optindex{Typeclasses Dependency Order} -This option (now on by default) respects the dependency order between +This option (on by default since 8.6) respects the dependency order between subgoals, meaning that subgoals which are depended on by other subgoals come first, while the non-dependent subgoals were put before the dependent ones previously (Coq v8.5 and below). This can result in quite different performance behaviors of proof search. +\subsection{\tt Set Typeclasses Filtered Unification} +\optindex{Typeclasses Filtered Unification} + +This option, available since Coq 8.6 and off by default, switches the +hint application procedure to a filter-then-unify strategy. To apply a +hint, we first check that the goal \emph{matches} syntactically the +inferred or specified pattern of the hint, and only then try to +\emph{unify} the goal with the conclusion of the hint. This can +drastically improve performance by calling unification less often, +matching syntactic patterns being very quick. This also provides more +control on the triggering of instances. For example, forcing a constant +to explicitely appear in the pattern will make it never apply on a goal +where there is a hole in that place. + \subsection{\tt Set Typeclasses Legacy Resolution} \optindex{Typeclasses Legacy Resolution} This option (off by default) uses the 8.5 implementation of resolution. Use for compatibility purposes only (porting and debugging). +\subsection{\tt Set Typeclasses Module Eta} +\optindex{Typeclasses Modulo Eta} + +This option allows eta-conversion for functions and records during +unification of type-classes. This option is now unsupported in 8.6 with +{\tt Typeclasses Filtered Unification} set, but still affects the +default unification strategy, and the one used in {\tt Legacy + Resolution} mode. It is \emph{unset} by default. If {\tt Typeclasses + Filtered Unification} is set, this has no effect and unification will +find solutions up-to eta conversion. Note however that syntactic +pattern-matching is not up-to eta. + \subsection{\tt Set Typeclasses Limit Intros} \optindex{Typeclasses Limit Intros} -This option (on by default in Coq 8.6 and below), controls the ability -to apply hints while avoiding eta-expansions in the proof term -generated. It does so by allowing hints that conclude in an product to +This option (on by default in Coq 8.6 and below) controls the ability to +apply hints while avoiding (functional) eta-expansions in the generated +proof term. It does so by allowing hints that conclude in a product to apply to a goal with a matching product directly, avoiding an -introduction. \emph{Warning:} can be expensive as it requires rebuilding -hint clauses dynamically, and does not benefit from the invertibility -status of the product introduction rule, resulting in more expensive -proof-search (i.e. more useless backtracking). - -\subsection{\tt Set Typeclasses Filtered Unification} -\optindex{Typeclasses Filtered Unification} - -This option, available since Coq 8.6, switches the hint application -procedure to a filter-then-unify strategy. To apply a hint, we first -check that it \emph{matches} syntactically the inferred pattern of the -hint, and only then try to \emph{unify} the goal with the conclusion of -the hint. This can drastically improve performance by calling -unification less often, matching syntactic patterns being very -quick. This also provides more control on the triggering of instances. -For example, forcing a constant to explicitely appear in the pattern -will make it never apply on a goal where there is a hole in that place. +introduction. \emph{Warning:} this can be expensive as it requires +rebuilding hint clauses dynamically, and does not benefit from the +invertibility status of the product introduction rule, resulting in +potentially more expensive proof-search (i.e. more useless +backtracking). \subsection{\tt Set Typeclass Resolution After Apply} \optindex{Typeclasses Resolution After Apply} @@ -544,6 +556,15 @@ The semantics of the options are: \item {\emph{depth}} This sets the depth limit of the search. \end{itemize} +\subsection{\tt Set Typeclasses Debug [Verbosity {\num}]} +\optindex{Typeclasses Debug} +\optindex{Typeclasses Debug Verbosity} + +These options allow to see the resolution steps of typeclasses that are +performed during search. The {\tt Debug} option is synonymous to +{\tt Debug Verbosity 1}, and {\tt Debug Verbosity 2} provides more +information (tried tactics, shelving of goals, etc\ldots). + \subsection{\tt Set Refine Instance Mode} \optindex{Refine Instance Mode} -- cgit v1.2.3 From d6fe6773c959493ed97108e1032b1bd8c1e78081 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Mon, 24 Oct 2016 18:18:33 +0200 Subject: Lets Hints/Instances take an optional pattern In addition to a priority, cleanup the interfaces for passing this information as well. The pattern, if given, takes priority over the inferred one. We only allow Existing Instances gr ... gr | pri. for now, without pattern, as before. Make the API compatible to 8.5 as well. --- doc/refman/Classes.tex | 2 +- doc/refman/RefMan-tac.tex | 6 ++-- intf/vernacexpr.mli | 12 +++++-- ltac/extratactics.ml4 | 3 +- ltac/rewrite.ml | 8 ++--- parsing/g_proofs.ml4 | 10 +++--- parsing/g_vernac.ml4 | 26 +++++++++----- parsing/pcoq.ml | 1 + parsing/pcoq.mli | 1 + pretyping/typeclasses.ml | 48 ++++++++++++------------- pretyping/typeclasses.mli | 17 ++++----- printing/ppvernac.ml | 22 +++++++----- printing/prettyp.ml | 2 +- tactics/class_tactics.ml | 18 ++++++---- tactics/hints.ml | 87 ++++++++++++++++++++++++---------------------- tactics/hints.mli | 36 +++++++++++++------ test-suite/success/Hints.v | 6 +++- toplevel/classes.ml | 33 +++++++++++------- toplevel/classes.mli | 8 ++--- toplevel/record.ml | 5 +-- toplevel/record.mli | 3 +- toplevel/vernacentries.ml | 10 +++--- 22 files changed, 212 insertions(+), 152 deletions(-) diff --git a/doc/refman/Classes.tex b/doc/refman/Classes.tex index 144fc22b96..254fca28f7 100644 --- a/doc/refman/Classes.tex +++ b/doc/refman/Classes.tex @@ -379,7 +379,7 @@ Declares variables according to the given binding context, which might use implicit generalization (see \ref{SectionContext}). \asubsection{\tt typeclasses eauto} -\tacindex{typeclasseseauto} +\tacindex{typeclasses eauto} The {\tt typeclasses eauto} tactic uses a different resolution engine than {\tt eauto} and {\tt auto}. The main differences are the following: diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex index c659e19e6b..0aa179d627 100644 --- a/doc/refman/RefMan-tac.tex +++ b/doc/refman/RefMan-tac.tex @@ -3718,12 +3718,14 @@ command to add a hint to some databases \ident$_1$, \dots, \ident$_n$ is The {\hintdef} is one of the following expressions: \begin{itemize} -\item {\tt Resolve \term} +\item {\tt Resolve \term {\zeroone{{\tt |} \zeroone{\num} \zeroone{\pattern}}}} \comindex{Hint Resolve} This command adds {\tt simple apply {\term}} to the hint list with the head symbol of the type of \term. The cost of that hint is - the number of subgoals generated by {\tt simple apply {\term}}. + the number of subgoals generated by {\tt simple apply {\term}} or \num + if specified. The associated pattern is inferred from the conclusion + of the type of \term or the given \pattern if specified. %{\tt auto} actually uses a slightly modified variant of {\tt simple apply} with use_metas_eagerly_in_conv_on_closed_terms set to false In case the inferred type of \term\ does not start with a product diff --git a/intf/vernacexpr.mli b/intf/vernacexpr.mli index 1336c92b6f..92e4dd618e 100644 --- a/intf/vernacexpr.mli +++ b/intf/vernacexpr.mli @@ -123,8 +123,14 @@ type hint_mode = | ModeNoHeadEvar (* No evar at the head *) | ModeOutput (* Anything *) +type 'a hint_info_gen = + { hint_priority : int option; + hint_pattern : 'a option } + +type hint_info_expr = constr_pattern_expr hint_info_gen + type hints_expr = - | HintsResolve of (int option * bool * reference_or_constr) list + | HintsResolve of (hint_info_expr * bool * reference_or_constr) list | HintsImmediate of reference_or_constr list | HintsUnfold of reference list | HintsTransparency of reference list * bool @@ -368,12 +374,12 @@ type vernac_expr = local_binder list * (* super *) typeclass_constraint * (* instance name, class name, params *) (bool * constr_expr) option * (* props *) - int option (* Priority *) + hint_info_expr | VernacContext of local_binder list | VernacDeclareInstances of - reference list * int option (* instance names, priority *) + (reference * hint_info_expr) list (* instances names, priorities and patterns *) | VernacDeclareClass of reference (* inductive or definition name *) diff --git a/ltac/extratactics.ml4 b/ltac/extratactics.ml4 index d0318fb5f6..063bfbe6d0 100644 --- a/ltac/extratactics.ml4 +++ b/ltac/extratactics.ml4 @@ -316,7 +316,8 @@ let project_hint pri l2r r = in let ctx = Evd.universe_context_set sigma in let c = Declare.declare_definition ~internal:Declare.InternalTacticRequest id (c,ctx) in - (pri,false,true,Hints.PathAny, Hints.IsGlobRef (Globnames.ConstRef c)) + let info = Vernacexpr.({hint_priority = pri; hint_pattern = None}) in + (info,false,true,Hints.PathAny, Hints.IsGlobRef (Globnames.ConstRef c)) let add_hints_iff l2r lc n bl = Hints.add_hints true bl diff --git a/ltac/rewrite.ml b/ltac/rewrite.ml index 4d7c5d0e4b..44efdd383f 100644 --- a/ltac/rewrite.ml +++ b/ltac/rewrite.ml @@ -1788,7 +1788,7 @@ let declare_instance a aeq n s = declare_an_instance n s [a;aeq] let anew_instance global binders instance fields = new_instance (Flags.is_universe_polymorphism ()) binders instance (Some (true, CRecord (Loc.ghost,fields))) - ~global ~generalize:false ~refine:false None + ~global ~generalize:false ~refine:false Hints.empty_hint_info let declare_instance_refl global binders a aeq n lemma = let instance = declare_instance a aeq (add_suffix n "_Reflexive") "Coq.Classes.RelationClasses.Reflexive" @@ -1969,7 +1969,7 @@ let add_morphism_infer glob m n = Decl_kinds.IsAssumption Decl_kinds.Logical) in add_instance (Typeclasses.new_instance - (Lazy.force PropGlobal.proper_class) None glob + (Lazy.force PropGlobal.proper_class) Hints.empty_hint_info glob poly (ConstRef cst)); declare_projection n instance_id (ConstRef cst) else @@ -1980,7 +1980,7 @@ let add_morphism_infer glob m n = let hook _ = function | Globnames.ConstRef cst -> add_instance (Typeclasses.new_instance - (Lazy.force PropGlobal.proper_class) None + (Lazy.force PropGlobal.proper_class) Hints.empty_hint_info glob poly (ConstRef cst)); declare_projection n instance_id (ConstRef cst) | _ -> assert false @@ -2004,7 +2004,7 @@ let add_morphism glob binders m s n = let tac = Tacinterp.interp (make_tactic "add_morphism_tactic") in ignore(new_instance ~global:glob poly binders instance (Some (true, CRecord (Loc.ghost,[]))) - ~generalize:false ~tac ~hook:(declare_projection n instance_id) None) + ~generalize:false ~tac ~hook:(declare_projection n instance_id) Hints.empty_hint_info) (** Bind to "rewrite" too *) diff --git a/parsing/g_proofs.ml4 b/parsing/g_proofs.ml4 index 1e3c4b880b..70c5d5d88b 100644 --- a/parsing/g_proofs.ml4 +++ b/parsing/g_proofs.ml4 @@ -103,10 +103,9 @@ GEXTEND Gram (* Declare "Resolve" explicitly so as to be able to later extend with "Resolve ->" and "Resolve <-" *) | IDENT "Hint"; IDENT "Resolve"; lc = LIST1 reference_or_constr; - pri = OPT [ "|"; i = natural -> i ]; - dbnames = opt_hintbases -> + info = hint_info; dbnames = opt_hintbases -> VernacHints (false,dbnames, - HintsResolve (List.map (fun x -> (pri, true, x)) lc)) + HintsResolve (List.map (fun x -> (info, true, x)) lc)) ] ]; obsolete_locality: [ [ IDENT "Local" -> true | -> false ] ] @@ -116,9 +115,8 @@ GEXTEND Gram | c = constr -> HintsConstr c ] ] ; hint: - [ [ IDENT "Resolve"; lc = LIST1 reference_or_constr; - pri = OPT [ "|"; i = natural -> i ] -> - HintsResolve (List.map (fun x -> (pri, true, x)) lc) + [ [ IDENT "Resolve"; lc = LIST1 reference_or_constr; info = hint_info -> + HintsResolve (List.map (fun x -> (info, true, x)) lc) | IDENT "Immediate"; lc = LIST1 reference_or_constr -> HintsImmediate lc | IDENT "Transparent"; lc = LIST1 global -> HintsTransparency (lc, true) | IDENT "Opaque"; lc = LIST1 global -> HintsTransparency (lc, false) diff --git a/parsing/g_vernac.ml4 b/parsing/g_vernac.ml4 index e0d836df80..ffc27d6051 100644 --- a/parsing/g_vernac.ml4 +++ b/parsing/g_vernac.ml4 @@ -582,7 +582,7 @@ let warn_deprecated_implicit_arguments = (* Extensions: implicits, coercions, etc. *) GEXTEND Gram - GLOBAL: gallina_ext instance_name; + GLOBAL: gallina_ext instance_name hint_info; gallina_ext: [ [ (* Transparent and Opaque *) @@ -635,17 +635,20 @@ GEXTEND Gram | IDENT "Instance"; namesup = instance_name; ":"; expl = [ "!" -> Decl_kinds.Implicit | -> Decl_kinds.Explicit ] ; t = operconstr LEVEL "200"; - pri = OPT [ "|"; i = natural -> i ] ; + info = hint_info ; props = [ ":="; "{"; r = record_declaration; "}" -> Some (true,r) | ":="; c = lconstr -> Some (false,c) | -> None ] -> - VernacInstance (false,snd namesup,(fst namesup,expl,t),props,pri) + VernacInstance (false,snd namesup,(fst namesup,expl,t),props,info) | IDENT "Existing"; IDENT "Instance"; id = global; - pri = OPT [ "|"; i = natural -> i ] -> - VernacDeclareInstances ([id], pri) + info = hint_info -> + VernacDeclareInstances [id, info] + | IDENT "Existing"; IDENT "Instances"; ids = LIST1 global; - pri = OPT [ "|"; i = natural -> i ] -> - VernacDeclareInstances (ids, pri) + pri = OPT [ "|"; i = natural -> i ] -> + let info = { hint_priority = pri; hint_pattern = None } in + let insts = List.map (fun i -> (i, info)) ids in + VernacDeclareInstances insts | IDENT "Existing"; IDENT "Class"; is = global -> VernacDeclareClass is @@ -786,6 +789,11 @@ GEXTEND Gram (Option.default [] sup) | -> ((!@loc, Anonymous), None), [] ] ] ; + hint_info: + [ [ "|"; i = OPT natural; pat = OPT constr_pattern -> + { hint_priority = i; hint_pattern = pat } + | -> { hint_priority = None; hint_pattern = None } ] ] + ; reserv_list: [ [ bl = LIST1 reserv_tuple -> bl | b = simple_reserv -> [b] ] ] ; @@ -807,8 +815,8 @@ GEXTEND Gram (* Hack! Should be in grammar_ext, but camlp4 factorize badly *) | IDENT "Declare"; IDENT "Instance"; namesup = instance_name; ":"; expl = [ "!" -> Decl_kinds.Implicit | -> Decl_kinds.Explicit ] ; t = operconstr LEVEL "200"; - pri = OPT [ "|"; i = natural -> i ] -> - VernacInstance (true, snd namesup, (fst namesup, expl, t), None, pri) + info = hint_info -> + VernacInstance (true, snd namesup, (fst namesup, expl, t), None, info) (* System directory *) | IDENT "Pwd" -> VernacChdir None diff --git a/parsing/pcoq.ml b/parsing/pcoq.ml index 9e9a7e723e..7dc02190ea 100644 --- a/parsing/pcoq.ml +++ b/parsing/pcoq.ml @@ -379,6 +379,7 @@ module Vernac_ = let vernac = gec_vernac "Vernac.vernac" let vernac_eoi = eoi_entry vernac let rec_definition = gec_vernac "Vernac.rec_definition" + let hint_info = gec_vernac "hint_info" (* Main vernac entry *) let main_entry = Gram.entry_create "vernac" let noedit_mode = gec_vernac "noedit_command" diff --git a/parsing/pcoq.mli b/parsing/pcoq.mli index 7f6caf63fb..ec8dac8210 100644 --- a/parsing/pcoq.mli +++ b/parsing/pcoq.mli @@ -213,6 +213,7 @@ module Vernac_ : val vernac_eoi : vernac_expr Gram.entry val noedit_mode : vernac_expr Gram.entry val command_entry : vernac_expr Gram.entry + val hint_info : Vernacexpr.hint_info_expr Gram.entry end (** The main entry: reads an optional vernac command *) diff --git a/pretyping/typeclasses.ml b/pretyping/typeclasses.ml index 31ef3dfdd7..b8da6b6852 100644 --- a/pretyping/typeclasses.ml +++ b/pretyping/typeclasses.ml @@ -65,7 +65,8 @@ type typeclass = { cl_props : Context.Rel.t; (* The method implementaions as projections. *) - cl_projs : (Name.t * (direction * int option) option * constant option) list; + cl_projs : (Name.t * (direction * Vernacexpr.hint_info_expr) option + * constant option) list; cl_strict : bool; @@ -76,10 +77,9 @@ type typeclasses = typeclass Refmap.t type instance = { is_class: global_reference; - is_pri: int option; + is_info: Vernacexpr.hint_info_expr; (* Sections where the instance should be redeclared, - -1 for discard, 0 for none, mutable to avoid redeclarations - when multiple rebuild_object happen. *) + -1 for discard, 0 for none. *) is_global: int; is_poly: bool; is_impl: global_reference; @@ -89,15 +89,15 @@ type instances = (instance Refmap.t) Refmap.t let instance_impl is = is.is_impl -let instance_priority is = is.is_pri +let hint_priority is = is.is_info.Vernacexpr.hint_priority -let new_instance cl pri glob poly impl = +let new_instance cl info glob poly impl = let global = if glob then Lib.sections_depth () else -1 in { is_class = cl.cl_impl; - is_pri = pri ; + is_info = info ; is_global = global ; is_poly = poly; is_impl = impl } @@ -274,7 +274,9 @@ let check_instance env sigma c = not (Evd.has_undefined evd) with e when CErrors.noncritical e -> false -let build_subclasses ~check env sigma glob pri = +open Vernacexpr + +let build_subclasses ~check env sigma glob { hint_priority = pri } = let _id = Nametab.basename_of_global glob in let _next_id = let i = ref (-1) in @@ -297,24 +299,24 @@ let build_subclasses ~check env sigma glob pri = match b with | None -> None | Some (Backward, _) -> None - | Some (Forward, pri') -> + | Some (Forward, info) -> let proj = Option.get proj in let body = it_mkLambda_or_LetIn (mkApp (mkConstU (proj,u), projargs)) rels in if check && check_instance env sigma body then None else - let pri = - match pri, pri' with + let newpri = + match pri, info.hint_priority with | Some p, Some p' -> Some (p + p') | Some p, None -> Some (p + 1) | _, _ -> None in - Some (ConstRef proj, pri, body)) tc.cl_projs + Some (ConstRef proj, { info with hint_priority = newpri }, body)) tc.cl_projs in - let declare_proj hints (cref, pri, body) = + let declare_proj hints (cref, info, body) = let path' = cref :: path in let ty = Retyping.get_type_of env sigma body in let rest = aux pri body ty path' in - hints @ (path', pri, body) :: rest + hints @ (path', info, body) :: rest in List.fold_left declare_proj [] projs in let term = Universes.constr_of_global_univ (glob,Univ.UContext.instance ctx) in @@ -368,11 +370,11 @@ let is_local i = Int.equal i.is_global (-1) let add_instance check inst = let poly = Global.is_polymorphic inst.is_impl in add_instance_hint (IsGlobal inst.is_impl) [inst.is_impl] (is_local inst) - inst.is_pri poly; + inst.is_info poly; List.iter (fun (path, pri, c) -> add_instance_hint (IsConstr c) path (is_local inst) pri poly) (build_subclasses ~check:(check && not (isVarRef inst.is_impl)) - (Global.env ()) (Evd.from_env (Global.env ())) inst.is_impl inst.is_pri) + (Global.env ()) (Evd.from_env (Global.env ())) inst.is_impl inst.is_info) let rebuild_instance (action, inst) = let () = match action with @@ -404,26 +406,22 @@ let remove_instance i = Lib.add_anonymous_leaf (instance_input (RemoveInstance, i)); remove_instance_hint i.is_impl -let declare_instance pri local glob = +let declare_instance info local glob = let ty = Global.type_of_global_unsafe glob in + let info = Option.default {hint_priority = None; hint_pattern = None} info in match class_of_constr ty with | Some (rels, ((tc,_), args) as _cl) -> - add_instance (new_instance tc pri (not local) (Flags.use_polymorphic_flag ()) glob) -(* let path, hints = build_subclasses (not local) (Global.env ()) Evd.empty glob in *) -(* let entries = List.map (fun (path, pri, c) -> (pri, local, path, c)) hints in *) -(* Auto.add_hints local [typeclasses_db] (Auto.HintsResolveEntry entries); *) -(* Auto.add_hints local [typeclasses_db] *) -(* (Auto.HintsCutEntry (PathSeq (PathStar (PathAtom PathAny), path))) *) + add_instance (new_instance tc info (not local) (Flags.use_polymorphic_flag ()) glob) | None -> () let add_class cl = add_class cl; List.iter (fun (n, inst, body) -> match inst with - | Some (Backward, pri) -> + | Some (Backward, info) -> (match body with | None -> CErrors.error "Non-definable projection can not be declared as a subinstance" - | Some b -> declare_instance pri false (ConstRef b)) + | Some b -> declare_instance (Some info) false (ConstRef b)) | _ -> ()) cl.cl_projs diff --git a/pretyping/typeclasses.mli b/pretyping/typeclasses.mli index 2530f5dfae..620bc367bd 100644 --- a/pretyping/typeclasses.mli +++ b/pretyping/typeclasses.mli @@ -32,7 +32,7 @@ type typeclass = { Some may be undefinable due to sorting restrictions or simply undefined if no name is provided. The [int option option] indicates subclasses whose hint has the given priority. *) - cl_projs : (Name.t * (direction * int option) option * constant option) list; + cl_projs : (Name.t * (direction * Vernacexpr.hint_info_expr) option * constant option) list; (** Whether we use matching or full unification during resolution *) cl_strict : bool; @@ -50,7 +50,7 @@ val all_instances : unit -> instance list val add_class : typeclass -> unit -val new_instance : typeclass -> int option -> bool -> Decl_kinds.polymorphic -> +val new_instance : typeclass -> Vernacexpr.hint_info_expr -> bool -> Decl_kinds.polymorphic -> global_reference -> instance val add_instance : instance -> unit val remove_instance : instance -> unit @@ -71,7 +71,7 @@ val class_of_constr : constr -> (Context.Rel.t * (typeclass puniverses * constr val instance_impl : instance -> global_reference -val instance_priority : instance -> int option +val hint_priority : instance -> int option val is_class : global_reference -> bool val is_instance : global_reference -> bool @@ -113,21 +113,22 @@ val classes_transparent_state : unit -> transparent_state val add_instance_hint_hook : (global_reference_or_constr -> global_reference list -> - bool (* local? *) -> int option -> Decl_kinds.polymorphic -> unit) Hook.t + bool (* local? *) -> Vernacexpr.hint_info_expr -> Decl_kinds.polymorphic -> unit) Hook.t val remove_instance_hint_hook : (global_reference -> unit) Hook.t val add_instance_hint : global_reference_or_constr -> global_reference list -> - bool -> int option -> Decl_kinds.polymorphic -> unit + bool -> Vernacexpr.hint_info_expr -> Decl_kinds.polymorphic -> unit val remove_instance_hint : global_reference -> unit val solve_all_instances_hook : (env -> evar_map -> evar_filter -> bool -> bool -> bool -> evar_map) Hook.t val solve_one_instance_hook : (env -> evar_map -> types -> bool -> open_constr) Hook.t -val declare_instance : int option -> bool -> global_reference -> unit +val declare_instance : Vernacexpr.hint_info_expr option -> bool -> global_reference -> unit (** Build the subinstances hints for a given typeclass object. check tells if we should check for existence of the subinstances and add only the missing ones. *) -val build_subclasses : check:bool -> env -> evar_map -> global_reference -> int option (* priority *) -> - (global_reference list * int option * constr) list +val build_subclasses : check:bool -> env -> evar_map -> global_reference -> + Vernacexpr.hint_info_expr -> + (global_reference list * Vernacexpr.hint_info_expr * constr) list diff --git a/printing/ppvernac.ml b/printing/ppvernac.ml index 5455ab891a..3494ad006f 100644 --- a/printing/ppvernac.ml +++ b/printing/ppvernac.ml @@ -166,14 +166,17 @@ module Make | ModeNoHeadEvar -> str"!" | ModeOutput -> str"-" + let pr_hint_info pr_pat { hint_priority = pri; hint_pattern = pat } = + pr_opt (fun x -> str"|" ++ int x) pri ++ + pr_opt (fun y -> (if Option.is_empty pri then str"| " else mt()) ++ pr_pat y) pat + let pr_hints db h pr_c pr_pat = let opth = pr_opt_hintbases db in let pph = match h with | HintsResolve l -> keyword "Resolve " ++ prlist_with_sep sep - (fun (pri, _, c) -> pr_reference_or_constr pr_c c ++ - match pri with Some x -> spc () ++ str"(" ++ int x ++ str")" | None -> mt ()) + (fun (info, _, c) -> pr_reference_or_constr pr_c c ++ pr_hint_info pr_pat info) l | HintsImmediate l -> keyword "Immediate" ++ spc() ++ @@ -888,7 +891,7 @@ module Make spc() ++ pr_class_rawexpr c2) ) - | VernacInstance (abst, sup, (instid, bk, cl), props, pri) -> + | VernacInstance (abst, sup, (instid, bk, cl), props, info) -> return ( hov 1 ( (if abst then keyword "Declare" ++ spc () else mt ()) ++ @@ -899,7 +902,7 @@ module Make pr_and_type_binders_arg sup ++ str":" ++ spc () ++ (match bk with Implicit -> str "! " | Explicit -> mt ()) ++ - pr_constr cl ++ pr_priority pri ++ + pr_constr cl ++ pr_hint_info pr_constr_pattern_expr info ++ (match props with | Some (true,CRecord (_,l)) -> spc () ++ str":=" ++ spc () ++ str"{" ++ pr_record_body l ++ str "}" | Some (true,_) -> assert false @@ -913,11 +916,14 @@ module Make keyword "Context" ++ spc () ++ pr_and_type_binders_arg l) ) - | VernacDeclareInstances (ids, pri) -> - return ( + | VernacDeclareInstances insts -> + let pr_inst (id, info) = + pr_reference id ++ pr_hint_info pr_constr_pattern_expr info + in + return ( hov 1 (keyword "Existing" ++ spc () ++ - keyword(String.plural (List.length ids) "Instance") ++ - spc () ++ prlist_with_sep spc pr_reference ids ++ pr_priority pri) + keyword(String.plural (List.length insts) "Instance") ++ + spc () ++ prlist_with_sep (fun () -> str", ") pr_inst insts) ) | VernacDeclareClass id -> diff --git a/printing/prettyp.ml b/printing/prettyp.ml index b590a8c930..e117f1dcb0 100644 --- a/printing/prettyp.ml +++ b/printing/prettyp.ml @@ -872,7 +872,7 @@ let pr_instance env i = (* gallina_print_constant_with_infos i.is_impl *) (* lighter *) print_ref false (instance_impl i) ++ - begin match instance_priority i with + begin match hint_priority i with | None -> mt () | Some i -> spc () ++ str "|" ++ spc () ++ int i end diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 9cb6b7fe78..da91674f5d 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -539,10 +539,16 @@ let make_resolve_hyp env sigma st flags only_classes pri decl = let name = PathHints [VarRef id] in let hints = if is_class then - let hints = build_subclasses ~check:false env sigma (VarRef id) None in + let hints = build_subclasses ~check:false env sigma (VarRef id) empty_hint_info in (List.map_append - (fun (path,pri, c) -> make_resolves env sigma ~name:(PathHints path) - (true,false,Flags.is_verbose()) pri false + (fun (path,info,c) -> + let info = + { info with Vernacexpr.hint_pattern = + Option.map (Constrintern.intern_constr_pattern env) + info.Vernacexpr.hint_pattern } + in + make_resolves env sigma ~name:(PathHints path) + (true,false,Flags.is_verbose()) info false (IsConstr (c,Univ.ContextSet.empty))) hints) else [] @@ -567,7 +573,7 @@ let make_hints g st only_classes sign = in if consider then let hint = - pf_apply make_resolve_hyp g st (true,false,false) only_classes None hyp + pf_apply make_resolve_hyp g st (true,false,false) only_classes empty_hint_info hyp in hint @ hints else hints) ([]) sign @@ -636,7 +642,7 @@ module V85 = struct let env = Goal.V82.env s g' in let context = Environ.named_context_of_val (Goal.V82.hyps s g') in let hint = make_resolve_hyp env s (Hint_db.transparent_state info.hints) - (true,false,false) info.only_classes None (List.hd context) in + (true,false,false) info.only_classes empty_hint_info (List.hd context) in let ldb = Hint_db.add_list env s hint info.hints in (g', { info with is_evar = None; hints = ldb; auto_last_tac = lazy (str"intro") })) gls @@ -1140,7 +1146,7 @@ module Search = struct let decl = Tacmach.New.pf_last_hyp gl in let hint = make_resolve_hyp env s (Hint_db.transparent_state info.search_hints) - (true,false,false) info.search_only_classes None decl in + (true,false,false) info.search_only_classes empty_hint_info decl in let ldb = Hint_db.add_list env s hint info.search_hints in let info' = { info with search_hints = ldb; last_tac = lazy (str"intro") } diff --git a/tactics/hints.ml b/tactics/hints.ml index 823af0b0a5..9cbfe20d96 100644 --- a/tactics/hints.ml +++ b/tactics/hints.ml @@ -84,6 +84,8 @@ let secvars_of_hyps hyps = if all then Id.Pred.full (* If the whole section context is available *) else pred +let empty_hint_info = Vernacexpr.{ hint_priority = None; hint_pattern = None } + (************************************************************************) (* The Type of Constructions Autotactic Hints *) (************************************************************************) @@ -736,7 +738,7 @@ let secvars_of_constr env c = let secvars_of_global env gr = secvars_of_idset (vars_of_global_reference env gr) -let make_exact_entry env sigma pri poly ?(name=PathAny) (c, cty, ctx) = +let make_exact_entry env sigma info poly ?(name=PathAny) (c, cty, ctx) = let secvars = secvars_of_constr env c in let cty = strip_outer_cast cty in match kind_of_term cty with @@ -747,16 +749,17 @@ let make_exact_entry env sigma pri poly ?(name=PathAny) (c, cty, ctx) = try head_pattern_bound pat with BoundPattern -> failwith "make_exact_entry" in - (Some hd, - { pri = (match pri with None -> 0 | Some p -> p); - poly = poly; - pat = Some pat; - name = name; - db = None; - secvars; - code = with_uid (Give_exact (c, cty, ctx)); }) + let pri = match info.hint_priority with None -> 0 | Some p -> p in + let pat = match info.hint_pattern with + | Some pat -> snd pat + | None -> pat + in + (Some hd, + { pri; poly; pat = Some pat; name; + db = None; secvars; + code = with_uid (Give_exact (c, cty, ctx)); }) -let make_apply_entry env sigma (eapply,hnf,verbose) pri poly ?(name=PathAny) (c, cty, ctx) = +let make_apply_entry env sigma (eapply,hnf,verbose) info poly ?(name=PathAny) (c, cty, ctx) = let cty = if hnf then hnf_constr env sigma cty else cty in match kind_of_term cty with | Prod _ -> @@ -769,12 +772,13 @@ let make_apply_entry env sigma (eapply,hnf,verbose) pri poly ?(name=PathAny) (c, with BoundPattern -> failwith "make_apply_entry" in let nmiss = List.length (clenv_missing ce) in let secvars = secvars_of_constr env c in + let pri = match info.hint_priority with None -> nb_hyp cty + nmiss | Some p -> p in + let pat = match info.hint_pattern with + | Some p -> snd p | None -> pat + in if Int.equal nmiss 0 then (Some hd, - { pri = (match pri with None -> nb_hyp cty | Some p -> p); - poly = poly; - pat = Some pat; - name = name; + { pri; poly; pat = Some pat; name; db = None; secvars; code = with_uid (Res_pf(c,cty,ctx)); }) @@ -784,12 +788,8 @@ let make_apply_entry env sigma (eapply,hnf,verbose) pri poly ?(name=PathAny) (c, Feedback.msg_info (str "the hint: eapply " ++ pr_lconstr c ++ str " will only be used by eauto"); (Some hd, - { pri = (match pri with None -> nb_hyp cty + nmiss | Some p -> p); - poly = poly; - pat = Some pat; - name = name; - db = None; - secvars; + { pri; poly; pat = Some pat; name; + db = None; secvars; code = with_uid (ERes_pf(c,cty,ctx)); }) end | _ -> failwith "make_apply_entry" @@ -840,14 +840,14 @@ let fresh_global_or_constr env sigma poly cr = (c, Univ.ContextSet.empty) end -let make_resolves env sigma flags pri poly ?name cr = +let make_resolves env sigma flags info poly ?name cr = let c, ctx = fresh_global_or_constr env sigma poly cr in let cty = Retyping.get_type_of env sigma c in let try_apply f = try Some (f (c, cty, ctx)) with Failure _ -> None in let ents = List.map_filter try_apply - [make_exact_entry env sigma pri poly ?name; - make_apply_entry env sigma flags pri poly ?name] + [make_exact_entry env sigma info poly ?name; + make_apply_entry env sigma flags info poly ?name] in if List.is_empty ents then errorlabstrm "Hint" @@ -861,7 +861,7 @@ let make_resolve_hyp env sigma decl = let hname = get_id decl in let c = mkVar hname in try - [make_apply_entry env sigma (true, true, false) None false + [make_apply_entry env sigma (true, true, false) empty_hint_info false ~name:(PathHints [VarRef hname]) (c, get_type decl, Univ.ContextSet.empty)] with @@ -1145,16 +1145,17 @@ let add_transparency l b local dbnames = Lib.add_anonymous_leaf (inAutoHint hint)) dbnames -let add_extern pri pat tacast local dbname = - let pat = match pat with +let add_extern info tacast local dbname = + let pat = match info.hint_pattern with | None -> None | Some (_, pat) -> Some pat in - let hint = make_hint ~local dbname (AddHints [make_extern pri pat tacast]) in + let hint = make_hint ~local dbname + (AddHints [make_extern (Option.get info.hint_priority) pat tacast]) in Lib.add_anonymous_leaf (inAutoHint hint) -let add_externs pri pat tacast local dbnames = - List.iter (add_extern pri pat tacast local) dbnames +let add_externs info tacast local dbnames = + List.iter (add_extern info tacast local) dbnames let add_trivials env sigma l local dbnames = List.iter @@ -1168,15 +1169,16 @@ let (forward_intern_tac, extern_intern_tac) = Hook.make () type hnf = bool +type hint_info = (patvar list * constr_pattern) hint_info_gen + type hints_entry = - | HintsResolveEntry of (int option * polymorphic * hnf * hints_path_atom * hint_term) list + | HintsResolveEntry of (hint_info * polymorphic * hnf * hints_path_atom * hint_term) list | HintsImmediateEntry of (hints_path_atom * polymorphic * hint_term) list | HintsCutEntry of hints_path | HintsUnfoldEntry of evaluable_global_reference list | HintsTransparencyEntry of evaluable_global_reference list * bool | HintsModeEntry of global_reference * hint_mode list - | HintsExternEntry of - int * (patvar list * constr_pattern) option * glob_tactic_expr + | HintsExternEntry of hint_info * glob_tactic_expr let default_prepare_hint_ident = Id.of_string "H" @@ -1240,11 +1242,12 @@ let interp_hints poly = (PathHints [gr], poly, IsGlobRef gr) | HintsConstr c -> (PathAny, poly, f poly c) in - let fres (pri, b, r) = + let fp = Constrintern.intern_constr_pattern (Global.env()) in + let fres (info, b, r) = let path, poly, gr = fi r in - (pri, poly, b, path, gr) + let info = { info with hint_pattern = Option.map fp info.hint_pattern } in + (info, poly, b, path, gr) in - let fp = Constrintern.intern_constr_pattern (Global.env()) in match h with | HintsResolve lhints -> HintsResolveEntry (List.map fres lhints) | HintsImmediate lhints -> HintsImmediateEntry (List.map fi lhints) @@ -1260,14 +1263,14 @@ let interp_hints poly = List.init (nconstructors ind) (fun i -> let c = (ind,i+1) in let gr = ConstructRef c in - None, mib.Declarations.mind_polymorphic, true, + empty_hint_info, mib.Declarations.mind_polymorphic, true, PathHints [gr], IsGlobRef gr) in HintsResolveEntry (List.flatten (List.map constr_hints_of_ind lqid)) | HintsExtern (pri, patcom, tacexp) -> let pat = Option.map fp patcom in let l = match pat with None -> [] | Some (l, _) -> l in let tacexp = Hook.get forward_intern_tac l tacexp in - HintsExternEntry (pri, pat, tacexp) + HintsExternEntry ({ hint_priority = Some pri; hint_pattern = pat }, tacexp) let add_hints local dbnames0 h = if String.List.mem "nocore" dbnames0 then @@ -1283,8 +1286,8 @@ let add_hints local dbnames0 h = | HintsUnfoldEntry lhints -> add_unfolds lhints local dbnames | HintsTransparencyEntry (lhints, b) -> add_transparency lhints b local dbnames - | HintsExternEntry (pri, pat, tacexp) -> - add_externs pri pat tacexp local dbnames + | HintsExternEntry (info, tacexp) -> + add_externs info tacexp local dbnames let expand_constructor_hints env sigma lems = List.map_append (fun (evd,lem) -> @@ -1308,7 +1311,7 @@ let add_hint_lemmas env sigma eapply lems hint_db = let lems = expand_constructor_hints env sigma lems in let hintlist' = List.map_append (fun (poly, lem) -> - make_resolves env sigma (eapply,true,false) None poly lem) lems in + make_resolves env sigma (eapply,true,false) empty_hint_info poly lem) lems in Hint_db.add_list env sigma hintlist' hint_db let make_local_hint_db env sigma ts eapply lems = @@ -1362,7 +1365,9 @@ let pr_hint h = match h.obj with (str "(*external*) " ++ Pptactic.pr_glb_generic env tac) let pr_id_hint (id, v) = - (pr_hint v.code ++ str"(level " ++ int v.pri ++ str", id " ++ int id ++ str ")" ++ spc ()) + let pr_pat p = str", pattern " ++ pr_lconstr_pattern p in + (pr_hint v.code ++ str"(level " ++ int v.pri ++ pr_opt_no_spc pr_pat v.pat + ++ str", id " ++ int id ++ str ")" ++ spc ()) let pr_hint_list hintlist = (str " " ++ hov 0 (prlist pr_id_hint hintlist) ++ fnl ()) diff --git a/tactics/hints.mli b/tactics/hints.mli index 8145ae1936..42a2896ed8 100644 --- a/tactics/hints.mli +++ b/tactics/hints.mli @@ -27,6 +27,8 @@ val decompose_app_bound : constr -> global_reference * constr array val secvars_of_hyps : Context.Named.t -> Id.Pred.t +val empty_hint_info : 'a hint_info_gen + (** Pre-created hint databases *) type 'a hint_ast = @@ -129,20 +131,21 @@ type hint_db = Hint_db.t type hnf = bool +type hint_info = (patvar list * constr_pattern) hint_info_gen + type hint_term = | IsGlobRef of global_reference | IsConstr of constr * Univ.universe_context_set type hints_entry = - | HintsResolveEntry of (int option * polymorphic * hnf * hints_path_atom * - hint_term) list + | HintsResolveEntry of + (hint_info * polymorphic * hnf * hints_path_atom * hint_term) list | HintsImmediateEntry of (hints_path_atom * polymorphic * hint_term) list | HintsCutEntry of hints_path | HintsUnfoldEntry of evaluable_global_reference list | HintsTransparencyEntry of evaluable_global_reference list * bool | HintsModeEntry of global_reference * hint_mode list - | HintsExternEntry of - int * (patvar list * constr_pattern) option * Tacexpr.glob_tactic_expr + | HintsExternEntry of hint_info * Tacexpr.glob_tactic_expr val searchtable_map : hint_db_name -> hint_db @@ -169,23 +172,34 @@ val prepare_hint : bool (* Check no remaining evars *) -> (bool * bool) (* polymorphic or monomorphic, local or global *) -> env -> evar_map -> open_constr -> hint_term -(** [make_exact_entry pri (c, ctyp, ctx, secvars)]. +(** [make_exact_entry info (c, ctyp, ctx)]. [c] is the term given as an exact proof to solve the goal; [ctyp] is the type of [c]. - [ctx] is its (refreshable) universe context. *) -val make_exact_entry : env -> evar_map -> int option -> polymorphic -> ?name:hints_path_atom -> + [ctx] is its (refreshable) universe context. + In info: + [hint_priority] is the hint's desired priority, it is 0 if unspecified + [hint_pattern] is the hint's desired pattern, it is inferred if not specified +*) + +val make_exact_entry : env -> evar_map -> hint_info -> polymorphic -> ?name:hints_path_atom -> (constr * types * Univ.universe_context_set) -> hint_entry -(** [make_apply_entry (eapply,hnf,verbose) pri (c,cty,ctx,secvars)]. +(** [make_apply_entry (eapply,hnf,verbose) info (c,cty,ctx))]. [eapply] is true if this hint will be used only with EApply; [hnf] should be true if we should expand the head of cty before searching for products; [c] is the term given as an exact proof to solve the goal; [cty] is the type of [c]. - [ctx] is its (refreshable) universe context. *) + [ctx] is its (refreshable) universe context. + In info: + [hint_priority] is the hint's desired priority, it is computed as the number of products in [cty] + if unspecified + [hint_pattern] is the hint's desired pattern, it is inferred from the conclusion of [cty] + if not specified +*) val make_apply_entry : - env -> evar_map -> bool * bool * bool -> int option -> polymorphic -> ?name:hints_path_atom -> + env -> evar_map -> bool * bool * bool -> hint_info -> polymorphic -> ?name:hints_path_atom -> (constr * types * Univ.universe_context_set) -> hint_entry (** A constr which is Hint'ed will be: @@ -196,7 +210,7 @@ val make_apply_entry : has missing arguments. *) val make_resolves : - env -> evar_map -> bool * bool * bool -> int option -> polymorphic -> ?name:hints_path_atom -> + env -> evar_map -> bool * bool * bool -> hint_info -> polymorphic -> ?name:hints_path_atom -> hint_term -> hint_entry list (** [make_resolve_hyp hname htyp]. diff --git a/test-suite/success/Hints.v b/test-suite/success/Hints.v index 89b8bd7ac1..91edc06bfa 100644 --- a/test-suite/success/Hints.v +++ b/test-suite/success/Hints.v @@ -8,6 +8,10 @@ Hint Unfold eq_sym: core. Hint Constructors eq: foo bar. Hint Extern 3 (_ = _) => apply eq_refl: foo bar. +Hint Resolve eq_refl | 4 (_ = _) : baz. +Hint Resolve eq_sym eq_trans : baz. +Hint Extern 3 (_ = _) => apply eq_sym : baz. + (* Old-style syntax *) Hint Resolve eq_refl eq_sym. Hint Resolve eq_refl eq_sym: foo. @@ -105,4 +109,4 @@ Hint Cut [_* (a_is_b | b_is_c | c_is_d | d_is_e) Timeout 1 Fail apply _. (* 0.06s *) Abort. -End HintCut. \ No newline at end of file +End HintCut. diff --git a/toplevel/classes.ml b/toplevel/classes.ml index d6a6162f9f..1f13ab6374 100644 --- a/toplevel/classes.ml +++ b/toplevel/classes.ml @@ -46,25 +46,32 @@ let set_typeclass_transparency c local b = let _ = Hook.set Typeclasses.add_instance_hint_hook - (fun inst path local pri poly -> + (fun inst path local info poly -> let inst' = match inst with IsConstr c -> Hints.IsConstr (c, Univ.ContextSet.empty) | IsGlobal gr -> Hints.IsGlobRef gr in - Flags.silently (fun () -> + let info = + Vernacexpr.{ info with hint_pattern = + Option.map + (Constrintern.intern_constr_pattern (Global.env())) info.hint_pattern } in + Flags.silently (fun () -> Hints.add_hints local [typeclasses_db] (Hints.HintsResolveEntry - [pri, poly, false, Hints.PathHints path, inst'])) ()); + [info, poly, false, Hints.PathHints path, inst'])) ()); Hook.set Typeclasses.set_typeclass_transparency_hook set_typeclass_transparency; Hook.set Typeclasses.classes_transparent_state_hook (fun () -> Hints.Hint_db.transparent_state (Hints.searchtable_map typeclasses_db)) - + +open Vernacexpr + (** TODO: add subinstances *) -let existing_instance glob g pri = +let existing_instance glob g info = let c = global g in + let info = Option.default Hints.empty_hint_info info in let instance = Global.type_of_global_unsafe c in let _, r = decompose_prod_assum instance in match class_of_constr r with - | Some (_, ((tc,u), _)) -> add_instance (new_instance tc pri glob + | Some (_, ((tc,u), _)) -> add_instance (new_instance tc info glob (*FIXME*) (Flags.use_polymorphic_flag ()) c) | None -> user_err_loc (loc_of_reference g, "declare_instance", Pp.str "Constant does not build instances of a declared type class.") @@ -98,12 +105,12 @@ let id_of_class cl = open Pp -let instance_hook k pri global imps ?hook cst = +let instance_hook k info global imps ?hook cst = Impargs.maybe_declare_manual_implicits false cst ~enriching:false imps; - Typeclasses.declare_instance pri (not global) cst; + Typeclasses.declare_instance (Some info) (not global) cst; (match hook with Some h -> h cst | None -> ()) -let declare_instance_constant k pri global imps ?hook id pl poly evm term termtype = +let declare_instance_constant k info global imps ?hook id pl poly evm term termtype = let kind = IsDefinition Instance in let evm = let levels = Univ.LSet.union (Universes.universes_of_constr termtype) @@ -118,7 +125,7 @@ let declare_instance_constant k pri global imps ?hook id pl poly evm term termty let kn = Declare.declare_constant id cdecl in Declare.definition_message id; Universes.register_universe_binders (ConstRef kn) pl; - instance_hook k pri global imps ?hook (ConstRef kn); + instance_hook k info global imps ?hook (ConstRef kn); id let new_instance ?(abstract=false) ?(global=false) ?(refine= !refine_instance) poly ctx (instid, bk, cl) props @@ -130,7 +137,7 @@ let new_instance ?(abstract=false) ?(global=false) ?(refine= !refine_instance) p let evars = ref (Evd.from_ctx uctx) in let tclass, ids = match bk with - | Implicit -> + | Decl_kinds.Implicit -> Implicit_quantifiers.implicit_application Id.Set.empty ~allow_partial:false (fun avoid (clname, _) -> match clname with @@ -299,7 +306,7 @@ let new_instance ?(abstract=false) ?(global=false) ?(refine= !refine_instance) p let hook vis gr _ = let cst = match gr with ConstRef kn -> kn | _ -> assert false in Impargs.declare_manual_implicits false gr ~enriching:false [imps]; - Typeclasses.declare_instance pri (not global) (ConstRef cst) + Typeclasses.declare_instance (Some pri) (not global) (ConstRef cst) in let obls, constr, typ = match term with @@ -378,7 +385,7 @@ let context poly l = let cst = Declare.declare_constant ~internal:Declare.InternalTacticRequest id decl in match class_of_constr t with | Some (rels, ((tc,_), args) as _cl) -> - add_instance (Typeclasses.new_instance tc None false (*FIXME*) + add_instance (Typeclasses.new_instance tc Hints.empty_hint_info false (*FIXME*) poly (ConstRef cst)); status (* declare_subclasses (ConstRef cst) cl *) diff --git a/toplevel/classes.mli b/toplevel/classes.mli index 7beb873e63..d2cb788eae 100644 --- a/toplevel/classes.mli +++ b/toplevel/classes.mli @@ -20,12 +20,12 @@ val mismatched_props : env -> constr_expr list -> Context.Rel.t -> 'a (** Instance declaration *) -val existing_instance : bool -> reference -> int option -> unit -(** globality, reference, priority *) +val existing_instance : bool -> reference -> Vernacexpr.hint_info_expr option -> unit +(** globality, reference, optional priority and pattern information *) val declare_instance_constant : typeclass -> - int option -> (** priority *) + Vernacexpr.hint_info_expr -> (** priority *) bool -> (** globality *) Impargs.manual_explicitation list -> (** implicits *) ?hook:(Globnames.global_reference -> unit) -> @@ -48,7 +48,7 @@ val new_instance : ?generalize:bool -> ?tac:unit Proofview.tactic -> ?hook:(Globnames.global_reference -> unit) -> - int option -> + Vernacexpr.hint_info_expr -> Id.t (** Setting opacity *) diff --git a/toplevel/record.ml b/toplevel/record.ml index 9c4d41ea50..63564fba16 100644 --- a/toplevel/record.ml +++ b/toplevel/record.ml @@ -565,8 +565,9 @@ let definition_structure (kind,poly,finite,(is_coe,((loc,idstruc),pl)),ps,cfs,id typecheck_params_and_fields (kind = Class true) idstruc pl s ps notations fs) () in let sign = structure_signature (fields@params) in let gr = match kind with - | Class def -> - let gr = declare_class finite def poly ctx (loc,idstruc) idbuild + | Class def -> + let priorities = List.map (fun id -> {hint_priority = id; hint_pattern = None}) priorities in + let gr = declare_class finite def poly ctx (loc,idstruc) idbuild implpars params arity template implfs fields is_coe coers priorities sign in gr | _ -> diff --git a/toplevel/record.mli b/toplevel/record.mli index b094255634..c50e577860 100644 --- a/toplevel/record.mli +++ b/toplevel/record.mli @@ -38,7 +38,8 @@ val declare_structure : inductive val definition_structure : - inductive_kind * Decl_kinds.polymorphic * Decl_kinds.recursivity_kind * plident with_coercion * local_binder list * + inductive_kind * Decl_kinds.polymorphic * Decl_kinds.recursivity_kind * + plident with_coercion * local_binder list * (local_decl_expr with_instance with_priority with_notation) list * Id.t * constr_expr option -> global_reference diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index 4de1d95959..973f73ef6f 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -841,9 +841,9 @@ let vernac_instance abst locality poly sup inst props pri = let vernac_context poly l = if not (Classes.context poly l) then Feedback.feedback Feedback.AddedAxiom -let vernac_declare_instances locality ids pri = +let vernac_declare_instances locality insts = let glob = not (make_section_locality locality) in - List.iter (fun id -> Classes.existing_instance glob id pri) ids + List.iter (fun (id, info) -> Classes.existing_instance glob id (Some info)) insts let vernac_declare_class id = Record.declare_existing_class (Nametab.global id) @@ -1989,10 +1989,10 @@ let interp ?proof ~loc locality poly c = vernac_identity_coercion locality poly local id s t (* Type classes *) - | VernacInstance (abst, sup, inst, props, pri) -> - vernac_instance abst locality poly sup inst props pri + | VernacInstance (abst, sup, inst, props, info) -> + vernac_instance abst locality poly sup inst props info | VernacContext sup -> vernac_context poly sup - | VernacDeclareInstances (ids, pri) -> vernac_declare_instances locality ids pri + | VernacDeclareInstances insts -> vernac_declare_instances locality insts | VernacDeclareClass id -> vernac_declare_class id (* Solving *) -- cgit v1.2.3 From b57c7005d81b35b2ae6c45e6ac3088a73b3c43b2 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Wed, 26 Oct 2016 18:31:03 +0200 Subject: Fix Typeclasses eauto := bfs. --- ltac/g_class.ml4 | 13 ++++++++++++- tactics/class_tactics.ml | 6 ++++++ tactics/class_tactics.mli | 4 ++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ltac/g_class.ml4 b/ltac/g_class.ml4 index 18df596eb8..1adf197d6b 100644 --- a/ltac/g_class.ml4 +++ b/ltac/g_class.ml4 @@ -44,11 +44,22 @@ ARGUMENT EXTEND debug TYPED AS bool PRINTED BY pr_debug | [ ] -> [ false ] END +let pr_search_strategy _prc _prlc _prt = function + | Dfs -> Pp.str "dfs" + | Bfs -> Pp.str "bfs" + +ARGUMENT EXTEND eauto_search_strategy PRINTED BY pr_search_strategy +| [ "bfs" ] -> [ Bfs ] +| [ "dfs" ] -> [ Dfs ] +| [ ] -> [ Dfs ] +END + (* true = All transparent, false = Opaque if possible *) VERNAC COMMAND EXTEND Typeclasses_Settings CLASSIFIED AS SIDEFF - | [ "Typeclasses" "eauto" ":=" debug(d) int_opt(depth) ] -> [ + | [ "Typeclasses" "eauto" ":=" debug(d) eauto_search_strategy(s) int_opt(depth) ] -> [ set_typeclasses_debug d; + set_typeclasses_strategy s; set_typeclasses_depth depth ] END diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index da91674f5d..c1ba645beb 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -181,6 +181,12 @@ let set_typeclasses_depth = optread = get_typeclasses_depth; optwrite = set_typeclasses_depth; } +type search_strategy = Dfs | Bfs + +let set_typeclasses_strategy = function + | Dfs -> set_typeclasses_iterative_deepening true + | Bfs -> set_typeclasses_iterative_deepening false + let pr_ev evs ev = Printer.pr_constr_env (Goal.V82.env evs ev) evs (Evarutil.nf_evar evs (Goal.V82.concl evs ev)) diff --git a/tactics/class_tactics.mli b/tactics/class_tactics.mli index 8db264ad95..565415a95e 100644 --- a/tactics/class_tactics.mli +++ b/tactics/class_tactics.mli @@ -20,6 +20,10 @@ val get_typeclasses_debug : unit -> bool val set_typeclasses_depth : int option -> unit val get_typeclasses_depth : unit -> int option +type search_strategy = Dfs | Bfs + +val set_typeclasses_strategy : search_strategy -> unit + val typeclasses_eauto : ?only_classes:bool -> ?st:transparent_state -> depth:(Int.t option) -> Hints.hint_db_name list -> unit Proofview.tactic -- cgit v1.2.3 From ced1e16d43bd896b7e8473921a29749a0ba35643 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Wed, 26 Oct 2016 18:31:46 +0200 Subject: Fix bugs in Filtered Unification and cleanup code --- tactics/class_tactics.ml | 58 ++++++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index c1ba645beb..264df52154 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -246,12 +246,11 @@ let unify_resolve poly flags = { enter = begin fun gls (c,_,clenv) -> end } (** Application of a lemma using [refine] instead of the old [w_unify] *) -let unify_resolve_refine poly flags = +let unify_resolve_refine poly flags gls ((c, t, ctx),n,clenv) = let open Clenv in - { enter = begin fun gls ((c, t, ctx),n,clenv) -> - let env = Proofview.Goal.env gls in - let concl = Proofview.Goal.concl gls in - Refine.refine ~unsafe:true { Sigma.run = fun sigma -> + let env = Proofview.Goal.env gls in + let concl = Proofview.Goal.concl gls in + Refine.refine ~unsafe:true { Sigma.run = fun sigma -> let sigma = Sigma.to_evar_map sigma in let sigma, term, ty = if poly then @@ -266,15 +265,20 @@ let unify_resolve_refine poly flags = let sigma', cl = Clenv.make_evar_clause env sigma ?len:n ty in let term = applistc term (List.map (fun x -> x.hole_evar) cl.cl_holes) in let sigma' = - let evdref = ref sigma' in - if not (Evarconv.e_cumul env ~ts:flags.core_unify_flags.modulo_delta - evdref cl.cl_concl concl) then - Type_errors.error_actual_type env - {Environ.uj_val = term; Environ.uj_type = cl.cl_concl} - concl; - !evdref + Evarconv.the_conv_x_leq env ~ts:flags.core_unify_flags.modulo_delta + cl.cl_concl concl sigma' in Sigma.here term (Sigma.Unsafe.of_evar_map sigma') } - end } + +let unify_resolve_refine poly flags gl clenv = + Proofview.tclORELSE + (unify_resolve_refine poly flags gl clenv) + (fun ie -> + match fst ie with + | Evarconv.UnableToUnify _ -> + Tacticals.New.tclZEROMSG (str "Unable to unify") + | e when CErrors.noncritical e -> + Tacticals.New.tclZEROMSG (str "Unexpected error") + | _ -> iraise ie) (** Dealing with goals of the form A -> B and hints of the form C -> A -> B. @@ -295,9 +299,11 @@ let clenv_of_prods poly nprods (c, clenv) gl = let with_prods nprods poly (c, clenv) f = if get_typeclasses_limit_intros () then Proofview.Goal.nf_enter { enter = begin fun gl -> - match clenv_of_prods poly nprods (c, clenv) gl with - | None -> Tacticals.New.tclZEROMSG (str"Not enough premisses") - | Some (diff, clenv') -> f.enter gl (c, diff, clenv') end } + try match clenv_of_prods poly nprods (c, clenv) gl with + | None -> Tacticals.New.tclZEROMSG (str"Not enough premisses") + | Some (diff, clenv') -> f.enter gl (c, diff, clenv') + with e when CErrors.noncritical e -> + Tacticals.New.tclFAIL 0 (CErrors.print e) end } else Proofview.Goal.nf_enter { enter = begin fun gl -> if Int.equal nprods 0 then f.enter gl (c, None, clenv) @@ -312,7 +318,7 @@ let matches_pattern concl pat = if Constr_matching.is_matching env sigma pat concl then Proofview.tclUNIT () else - Tacticals.New.tclZEROMSG (str "conclPattern") + Tacticals.New.tclZEROMSG (str "pattern does not match") in Proofview.Goal.enter { enter = fun gl -> let env = Proofview.Goal.env gl in @@ -405,8 +411,8 @@ and e_my_find_search db_list local_db secvars hdc complete only_classes sigma co let tac = with_prods nprods poly (term,cl) ({ enter = fun gl clenv -> - (matches_pattern concl p) <*> - ((unify_resolve_refine poly flags).enter gl clenv)}) + matches_pattern concl p <*> + unify_resolve_refine poly flags gl clenv}) in Tacticals.New.tclTHEN tac Proofview.shelve_unifiable else let tac = @@ -420,8 +426,8 @@ and e_my_find_search db_list local_db secvars hdc complete only_classes sigma co if get_typeclasses_filtered_unification () then let tac = (with_prods nprods poly (term,cl) ({ enter = fun gl clenv -> - (matches_pattern concl p) <*> - ((unify_resolve_refine poly flags).enter gl clenv)})) in + matches_pattern concl p <*> + unify_resolve_refine poly flags gl clenv})) in Tacticals.New.tclTHEN tac Proofview.shelve_unifiable else let tac = @@ -431,7 +437,15 @@ and e_my_find_search db_list local_db secvars hdc complete only_classes sigma co else Proofview.tclBIND (Proofview.with_shelf tac) (fun (gls, ()) -> shelve_dependencies gls) - | Give_exact c -> Proofview.V82.tactic (e_give_exact flags poly c) + | Give_exact (c,clenv) -> + if get_typeclasses_filtered_unification () then + let tac = + matches_pattern concl p <*> + Proofview.Goal.nf_enter + { enter = fun gl -> unify_resolve_refine poly flags gl (c,None,clenv) } in + Tacticals.New.tclTHEN tac Proofview.shelve_unifiable + else + Proofview.V82.tactic (e_give_exact flags poly (c,clenv)) | Res_pf_THEN_trivial_fail (term,cl) -> let fst = with_prods nprods poly (term,cl) (unify_e_resolve poly flags) in let snd = if complete then Tacticals.New.tclIDTAC -- cgit v1.2.3 From 59b4938c3a763e0ed35dd8f91f5d45b286df01a6 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Wed, 26 Oct 2016 18:32:31 +0200 Subject: TCS: error handling and debug printing in resolution --- tactics/class_tactics.ml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 264df52154..8ec005a601 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -1044,13 +1044,18 @@ module Search = struct let foundone = ref false in let rec onetac e (tac, pat, b, name, pp) tl = let derivs = path_derivate info.search_cut name in - (if !typeclasses_debug > 1 then - Feedback.msg_debug - (pr_depth (!idx :: info.search_depth) ++ str": trying " ++ + let pr_error ie = + if !typeclasses_debug > 1 then + let msg = + pr_depth (!idx :: info.search_depth) ++ str": " ++ Lazy.force pp ++ (if !foundone != true then str" on" ++ spc () ++ pr_ev s (Proofview.Goal.goal gl) - else mt ()))); + else mt ()) + in + Feedback.msg_debug (msg ++ str " failed with " ++ CErrors.iprint ie) + else () + in let tac_of gls i j = Goal.nf_enter { enter = fun gl' -> let sigma' = Goal.sigma gl' in let s' = Sigma.to_evar_map sigma' in @@ -1136,7 +1141,9 @@ module Search = struct else ortac (with_shelf tac >>= fun s -> let i = !idx in incr idx; result s i None) - (fun e' -> aux (merge_exceptions e e') tl) + (fun e' -> if CErrors.noncritical (fst e') then + (pr_error e'; aux (merge_exceptions e e') tl) + else iraise e') and aux e = function | x :: xs -> onetac e x xs | [] -> -- cgit v1.2.3 From 8aa945902d40765f69cd16ce7647d3c28248eb54 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Wed, 26 Oct 2016 18:33:08 +0200 Subject: Handle Unique Solutions flag. --- tactics/class_tactics.ml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 8ec005a601..c1a2f7ff2f 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -9,7 +9,6 @@ (* TODO: - Find an interface allowing eauto to backtrack when shelved goals remain, e.g. to force instantiations. - - unique solutions *) open Pp @@ -1256,6 +1255,9 @@ module Search = struct Tacticals.New.tclFAIL 0 (str"Proof search failed" ++ (if Option.is_empty depth then mt() else str" without reaching its limit")) + | Proofview.MoreThanOneSuccess -> + Tacticals.New.tclFAIL 0 (str"Proof search failed: " ++ + str"more than one success found.") | e -> Proofview.tclZERO ~info:ie e in Proofview.tclOR tac error @@ -1273,6 +1275,11 @@ module Search = struct let _, pv = Proofview.init evm' [] in let pv = Proofview.unshelve goals pv in try + let tac = + if unique then + Proofview.tclEXACTLY_ONCE Proofview.MoreThanOneSuccess tac + else tac + in let (), pv', (unsafe, shelved, gaveup), _ = Proofview.apply (Global.env ()) tac pv in @@ -1292,7 +1299,7 @@ module Search = struct with Logic_monad.TacticFailure _ -> raise Not_found let eauto depth only_classes unique dep st hints p evd = - let eauto_tac = eauto_tac ~st ~only_classes ~depth ~dep hints in + let eauto_tac = eauto_tac ~st ~only_classes ~depth ~dep:(unique || dep) hints in let res = run_on_evars ~unique p evd eauto_tac in match res with | None -> evd -- cgit v1.2.3 From c5802966f23b9a8dc34f55961d4861997a3df01f Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Wed, 26 Oct 2016 18:34:13 +0200 Subject: Test new syntax for hints and typeclass options --- test-suite/success/Hints.v | 81 ++++++++++++++++++++++++++++++++++++---- test-suite/success/Typeclasses.v | 47 +++++++++++++++++++++++ 2 files changed, 121 insertions(+), 7 deletions(-) diff --git a/test-suite/success/Hints.v b/test-suite/success/Hints.v index 91edc06bfa..1abe14774c 100644 --- a/test-suite/success/Hints.v +++ b/test-suite/success/Hints.v @@ -1,4 +1,12 @@ (* Checks syntax of Hints commands *) +(* Old-style syntax *) +Hint Resolve eq_refl eq_sym. +Hint Resolve eq_refl eq_sym: foo. +Hint Immediate eq_refl eq_sym. +Hint Immediate eq_refl eq_sym: foo. +Hint Unfold fst eq_sym. +Hint Unfold fst eq_sym: foo. + (* Checks that qualified names are accepted *) (* New-style syntax *) @@ -8,17 +16,76 @@ Hint Unfold eq_sym: core. Hint Constructors eq: foo bar. Hint Extern 3 (_ = _) => apply eq_refl: foo bar. +(* Extended new syntax with patterns *) Hint Resolve eq_refl | 4 (_ = _) : baz. Hint Resolve eq_sym eq_trans : baz. Hint Extern 3 (_ = _) => apply eq_sym : baz. -(* Old-style syntax *) -Hint Resolve eq_refl eq_sym. -Hint Resolve eq_refl eq_sym: foo. -Hint Immediate eq_refl eq_sym. -Hint Immediate eq_refl eq_sym: foo. -Hint Unfold fst eq_sym. -Hint Unfold fst eq_sym: foo. +Parameter pred : nat -> Prop. +Parameter pred0 : pred 0. +Parameter f : nat -> nat. +Parameter predf : forall n, pred n -> pred (f n). + +(* No conversion on let-bound variables and constants in pred (the default) *) +Hint Resolve pred0 | 1 (pred _) : pred. +Hint Resolve predf | 0 : pred. + +(* Allow full conversion on let-bound variables and constants *) +Create HintDb predconv discriminated. +Hint Resolve pred0 | 1 (pred _) : predconv. +Hint Resolve predf | 0 : predconv. + +Goal exists n, pred n. + eexists. + Fail Timeout 1 typeclasses eauto with pred. + Set Typeclasses Filtered Unification. + Set Typeclasses Debug Verbosity 2. + (* predf is not tried as it doesn't match the goal *) + typeclasses eauto with pred. +Qed. + +Parameter predconv : forall n, pred n -> pred (0 + S n). + +(* The inferred pattern contains 0 + ?n, syntactic match will fail to see convertible + terms *) +Hint Resolve pred0 : pred2. +Hint Resolve predconv : pred2. + +(** In this database we allow predconv to apply to pred (S _) goals, more generally + than the inferred pattern (pred (0 + S _)). *) +Create HintDb pred2conv discriminated. +Hint Resolve pred0 : pred2conv. +Hint Resolve predconv | 1 (pred (S _)) : pred2conv. + +Goal pred 3. + Fail typeclasses eauto with pred2. + typeclasses eauto with pred2conv. +Abort. + +Set Typeclasses Filtered Unification. +Set Typeclasses Debug Verbosity 2. +Hint Resolve predconv | 1 (pred _) : pred. +Hint Resolve predconv | 1 (pred (S _)) : predconv. +Test Typeclasses Limit Intros. +Goal pred 3. + (* predf is not tried as it doesn't match the goal *) + (* predconv is tried but fails as the transparent state doesn't allow + unfolding + *) + Fail typeclasses eauto with pred. + (* Here predconv succeeds as it matches (pred (S _)) and then + full unification is allowed *) + typeclasses eauto with predconv. +Qed. + +(** The other way around: goal contains redexes instead of instances *) +Goal exists n, pred (0 + n). + eexists. + (* predf is applied indefinitely *) + Fail Timeout 1 typeclasses eauto with pred. + (* pred0 (pred _) matches the goal *) + typeclasses eauto with predconv. +Qed. + (* Checks that local names are accepted *) Section A. diff --git a/test-suite/success/Typeclasses.v b/test-suite/success/Typeclasses.v index 3eaa04144f..651bbf7d28 100644 --- a/test-suite/success/Typeclasses.v +++ b/test-suite/success/Typeclasses.v @@ -1,3 +1,16 @@ +Module onlyclasses. + + Variable Foo : Type. + Variable foo : Foo. + Hint Extern 0 Foo => exact foo : typeclass_instances. + Goal Foo * Foo. + split. shelve. + Fail typeclasses eauto. + typeclasses eauto with typeclass_instances. + Unshelve. typeclasses eauto with typeclass_instances. + Abort. +End onlyclasses. + Module bt. Require Import Equivalence. @@ -104,6 +117,40 @@ Section sec. Check U (fun x => e x) _. End sec. +Module UniqueSolutions. + Set Typeclasses Unique Solutions. + Class Eq (A : Type) : Set. + Instance eqa : Eq nat := {}. + Instance eqb : Eq nat := {}. + + Goal Eq nat. + try apply _. + Fail exactly_once typeclasses eauto. + Abort. +End UniqueSolutions. + + +Module UniqueInstances. + (** Optimize proof search on this class by never backtracking on (closed) goals + for it. *) + Set Typeclasses Unique Instances. + Class Eq (A : Type) : Set. + Instance eqa : Eq nat := _. constructor. Qed. + Instance eqb : Eq nat := {}. + Class Foo (A : Type) (e : Eq A) : Set. + Instance fooa : Foo _ eqa := {}. + + Tactic Notation "refineu" open_constr(c) := unshelve refine c. + + Set Typeclasses Debug. + Goal { e : Eq nat & Foo nat e }. + unshelve refineu (existT _ _ _). + all:simpl. + (** Does not backtrack on the (wrong) solution eqb *) + Fail all:typeclasses eauto. + Abort. +End UniqueInstances. + Module IterativeDeepening. Class A. -- cgit v1.2.3 From a477dca64bb71a98fb92875df438d44d1fe54400 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Wed, 26 Oct 2016 19:20:08 +0200 Subject: Fix handling of only_classes at toplevel --- ltac/extratactics.ml4 | 21 ++++-- tactics/class_tactics.ml | 99 ++++++++++++++++++---------- tactics/class_tactics.mli | 2 + test-suite/bugs/closed/3513.v | 31 +++++++-- test-suite/success/Typeclasses.v | 30 ++++++++- test-suite/success/eauto.v | 135 +++++++++++++++++++++++++++------------ 6 files changed, 234 insertions(+), 84 deletions(-) diff --git a/ltac/extratactics.ml4 b/ltac/extratactics.ml4 index 063bfbe6d0..d9780dcc8c 100644 --- a/ltac/extratactics.ml4 +++ b/ltac/extratactics.ml4 @@ -348,11 +348,12 @@ let constr_flags = { Pretyping.fail_evar = false; Pretyping.expand_evars = true } -let refine_tac ist simple c = +let refine_tac ist simple with_classes c = Proofview.Goal.nf_enter { enter = begin fun gl -> let concl = Proofview.Goal.concl gl in let env = Proofview.Goal.env gl in - let flags = constr_flags in + let flags = + { constr_flags with Pretyping.use_typeclasses = with_classes } in let expected_type = Pretyping.OfType concl in let c = Pretyping.type_uconstr ~flags ~expected_type ist c in let update = { run = fun sigma -> c.delayed env sigma } in @@ -364,11 +365,23 @@ let refine_tac ist simple c = end } TACTIC EXTEND refine -| [ "refine" uconstr(c) ] -> [ refine_tac ist false c ] +| [ "refine" uconstr(c) ] -> + [ refine_tac ist false true c ] END TACTIC EXTEND simple_refine -| [ "simple" "refine" uconstr(c) ] -> [ refine_tac ist true c ] +| [ "simple" "refine" uconstr(c) ] -> + [ refine_tac ist true true c ] +END + +TACTIC EXTEND notcs_refine +| [ "notypeclasses" "refine" uconstr(c) ] -> + [ refine_tac ist false false c ] +END + +TACTIC EXTEND notcs_simple_refine +| [ "simple" "notypeclasses" "refine" uconstr(c) ] -> + [ refine_tac ist true false c ] END (**********************************************************************) diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index c1a2f7ff2f..103368e022 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -92,7 +92,7 @@ open Goptions let _ = declare_bool_option { optsync = true; - optdepr = false; + optdepr = true; optname = "do typeclass search modulo eta conversion"; optkey = ["Typeclasses";"Modulo";"Eta"]; optread = get_typeclasses_modulo_eta; @@ -183,8 +183,8 @@ let set_typeclasses_depth = type search_strategy = Dfs | Bfs let set_typeclasses_strategy = function - | Dfs -> set_typeclasses_iterative_deepening true - | Bfs -> set_typeclasses_iterative_deepening false + | Dfs -> set_typeclasses_iterative_deepening false + | Bfs -> set_typeclasses_iterative_deepening true let pr_ev evs ev = Printer.pr_constr_env (Goal.V82.env evs ev) evs @@ -302,7 +302,7 @@ let with_prods nprods poly (c, clenv) f = | None -> Tacticals.New.tclZEROMSG (str"Not enough premisses") | Some (diff, clenv') -> f.enter gl (c, diff, clenv') with e when CErrors.noncritical e -> - Tacticals.New.tclFAIL 0 (CErrors.print e) end } + Tacticals.New.tclZEROMSG (CErrors.print e) end } else Proofview.Goal.nf_enter { enter = begin fun gl -> if Int.equal nprods 0 then f.enter gl (c, None, clenv) @@ -345,8 +345,8 @@ let pr_gls sigma gls = let shelve_dependencies gls = let open Proofview in tclEVARMAP >>= fun sigma -> - (if !typeclasses_debug > 1 then - Feedback.msg_debug (str" shelving goals: " ++ pr_gls sigma gls); + (if !typeclasses_debug > 1 && List.length gls > 0 then + Feedback.msg_debug (str" shelving dependent subgoals: " ++ pr_gls sigma gls); shelve_goals gls) (** Hack to properly solve dependent evars that are typeclasses *) @@ -1011,6 +1011,17 @@ module Search = struct Evd.add sigma gl evi') sigma goals + let shelve_nonclass info = + Proofview.Goal.enter { enter = fun gl -> + let gl = Proofview.Goal.assume gl in + let sigma = Sigma.to_evar_map (Proofview.Goal.sigma gl) in + if is_class_type sigma (Proofview.Goal.concl gl) then + Proofview.tclUNIT () + else (if !typeclasses_debug > 1 then + Feedback.msg_debug (pr_depth info.search_depth ++ str": shelving non-class subgoal " ++ + pr_ev sigma (Proofview.Goal.goal gl)); + Proofview.shelve) } + (** The general hint application tactic. tac1 + tac2 .... The choice of OR or ORELSE is determined depending on the dependencies of the goal and the unique/Prop @@ -1121,7 +1132,7 @@ module Search = struct in the subgoals, turn them into subgoals now. *) let shelved, goals = List.split_when (fun (ev, s) -> s) remaining in let shelved = List.map fst shelved and goals = List.map fst goals in - if !typeclasses_debug > 1 then + if !typeclasses_debug > 1 && not (List.is_empty goals) then Feedback.msg_debug (str"Adding shelved subgoals to the search: " ++ prlist_with_sep spc (pr_ev sigma) goals ++ @@ -1137,12 +1148,18 @@ module Search = struct in res <*> tclEVARMAP >>= finish in if path_matches derivs [] then aux e tl - else ortac - (with_shelf tac >>= fun s -> + else + let filter = + if info.search_only_classes then shelve_nonclass info + else Proofview.tclUNIT () + in + ortac + (with_shelf (tac <*> filter) >>= fun s -> let i = !idx in incr idx; result s i None) - (fun e' -> if CErrors.noncritical (fst e') then - (pr_error e'; aux (merge_exceptions e e') tl) - else iraise e') + (fun e' -> + if CErrors.noncritical (fst e') then + (pr_error e'; aux (merge_exceptions e e') tl) + else (Printf.printf "raising again\n%!"; iraise e')) and aux e = function | x :: xs -> onetac e x xs | [] -> @@ -1203,9 +1220,12 @@ module Search = struct unit Proofview.tactic = let open Proofview in let open Proofview.Notations in - let dep = dep || Proofview.unifiable sigma (Goal.goal gl) gls in - let info = make_autogoal ?st only_classes dep (cut_of_hints hints) i gl in - search_tac hints depth 1 info + if only_classes && not (is_class_type sigma (Goal.concl gl)) then + Proofview.shelve + else + let dep = dep || Proofview.unifiable sigma (Goal.goal gl) gls in + let info = make_autogoal ?st only_classes dep (cut_of_hints hints) i gl in + search_tac hints depth 1 info let search_tac ?(st=full_transparent_state) only_classes dep hints depth = let open Proofview in @@ -1236,7 +1256,22 @@ module Search = struct | (e,ie) -> Proofview.tclZERO ~info:ie e) in aux 1 - let eauto_tac ?(st=full_transparent_state) ~only_classes ~depth ~dep hints = + let disallow_shelved tac = + let open Proofview in + with_shelf (tclONCE tac) >>= fun (shelved,result) -> + (if not (List.is_empty shelved) then + begin + Proofview.tclEVARMAP >>= fun sigma -> + let gls = prlist_with_sep spc (pr_ev sigma) shelved in + (if !typeclasses_debug > 0 then + Feedback.msg_debug (str"Non-empty shelf at end of resolution:" ++ gls)); + Tacticals.New.tclFAIL 1 (str"Proof search failed: " ++ + str"shelved goals remain: " ++ gls) + end + else tclUNIT result) + + let eauto_tac ?(st=full_transparent_state) ?(unique=false) ~only_classes ~depth ~dep hints = + let open Proofview in let tac = let search = search_tac ~st only_classes dep hints in if get_typeclasses_iterative_deepening () then @@ -1257,11 +1292,19 @@ module Search = struct else str" without reaching its limit")) | Proofview.MoreThanOneSuccess -> Tacticals.New.tclFAIL 0 (str"Proof search failed: " ++ - str"more than one success found.") + str"more than one success found") | e -> Proofview.tclZERO ~info:ie e - in Proofview.tclOR tac error + in + let tac = Proofview.tclOR tac error in + let tac = + if unique then + Proofview.tclEXACTLY_ONCE Proofview.MoreThanOneSuccess tac + else tac + in + let tac = if only_classes then disallow_shelved tac else tac in + tac - let run_on_evars ?(unique=false) p evm tac = + let run_on_evars p evm tac = match evars_to_goals p evm with | None -> None (* This happens only because there's no evar having p *) | Some (goals, evm') -> @@ -1275,11 +1318,6 @@ module Search = struct let _, pv = Proofview.init evm' [] in let pv = Proofview.unshelve goals pv in try - let tac = - if unique then - Proofview.tclEXACTLY_ONCE Proofview.MoreThanOneSuccess tac - else tac - in let (), pv', (unsafe, shelved, gaveup), _ = Proofview.apply (Global.env ()) tac pv in @@ -1298,16 +1336,15 @@ module Search = struct else raise Not_found with Logic_monad.TacticFailure _ -> raise Not_found - let eauto depth only_classes unique dep st hints p evd = - let eauto_tac = eauto_tac ~st ~only_classes ~depth ~dep:(unique || dep) hints in - let res = run_on_evars ~unique p evd eauto_tac in + let evars_eauto depth only_classes unique dep st hints p evd = + let eauto_tac = eauto_tac ~st ~unique ~only_classes ~depth ~dep:(unique || dep) hints in + let res = run_on_evars p evd eauto_tac in match res with | None -> evd | Some evd' -> evd' - (* TODO treat unique solutions *) let typeclasses_eauto ?depth unique st hints p evd = - eauto depth true unique false st hints p evd + evars_eauto depth true unique false st hints p evd (** Typeclasses eauto is an eauto which tries to resolve only goals of typeclass type, and assumes that the initially selected evars in evd are independent of the rest of the evars *) @@ -1318,8 +1355,6 @@ module Search = struct end (** Binding to either V85 or Search implementations. *) -let eauto depth ~only_classes ~st ~dep dbs = - Search.eauto_tac ~st ~only_classes ~depth ~dep dbs let typeclasses_eauto ?(only_classes=false) ?(st=full_transparent_state) ~depth dbs = @@ -1336,7 +1371,7 @@ let typeclasses_eauto ?(only_classes=false) ?(st=full_transparent_state) try V85.eauto85 depth ~only_classes ~st dbs gl with Not_found -> Refiner.tclFAIL 0 (str"Proof search failed") gl) - else eauto depth ~only_classes ~st ~dep:true dbs + else Search.eauto_tac ~st ~only_classes ~depth ~dep:true dbs (** We compute dependencies via a union-find algorithm. Beware of the imperative effects on the partition structure, diff --git a/tactics/class_tactics.mli b/tactics/class_tactics.mli index 565415a95e..21c5d2172b 100644 --- a/tactics/class_tactics.mli +++ b/tactics/class_tactics.mli @@ -40,6 +40,8 @@ module Search : sig val eauto_tac : ?st:Names.transparent_state -> (** The transparent_state used when working with local hypotheses *) + ?unique:bool -> + (** Should we force a unique solution *) only_classes:bool -> (** Should non-class goals be shelved and resolved at the end *) depth:Int.t option -> diff --git a/test-suite/bugs/closed/3513.v b/test-suite/bugs/closed/3513.v index fcdfa0057b..ff515038ec 100644 --- a/test-suite/bugs/closed/3513.v +++ b/test-suite/bugs/closed/3513.v @@ -1,4 +1,3 @@ -Require Import TestSuite.admit. (* File reduced by coq-bug-finder from original input, then from 5752 lines to 3828 lines, then from 2707 lines to 558 lines, then from 472 lines to 168 lines, then from 110 lines to 101 lines, then from 96 lines to 77 lines, then from 80 lines to 64 lines *) Require Coq.Setoids.Setoid. Import Coq.Setoids.Setoid. @@ -35,7 +34,7 @@ Local Existing Instance ILFun_Ops. Local Existing Instance ILFun_ILogic. Definition catOP (P Q: OPred) : OPred := admit. Add Parametric Morphism : catOP with signature lentails ==> lentails ==> lentails as catOP_entails_m. -admit. +apply admit. Defined. Definition catOPA (P Q R : OPred) : catOP (catOP P Q) R -|- catOP P (catOP Q R) := admit. Class IsPointed (T : Type) := point : T. @@ -69,8 +68,26 @@ Goal forall (T : Type) (O0 : T -> OPred) (O1 : T -> PointedOPred) pose P; refine (P _ _) end; unfold Basics.flip. - 2: solve [ apply reflexivity ]. - Undo. - 2: reflexivity. (* Toplevel input, characters 18-29: -Error: -Tactic failure: The relation lentails is not a declared reflexive relation. Maybe you need to require the Setoid library. *) \ No newline at end of file + Focus 2. + Set Typeclasses Debug. + Set Typeclasses Legacy Resolution. + apply reflexivity. + (* Debug: 1.1: apply @IsPointed_catOP on +(IsPointed (exists x0 : Actions, (catOP ?Goal O2 : OPred) x0)) +Debug: 1.1.1.1: apply OPred_inhabited on (IsPointed (exists x0 : Actions, ?Goal x0)) +Debug: 1.1.2.1: apply OPred_inhabited on (IsPointed (exists x : Actions, O2 x)) +Debug: 2.1: apply @Equivalence_Reflexive on (Reflexive lentails) +Debug: 2.1.1: no match for (Equivalence lentails) , 5 possibilities +Debug: Backtracking after apply @Equivalence_Reflexive +Debug: 2.2: apply @PreOrder_Reflexive on (Reflexive lentails) +Debug: 2.2.1.1: apply @lentailsPre on (PreOrder lentails) +Debug: 2.2.1.1.1.1: apply ILFun_ILogic on (ILogic OPred) +*) + Undo. Unset Typeclasses Legacy Resolution. + Test Typeclasses Unique Solutions. + Test Typeclasses Unique Instances. + Show Existentials. + Set Typeclasses Debug Verbosity 2. + Set Printing All. + Fail apply reflexivity. + \ No newline at end of file diff --git a/test-suite/success/Typeclasses.v b/test-suite/success/Typeclasses.v index 651bbf7d28..4581a7ce40 100644 --- a/test-suite/success/Typeclasses.v +++ b/test-suite/success/Typeclasses.v @@ -5,12 +5,40 @@ Module onlyclasses. Hint Extern 0 Foo => exact foo : typeclass_instances. Goal Foo * Foo. split. shelve. - Fail typeclasses eauto. + Set Typeclasses Debug. + typeclasses eauto. typeclasses eauto with typeclass_instances. Unshelve. typeclasses eauto with typeclass_instances. Abort. End onlyclasses. +Module shelve_non_class_subgoals. + Variable Foo : Type. + Variable foo : Foo. + Hint Extern 0 Foo => exact foo : typeclass_instances. + Class Bar := {}. + Instance bar1 (f:Foo) : Bar. + + Typeclasses eauto := debug. + Set Typeclasses Debug Verbosity 2. + Goal Bar. + (* Solution has shelved subgoals *) + Fail typeclasses eauto. + Abort. +End shelve_non_class_subgoals. + +Module shelve_non_class_subgoals2. + Class Bar := {}. + + Instance bar1 (t:Type) : Bar. + Hint Extern 0 => exact True : typeclass_instances. + Typeclasses eauto := debug. + Goal Bar. + Fail typeclasses eauto. + debug eauto with typeclass_instances. + Qed. +End shelve_non_class_subgoals2. + Module bt. Require Import Equivalence. diff --git a/test-suite/success/eauto.v b/test-suite/success/eauto.v index 4db547f4e4..9bcecfe1f3 100644 --- a/test-suite/success/eauto.v +++ b/test-suite/success/eauto.v @@ -5,7 +5,6 @@ (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) -Require Import List. Class A (A : Type). Instance an: A nat. @@ -31,6 +30,8 @@ Defined. Hint Extern 0 (_ /\ _) => constructor : typeclass_instances. +Existing Class and. + Goal exists (T : Type) (t : T), A T /\ B T t. Proof. eexists. eexists. typeclasses eauto. @@ -46,7 +47,7 @@ Class C {T} `(a : A T) (t : T). Require Import Classes.Init. Hint Extern 0 { x : ?A & _ } => unshelve class_apply @existT : typeclass_instances. - +Existing Class sigT. Set Typeclasses Debug. Instance can: C an 0. (* Backtrack on instance implementation *) @@ -63,41 +64,6 @@ Proof. Defined. -Parameter in_list : list (nat * nat) -> nat -> Prop. -Definition not_in_list (l : list (nat * nat)) (n : nat) : Prop := - ~ in_list l n. - -(* Hints Unfold not_in_list. *) - -Axiom - lem1 : - forall (l1 l2 : list (nat * nat)) (n : nat), - not_in_list (l1 ++ l2) n -> not_in_list l1 n. - -Axiom - lem2 : - forall (l1 l2 : list (nat * nat)) (n : nat), - not_in_list (l1 ++ l2) n -> not_in_list l2 n. - -Axiom - lem3 : - forall (l : list (nat * nat)) (n p q : nat), - not_in_list ((p, q) :: l) n -> not_in_list l n. - -Axiom - lem4 : - forall (l1 l2 : list (nat * nat)) (n : nat), - not_in_list l1 n -> not_in_list l2 n -> not_in_list (l1 ++ l2) n. - -Hint Resolve lem1 lem2 lem3 lem4: essai. - -Goal -forall (l : list (nat * nat)) (n p q : nat), -not_in_list ((p, q) :: l) n -> not_in_list l n. - intros. - eauto with essai. -Qed. - (* Example from Nicolas Magaud on coq-club - Jul 2000 *) Definition Nat : Set := nat. @@ -126,6 +92,9 @@ Qed. Full backtracking on dependent subgoals. *) Require Import Coq.Classes.Init. + +Module NTabareau. + Set Typeclasses Dependency Order. Unset Typeclasses Iterative Deepening. Notation "x .1" := (projT1 x) (at level 3). @@ -149,7 +118,8 @@ Hint Extern 5 (Bar ?D.1) => Hint Extern 5 (Qux ?D.1) => destruct D; simpl : typeclass_instances. -Hint Extern 1 myType => unshelve refine (fooTobar _ _).1 : typeclass_instances. +Hint Extern 1 myType => + unshelve refine (fooTobar _ _).1 : typeclass_instances. Hint Extern 1 myType => unshelve refine (barToqux _ _).1 : typeclass_instances. @@ -158,8 +128,93 @@ Hint Extern 0 { x : _ & _ } => simple refine (existT _ _ _) : typeclass_instance Unset Typeclasses Debug. Definition trivial a (H : Foo a) : {b : myType & Qux b}. Proof. - Time typeclasses eauto 10. + Time typeclasses eauto 10 with typeclass_instances. Undo. Set Typeclasses Iterative Deepening. - Time typeclasses eauto. + Time typeclasses eauto with typeclass_instances. Defined. +End NTabareau. + +Module NTabareauClasses. + +Set Typeclasses Dependency Order. +Unset Typeclasses Iterative Deepening. +Notation "x .1" := (projT1 x) (at level 3). +Notation "x .2" := (projT2 x) (at level 3). + +Parameter myType: Type. +Existing Class myType. + +Class Foo (a:myType) := {}. + +Class Bar (a:myType) := {}. + +Class Qux (a:myType) := {}. + +Parameter fooTobar : forall a (H : Foo a), {b: myType & Bar b}. + +Parameter barToqux : forall a (H : Bar a), {b: myType & Qux b}. + +Hint Extern 5 (Bar ?D.1) => + destruct D; simpl : typeclass_instances. + +Hint Extern 5 (Qux ?D.1) => + destruct D; simpl : typeclass_instances. + +Hint Extern 1 myType => + unshelve notypeclasses refine (fooTobar _ _).1 : typeclass_instances. + +Hint Extern 1 myType => + unshelve notypeclasses refine (barToqux _ _).1 : typeclass_instances. + +Hint Extern 0 { x : _ & _ } => + unshelve notypeclasses refine (existT _ _ _) : typeclass_instances. + +Unset Typeclasses Debug. + +Definition trivial a (H : Foo a) : {b : myType & Qux b}. +Proof. + Time typeclasses eauto 10 with typeclass_instances. + Undo. Set Typeclasses Iterative Deepening. + Time typeclasses eauto with typeclass_instances. +Defined. + +End NTabareauClasses. + + +Require Import List. + +Parameter in_list : list (nat * nat) -> nat -> Prop. +Definition not_in_list (l : list (nat * nat)) (n : nat) : Prop := + ~ in_list l n. + +(* Hints Unfold not_in_list. *) + +Axiom + lem1 : + forall (l1 l2 : list (nat * nat)) (n : nat), + not_in_list (l1 ++ l2) n -> not_in_list l1 n. + +Axiom + lem2 : + forall (l1 l2 : list (nat * nat)) (n : nat), + not_in_list (l1 ++ l2) n -> not_in_list l2 n. + +Axiom + lem3 : + forall (l : list (nat * nat)) (n p q : nat), + not_in_list ((p, q) :: l) n -> not_in_list l n. + +Axiom + lem4 : + forall (l1 l2 : list (nat * nat)) (n : nat), + not_in_list l1 n -> not_in_list l2 n -> not_in_list (l1 ++ l2) n. + +Hint Resolve lem1 lem2 lem3 lem4: essai. + +Goal +forall (l : list (nat * nat)) (n p q : nat), +not_in_list ((p, q) :: l) n -> not_in_list l n. + intros. + eauto with essai. +Qed. -- cgit v1.2.3 From c0f3d5fb81c543d1b05b0ff7041efee086514f3a Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sat, 29 Oct 2016 11:48:26 +0200 Subject: Fix [typeclasses eauto with] and nopattern hints This was the source of a bug in #5115#c7. --- tactics/class_tactics.ml | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 103368e022..72e410160d 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -349,6 +349,15 @@ let shelve_dependencies gls = Feedback.msg_debug (str" shelving dependent subgoals: " ++ pr_gls sigma gls); shelve_goals gls) +let hintmap_of hdc secvars concl = + match hdc with + | None -> fun db -> Hint_db.map_none secvars db + | Some hdc -> + fun db -> + if Hint_db.use_dn db then (* Using dnet *) + Hint_db.map_eauto secvars hdc concl db + else Hint_db.map_existential secvars hdc concl db + (** Hack to properly solve dependent evars that are typeclasses *) let rec e_trivial_fail_db only_classes db_list local_db secvars = let open Tacticals.New in @@ -384,20 +393,20 @@ and e_my_find_search db_list local_db secvars hdc complete only_classes sigma co let nprods = List.length prods in let freeze = try - let cl = Typeclasses.class_info (fst hdc) in - if cl.cl_strict then - Evd.evars_of_term concl - else Evar.Set.empty + match hdc with + | Some (hd,_) when only_classes -> + let cl = Typeclasses.class_info hd in + if cl.cl_strict then + Evd.evars_of_term concl + else Evar.Set.empty + | _ -> Evar.Set.empty with e when CErrors.noncritical e -> Evar.Set.empty in + let hint_of_db = hintmap_of hdc secvars concl in let hintl = List.map_append (fun db -> - let tacs = - if Hint_db.use_dn db then (* Using dnet *) - Hint_db.map_eauto secvars hdc concl db - else Hint_db.map_existential secvars hdc concl db - in + let tacs = hint_of_db db in let flags = auto_unif_flags freeze (Hint_db.transparent_state db) in List.map (fun x -> (flags, x)) tacs) (local_db::db_list) @@ -469,16 +478,16 @@ and e_my_find_search db_list local_db secvars hdc complete only_classes sigma co in List.map tac_of_hint hintl and e_trivial_resolve db_list local_db secvars only_classes sigma concl = + let hd = try Some (decompose_app_bound concl) with Bound -> None in try - e_my_find_search db_list local_db secvars - (decompose_app_bound concl) true only_classes sigma concl - with Bound | Not_found -> [] + e_my_find_search db_list local_db secvars hd true only_classes sigma concl + with Not_found -> [] let e_possible_resolve db_list local_db secvars only_classes sigma concl = + let hd = try Some (decompose_app_bound concl) with Bound -> None in try - e_my_find_search db_list local_db secvars - (decompose_app_bound concl) false only_classes sigma concl - with Bound | Not_found -> [] + e_my_find_search db_list local_db secvars hd false only_classes sigma concl + with Not_found -> [] let cut_of_hints h = List.fold_left (fun cut db -> PathOr (Hint_db.cut db, cut)) PathEmpty h -- cgit v1.2.3 From 98305374e2fdec4b64d7d086ddca0c4e812b178e Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sat, 29 Oct 2016 11:51:38 +0200 Subject: typeclasses eauto Implem/doc of shelving strategy Now [typeclasses eauto] mimicks what happens during resolution faithfully, and the shelving behavior/requirements for a successful proof-search are documented. --- doc/refman/Classes.tex | 13 ++++++++++- tactics/class_tactics.ml | 47 +++++++++++++++++++++++++++------------- test-suite/success/Typeclasses.v | 17 ++++++++------- test-suite/success/bteauto.v | 10 ++++++--- test-suite/success/eauto.v | 1 + 5 files changed, 61 insertions(+), 27 deletions(-) diff --git a/doc/refman/Classes.tex b/doc/refman/Classes.tex index 254fca28f7..d6a553e1a8 100644 --- a/doc/refman/Classes.tex +++ b/doc/refman/Classes.tex @@ -394,7 +394,18 @@ than {\tt eauto} and {\tt auto}. The main differences are the following: {\tt typeclass\_instances} database by default (instead of {\tt core}) and will try to solve \emph{only} typeclass goals. Other subgoals are automatically shelved and \emph{must be} resolved entirely when the - other typeclass subgoals are resolved or the proof search will fail. + other typeclass subgoals are resolved or the proof search will fail + \emph{globally}, \emph{without} the possibility to find another + complete solution with no shelved subgoals. + + \emph{Note: } As of Coq 8.6, {\tt all:once (typeclasses eauto)} + faithfully mimicks what happens during typeclass resolution when it is + called during refinement/type-inference. It might move to {\tt + all:typeclasses eauto} in future versions when the refinement engine + will be able to backtrack. +\item When called with specific databases (e.g. {\tt with}), {\tt + typeclasses eauto} allows shelved goals to remain at any point + during search and treat typeclasses goals like any other. \item The transparency information of databases is used consistently for all hints declared in them. It is always used when calling the unifier. When considering the local hypotheses, we use the transparent diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 72e410160d..91eb388b3e 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -1265,21 +1265,29 @@ module Search = struct | (e,ie) -> Proofview.tclZERO ~info:ie e) in aux 1 - let disallow_shelved tac = + let disallow_shelved initshelf tac = let open Proofview in - with_shelf (tclONCE tac) >>= fun (shelved,result) -> - (if not (List.is_empty shelved) then - begin - Proofview.tclEVARMAP >>= fun sigma -> - let gls = prlist_with_sep spc (pr_ev sigma) shelved in - (if !typeclasses_debug > 0 then - Feedback.msg_debug (str"Non-empty shelf at end of resolution:" ++ gls)); - Tacticals.New.tclFAIL 1 (str"Proof search failed: " ++ - str"shelved goals remain: " ++ gls) - end - else tclUNIT result) - - let eauto_tac ?(st=full_transparent_state) ?(unique=false) ~only_classes ~depth ~dep hints = + let casefn = function + | Fail (e,info) -> tclZERO ~info e + | Next ((shelved, result), k) -> + if not (List.is_empty shelved) then + begin + Proofview.tclEVARMAP >>= fun sigma -> + let gls = prlist_with_sep spc (pr_ev sigma) shelved in + (if !typeclasses_debug > 0 then + let initgls = prlist_with_sep spc (pr_ev sigma) initshelf in + Feedback.msg_debug (str"Non-empty shelf at end of resolution:" ++ gls + ++ str" initially: " ++ initgls ++ str".")); + Tacticals.New.tclZEROMSG (str"Proof search failed: " ++ + str"shelved goals remain: " ++ gls) + end + else + tclOR (tclUNIT result) (fun e -> k e >>= fun (gls, result) -> tclUNIT result) + in + tclCASE (with_shelf tac) >>= casefn + + let eauto_tac ?(st=full_transparent_state) ?(unique=false) + ~only_classes ~depth ~dep hints = let open Proofview in let tac = let search = search_tac ~st only_classes dep hints in @@ -1310,7 +1318,16 @@ module Search = struct Proofview.tclEXACTLY_ONCE Proofview.MoreThanOneSuccess tac else tac in - let tac = if only_classes then disallow_shelved tac else tac in + with_shelf numgoals >>= fun (initshelf, i) -> + (if !typeclasses_debug > 1 then + Feedback.msg_debug (str"Starting resolution with " ++ int i ++ + str" goal(s) under focus and " ++ + int (List.length initshelf) ++ str " shelved goal(s)" ++ + if only_classes then str " in only_classes mode" else + str " in regular mode" ++ + match depth with None -> str ", unbounded" + | Some i -> str ", with depth limit " ++ int i)); + let tac = if only_classes then disallow_shelved initshelf tac else tac in tac let run_on_evars p evm tac = diff --git a/test-suite/success/Typeclasses.v b/test-suite/success/Typeclasses.v index 4581a7ce40..6885717ec5 100644 --- a/test-suite/success/Typeclasses.v +++ b/test-suite/success/Typeclasses.v @@ -6,10 +6,10 @@ Module onlyclasses. Goal Foo * Foo. split. shelve. Set Typeclasses Debug. - typeclasses eauto. + Fail typeclasses eauto. typeclasses eauto with typeclass_instances. Unshelve. typeclasses eauto with typeclass_instances. - Abort. + Qed. End onlyclasses. Module shelve_non_class_subgoals. @@ -22,22 +22,23 @@ Module shelve_non_class_subgoals. Typeclasses eauto := debug. Set Typeclasses Debug Verbosity 2. Goal Bar. - (* Solution has shelved subgoals *) + (* Solution has shelved subgoals (of non typeclass type) *) Fail typeclasses eauto. Abort. End shelve_non_class_subgoals. -Module shelve_non_class_subgoals2. +Module Leivantex2PR339. + (** Was a bug preventing to find hints associated with no pattern *) Class Bar := {}. - Instance bar1 (t:Type) : Bar. Hint Extern 0 => exact True : typeclass_instances. Typeclasses eauto := debug. Goal Bar. Fail typeclasses eauto. - debug eauto with typeclass_instances. - Qed. -End shelve_non_class_subgoals2. + Set Typeclasses Debug Verbosity 2. + typeclasses eauto with typeclass_instances. + Qed. +End Leivantex2PR339. Module bt. Require Import Equivalence. diff --git a/test-suite/success/bteauto.v b/test-suite/success/bteauto.v index bb1cf06541..f97f764b4d 100644 --- a/test-suite/success/bteauto.v +++ b/test-suite/success/bteauto.v @@ -8,7 +8,7 @@ Module Backtracking. Qed. Arguments foo A : clear implicits. - + Require Import Program.Tactics. Example find42 : exists n, n = 42. Proof. eexists. @@ -20,9 +20,13 @@ Module Backtracking. Fail reflexivity. Undo 2. (* Without multiple successes it fails *) - Fail all:((once typeclasses eauto) + apply eq_refl). + Set Typeclasses Debug Verbosity 2. + Fail all:((once (typeclasses eauto with typeclass_instances)) + + apply eq_refl). (* Does backtrack if other goals fail *) - all:((typeclasses eauto) + reflexivity). + all:[> typeclasses eauto + reflexivity .. ]. + Undo 1. + all:(typeclasses eauto + reflexivity). (* Note "+" is a focussing combinator *) Show Proof. Qed. diff --git a/test-suite/success/eauto.v b/test-suite/success/eauto.v index 9bcecfe1f3..160f2d9deb 100644 --- a/test-suite/success/eauto.v +++ b/test-suite/success/eauto.v @@ -176,6 +176,7 @@ Definition trivial a (H : Foo a) : {b : myType & Qux b}. Proof. Time typeclasses eauto 10 with typeclass_instances. Undo. Set Typeclasses Iterative Deepening. + (* Much faster in iteratove deepening mode *) Time typeclasses eauto with typeclass_instances. Defined. -- cgit v1.2.3 From 0ab187ee578f0ef49ecf484278b8d3569630ee48 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sat, 29 Oct 2016 11:55:29 +0200 Subject: Fixed bug #4095. --- test-suite/bugs/closed/4095.v | 87 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 test-suite/bugs/closed/4095.v diff --git a/test-suite/bugs/closed/4095.v b/test-suite/bugs/closed/4095.v new file mode 100644 index 0000000000..83d4ed69d4 --- /dev/null +++ b/test-suite/bugs/closed/4095.v @@ -0,0 +1,87 @@ +(* File reduced by coq-bug-finder from original input, then from 5752 lines to 3828 lines, then from 2707 lines to 558 lines, then from 472 lines to 168 lines, then from 110 lines to 101 lines, then from 96 lines to 77 lines, then from 80 lines to 64 lines, then from 92 lines to 79 lines *) +(* coqc version 8.5beta1 (February 2015) compiled on Feb 23 2015 18:32:3 with OCaml 4.01.0 + coqtop version cagnode15:/afs/csail.mit.edu/u/j/jgross/coq-8.5,v8.5 (ebfc19d792492417b129063fb511aa423e9d9e08) *) +Require Import TestSuite.admit. +Require Import Coq.Setoids.Setoid. +Generalizable All Variables. +Axiom admit : forall {T}, T. +Class Equiv (A : Type) := equiv : relation A. +Class type (A : Type) {e : Equiv A} := eq_equiv : Equivalence equiv. +Class ILogicOps Frm := { lentails: relation Frm; + ltrue: Frm; + land: Frm -> Frm -> Frm; + lor: Frm -> Frm -> Frm }. +Infix "|--" := lentails (at level 79, no associativity). +Class ILogic Frm {ILOps: ILogicOps Frm} := { lentailsPre:> PreOrder lentails }. +Definition lequiv `{ILogic Frm} P Q := P |-- Q /\ Q |-- P. +Infix "-|-" := lequiv (at level 85, no associativity). +Instance lequiv_inverse_lentails `{ILogic Frm} : subrelation lequiv (inverse lentails) := admit. +Record ILFunFrm (T : Type) `{e : Equiv T} `{ILOps : ILogicOps Frm} := mkILFunFrm { ILFunFrm_pred :> T -> Frm }. +Section ILogic_Fun. + Context (T: Type) `{TType: type T}. + Context `{IL: ILogic Frm}. + Local Instance ILFun_Ops : ILogicOps (@ILFunFrm T _ Frm _) := admit. + Definition ILFun_ILogic : ILogic (@ILFunFrm T _ Frm _) := admit. +End ILogic_Fun. +Implicit Arguments ILFunFrm [[ILOps] [e]]. +Instance ILogicOps_Prop : ILogicOps Prop | 2 := {| lentails P Q := (P : Prop) -> Q; + ltrue := True; + land P Q := P /\ Q; + lor P Q := P \/ Q |}. +Axiom Action : Set. +Definition Actions := list Action. +Instance ActionsEquiv : Equiv Actions := { equiv a1 a2 := a1 = a2 }. +Definition OPred := ILFunFrm Actions Prop. +Local Existing Instance ILFun_Ops. +Local Existing Instance ILFun_ILogic. +Definition catOP (P Q: OPred) : OPred := admit. +Add Parametric Morphism : catOP with signature lentails ==> lentails ==> lentails as catOP_entails_m. +admit. +Defined. +Definition catOPA (P Q R : OPred) : catOP (catOP P Q) R -|- catOP P (catOP Q R) := admit. +Class IsPointed (T : Type) := point : T. +Notation IsPointed_OPred P := (IsPointed (exists x : Actions, (P : OPred) x)). +Record PointedOPred := mkPointedOPred { + OPred_pred :> OPred; + OPred_inhabited: IsPointed_OPred OPred_pred + }. +Existing Instance OPred_inhabited. +Canonical Structure default_PointedOPred O `{IsPointed_OPred O} : PointedOPred + := {| OPred_pred := O ; OPred_inhabited := _ |}. +Instance IsPointed_catOP `{IsPointed_OPred P, IsPointed_OPred Q} : IsPointed_OPred (catOP P Q) := admit. +Goal forall (T : Type) (O0 : T -> OPred) (O1 : T -> PointedOPred) + (tr : T -> T) (O2 : PointedOPred) (x : T) + (H : forall x0 : T, catOP (O0 x0) (O1 (tr x0)) |-- O1 x0), + exists e1 e2, + catOP (O0 e1) (OPred_pred e2) |-- catOP (O1 x) O2. + intros; do 2 esplit. + rewrite <- catOPA. + lazymatch goal with + | |- ?R (?f ?a ?b) (?f ?a' ?b') => + let P := constr:(fun H H' => @Morphisms.proper_prf (OPred -> OPred -> OPred) + (@Morphisms.respectful OPred (OPred -> OPred) + (@lentails OPred + (@ILFun_Ops Actions ActionsEquiv Prop ILogicOps_Prop)) + (@lentails OPred + (@ILFun_Ops Actions ActionsEquiv Prop ILogicOps_Prop) ==> + @lentails OPred + (@ILFun_Ops Actions ActionsEquiv Prop ILogicOps_Prop))) catOP + catOP_entails_m_Proper a a' H b b' H') in + pose P; + refine (P _ _) + end. + Undo. + lazymatch goal with + | |- ?R (?f ?a ?b) (?f ?a' ?b') => + let P := constr:(fun H H' => Morphisms.proper_prf a a' H b b' H') in + set(p:=P) + end. (* Toplevel input, characters 15-182: +Error: Cannot infer an instance of type +"PointedOPred" for the variable p in environment: +T : Type +O0 : T -> OPred +O1 : T -> PointedOPred +tr : T -> T +O2 : PointedOPred +x0 : T +H : forall x0 : T, catOP (O0 x0) (O1 (tr x0)) |-- O1 x0 *) \ No newline at end of file -- cgit v1.2.3 From d51c384e52003668bd97ca44da77a14c91e5cb14 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sat, 29 Oct 2016 12:37:46 +0200 Subject: Fix test-suite files relying on tcs bugs - One was expecting shelved goals to remain after resolution (from refine). - The other too were relying on the wrong classification of subgoals as typeclass subgoals at toplevel. --- test-suite/bugs/closed/3699.v | 12 ++++-------- test-suite/bugs/closed/4863.v | 7 ++++--- test-suite/success/bteauto.v | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/test-suite/bugs/closed/3699.v b/test-suite/bugs/closed/3699.v index 8dadc2419c..efa4325264 100644 --- a/test-suite/bugs/closed/3699.v +++ b/test-suite/bugs/closed/3699.v @@ -34,8 +34,7 @@ Module NonPrim. : forall b:B, P b. Proof. intros b. - unshelve (refine (pr1 (isconnected_elim _ _))). - exact b. + unshelve (refine (pr1 (isconnected_elim (A:=hfiber f b) _ _))). intro x. exact (transport P x.2 (d x.1)). Defined. @@ -47,8 +46,7 @@ Module NonPrim. : forall b:B, P b. Proof. intros b. - unshelve (refine (pr1 (isconnected_elim _ _))). - exact b. + unshelve (refine (pr1 (isconnected_elim (A:=hfiber f b) _ _))). intros [a p]. exact (transport P p (d a)). Defined. @@ -111,8 +109,7 @@ Module Prim. : forall b:B, P b. Proof. intros b. - unshelve (refine (pr1 (isconnected_elim _ _))). - exact b. + unshelve (refine (pr1 (isconnected_elim (A:=hfiber f b) _ _))). intro x. exact (transport P x.2 (d x.1)). Defined. @@ -124,8 +121,7 @@ Module Prim. : forall b:B, P b. Proof. intros b. - unshelve (refine (pr1 (isconnected_elim _ _))). - exact b. + unshelve (refine (pr1 (isconnected_elim (A:=hfiber f b) _ _))). intros [a p]. exact (transport P p (d a)). Defined. diff --git a/test-suite/bugs/closed/4863.v b/test-suite/bugs/closed/4863.v index e884355fde..1e47f2957b 100644 --- a/test-suite/bugs/closed/4863.v +++ b/test-suite/bugs/closed/4863.v @@ -3,14 +3,14 @@ Require Import Classes.DecidableClass. Inductive Foo : Set := | foo1 | foo2. -Instance Decidable_sumbool : forall P, {P}+{~P} -> Decidable P. +Lemma Decidable_sumbool : forall P, {P}+{~P} -> Decidable P. Proof. intros P H. refine (Build_Decidable _ (if H then true else false) _). intuition congruence. Qed. -Hint Extern 100 ({?A = ?B}+{~ ?A = ?B}) => abstract (abstract (abstract (decide equality))) : typeclass_instances. +Hint Extern 100 (Decidable (?A = ?B)) => abstract (abstract (abstract (apply Decidable_sumbool; decide equality))) : typeclass_instances. Goal forall (a b : Foo), {a=b}+{a<>b}. intros. @@ -21,7 +21,8 @@ Check ltac:(abstract (exact I)) : True. Goal forall (a b : Foo), Decidable (a=b) * Decidable (a=b). intros. -split. typeclasses eauto. typeclasses eauto. Qed. +split. typeclasses eauto. +typeclasses eauto. Qed. Goal forall (a b : Foo), Decidable (a=b) * Decidable (a=b). intros. diff --git a/test-suite/success/bteauto.v b/test-suite/success/bteauto.v index f97f764b4d..3178c6fc15 100644 --- a/test-suite/success/bteauto.v +++ b/test-suite/success/bteauto.v @@ -1,3 +1,4 @@ +Require Import Program.Tactics. Module Backtracking. Class A := { foo : nat }. @@ -8,7 +9,6 @@ Module Backtracking. Qed. Arguments foo A : clear implicits. - Require Import Program.Tactics. Example find42 : exists n, n = 42. Proof. eexists. -- cgit v1.2.3 From f6916774eea2ecc1262377cb14c2d494a0486358 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sat, 29 Oct 2016 19:07:21 +0200 Subject: Do not shelve non-class subgoals but fail, it should be the instance writer's responsibility to not generated non-dependent non-class subgoals (otherwise we loose compatibility as shown in e.g. MathClasses, which goes into loops because of unexpectedly unconstrained goals). Reflect it in the doc. --- doc/refman/Classes.tex | 12 +++++++----- tactics/class_tactics.ml | 9 +++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/doc/refman/Classes.tex b/doc/refman/Classes.tex index d6a553e1a8..58ae7191f8 100644 --- a/doc/refman/Classes.tex +++ b/doc/refman/Classes.tex @@ -392,11 +392,13 @@ than {\tt eauto} and {\tt auto}. The main differences are the following: backtracking on subgoals that are entirely independent. \item When called with no arguments, {\tt typeclasses eauto} uses the {\tt typeclass\_instances} database by default (instead of {\tt core}) - and will try to solve \emph{only} typeclass goals. Other subgoals are - automatically shelved and \emph{must be} resolved entirely when the - other typeclass subgoals are resolved or the proof search will fail - \emph{globally}, \emph{without} the possibility to find another - complete solution with no shelved subgoals. + and will try to solve \emph{only} typeclass goals. If some subgoal of + a hint/instance is non-dependent and not of class type, that hint + application will fail. Dependent subgoals are automatically shelved + and \emph{must be} resolved entirely when the other typeclass subgoals + are resolved or the proof search will fail \emph{globally}, + \emph{without} the possibility to find another complete solution with + no shelved subgoals. \emph{Note: } As of Coq 8.6, {\tt all:once (typeclasses eauto)} faithfully mimicks what happens during typeclass resolution when it is diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 91eb388b3e..fe12b54a13 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -1020,16 +1020,17 @@ module Search = struct Evd.add sigma gl evi') sigma goals - let shelve_nonclass info = + let fail_if_nonclass info = Proofview.Goal.enter { enter = fun gl -> let gl = Proofview.Goal.assume gl in let sigma = Sigma.to_evar_map (Proofview.Goal.sigma gl) in if is_class_type sigma (Proofview.Goal.concl gl) then Proofview.tclUNIT () else (if !typeclasses_debug > 1 then - Feedback.msg_debug (pr_depth info.search_depth ++ str": shelving non-class subgoal " ++ + Feedback.msg_debug (pr_depth info.search_depth ++ + str": failure due to non-class subgoal " ++ pr_ev sigma (Proofview.Goal.goal gl)); - Proofview.shelve) } + Proofview.tclZERO NotApplicableEx) } (** The general hint application tactic. tac1 + tac2 .... The choice of OR or ORELSE is determined @@ -1159,7 +1160,7 @@ module Search = struct if path_matches derivs [] then aux e tl else let filter = - if info.search_only_classes then shelve_nonclass info + if info.search_only_classes then fail_if_nonclass info else Proofview.tclUNIT () in ortac -- cgit v1.2.3 From 919545d39c77a9168e70141e78d2c9589dad7c4e Mon Sep 17 00:00:00 2001 From: Théo Zimmermann Date: Thu, 27 Oct 2016 14:14:50 +0200 Subject: Internal API change to typeclasses eauto. This commit makes the traversing strategy of typeclasses eauto an optional argument of the function that implements it. This change should be non-breaking. --- tactics/class_tactics.ml | 9 +++++++-- tactics/class_tactics.mli | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index fe12b54a13..5d5511d78f 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -1288,11 +1288,16 @@ module Search = struct tclCASE (with_shelf tac) >>= casefn let eauto_tac ?(st=full_transparent_state) ?(unique=false) - ~only_classes ~depth ~dep hints = + ~only_classes ?dfs ~depth ~dep hints = let open Proofview in let tac = let search = search_tac ~st only_classes dep hints in - if get_typeclasses_iterative_deepening () then + let bfs = + match dfs with + | None -> get_typeclasses_iterative_deepening () + | Some v -> v + in + if bfs then match depth with | None -> fix_iterative search | Some l -> fix_iterative_limit l search diff --git a/tactics/class_tactics.mli b/tactics/class_tactics.mli index 21c5d2172b..1b2fa035bd 100644 --- a/tactics/class_tactics.mli +++ b/tactics/class_tactics.mli @@ -44,6 +44,9 @@ module Search : sig (** Should we force a unique solution *) only_classes:bool -> (** Should non-class goals be shelved and resolved at the end *) + ?dfs:bool -> + (** Is a traversing-strategy specified? + If yes, true means dfs, false means bfs, i.e iterative deepening *) depth:Int.t option -> (** Bounded or unbounded search *) dep:bool -> -- cgit v1.2.3 From a4cecc13cde3239d6a86f98ba6bba0e4554306bd Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Thu, 3 Nov 2016 16:25:06 +0100 Subject: Rework search_strategy option handling --- ltac/g_class.ml4 | 17 +++++++------ tactics/class_tactics.ml | 64 ++++++++++++++++++++++++++--------------------- tactics/class_tactics.mli | 7 +++--- 3 files changed, 49 insertions(+), 39 deletions(-) diff --git a/ltac/g_class.ml4 b/ltac/g_class.ml4 index 1adf197d6b..7e26b5d189 100644 --- a/ltac/g_class.ml4 +++ b/ltac/g_class.ml4 @@ -45,13 +45,14 @@ ARGUMENT EXTEND debug TYPED AS bool PRINTED BY pr_debug END let pr_search_strategy _prc _prlc _prt = function - | Dfs -> Pp.str "dfs" - | Bfs -> Pp.str "bfs" + | Some Dfs -> Pp.str "dfs" + | Some Bfs -> Pp.str "bfs" + | None -> Pp.mt () ARGUMENT EXTEND eauto_search_strategy PRINTED BY pr_search_strategy -| [ "bfs" ] -> [ Bfs ] -| [ "dfs" ] -> [ Dfs ] -| [ ] -> [ Dfs ] +| [ "(bfs)" ] -> [ Some Bfs ] +| [ "(dfs)" ] -> [ Some Dfs ] +| [ ] -> [ None ] END (* true = All transparent, false = Opaque if possible *) @@ -59,15 +60,17 @@ END VERNAC COMMAND EXTEND Typeclasses_Settings CLASSIFIED AS SIDEFF | [ "Typeclasses" "eauto" ":=" debug(d) eauto_search_strategy(s) int_opt(depth) ] -> [ set_typeclasses_debug d; - set_typeclasses_strategy s; + Option.iter set_typeclasses_strategy s; set_typeclasses_depth depth ] END (** Compatibility: typeclasses eauto has 8.5 and 8.6 modes *) TACTIC EXTEND typeclasses_eauto + | [ "typeclasses" "eauto" "bfs" int_or_var_opt(d) "with" ne_preident_list(l) ] -> + [ typeclasses_eauto ~strategy:Bfs ~depth:d l ] | [ "typeclasses" "eauto" int_or_var_opt(d) "with" ne_preident_list(l) ] -> - [ typeclasses_eauto d l ] + [ typeclasses_eauto ~depth:d l ] | [ "typeclasses" "eauto" int_or_var_opt(d) ] -> [ typeclasses_eauto ~only_classes:true ~depth:d [Hints.typeclasses_db] ] END diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 5d5511d78f..63994bafe6 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -914,19 +914,20 @@ module V85 = struct let eauto_tac hints = then_tac normevars_tac (or_tac (hints_tac hints) intro_tac) - let eauto_tac depth hints = - if get_typeclasses_iterative_deepening () then - match depth with - | None -> fix_iterative (eauto_tac hints) - | Some depth -> fix_iterative_limit depth (eauto_tac hints) - else - match depth with - | None -> fix (eauto_tac hints) - | Some depth -> fix_limit depth (eauto_tac hints) - - let real_eauto ?depth unique st hints p evd = + let eauto_tac strategy depth hints = + match strategy with + | Bfs -> + begin match depth with + | None -> fix_iterative (eauto_tac hints) + | Some depth -> fix_iterative_limit depth (eauto_tac hints) end + | Dfs -> + match depth with + | None -> fix (eauto_tac hints) + | Some depth -> fix_limit depth (eauto_tac hints) + + let real_eauto ?depth strategy unique st hints p evd = let res = - run_on_evars ~st ~unique p evd hints (eauto_tac depth hints) + run_on_evars ~st ~unique p evd hints (eauto_tac strategy depth hints) in match res with | None -> evd @@ -939,12 +940,18 @@ module V85 = struct let resolve_all_evars_once debug depth unique p evd = let db = searchtable_map typeclasses_db in - real_eauto ?depth unique (Hint_db.transparent_state db) [db] p evd - - let eauto85 ?(only_classes=true) ?st depth hints g = + let strategy = if get_typeclasses_iterative_deepening () then Bfs else Dfs in + real_eauto ?depth strategy unique (Hint_db.transparent_state db) [db] p evd + + let eauto85 ?(only_classes=true) ?st ?strategy depth hints g = + let strategy = + match strategy with + | None -> if get_typeclasses_iterative_deepening () then Bfs else Dfs + | Some s -> s + in let gl = { it = make_autogoal ~only_classes ?st (cut_of_hints hints) None g; sigma = project g; } in - match run_tac (eauto_tac depth hints) gl with + match run_tac (eauto_tac strategy depth hints) gl with | None -> raise Not_found | Some {it = goals; sigma = s; } -> {it = List.map fst goals; sigma = s;} @@ -1288,22 +1295,23 @@ module Search = struct tclCASE (with_shelf tac) >>= casefn let eauto_tac ?(st=full_transparent_state) ?(unique=false) - ~only_classes ?dfs ~depth ~dep hints = + ~only_classes ?strategy ~depth ~dep hints = let open Proofview in let tac = let search = search_tac ~st only_classes dep hints in - let bfs = - match dfs with - | None -> get_typeclasses_iterative_deepening () - | Some v -> v + let dfs = + match strategy with + | None -> not (get_typeclasses_iterative_deepening ()) + | Some Dfs -> true + | Some Bfs -> false in - if bfs then + if dfs then + let depth = match depth with None -> -1 | Some d -> d in + search depth + else match depth with | None -> fix_iterative search | Some l -> fix_iterative_limit l search - else - let depth = match depth with None -> -1 | Some d -> d in - search depth in let error (e, ie) = match e with @@ -1389,7 +1397,7 @@ end (** Binding to either V85 or Search implementations. *) let typeclasses_eauto ?(only_classes=false) ?(st=full_transparent_state) - ~depth dbs = + ?strategy ~depth dbs = let dbs = List.map_filter (fun db -> try Some (searchtable_map db) with e when CErrors.noncritical e -> None) @@ -1400,10 +1408,10 @@ let typeclasses_eauto ?(only_classes=false) ?(st=full_transparent_state) if get_typeclasses_legacy_resolution () then Proofview.V82.tactic (fun gl -> - try V85.eauto85 depth ~only_classes ~st dbs gl + try V85.eauto85 depth ~only_classes ~st ?strategy dbs gl with Not_found -> Refiner.tclFAIL 0 (str"Proof search failed") gl) - else Search.eauto_tac ~st ~only_classes ~depth ~dep:true dbs + else Search.eauto_tac ~st ~only_classes ?strategy ~depth ~dep:true dbs (** We compute dependencies via a union-find algorithm. Beware of the imperative effects on the partition structure, diff --git a/tactics/class_tactics.mli b/tactics/class_tactics.mli index 1b2fa035bd..76760db025 100644 --- a/tactics/class_tactics.mli +++ b/tactics/class_tactics.mli @@ -24,7 +24,7 @@ type search_strategy = Dfs | Bfs val set_typeclasses_strategy : search_strategy -> unit -val typeclasses_eauto : ?only_classes:bool -> ?st:transparent_state -> +val typeclasses_eauto : ?only_classes:bool -> ?st:transparent_state -> ?strategy:search_strategy -> depth:(Int.t option) -> Hints.hint_db_name list -> unit Proofview.tactic @@ -44,9 +44,8 @@ module Search : sig (** Should we force a unique solution *) only_classes:bool -> (** Should non-class goals be shelved and resolved at the end *) - ?dfs:bool -> - (** Is a traversing-strategy specified? - If yes, true means dfs, false means bfs, i.e iterative deepening *) + ?strategy:search_strategy -> + (** Is a traversing-strategy specified? *) depth:Int.t option -> (** Bounded or unbounded search *) dep:bool -> -- cgit v1.2.3 From dd558cc1a9b87d2b1dda5d1ff2baf9f02a32e519 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Thu, 3 Nov 2016 18:20:36 +0100 Subject: Remove an OCaml 4.02 construct. This was not detected by running coq-contribs, so it probably means that we are not testing with the right version of OCaml. --- lib/cWarnings.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cWarnings.ml b/lib/cWarnings.ml index 68664d1ab2..1a1944d61f 100644 --- a/lib/cWarnings.ml +++ b/lib/cWarnings.ml @@ -136,7 +136,7 @@ let uniquize_flags_rev flags = let visited = try let warnings = Hashtbl.find categories name in - CString.Set.union visited (CString.Set.of_list warnings) + List.fold_left (fun v w -> CString.Set.add w v) visited warnings with Not_found -> visited in -- cgit v1.2.3 From 962a5d3526290b83967a92ef1eb772894d10362b Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Tue, 27 Sep 2016 19:09:40 -0400 Subject: Silence option deprecation warnings in the compat file Some options are expected to be deprecated --- theories/Compat/Coq85.v | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/theories/Compat/Coq85.v b/theories/Compat/Coq85.v index 4007536442..1bc6fee0c4 100644 --- a/theories/Compat/Coq85.v +++ b/theories/Compat/Coq85.v @@ -12,6 +12,10 @@ are likely needed to make them behave like Coq 8.5. *) Require Export Coq.Compat.Coq86. +(** We use some deprecated options in this file, so we disable the + corresponding warning, to silence the build of this file. *) +Local Set Warnings "-deprecated-option". + (* In 8.5, "intros [|]", taken e.g. on a goal "A\/B->C", does not behave as "intros [H|H]" but leave instead hypotheses quantified in the goal, here producing subgoals A->C and B->C. *) -- cgit v1.2.3 From 5939d426ac785ec063e66a302f3692b645993c56 Mon Sep 17 00:00:00 2001 From: Cyprien Mangin Date: Wed, 28 Sep 2016 16:56:22 +0200 Subject: Add documentation for [Set Warnings] and the -w option. --- doc/refman/RefMan-com.tex | 6 ++++++ doc/refman/RefMan-oth.tex | 13 +++++++++++++ toplevel/usage.ml | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/doc/refman/RefMan-com.tex b/doc/refman/RefMan-com.tex index 6f85849888..c1e552a5da 100644 --- a/doc/refman/RefMan-com.tex +++ b/doc/refman/RefMan-com.tex @@ -199,6 +199,12 @@ The following command-line options are recognized by the commands {\tt available for {\tt coqc} only; it is the counterpart of {\tt -compile-verbose}. + \item[{\tt -w} (all|none|w$_1$,\ldots,w$_n$)]\ % + + Configure the display of warnings. This option expects {\tt all}, {\tt none} + or a comma-separated list of warning names or categories (see + Section~\ref{SetWarnings}). + %Mostly unused in the code %\item[{\tt -debug}]\ % % diff --git a/doc/refman/RefMan-oth.tex b/doc/refman/RefMan-oth.tex index 919e7b5cdc..3a9db5ead2 100644 --- a/doc/refman/RefMan-oth.tex +++ b/doc/refman/RefMan-oth.tex @@ -914,6 +914,19 @@ This command turns off the normal displaying. \subsection[\tt Unset Silent.]{\tt Unset Silent.\optindex{Silent}} This command turns the normal display on. +\subsection[\tt Set Warnings (\nterm{all}|\nterm{none}|\nterm{w}$_1$,\ldots,% + \nterm{w}$_n$).]{{\tt Set Warnings (\nterm{all}|\nterm{none}|\nterm{w}$_1$,\ldots,% + \nterm{w}$_n$)}.\optindex{Warnings}} +\label{SetWarnings} +This command configures the display of warnings. It is experimental, and expects +\texttt{all}, \texttt{none} or a comma-separated list of warning names or +categories. Adding~\texttt{-} in front of a warning disables it, +adding~\texttt{+} makes it an error. It is possible to use the special categories +\texttt{all} and \texttt{default}, the latter containing the warnings enabled by +default. The flags are interpreted from left to right, so in case of an overlap, +the flags on the right have higher priority, meaning that \texttt{A,-A} is +equivalent to \texttt{-A}. + \subsection[\tt Set Search Output Name Only.]{\tt Set Search Output Name Only.\optindex{Search Output Name Only} \label{Search-Output-Name-Only} \index{Search Output Name Only mode}} diff --git a/toplevel/usage.ml b/toplevel/usage.ml index de41f7b190..2bde1dc46b 100644 --- a/toplevel/usage.ml +++ b/toplevel/usage.ml @@ -62,7 +62,7 @@ let print_usage_channel co command = \n -list-tags print highlight color tags known by Coq and exit\ \n\ \n -quiet unset display of extra information (implies -w none)\ -\n -w (all|none) configure display of warnings\ +\n -w (all|none|w1,..,wn) configure display of warnings\ \n -color (yes|no|auto) configure color output\ \n\ \n -q skip loading of rcfile\ -- cgit v1.2.3 From 1d637f15de540c82289d6b3a16181a625a0d9cdf Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Fri, 4 Nov 2016 13:28:08 +0100 Subject: Fix #4837: ./configure -local makes coqdep issue many warnings We simply remove the warnings about paths mixing Win32 and Unix separators, since that situation does not seem problematic (c.f. discussion on the bug tracker). --- lib/minisys.ml | 8 -------- lib/system.ml | 1 - lib/system.mli | 5 ----- tools/coqdep_common.ml | 1 - 4 files changed, 15 deletions(-) diff --git a/lib/minisys.ml b/lib/minisys.ml index 25e4d79c4e..f15021c655 100644 --- a/lib/minisys.ml +++ b/lib/minisys.ml @@ -46,14 +46,6 @@ let ok_dirname f = let exists_dir dir = try Sys.is_directory dir with Sys_error _ -> false -let check_unix_dir warn dir = - if (Sys.os_type = "Win32" || Sys.os_type = "Cygwin") && - (String.length dir > 2 && dir.[1] = ':' || - String.contains dir '\\' || - String.contains dir ';') - then warn ("assuming " ^ dir ^ - " to be a Unix path even if looking like a Win32 path.") - let apply_subdir f path name = (* we avoid all files and subdirs starting by '.' (e.g. .svn) *) (* as well as skipped files like CVS, ... *) diff --git a/lib/system.ml b/lib/system.ml index af9aa5c074..4b99de707b 100644 --- a/lib/system.ml +++ b/lib/system.ml @@ -33,7 +33,6 @@ let all_subdirs ~unix_path:root = | _ -> () in process_directory f path in - check_unix_dir (fun s -> Feedback.msg_warning (str s)) root; if exists_dir root then traverse root [] else warn_cannot_open_dir root; List.rev !l diff --git a/lib/system.mli b/lib/system.mli index 4dbb3695d2..214369095c 100644 --- a/lib/system.mli +++ b/lib/system.mli @@ -20,11 +20,6 @@ val (//) : unix_path -> string -> unix_path val exists_dir : unix_path -> bool -(** [check_unix_dir warn path] calls [warn] with an appropriate - message if [path] looks does not look like a Unix path on Windows *) - -val check_unix_dir : (string -> unit) -> unix_path -> unit - (** [exclude_search_in_dirname path] excludes [path] when processing directories *) diff --git a/tools/coqdep_common.ml b/tools/coqdep_common.ml index cc63c13d7b..0064aebdae 100644 --- a/tools/coqdep_common.ml +++ b/tools/coqdep_common.ml @@ -526,7 +526,6 @@ let rec add_directory recur add_file phys_dir log_dir = | FileRegular f -> add_file phys_dir log_dir f in - check_unix_dir (fun s -> eprintf "*** Warning: %s\n" s) phys_dir; if exists_dir phys_dir then process_directory f phys_dir else -- cgit v1.2.3 From 6bb352a6743c7332b9715ac15e95c806a58d101c Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Fri, 4 Nov 2016 14:55:40 +0100 Subject: Fix refine in compatibility mode --- tactics/tactics.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tactics/tactics.ml b/tactics/tactics.ml index d2e5d8525d..548d2a81f3 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -4973,9 +4973,15 @@ module New = struct open Locus let reduce_after_refine = + let onhyps = + (** We reduced everywhere in the hyps before 8.6 *) + if Flags.version_less_or_equal Flags.V8_5 then None + else Some [] + in reduce - (Lazy {rBeta=true;rMatch=true;rFix=true;rCofix=true;rZeta=false;rDelta=false;rConst=[]}) - {onhyps=None; concl_occs=AllOccurrences } + (Lazy {rBeta=true;rMatch=true;rFix=true;rCofix=true; + rZeta=false;rDelta=false;rConst=[]}) + {onhyps; concl_occs=AllOccurrences } let refine ?unsafe c = Refine.refine ?unsafe c <*> -- cgit v1.2.3 From 22dfbff296cf03b6fab2bcec4eb5f9cf6ee8368c Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Fri, 4 Nov 2016 15:55:52 +0100 Subject: Fix #3441 Use pf_get_type_of to avoid blowup ... in pose proof of large proof terms --- proofs/tacmach.ml | 3 +++ proofs/tacmach.mli | 1 + tactics/tactics.ml | 2 +- test-suite/bugs/closed/3441.v | 23 +++++++++++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 test-suite/bugs/closed/3441.v diff --git a/proofs/tacmach.ml b/proofs/tacmach.ml index 2b129ad89c..330594af5c 100644 --- a/proofs/tacmach.ml +++ b/proofs/tacmach.ml @@ -171,6 +171,9 @@ module New = struct let pf_unsafe_type_of gl t = pf_apply unsafe_type_of gl t + let pf_get_type_of gl t = + pf_apply (Retyping.get_type_of ~lax:true) gl t + let pf_type_of gl t = pf_apply type_of gl t diff --git a/proofs/tacmach.mli b/proofs/tacmach.mli index 727efcf6dc..f79fa1d4b3 100644 --- a/proofs/tacmach.mli +++ b/proofs/tacmach.mli @@ -109,6 +109,7 @@ module New : sig val pf_concl : ([ `NF ], 'r) Proofview.Goal.t -> types val pf_unsafe_type_of : ('a, 'r) Proofview.Goal.t -> Term.constr -> Term.types + val pf_get_type_of : ('a, 'r) Proofview.Goal.t -> Term.constr -> Term.types val pf_type_of : ('a, 'r) Proofview.Goal.t -> Term.constr -> evar_map * Term.types val pf_conv_x : ('a, 'r) Proofview.Goal.t -> Term.constr -> Term.constr -> bool diff --git a/tactics/tactics.ml b/tactics/tactics.ml index 548d2a81f3..92cb8a11ea 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -2714,7 +2714,7 @@ let forward b usetac ipat c = match usetac with | None -> Proofview.Goal.enter { enter = begin fun gl -> - let t = Tacmach.New.pf_unsafe_type_of gl c in + let t = Tacmach.New.pf_get_type_of gl c in let hd = head_ident c in Tacticals.New.tclTHENFIRST (assert_as true hd ipat t) (exact_no_check c) end } diff --git a/test-suite/bugs/closed/3441.v b/test-suite/bugs/closed/3441.v new file mode 100644 index 0000000000..50d2978077 --- /dev/null +++ b/test-suite/bugs/closed/3441.v @@ -0,0 +1,23 @@ +Axiom f : nat -> nat -> nat. +Fixpoint do_n (n : nat) (k : nat) := + match n with + | 0 => k + | S n' => do_n n' (f k k) + end. + +Notation big := (_ = _). +Axiom k : nat. +Goal True. +Timeout 1 let H := fresh "H" in + let x := constr:(let n := 17 in do_n n = do_n n) in + let y := (eval lazy in x) in + pose proof y as H. (* Finished transaction in 1.102 secs (1.084u,0.016s) (successful) *) +Timeout 1 let H := fresh "H" in + let x := constr:(let n := 17 in do_n n = do_n n) in + let y := (eval lazy in x) in + pose y as H; clearbody H. (* Finished transaction in 0.412 secs (0.412u,0.s) (successful) *) + +Timeout 1 Time let H := fresh "H" in + let x := constr:(let n := 17 in do_n n = do_n n) in + let y := (eval lazy in x) in + assert (H := y). (* Finished transaction in 1.19 secs (1.164u,0.024s) (successful) *) \ No newline at end of file -- cgit v1.2.3 From 94bdd90bacc4d4a92b79bbe0db532e523fbcbce8 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Fri, 4 Nov 2016 17:03:04 +0100 Subject: Test for #4966 ("auto" wrongly seen as "auto with *" when in position of ident). --- test-suite/bugs/closed/4966.v | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test-suite/bugs/closed/4966.v diff --git a/test-suite/bugs/closed/4966.v b/test-suite/bugs/closed/4966.v new file mode 100644 index 0000000000..bd93cdc858 --- /dev/null +++ b/test-suite/bugs/closed/4966.v @@ -0,0 +1,10 @@ +(* Interpretation of auto as an argument of an ltac function (i.e. as an ident) was wrongly "auto with *" *) + +Axiom proof_admitted : False. +Hint Extern 0 => case proof_admitted : unused. +Ltac do_tac tac := tac. + +Goal False. + Set Ltac Profiling. + Fail solve [ do_tac auto ]. +Abort. -- cgit v1.2.3 From dc4200a1c0e37a600537fd1809377a3137ce0cc3 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Fri, 4 Nov 2016 19:34:40 +0100 Subject: Quick fix of tactic parsing while Load-ing in coqide. Note that this is still broken when loading files containing C-zar scripts. --- toplevel/vernacentries.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index c03f183ff5..ef530d590f 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -1906,6 +1906,10 @@ let vernac_check_guard () = exception End_of_input let vernac_load interp fname = + let interp x = + let proof_mode = Proof_global.get_default_proof_mode_name () in + Proof_global.activate_proof_mode proof_mode; + interp x in let parse_sentence = Flags.with_option Flags.we_are_parsing (fun po -> match Pcoq.Gram.entry_parse Pcoq.main_entry po with -- cgit v1.2.3 From d8baa76d86eaa691a5386669596a6004bb44bb7a Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Fri, 4 Nov 2016 18:00:18 +0100 Subject: More precise refine compatibility --- tactics/tactics.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tactics/tactics.ml b/tactics/tactics.ml index 92cb8a11ea..af52c52370 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -4975,7 +4975,8 @@ module New = struct let reduce_after_refine = let onhyps = (** We reduced everywhere in the hyps before 8.6 *) - if Flags.version_less_or_equal Flags.V8_5 then None + if Flags.version_compare !Flags.compat_version Flags.V8_5 == 0 + then None else Some [] in reduce -- cgit v1.2.3 From f558a0552b49b533c1c79ee3eb6d49015eeb6084 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Fri, 4 Nov 2016 16:10:31 +0100 Subject: Do not print dependent evars by default (expensive) The option can be turned on by the user though. --- printing/printer.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printing/printer.ml b/printing/printer.ml index 608bca62ac..04337f6be8 100644 --- a/printing/printer.ml +++ b/printing/printer.ml @@ -529,7 +529,7 @@ let print_evar_constraints gl sigma = str" with candidates:" ++ fnl () ++ hov 0 ppcandidates else mt () -let should_print_dependent_evars = ref true +let should_print_dependent_evars = ref false let _ = let open Goptions in -- cgit v1.2.3 From 29ff821da57e35d37b41be34febb275306c4809f Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sat, 5 Nov 2016 11:33:42 +0100 Subject: Minor fix in documentation --- doc/refman/RefMan-tac.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex index 656ae57b95..54393e46f6 100644 --- a/doc/refman/RefMan-tac.tex +++ b/doc/refman/RefMan-tac.tex @@ -1278,7 +1278,7 @@ in the list of subgoals remaining to prove. In particular, \texttt{pose proof {\term} as {\ident}} behaves as \texttt{assert ({\ident} := {\term})} and \texttt{pose proof {\term} - as {\intropattern}\tacindex{pose proof}} is the same as applying + as {\intropattern}} is the same as applying the {\intropattern} to {\term}. \item \texttt{enough ({\ident} :\ {\form})}\tacindex{enough} -- cgit v1.2.3 From d6edca2f025574fd84ef7e37a178c42674ff5840 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sat, 5 Nov 2016 11:34:10 +0100 Subject: Credits for 8.6 --- doc/refman/RefMan-pre.tex | 129 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) diff --git a/doc/refman/RefMan-pre.tex b/doc/refman/RefMan-pre.tex index cb2ab5dc2f..c7a3c7415a 100644 --- a/doc/refman/RefMan-pre.tex +++ b/doc/refman/RefMan-pre.tex @@ -1087,6 +1087,135 @@ Paris, January 2015, revised December 2015,\\ Hugo Herbelin, Matthieu Sozeau and the {\Coq} development team\\ \end{flushright} +\section*{Credits: version 8.6 (Stronger, Better, Faster Rooster)} + +{\Coq} version 8.6 contains the result of refinements, stabilization of +8.5's features and cleanups of the internals of the system. Over the +year of (now time-based) development, about 450 bugs were resolved and +over 100 contributions integrated. The main user visible changes are: +\begin{itemize} +\item A new, state-of-the-art universe constraint checker that + can outperform the previous version by an order of magnitude, by + Jacques-Henri Jourdan. +\item In CoqIDE and other asynchronous interfaces, more fine-grained + asynchronous processing and error reporting by Enrico Tassi. +\item More access to the proof engine features from Ltac: goal + management primitives, range selectors and a {\tt typeclasses + eauto} engine handling multiple goals and multiple successes, by + Cyprien Mangin, Matthieu Sozeau and Arnaud Spiwack. +\item Tactic behavior uniformization and specification, generalization + of intro-patterns by Hugo Herbelin and others. +\item Update of the beautifier by Hugo Herbelin, useful for switching + between versions. +\item A brand new warning system allowing to control warnings, turn them + into errors or ignore them selectively by Maxime Dénès, Guillaume + Melquiond and others. +\item Irrefutable patterns in abstractions, by Daniel de Rauglaudre. +\item Integration of {\tt ssreflect}'s subterm selection algorithm by + Enrico Tassi. +\item Integration of {\tt LtacProf}, a profiler for {\tt Ltac} by Tobias + Tebbi, Jason Gross and Paul Steckler. +\end{itemize} + +{\Coq} 8.6 also comes with a bunch of smaller-scale changes and +improvements regarding the different components of the system. We shall +only list a few of them. + +The {\tt iota} reduction flag is now a shorthand for {\tt match}, {\tt + fix} and {\tt cofix} flags controlling the corresponding reduction +rules (by Hugo Herbelin and Maxime Dénès). + +Maxime Dénès maintained the native compilation machinery. + +Pierre-Marie Pédrot separated the Ltac code from general purpose +tactics, and generalized and rationalized the handling of generic +arguments, allowing to create new versions of Ltac more easily in the +future. + +Many tactics have now more uniform behavior w.r.t. intro-patterns thanks +to Hugo Herbelin who also improved the basic tactics here and there. + +In patterns and terms, {\tt @}, abbreviations and notations are now +interpreted the same way, by Hugo Herbelin. + +Name handling for universes has been improved by Pierre-Marie Pédrot and +Matthieu Sozeau. The minimization algorithm has been improved by +Matthieu Sozeau. + +The unifier has been improved by Hugo Herbelin and Matthieu Sozeau, +fixing some incompatibilities introduced in Coq 8.5. Unification +constraints can now be left floating around and be seen by the user +thanks to a new option. The {\tt Keyed Unification} mode has been +improved by Matthieu Sozeau. + +The typeclass resolution engine and associated proof-search tactic have +been reimplemented on top of the proof-engine monad, providing better +integration in tactics, and new options have been introduced to control +it, by Matthieu Sozeau with help from Théo Zimmermann. + +The efficiency of the whole system has been significantly improved +thanks to contributions from Pierre-Marie Pédrot, Maxime Dénès and +Matthieu Sozeau and performance issue tracking by Jason Gross and Paul +Steckler. + +Standard library improvements by Jason Gross, Sébastien Hinderer, Pierre +Letouzey and others. + +Emilio Jesús Gallego Arias contributed many cleanups and refactorings of +the pretty-printing and user interface communication components. + +Frédéric Besson maintained the micromega tactic. + +The OPAM repository for {\Coq} packages has been maintained by Guillaume +Claret, Guillaume Melquiond, Matthieu Sozeau, Enrico Tassi and others. A +list of packages is now available at \url{https://coq.inria.fr/opam/www/}. + +Packaging tools were provided by Michael Soegtrop and Enrico Tassi +(Windows), Maxime Dénès and Matthieu Sozeau (MacOS X). Packages are now +regularly built on the continuous integration server. + +Matej Košík maintained and greatly improved the continuous integration +setup and the testing of {\Coq} contributions. He also contributed many +API improvement and code cleanups throughout the system. + +Many power users helped to improve the design of the new features via +the bug tracker, the pull request system, the {\Coq} development mailing +list or the coq-club mailing list. Special thanks to the users who +contributed patches and intensive brain-storming and code reviews, +starting with Cyril Cohen, Jason Gross, Robbert Krebbers, Jonathan +Leivent, Xavier Leroy, Gregory Malecha, Clément Pit-Claudel, Gabriel +Sherer and Beta Ziliani. It would however be impossible to mention with +precision all the names of people who to some extent influenced the +development. + +Version 8.6 is the first release of {\Coq} developed on a time-based +development cycle. Its development spanned 10 months from the release of +{\Coq} 8.5 and was based on a public roadmap. To date, it contains more +external contributions than any previous {\Coq} system. Code reviews +were systematically done before integration of new features, with an +important focus given to compatibility and performance issues, resulting +in a much more robust release than previous ones. + +General maintenance during part or whole of this period has been done by +Pierre Boutillier, Pierre Courtieu, Maxime Dénès, Hugo Herbelin, Pierre +Letouzey, Guillaume Melquiond, Pierre-Marie Pédrot, Matthieu Sozeau, +Arnaud Spiwack, Enrico Tassi as well as Bruno Barras, Yves Bertot, +Frédéric Besson, Assia Mahboubi, Yann Régis-Gianas. The development +process was coordinated by Matthieu Sozeau with the help of Maxime +Dénès, who was also in charge of the release process. + +Coq Enhancement Proposals (CEPs for short) were introduced by Enrico +Tassi to provide more visibility and a discussion period on new +features, they are publicly available \url{https://github.com/coq/ceps}. + +Started during this period, an effort is led by Yves Bertot and Maxime +Dénès to put together a {\Coq} consortium. + +\begin{flushright} +Paris, November 2016,\\ +Matthieu Sozeau and the {\Coq} development team\\ +\end{flushright} + %new Makefile -- cgit v1.2.3 From 0ad6edc1d088385ffe90f1a4dd1bddc04cb31b07 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sat, 5 Nov 2016 10:55:55 +0100 Subject: Removing obsolete parsing of strings à la v7 in comments. This was for the translator and is not relevant for the beautifier. --- parsing/cLexer.ml4 | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/parsing/cLexer.ml4 b/parsing/cLexer.ml4 index a0cf631ea8..d570f015eb 100644 --- a/parsing/cLexer.ml4 +++ b/parsing/cLexer.ml4 @@ -408,24 +408,6 @@ let comment_stop ep = comment_begin := None; between_commands := false -(* Does not unescape!!! *) -let rec comm_string loc bp = parser - | [< ''"' >] -> push_string "\""; loc - | [< ''\\'; loc = - (parser [< ' ('"' | '\\' as c) >] -> - let () = match c with - | '"' -> real_push_char c - | _ -> () - in - real_push_char c; loc - | [< >] -> real_push_char '\\'; loc); s >] - -> comm_string loc bp s - | [< _ = Stream.empty >] ep -> - let loc = set_loc_pos loc bp ep in - err loc Unterminated_string - | [< ''\n' as c; s >] ep -> real_push_char c; comm_string (bump_loc_line loc ep) bp s - | [< 'c; s >] -> real_push_char c; comm_string loc bp s - let rec comment loc bp = parser bp2 | [< ''('; loc = (parser @@ -437,11 +419,7 @@ let rec comment loc bp = parser bp2 | [< '')' >] -> push_string "*)"; loc | [< s >] -> real_push_char '*'; comment loc bp s >] -> loc | [< ''"'; s >] -> - let loc = - (* In beautify mode, the lexing differs between strings in comments and - regular strings (e.g. escaping). It seems wrong. *) - if !Flags.beautify then (push_string"\""; comm_string loc bp2 s) - else fst (string loc ~comm_level:(Some 0) bp2 0 s) + let loc = fst (string loc ~comm_level:(Some 0) bp2 0 s) in comment loc bp s | [< _ = Stream.empty >] ep -> -- cgit v1.2.3 From ed2ec9362c0c0010b9caaaba4dcc771878ee2b7c Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sat, 5 Nov 2016 12:09:14 +0100 Subject: Removing a special treatment for empty lines in comments. This made the whole pp code complicated only for the purpose of the beautifier, while it is not clear when this was useful. Removing the code for simplicity, not excluding to later address beautifier issues when they show up. --- lib/pp.ml | 51 ++++++++++++--------------------------------------- 1 file changed, 12 insertions(+), 39 deletions(-) diff --git a/lib/pp.ml b/lib/pp.ml index 5520498026..f3bb475392 100644 --- a/lib/pp.ml +++ b/lib/pp.ml @@ -243,32 +243,15 @@ let qstring s = str "\"" ++ str (escape_string s) ++ str "\"" let qs = qstring let quote s = h 0 (str "\"" ++ s ++ str "\"") -(* This flag tells if the last printed comment ends with a newline, to - avoid empty lines *) -let com_eol = ref false - -let com_brk ft = com_eol := false -let com_if ft f = - if !com_eol then (com_eol := false; Format.pp_force_newline ft ()) - else Lazy.force f - let rec pr_com ft s = let (s1,os) = try let n = String.index s '\n' in String.sub s 0 n, Some (String.sub s (n+1) (String.length s - n - 1)) with Not_found -> s,None in - com_if ft (Lazy.from_val()); -(* let s1 = - if String.length s1 <> 0 && s1.[0] = ' ' then - (Format.pp_print_space ft (); String.sub s1 1 (String.length s1 - 1)) - else s1 in*) Format.pp_print_as ft (utf8_length s1) s1; match os with - Some s2 -> - if Int.equal (String.length s2) 0 then (com_eol := true) - else - (Format.pp_force_newline ft (); pr_com ft s2) + Some s2 -> Format.pp_force_newline ft (); pr_com ft s2 | None -> () type tag_handler = Tag.t -> Format.tag @@ -287,33 +270,24 @@ let pp_dirs ?pp_tag ft = begin match tok with | Str_def s -> let n = utf8_length s in - com_if ft (Lazy.from_val()); Format.pp_print_as ft n s + Format.pp_print_as ft n s | Str_len (s, n) -> - com_if ft (Lazy.from_val()); Format.pp_print_as ft n s + Format.pp_print_as ft n s end | Ppcmd_box(bty,ss) -> (* Prevent evaluation of the stream! *) - com_if ft (Lazy.from_val()); pp_open_box bty ; if not (Format.over_max_boxes ()) then Glue.iter pp_cmd ss; Format.pp_close_box ft () - | Ppcmd_open_box bty -> com_if ft (Lazy.from_val()); pp_open_box bty + | Ppcmd_open_box bty -> pp_open_box bty | Ppcmd_close_box -> Format.pp_close_box ft () | Ppcmd_close_tbox -> Format.pp_close_tbox ft () - | Ppcmd_white_space n -> - com_if ft (Lazy.from_fun (fun()->Format.pp_print_break ft n 0)) - | Ppcmd_print_break(m,n) -> - com_if ft (Lazy.from_fun(fun()->Format.pp_print_break ft m n)) + | Ppcmd_white_space n -> Format.pp_print_break ft n 0 + | Ppcmd_print_break(m,n) -> Format.pp_print_break ft m n | Ppcmd_set_tab -> Format.pp_set_tab ft () - | Ppcmd_print_tbreak(m,n) -> - com_if ft (Lazy.from_fun(fun()->Format.pp_print_tbreak ft m n)) - | Ppcmd_force_newline -> - com_brk ft; Format.pp_force_newline ft () - | Ppcmd_print_if_broken -> - com_if ft (Lazy.from_fun(fun()->Format.pp_print_if_newline ft ())) - | Ppcmd_comment coms -> -(* Format.pp_open_hvbox ft 0;*) - List.iter (pr_com ft) coms(*; - Format.pp_close_box ft ()*) + | Ppcmd_print_tbreak(m,n) -> Format.pp_print_tbreak ft m n + | Ppcmd_force_newline -> Format.pp_force_newline ft () + | Ppcmd_print_if_broken -> Format.pp_print_if_newline ft () + | Ppcmd_comment coms -> List.iter (pr_com ft) coms | Ppcmd_open_tag tag -> begin match pp_tag with | None -> () @@ -327,13 +301,12 @@ let pp_dirs ?pp_tag ft = in let pp_dir = function | Ppdir_ppcmds cmdstream -> Glue.iter pp_cmd cmdstream - | Ppdir_print_newline -> - com_brk ft; Format.pp_print_newline ft () + | Ppdir_print_newline -> Format.pp_print_newline ft () | Ppdir_print_flush -> Format.pp_print_flush ft () in fun (dirstream : _ ppdirs) -> try - Glue.iter pp_dir dirstream; com_brk ft + Glue.iter pp_dir dirstream with reraise -> let reraise = Backtrace.add_backtrace reraise in let () = Format.pp_print_flush ft () in -- cgit v1.2.3 From d6a18782919367006ab1cee0a5577ed9b3028682 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sat, 5 Nov 2016 12:02:43 +0100 Subject: Not using style tags when translating/beautifying a file. --- toplevel/vernac.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toplevel/vernac.ml b/toplevel/vernac.ml index de45090bfc..bfdae85d50 100644 --- a/toplevel/vernac.ml +++ b/toplevel/vernac.ml @@ -143,7 +143,7 @@ let pr_new_syntax_in_context loc chan_beautify ocom = | None -> mt() in let after = comment (CLexer.extract_comments (snd loc)) in if !beautify_file then - Pp.msg_with ~pp_tag:Ppstyle.pp_tag !Pp_control.std_ft (hov 0 (before ++ com ++ after)) + Pp.msg_with !Pp_control.std_ft (hov 0 (before ++ com ++ after)) else Feedback.msg_info (hov 4 (str"New Syntax:" ++ fnl() ++ (hov 0 com))); States.unfreeze fs; -- cgit v1.2.3 From beb5875cca7648ba9963c99a68ea22494ab6329b Mon Sep 17 00:00:00 2001 From: Matej Kosik Date: Sat, 5 Nov 2016 16:28:23 +0100 Subject: FIX: dev/include --- dev/include | 1 - 1 file changed, 1 deletion(-) diff --git a/dev/include b/dev/include index d82fb74f22..9068688f19 100644 --- a/dev/include +++ b/dev/include @@ -47,7 +47,6 @@ #install_printer (* univ full subst *) ppuniverse_level_subst;; #install_printer (* univ opt subst *) ppuniverse_opt_subst;; #install_printer (* evar univ ctx *) ppevar_universe_context;; -#install_printer (* constraints_map *) ppconstraints_map;; #install_printer (* inductive *) ppind;; #install_printer (* 'a scheme_kind *) ppscheme;; #install_printer (* type_judgement *) pptype;; -- cgit v1.2.3 From 25fc9919c6d86fa8119b1f0c8e5ddba156055c9d Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sun, 6 Nov 2016 08:54:37 +0100 Subject: Fixes from Enrico's review --- doc/refman/RefMan-pre.tex | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/doc/refman/RefMan-pre.tex b/doc/refman/RefMan-pre.tex index c7a3c7415a..669ba11e81 100644 --- a/doc/refman/RefMan-pre.tex +++ b/doc/refman/RefMan-pre.tex @@ -1113,8 +1113,8 @@ over 100 contributions integrated. The main user visible changes are: \item Irrefutable patterns in abstractions, by Daniel de Rauglaudre. \item Integration of {\tt ssreflect}'s subterm selection algorithm by Enrico Tassi. -\item Integration of {\tt LtacProf}, a profiler for {\tt Ltac} by Tobias - Tebbi, Jason Gross and Paul Steckler. +\item Integration of {\tt LtacProf}, a profiler for {\tt Ltac} by Jason + Gross, Paul Steckler, Enrico Tassi and Tobias Tebbi. \end{itemize} {\Coq} 8.6 also comes with a bunch of smaller-scale changes and @@ -1170,14 +1170,23 @@ The OPAM repository for {\Coq} packages has been maintained by Guillaume Claret, Guillaume Melquiond, Matthieu Sozeau, Enrico Tassi and others. A list of packages is now available at \url{https://coq.inria.fr/opam/www/}. -Packaging tools were provided by Michael Soegtrop and Enrico Tassi -(Windows), Maxime Dénès and Matthieu Sozeau (MacOS X). Packages are now -regularly built on the continuous integration server. +Packaging tools and software development kits were prepared by Maxime +Dénès, Michael Soegtrop and Enrico Tassi for Windows, and Maxime Dénès +and Matthieu Sozeau for MacOS X. Packages are now regularly built on the +continuous integration server. Matej Košík maintained and greatly improved the continuous integration setup and the testing of {\Coq} contributions. He also contributed many API improvement and code cleanups throughout the system. +General maintenance during part or whole of this period has been done by +Pierre Boutillier, Pierre Courtieu, Maxime Dénès, Hugo Herbelin, Pierre +Letouzey, Guillaume Melquiond, Pierre-Marie Pédrot, Matthieu Sozeau, +Arnaud Spiwack, Enrico Tassi, Bruno Barras, Yves Bertot, +Frédéric Besson, Assia Mahboubi and Yann Régis-Gianas. The development +process was coordinated by Matthieu Sozeau with the help of Maxime +Dénès, who was also in charge of the release process. + Many power users helped to improve the design of the new features via the bug tracker, the pull request system, the {\Coq} development mailing list or the coq-club mailing list. Special thanks to the users who @@ -1194,15 +1203,7 @@ development cycle. Its development spanned 10 months from the release of external contributions than any previous {\Coq} system. Code reviews were systematically done before integration of new features, with an important focus given to compatibility and performance issues, resulting -in a much more robust release than previous ones. - -General maintenance during part or whole of this period has been done by -Pierre Boutillier, Pierre Courtieu, Maxime Dénès, Hugo Herbelin, Pierre -Letouzey, Guillaume Melquiond, Pierre-Marie Pédrot, Matthieu Sozeau, -Arnaud Spiwack, Enrico Tassi as well as Bruno Barras, Yves Bertot, -Frédéric Besson, Assia Mahboubi, Yann Régis-Gianas. The development -process was coordinated by Matthieu Sozeau with the help of Maxime -Dénès, who was also in charge of the release process. +in a hopefully much more robust release than previous ones. Coq Enhancement Proposals (CEPs for short) were introduced by Enrico Tassi to provide more visibility and a discussion period on new -- cgit v1.2.3 From ceaafcde70e0ba536cae03baa740563aff47f6e8 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sun, 6 Nov 2016 11:22:31 +0100 Subject: Maxime's comments --- doc/refman/RefMan-pre.tex | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/doc/refman/RefMan-pre.tex b/doc/refman/RefMan-pre.tex index 669ba11e81..944cd48481 100644 --- a/doc/refman/RefMan-pre.tex +++ b/doc/refman/RefMan-pre.tex @@ -1087,7 +1087,7 @@ Paris, January 2015, revised December 2015,\\ Hugo Herbelin, Matthieu Sozeau and the {\Coq} development team\\ \end{flushright} -\section*{Credits: version 8.6 (Stronger, Better, Faster Rooster)} +\section*{Credits: version 8.6} {\Coq} version 8.6 contains the result of refinements, stabilization of 8.5's features and cleanups of the internals of the system. Over the @@ -1098,7 +1098,8 @@ over 100 contributions integrated. The main user visible changes are: can outperform the previous version by an order of magnitude, by Jacques-Henri Jourdan. \item In CoqIDE and other asynchronous interfaces, more fine-grained - asynchronous processing and error reporting by Enrico Tassi. + asynchronous processing and error reporting by Enrico Tassi (ability + to jump to any error in the document). \item More access to the proof engine features from Ltac: goal management primitives, range selectors and a {\tt typeclasses eauto} engine handling multiple goals and multiple successes, by @@ -1170,22 +1171,25 @@ The OPAM repository for {\Coq} packages has been maintained by Guillaume Claret, Guillaume Melquiond, Matthieu Sozeau, Enrico Tassi and others. A list of packages is now available at \url{https://coq.inria.fr/opam/www/}. -Packaging tools and software development kits were prepared by Maxime -Dénès, Michael Soegtrop and Enrico Tassi for Windows, and Maxime Dénès -and Matthieu Sozeau for MacOS X. Packages are now regularly built on the -continuous integration server. +Packaging tools and software development kits were prepared by Michael +Soegtrop with the help of Maxime Dénès and Enrico Tassi for Windows, and +Maxime Dénès and Matthieu Sozeau for MacOS X. Packages are now regularly +built on the continuous integration server. Matej Košík maintained and greatly improved the continuous integration setup and the testing of {\Coq} contributions. He also contributed many API improvement and code cleanups throughout the system. -General maintenance during part or whole of this period has been done by -Pierre Boutillier, Pierre Courtieu, Maxime Dénès, Hugo Herbelin, Pierre -Letouzey, Guillaume Melquiond, Pierre-Marie Pédrot, Matthieu Sozeau, -Arnaud Spiwack, Enrico Tassi, Bruno Barras, Yves Bertot, -Frédéric Besson, Assia Mahboubi and Yann Régis-Gianas. The development -process was coordinated by Matthieu Sozeau with the help of Maxime -Dénès, who was also in charge of the release process. +The contributors for this version are C.J. Bell, Yves Bertot, Frédéric +Besson, Tej Chajed, Pierre Courtieu, Maxime Dénès, Ricky Elrod, Jason +Gross, Hugo Herbelin, Emilio Jesus Gallego Arias, Jacques-Henri Jourdan, +Matej Košík, Xavier Leroy, Pierre Letouzey, Gregory Malecha, Cyprien +Mangin, Erik Martin-Dorel, Guillaume Melquiond, Pierre-Marie Pédrot, +Lionel Rieg, Gabriel Scherer, Matthieu Sozeau, Arnaud Spiwack, Paul +Steckler, Laurent Théry, Enrico Tassi, Nickolai Zeldovich, Théo +Zimmermann and Daniel de Rauglaudre. The development process was +coordinated by Hugo Herbelin and Matthieu Sozeau with the help of +Maxime Dénès, who was also in charge of the release process. Many power users helped to improve the design of the new features via the bug tracker, the pull request system, the {\Coq} development mailing @@ -1193,8 +1197,8 @@ list or the coq-club mailing list. Special thanks to the users who contributed patches and intensive brain-storming and code reviews, starting with Cyril Cohen, Jason Gross, Robbert Krebbers, Jonathan Leivent, Xavier Leroy, Gregory Malecha, Clément Pit-Claudel, Gabriel -Sherer and Beta Ziliani. It would however be impossible to mention with -precision all the names of people who to some extent influenced the +Sherer and Beta Ziliani. It would however be impossible to mention +exhaustively the names of everybody who to some extent influenced the development. Version 8.6 is the first release of {\Coq} developed on a time-based @@ -1203,7 +1207,7 @@ development cycle. Its development spanned 10 months from the release of external contributions than any previous {\Coq} system. Code reviews were systematically done before integration of new features, with an important focus given to compatibility and performance issues, resulting -in a hopefully much more robust release than previous ones. +in a hopefully more robust release than {\Coq} 8.5. Coq Enhancement Proposals (CEPs for short) were introduced by Enrico Tassi to provide more visibility and a discussion period on new -- cgit v1.2.3 From bf8827788d1d8c0dc96b963d3c35985d8b3725c6 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sun, 6 Nov 2016 11:48:06 +0100 Subject: Hugo's comments --- doc/refman/RefMan-pre.tex | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/refman/RefMan-pre.tex b/doc/refman/RefMan-pre.tex index 944cd48481..6ba2f850ee 100644 --- a/doc/refman/RefMan-pre.tex +++ b/doc/refman/RefMan-pre.tex @@ -1106,8 +1106,6 @@ over 100 contributions integrated. The main user visible changes are: Cyprien Mangin, Matthieu Sozeau and Arnaud Spiwack. \item Tactic behavior uniformization and specification, generalization of intro-patterns by Hugo Herbelin and others. -\item Update of the beautifier by Hugo Herbelin, useful for switching - between versions. \item A brand new warning system allowing to control warnings, turn them into errors or ignore them selectively by Maxime Dénès, Guillaume Melquiond and others. -- cgit v1.2.3 From e6edb3319c850cc7e30e5c31b0bfbf16c5c1a32c Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Mon, 7 Nov 2016 08:41:21 +0100 Subject: More explicit name for status of unification constraints. --- ltac/extratactics.ml4 | 4 ++-- ltac/g_auto.ml4 | 2 +- ltac/tacinterp.ml | 8 ++++---- pretyping/pretyping.ml | 10 +++++----- pretyping/pretyping.mli | 2 +- proofs/evar_refiner.ml | 2 +- proofs/pfedit.ml | 4 ++-- tactics/tactics.ml | 2 +- test-suite/bugs/closed/2310.v | 2 +- test-suite/bugs/closed/3647.v | 2 +- test-suite/bugs/closed/4416.v | 2 +- test-suite/bugs/closed/5149.v | 2 +- test-suite/output/unifconstraints.v | 2 +- theories/Compat/Coq85.v | 2 +- 14 files changed, 23 insertions(+), 23 deletions(-) diff --git a/ltac/extratactics.ml4 b/ltac/extratactics.ml4 index e6498e02b2..2cca760c38 100644 --- a/ltac/extratactics.ml4 +++ b/ltac/extratactics.ml4 @@ -38,7 +38,7 @@ DECLARE PLUGIN "extratactics" let with_delayed_uconstr ist c tac = let flags = { Pretyping.use_typeclasses = false; - use_unif_heuristics = true; + solve_unification_constraints = true; use_hook = Some Pfedit.solve_by_implicit_tactic; fail_evar = false; expand_evars = true @@ -342,7 +342,7 @@ END let constr_flags = { Pretyping.use_typeclasses = true; - Pretyping.use_unif_heuristics = true; + Pretyping.solve_unification_constraints = true; Pretyping.use_hook = Some Pfedit.solve_by_implicit_tactic; Pretyping.fail_evar = false; Pretyping.expand_evars = true } diff --git a/ltac/g_auto.ml4 b/ltac/g_auto.ml4 index 8bc2ffd654..22a2d7fc2f 100644 --- a/ltac/g_auto.ml4 +++ b/ltac/g_auto.ml4 @@ -43,7 +43,7 @@ END let eval_uconstrs ist cs = let flags = { Pretyping.use_typeclasses = false; - use_unif_heuristics = true; + solve_unification_constraints = true; use_hook = Some Pfedit.solve_by_implicit_tactic; fail_evar = false; expand_evars = true diff --git a/ltac/tacinterp.ml b/ltac/tacinterp.ml index 08e67a0c2f..b9dcc4e18d 100644 --- a/ltac/tacinterp.ml +++ b/ltac/tacinterp.ml @@ -646,7 +646,7 @@ let interp_gen kind ist allow_patvar flags env sigma (c,ce) = let constr_flags = { use_typeclasses = true; - use_unif_heuristics = true; + solve_unification_constraints = true; use_hook = Some solve_by_implicit_tactic; fail_evar = true; expand_evars = true } @@ -661,21 +661,21 @@ let interp_type = interp_constr_gen IsType let open_constr_use_classes_flags = { use_typeclasses = true; - use_unif_heuristics = true; + solve_unification_constraints = true; use_hook = Some solve_by_implicit_tactic; fail_evar = false; expand_evars = true } let open_constr_no_classes_flags = { use_typeclasses = false; - use_unif_heuristics = true; + solve_unification_constraints = true; use_hook = Some solve_by_implicit_tactic; fail_evar = false; expand_evars = true } let pure_open_constr_flags = { use_typeclasses = false; - use_unif_heuristics = true; + solve_unification_constraints = true; use_hook = None; fail_evar = false; expand_evars = false } diff --git a/pretyping/pretyping.ml b/pretyping/pretyping.ml index 95d854323a..4b6d10c640 100644 --- a/pretyping/pretyping.ml +++ b/pretyping/pretyping.ml @@ -243,7 +243,7 @@ type inference_hook = env -> evar_map -> evar -> evar_map * constr type inference_flags = { use_typeclasses : bool; - use_unif_heuristics : bool; + solve_unification_constraints : bool; use_hook : inference_hook option; fail_evar : bool; expand_evars : bool @@ -339,7 +339,7 @@ let solve_remaining_evars flags env current_sigma pending = if flags.use_typeclasses then apply_typeclasses env evdref frozen false; if Option.has_some flags.use_hook then apply_inference_hook (Option.get flags.use_hook env) evdref pending; - if flags.use_unif_heuristics then apply_heuristics env evdref false; + if flags.solve_unification_constraints then apply_heuristics env evdref false; if flags.fail_evar then check_evars_are_solved env !evdref frozen pending; !evdref @@ -1109,14 +1109,14 @@ let ise_pretype_gen flags env sigma lvar kind c = let default_inference_flags fail = { use_typeclasses = true; - use_unif_heuristics = true; + solve_unification_constraints = true; use_hook = None; fail_evar = fail; expand_evars = true } let no_classes_no_fail_inference_flags = { use_typeclasses = false; - use_unif_heuristics = true; + solve_unification_constraints = true; use_hook = None; fail_evar = false; expand_evars = true } @@ -1180,7 +1180,7 @@ let understand_ltac flags env sigma lvar kind c = let constr_flags = { use_typeclasses = true; - use_unif_heuristics = true; + solve_unification_constraints = true; use_hook = None; fail_evar = true; expand_evars = true } diff --git a/pretyping/pretyping.mli b/pretyping/pretyping.mli index eead48a549..0f3f7c3c9a 100644 --- a/pretyping/pretyping.mli +++ b/pretyping/pretyping.mli @@ -51,7 +51,7 @@ type inference_hook = env -> evar_map -> evar -> evar_map * constr type inference_flags = { use_typeclasses : bool; - use_unif_heuristics : bool; + solve_unification_constraints : bool; use_hook : inference_hook option; fail_evar : bool; expand_evars : bool diff --git a/proofs/evar_refiner.ml b/proofs/evar_refiner.ml index 5f0cc73d2c..29cad06352 100644 --- a/proofs/evar_refiner.ml +++ b/proofs/evar_refiner.ml @@ -46,7 +46,7 @@ let w_refine (evk,evi) (ltac_var,rawc) sigma = let sigma',typed_c = let flags = { Pretyping.use_typeclasses = true; - Pretyping.use_unif_heuristics = true; + Pretyping.solve_unification_constraints = true; Pretyping.use_hook = None; Pretyping.fail_evar = false; Pretyping.expand_evars = true } in diff --git a/proofs/pfedit.ml b/proofs/pfedit.ml index 9c71e107cc..eddbf72a89 100644 --- a/proofs/pfedit.ml +++ b/proofs/pfedit.ml @@ -16,8 +16,8 @@ open Evd let use_unification_heuristics_ref = ref true let _ = Goptions.declare_bool_option { Goptions.optsync = true; Goptions.optdepr = false; - Goptions.optname = "Unification heuristics are applied at every ."; - Goptions.optkey = ["Use";"Unification";"Heuristics"]; + Goptions.optname = "Solve unification constraints at every \".\""; + Goptions.optkey = ["Solve";"Unification";"Constraints"]; Goptions.optread = (fun () -> !use_unification_heuristics_ref); Goptions.optwrite = (fun a -> use_unification_heuristics_ref:=a); } diff --git a/tactics/tactics.ml b/tactics/tactics.ml index 893f33f1a8..e8cf09415c 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -1141,7 +1141,7 @@ let run_delayed env sigma c = let tactic_infer_flags with_evar = { Pretyping.use_typeclasses = true; - Pretyping.use_unif_heuristics = true; + Pretyping.solve_unification_constraints = true; Pretyping.use_hook = Some solve_by_implicit_tactic; Pretyping.fail_evar = not with_evar; Pretyping.expand_evars = true } diff --git a/test-suite/bugs/closed/2310.v b/test-suite/bugs/closed/2310.v index 9fddede7e9..7fae328715 100644 --- a/test-suite/bugs/closed/2310.v +++ b/test-suite/bugs/closed/2310.v @@ -15,7 +15,7 @@ Definition replace a (y:Nest (prod a a)) : a = a -> Nest a. leave P as subgoal or choose itself one solution *) intros. Fail refine (Cons (cast H _ y)). - Unset Use Unification Heuristics. (* Keep the unification constraint around *) + Unset Solve Unification Constraints. (* Keep the unification constraint around *) refine (Cons (cast H _ y)). intros. refine (Nest (prod X X)). Qed. \ No newline at end of file diff --git a/test-suite/bugs/closed/3647.v b/test-suite/bugs/closed/3647.v index f2cd41203c..f5a22bd508 100644 --- a/test-suite/bugs/closed/3647.v +++ b/test-suite/bugs/closed/3647.v @@ -651,4 +651,4 @@ Goal forall (ptest : program) (cond : Condition) (value : bool) Grab Existential Variables. subst_body; simpl. Fail refine (all_behead (projT2 _)). - Unset Use Unification Heuristics. refine (all_behead (projT2 _)). + Unset Solve Unification Constraints. refine (all_behead (projT2 _)). diff --git a/test-suite/bugs/closed/4416.v b/test-suite/bugs/closed/4416.v index afe8c62ed0..3189685ec0 100644 --- a/test-suite/bugs/closed/4416.v +++ b/test-suite/bugs/closed/4416.v @@ -1,4 +1,4 @@ Goal exists x, x. -Unset Use Unification Heuristics. +Unset Solve Unification Constraints. unshelve refine (ex_intro _ _ _); match goal with _ => refine (_ _) end. (* Error: Incorrect number of goals (expected 2 tactics). *) \ No newline at end of file diff --git a/test-suite/bugs/closed/5149.v b/test-suite/bugs/closed/5149.v index 01b9d158fe..684dba1961 100644 --- a/test-suite/bugs/closed/5149.v +++ b/test-suite/bugs/closed/5149.v @@ -40,7 +40,7 @@ Proof. Fail solve [ unshelve (eapply interpf_SmartVarVar; subst; eassumption) ]. solve [eapply interpf_SmartVarVar; subst; eassumption]. Undo. - Unset Use Unification Heuristics. + Unset Solve Unification Constraints. (* User control of when constraints are solved *) solve [ unshelve (eapply interpf_SmartVarVar; subst; eassumption); solve_constraints ]. Qed. diff --git a/test-suite/output/unifconstraints.v b/test-suite/output/unifconstraints.v index c7fb82adac..b9413a4ac2 100644 --- a/test-suite/output/unifconstraints.v +++ b/test-suite/output/unifconstraints.v @@ -1,5 +1,5 @@ (* Set Printing Existential Instances. *) -Unset Use Unification Heuristics. +Unset Solve Unification Constraints. Axiom veeryyyyyyyyyyyyloooooooooooooonggidentifier : nat. Goal True /\ True /\ True \/ veeryyyyyyyyyyyyloooooooooooooonggidentifier = diff --git a/theories/Compat/Coq85.v b/theories/Compat/Coq85.v index ba58e2d88b..c644133839 100644 --- a/theories/Compat/Coq85.v +++ b/theories/Compat/Coq85.v @@ -29,4 +29,4 @@ Global Set Typeclasses Limit Intros. Global Unset Typeclasses Filtered Unification. (** Allow silently letting unification constraints float after a "." *) -Global Unset Use Unification Heuristics. \ No newline at end of file +Global Unset Solve Unification Constraints. -- cgit v1.2.3 From 3308336f1a412cb2a218e3a70a171cb7ff88bfbe Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Sun, 6 Nov 2016 13:29:18 +0100 Subject: Fix #5182: "Arguments names must be distinct." is bogus and underinformative --- test-suite/output/Arguments_renaming.out | 10 ++++------ test-suite/output/Arguments_renaming.v | 2 +- toplevel/vernacentries.ml | 12 ++++++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/test-suite/output/Arguments_renaming.out b/test-suite/output/Arguments_renaming.out index 9d90de47cb..b084ad4984 100644 --- a/test-suite/output/Arguments_renaming.out +++ b/test-suite/output/Arguments_renaming.out @@ -1,6 +1,5 @@ The command has indeed failed with message: -Error: To rename arguments the "rename" flag must be -specified. +Error: To rename arguments the "rename" flag must be specified. Argument A renamed to B. File "stdin", line 2, characters 0-25: Warning: This command is just asserting the names of arguments of identity. @@ -104,16 +103,15 @@ Expands to: Constant Top.myplus @myplus : forall Z : Type, Z -> nat -> nat -> nat The command has indeed failed with message: -Error: Arguments lists should agree on names they provide. +Error: Argument lists should agree on the names they provide. The command has indeed failed with message: Error: Sequences of implicit arguments must be of different lengths. The command has indeed failed with message: -Error: Arguments names must be distinct. +Error: Some argument names are duplicated: F The command has indeed failed with message: Error: Argument z cannot be declared implicit. The command has indeed failed with message: Error: Extra arguments: y. The command has indeed failed with message: -Error: To rename arguments the "rename" flag must be -specified. +Error: To rename arguments the "rename" flag must be specified. Argument A renamed to R. diff --git a/test-suite/output/Arguments_renaming.v b/test-suite/output/Arguments_renaming.v index 2d14c94ac8..0cb331347d 100644 --- a/test-suite/output/Arguments_renaming.v +++ b/test-suite/output/Arguments_renaming.v @@ -47,7 +47,7 @@ Check @myplus. Fail Arguments eq_refl {F g}, [H] k. Fail Arguments eq_refl {F}, [F] : rename. -Fail Arguments eq_refl {F F}, [F] F. +Fail Arguments eq_refl {F F}, [F] F : rename. Fail Arguments eq {F} x [z] : rename. Fail Arguments eq {F} x z y. Fail Arguments eq {R} s t. diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index ef530d590f..851d7557a5 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -1082,7 +1082,7 @@ let vernac_arguments locality reference args more_implicits nargs_for_red flags | name1 :: names1, name2 :: names2 -> if Name.equal name1 name2 then name1 :: names_union names1 names2 - else error "Arguments lists should agree on names they provide." + else error "Argument lists should agree on the names they provide." in let initial = List.make num_args Anonymous in @@ -1107,9 +1107,6 @@ let vernac_arguments locality reference args more_implicits nargs_for_red flags let names = rename prev_names names in let renaming_specified = Option.has_some !example_renaming in - if not (List.distinct_f Name.compare (List.filter ((!=) Anonymous) names)) then - error "Arguments names must be distinct."; - if !rename_flag_required && not rename_flag then errorlabstrm "vernac_declare_arguments" (strbrk "To rename arguments the \"rename\" flag must be specified." @@ -1120,6 +1117,13 @@ let vernac_arguments locality reference args more_implicits nargs_for_red flags str "\nArgument " ++ pr_name o ++ str " renamed to " ++ pr_name n ++ str "."); + let duplicate_names = + List.duplicates Name.equal (List.filter ((!=) Anonymous) names) + in + if not (List.is_empty duplicate_names) then begin + let duplicates = prlist_with_sep pr_comma pr_name duplicate_names in + errorlabstrm "_" (strbrk "Some argument names are duplicated: " ++ duplicates) + end; (* Parts of this code are overly complicated because the implicit arguments API is completely crazy: positions (ExplByPos) are elaborated to -- cgit v1.2.3 From 75b49b14987ec9467ec5916609da8ce3136d3e11 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Sun, 6 Nov 2016 13:46:25 +0100 Subject: Fix #5181: [Arguments] no longer correctly checks the length of arguments lists --- test-suite/bugs/closed/5181.v | 3 +++ toplevel/vernacentries.ml | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 test-suite/bugs/closed/5181.v diff --git a/test-suite/bugs/closed/5181.v b/test-suite/bugs/closed/5181.v new file mode 100644 index 0000000000..0e6d471979 --- /dev/null +++ b/test-suite/bugs/closed/5181.v @@ -0,0 +1,3 @@ +Definition foo (x y : nat) := x. +Fail Arguments foo {_} : assert. + diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index 851d7557a5..86b86e572d 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -1085,8 +1085,7 @@ let vernac_arguments locality reference args more_implicits nargs_for_red flags else error "Argument lists should agree on the names they provide." in - let initial = List.make num_args Anonymous in - let names = List.fold_left names_union initial names in + let names = List.fold_left names_union [] names in let rec rename prev_names names = match prev_names, names with -- cgit v1.2.3 From 207fcfd9355b01441f2a01614a7de017f4148cde Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Sun, 6 Nov 2016 14:26:01 +0100 Subject: Improve formatting of a message in [Arguments]. --- toplevel/vernacentries.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index 86b86e572d..8a28d979c7 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -1109,11 +1109,11 @@ let vernac_arguments locality reference args more_implicits nargs_for_red flags if !rename_flag_required && not rename_flag then errorlabstrm "vernac_declare_arguments" (strbrk "To rename arguments the \"rename\" flag must be specified." - ++ + ++ spc () ++ match !example_renaming with | None -> mt () | Some (o,n) -> - str "\nArgument " ++ pr_name o ++ + str "Argument " ++ pr_name o ++ str " renamed to " ++ pr_name n ++ str "."); let duplicate_names = -- cgit v1.2.3 From a96fed4624d8baaa4bec9bb63676eb1bcb389091 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Mon, 7 Nov 2016 09:36:30 +0100 Subject: Hugo and Maxime's 2nd pass of comments --- doc/refman/RefMan-pre.tex | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/doc/refman/RefMan-pre.tex b/doc/refman/RefMan-pre.tex index 6ba2f850ee..29ae51fea5 100644 --- a/doc/refman/RefMan-pre.tex +++ b/doc/refman/RefMan-pre.tex @@ -1108,7 +1108,7 @@ over 100 contributions integrated. The main user visible changes are: of intro-patterns by Hugo Herbelin and others. \item A brand new warning system allowing to control warnings, turn them into errors or ignore them selectively by Maxime Dénès, Guillaume - Melquiond and others. + Melquiond, Pierre-Marie Pédrot and others. \item Irrefutable patterns in abstractions, by Daniel de Rauglaudre. \item Integration of {\tt ssreflect}'s subterm selection algorithm by Enrico Tassi. @@ -1131,9 +1131,6 @@ tactics, and generalized and rationalized the handling of generic arguments, allowing to create new versions of Ltac more easily in the future. -Many tactics have now more uniform behavior w.r.t. intro-patterns thanks -to Hugo Herbelin who also improved the basic tactics here and there. - In patterns and terms, {\tt @}, abbreviations and notations are now interpreted the same way, by Hugo Herbelin. @@ -1179,15 +1176,16 @@ setup and the testing of {\Coq} contributions. He also contributed many API improvement and code cleanups throughout the system. The contributors for this version are C.J. Bell, Yves Bertot, Frédéric -Besson, Tej Chajed, Pierre Courtieu, Maxime Dénès, Ricky Elrod, Jason -Gross, Hugo Herbelin, Emilio Jesus Gallego Arias, Jacques-Henri Jourdan, -Matej Košík, Xavier Leroy, Pierre Letouzey, Gregory Malecha, Cyprien -Mangin, Erik Martin-Dorel, Guillaume Melquiond, Pierre-Marie Pédrot, -Lionel Rieg, Gabriel Scherer, Matthieu Sozeau, Arnaud Spiwack, Paul -Steckler, Laurent Théry, Enrico Tassi, Nickolai Zeldovich, Théo -Zimmermann and Daniel de Rauglaudre. The development process was -coordinated by Hugo Herbelin and Matthieu Sozeau with the help of -Maxime Dénès, who was also in charge of the release process. +Besson, Pierre Boutillier, Tej Chajed, Pierre Courtieu, Maxime Dénès, +Ricky Elrod, Jason Gross, Hugo Herbelin, Sébastien Hinderer, Emilio +Jesus Gallego Arias, Jacques-Henri Jourdan, Matej Košík, Xavier Leroy, +Pierre Letouzey, Gregory Malecha, Cyprien Mangin, Erik Martin-Dorel, +Guillaume Melquiond, Pierre-Marie Pédrot, Clément Pit-Claudel, Daniel de +Rauglaudre, Lionel Rieg, Gabriel Scherer, Matthieu Sozeau, Arnaud +Spiwack, Paul Steckler, Laurent Théry, Enrico Tassi, Nickolai Zeldovich +and Théo Zimmermann. The development process was coordinated by Hugo +Herbelin and Matthieu Sozeau with the help of Maxime Dénès, who was also +in charge of the release process. Many power users helped to improve the design of the new features via the bug tracker, the pull request system, the {\Coq} development mailing @@ -1195,7 +1193,7 @@ list or the coq-club mailing list. Special thanks to the users who contributed patches and intensive brain-storming and code reviews, starting with Cyril Cohen, Jason Gross, Robbert Krebbers, Jonathan Leivent, Xavier Leroy, Gregory Malecha, Clément Pit-Claudel, Gabriel -Sherer and Beta Ziliani. It would however be impossible to mention +Scherer and Beta Ziliani. It would however be impossible to mention exhaustively the names of everybody who to some extent influenced the development. -- cgit v1.2.3 From 1692b9e8245fbf485c40c9b6dd311f124978e987 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Mon, 7 Nov 2016 13:49:57 +0100 Subject: More accurate contributor list. Command used: git log v8.5..HEAD --pretty=format:"%an," | sort -k 2 | uniq with some manual postprocessing for login names, particles and multiple first names. --- doc/refman/RefMan-pre.tex | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/doc/refman/RefMan-pre.tex b/doc/refman/RefMan-pre.tex index 29ae51fea5..4578bee120 100644 --- a/doc/refman/RefMan-pre.tex +++ b/doc/refman/RefMan-pre.tex @@ -1175,24 +1175,25 @@ Matej Košík maintained and greatly improved the continuous integration setup and the testing of {\Coq} contributions. He also contributed many API improvement and code cleanups throughout the system. -The contributors for this version are C.J. Bell, Yves Bertot, Frédéric -Besson, Pierre Boutillier, Tej Chajed, Pierre Courtieu, Maxime Dénès, -Ricky Elrod, Jason Gross, Hugo Herbelin, Sébastien Hinderer, Emilio -Jesus Gallego Arias, Jacques-Henri Jourdan, Matej Košík, Xavier Leroy, +The contributors for this version are Bruno Barras, C.J. Bell, Yves +Bertot, Frédéric Besson, Pierre Boutillier, Tej Chajed, Guillaume +Claret, Xavier Clerc, Pierre Corbineau, Pierre Courtieu, Maxime Dénès, +Ricky Elrod, Emilio Jesus Gallego Arias, Jason Gross, Hugo Herbelin, +Sébastien Hinderer, Jacques-Henri Jourdan, Matej Kosik, Xavier Leroy, Pierre Letouzey, Gregory Malecha, Cyprien Mangin, Erik Martin-Dorel, -Guillaume Melquiond, Pierre-Marie Pédrot, Clément Pit-Claudel, Daniel de -Rauglaudre, Lionel Rieg, Gabriel Scherer, Matthieu Sozeau, Arnaud -Spiwack, Paul Steckler, Laurent Théry, Enrico Tassi, Nickolai Zeldovich -and Théo Zimmermann. The development process was coordinated by Hugo -Herbelin and Matthieu Sozeau with the help of Maxime Dénès, who was also -in charge of the release process. +Guillaume Melquiond, Clément Pit--Claudel, Pierre-Marie Pédrot, Daniel +de Rauglaudre, Lionel Rieg, Gabriel Scherer, Thomas Sibut-Pinote, +Matthieu Sozeau, Arnaud Spiwack, Paul Steckler, Enrico Tassi, Laurent +Théry, Nickolai Zeldovich and Théo Zimmermann. The development process +was coordinated by Hugo Herbelin and Matthieu Sozeau with the help of +Maxime Dénès, who was also in charge of the release process. Many power users helped to improve the design of the new features via the bug tracker, the pull request system, the {\Coq} development mailing list or the coq-club mailing list. Special thanks to the users who contributed patches and intensive brain-storming and code reviews, starting with Cyril Cohen, Jason Gross, Robbert Krebbers, Jonathan -Leivent, Xavier Leroy, Gregory Malecha, Clément Pit-Claudel, Gabriel +Leivent, Xavier Leroy, Gregory Malecha, Clément Pit--Claudel, Gabriel Scherer and Beta Ziliani. It would however be impossible to mention exhaustively the names of everybody who to some extent influenced the development. -- cgit v1.2.3 From 1f36cdefd841526f804bd2dd51c1d88309333376 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Mon, 7 Nov 2016 14:47:15 +0100 Subject: Fixes to compile with ocaml 4.01 --- engine/termops.ml | 2 +- ltac/extratactics.ml4 | 2 +- tactics/hints.ml | 4 +++- toplevel/classes.ml | 6 ++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/engine/termops.ml b/engine/termops.ml index 35cacc65b2..697b9a5f15 100644 --- a/engine/termops.ml +++ b/engine/termops.ml @@ -980,7 +980,7 @@ let smash_rel_context sign = let fold_named_context_both_sides f l ~init = List.fold_right_and_left f l init let mem_named_context_val id ctxt = - try Environ.lookup_named_val id ctxt; true with Not_found -> false + try ignore(Environ.lookup_named_val id ctxt); true with Not_found -> false let compact_named_context_reverse sign = let compact l decl = diff --git a/ltac/extratactics.ml4 b/ltac/extratactics.ml4 index d9780dcc8c..8ae95c315b 100644 --- a/ltac/extratactics.ml4 +++ b/ltac/extratactics.ml4 @@ -316,7 +316,7 @@ let project_hint pri l2r r = in let ctx = Evd.universe_context_set sigma in let c = Declare.declare_definition ~internal:Declare.InternalTacticRequest id (c,ctx) in - let info = Vernacexpr.({hint_priority = pri; hint_pattern = None}) in + let info = {Vernacexpr.hint_priority = pri; hint_pattern = None} in (info,false,true,Hints.PathAny, Hints.IsGlobRef (Globnames.ConstRef c)) let add_hints_iff l2r lc n bl = diff --git a/tactics/hints.ml b/tactics/hints.ml index 9cbfe20d96..53573bc7e4 100644 --- a/tactics/hints.ml +++ b/tactics/hints.ml @@ -84,7 +84,9 @@ let secvars_of_hyps hyps = if all then Id.Pred.full (* If the whole section context is available *) else pred -let empty_hint_info = Vernacexpr.{ hint_priority = None; hint_pattern = None } +let empty_hint_info = + let open Vernacexpr in + { hint_priority = None; hint_pattern = None } (************************************************************************) (* The Type of Constructions Autotactic Hints *) diff --git a/toplevel/classes.ml b/toplevel/classes.ml index 1f13ab6374..1528cbb2f6 100644 --- a/toplevel/classes.ml +++ b/toplevel/classes.ml @@ -51,9 +51,11 @@ let _ = | IsGlobal gr -> Hints.IsGlobRef gr in let info = - Vernacexpr.{ info with hint_pattern = + let open Vernacexpr in + { info with hint_pattern = Option.map - (Constrintern.intern_constr_pattern (Global.env())) info.hint_pattern } in + (Constrintern.intern_constr_pattern (Global.env())) + info.hint_pattern } in Flags.silently (fun () -> Hints.add_hints local [typeclasses_db] (Hints.HintsResolveEntry -- cgit v1.2.3 From 25a60b1fcfa2f6017bedd986b1f90fe923d0f3ad Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Mon, 7 Nov 2016 14:50:56 +0100 Subject: Document two new variants of refine They allow to call refine without doing typeclass resolution, allowing to use refine in typeclass hints. --- doc/refman/RefMan-tac.tex | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex index 0aa179d627..695b0b883f 100644 --- a/doc/refman/RefMan-tac.tex +++ b/doc/refman/RefMan-tac.tex @@ -263,6 +263,16 @@ Defined. This tactic behaves like {\tt refine}, but it does not shelve any subgoal. It does not perform any beta-reduction either. +\item {\tt notypeclasses refine \term}\tacindex{notypeclasses refine} + + This tactic behaves like {\tt refine} except it performs typechecking + without resolution of typeclasses. + +\item {\tt simple notypeclasses refine \term}\tacindex{simple + notypeclasses refine} + + This tactic behaves like {\tt simple refine} except it performs typechecking + without resolution of typeclasses. \end{Variants} \subsection{\tt apply \term} -- cgit v1.2.3 From d03e27800ec51538701b606fb7be196e4693780a Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Mon, 7 Nov 2016 15:14:44 +0100 Subject: CHANGES for this branch. --- CHANGES | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index 1b74e783dd..7f171ebc40 100644 --- a/CHANGES +++ b/CHANGES @@ -82,6 +82,16 @@ Hints - Hint Mode now accepts "!" which means that the mode matches only if the argument's head is not an evar (it goes under applications, casts, and scrutinees of matches and projections). +- Hints can now take an optional user-given pattern, used only by + [typeclasses eauto] with the [Filtered Unification] option on. + +Typeclasses + +- Many new options and new engine based on the proof monad. The + [typeclasses eauto] tactic is now a multi-goal, multi-success tactic. + See reference manual for more information. It is planned to + replace auto and eauto in the following version. The 8.5 resolution + engine is still available to help solve compatibility issues. Program -- cgit v1.2.3 From d7cb0e2115ec37eddeeecbb1f2dbdeb7e49aeb7a Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Mon, 7 Nov 2016 15:16:46 +0100 Subject: Mention notypeclasses refine in CHANGES --- CHANGES | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 7f171ebc40..4a70584da7 100644 --- a/CHANGES +++ b/CHANGES @@ -75,7 +75,10 @@ Tactics - Option "Injection On Proofs" was renamed "Keep Proof Equalities". When enabled, injection and inversion do not drop equalities between objects in Prop. Still disabled by default. - +- New tactics "notypeclasses refine" and "simple notypeclasses refine" that + disallow typeclass resolution when typechecking their argument, for use + in typeclass hints. + Hints - Revised the syntax of [Hint Cut] to follow standard notation for regexps. -- cgit v1.2.3 From 3bc8d841148da0cf1db5b9b896f28c3285d4f5db Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Mon, 7 Nov 2016 17:31:48 +0100 Subject: After Emilio's comment. --- doc/refman/RefMan-pre.tex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/refman/RefMan-pre.tex b/doc/refman/RefMan-pre.tex index 4578bee120..8f75353bb3 100644 --- a/doc/refman/RefMan-pre.tex +++ b/doc/refman/RefMan-pre.tex @@ -1169,7 +1169,9 @@ list of packages is now available at \url{https://coq.inria.fr/opam/www/}. Packaging tools and software development kits were prepared by Michael Soegtrop with the help of Maxime Dénès and Enrico Tassi for Windows, and Maxime Dénès and Matthieu Sozeau for MacOS X. Packages are now regularly -built on the continuous integration server. +built on the continuous integration server. {\Coq} now comes with a {\tt + META} file usable with {\tt ocamlfind}, contributed by Emilio Jesús +Gallego Arias, Gregory Malecha, and Matthieu Sozeau. Matej Košík maintained and greatly improved the continuous integration setup and the testing of {\Coq} contributions. He also contributed many @@ -1178,7 +1180,7 @@ API improvement and code cleanups throughout the system. The contributors for this version are Bruno Barras, C.J. Bell, Yves Bertot, Frédéric Besson, Pierre Boutillier, Tej Chajed, Guillaume Claret, Xavier Clerc, Pierre Corbineau, Pierre Courtieu, Maxime Dénès, -Ricky Elrod, Emilio Jesus Gallego Arias, Jason Gross, Hugo Herbelin, +Ricky Elrod, Emilio Jesús Gallego Arias, Jason Gross, Hugo Herbelin, Sébastien Hinderer, Jacques-Henri Jourdan, Matej Kosik, Xavier Leroy, Pierre Letouzey, Gregory Malecha, Cyprien Mangin, Erik Martin-Dorel, Guillaume Melquiond, Clément Pit--Claudel, Pierre-Marie Pédrot, Daniel -- cgit v1.2.3 From 970bd8e901267916ae23bbe661d05c7d64f60b48 Mon Sep 17 00:00:00 2001 From: Arnaud Spiwack Date: Sat, 30 Jul 2016 17:13:27 +0200 Subject: Sort search results by relevance This orders the results of search commands (such as `Search`, `SearchAbout`, …) according to a "relevance" metric to minimise. In this minimal version, the metric is the size of the displayed term. --- toplevel/search.ml | 41 +++++++++++++++++++++++++++++++++++++++++ toplevel/search.mli | 8 ++++++++ toplevel/vernacentries.ml | 8 ++++---- 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/toplevel/search.ml b/toplevel/search.ml index d319b24199..d207ba7e0e 100644 --- a/toplevel/search.ml +++ b/toplevel/search.ml @@ -107,6 +107,47 @@ let generic_search glnumopt fn = | Some glnum -> iter_hypothesis glnum fn); iter_declarations fn +(** This module defines a preference on constrs in the form of a + [compare] function (preferred constr must be big for this + functions, so preferences such as small constr must use a reversed + order). This priority will be used to order search results and + propose first results which are more likely to be relevant to the + query, this is why the type [t] contains the other elements + required of a search. *) +module ConstrPriority = struct + + type t = Globnames.global_reference * Environ.env * Constr.t + + (** A measure of the size of a term *) + let rec size t = + Constr.fold (fun s t -> 1 + s + size t) 0 t + + let compare (_,_,t1) (_,_,t2) = + -compare (size t1) (size t2) +end + +module PriorityQueue = Heap.Functional(ConstrPriority) + +let rec iter_priority_queue q fn = + (* use an option to make the function tail recursive. Will be + obsoleted with Ocaml 4.02 with the [match … with | exception …] + syntax. *) + let next = begin + try Some (PriorityQueue.maximum q) + with Heap.EmptyHeap -> None + end in + match next with + | Some (gref,env,t) -> fn gref env t; iter_priority_queue (PriorityQueue.remove q) fn + | None -> () + +let prioritize_search seq fn = + let acc = ref PriorityQueue.empty in + let iter gref env t = + acc := PriorityQueue.add (gref,env,t) !acc + in + let () = seq iter in + iter_priority_queue !acc fn + (** Filters *) (** This function tries to see whether the conclusion matches a pattern. *) diff --git a/toplevel/search.mli b/toplevel/search.mli index ba3d48efcc..c9167c485d 100644 --- a/toplevel/search.mli +++ b/toplevel/search.mli @@ -74,3 +74,11 @@ val interface_search : ?glnum:int -> (search_constraint * bool) list -> val generic_search : int option -> display_function -> unit (** This function iterates over all hypothesis of the goal numbered [glnum] (if present) and all known declarations. *) + +(** {6 Search function modifiers} *) + +val prioritize_search : (display_function -> unit) -> display_function -> unit +(** [prioritize_search iter] iterates over the values of [iter] (seen + as a sequence of declarations), in a relevance order. This requires to + perform the entire iteration of [iter] before starting streaming. So + [prioritize_search] should not be used for low-latency streaming. *) diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index ede88399ef..18410f9e97 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -1784,13 +1784,13 @@ let vernac_search s gopt r = in match s with | SearchPattern c -> - Search.search_pattern gopt (get_pattern c) r pr_search + (Search.search_pattern gopt (get_pattern c) r |> Search.prioritize_search) pr_search | SearchRewrite c -> - Search.search_rewrite gopt (get_pattern c) r pr_search + (Search.search_rewrite gopt (get_pattern c) r |> Search.prioritize_search) pr_search | SearchHead c -> - Search.search_by_head gopt (get_pattern c) r pr_search + (Search.search_by_head gopt (get_pattern c) r |> Search.prioritize_search) pr_search | SearchAbout sl -> - Search.search_about gopt (List.map (on_snd (interp_search_about_item env)) sl) r pr_search + (Search.search_about gopt (List.map (on_snd (interp_search_about_item env)) sl) r |> Search.prioritize_search) pr_search let vernac_locate = let open Feedback in function | LocateAny (AN qid) -> msg_notice (print_located_qualid qid) -- cgit v1.2.3 From e0e52953a7b06b52603eb6f592dbf40cb325a4de Mon Sep 17 00:00:00 2001 From: Arnaud Spiwack Date: Sat, 30 Jul 2016 17:51:19 +0200 Subject: Refine the relevance measure Having more disctinc symbols incurs a penalty. --- toplevel/search.ml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/toplevel/search.ml b/toplevel/search.ml index d207ba7e0e..e4db764759 100644 --- a/toplevel/search.ml +++ b/toplevel/search.ml @@ -118,12 +118,29 @@ module ConstrPriority = struct type t = Globnames.global_reference * Environ.env * Constr.t + module ConstrSet = CSet.Make(Constr) + (** A measure of the size of a term *) let rec size t = Constr.fold (fun s t -> 1 + s + size t) 0 t + (** Set of the "symbols" (definitions, inductives, constructors) + which appear in a term. *) + let rec symbols acc t = + let open Constr in + match kind t with + | Const _ | Ind _ | Construct _ -> ConstrSet.add t acc + | _ -> Constr.fold symbols acc t + + (** The number of distinct "symbols" (see {!symbols}) which appear + in a term. *) + let num_symbols t = + ConstrSet.(cardinal (symbols empty t)) + + -(3*(num_symbols t) + size t) + let compare (_,_,t1) (_,_,t2) = - -compare (size t1) (size t2) + compare (priority t1) (priority t2) end module PriorityQueue = Heap.Functional(ConstrPriority) @@ -137,7 +154,9 @@ let rec iter_priority_queue q fn = with Heap.EmptyHeap -> None end in match next with - | Some (gref,env,t) -> fn gref env t; iter_priority_queue (PriorityQueue.remove q) fn + | Some (gref,env,t) -> + fn gref env t; + iter_priority_queue (PriorityQueue.remove q) fn | None -> () let prioritize_search seq fn = -- cgit v1.2.3 From 890e0738000d6f12d51761a315b0dd09a915b6c9 Mon Sep 17 00:00:00 2001 From: Arnaud Spiwack Date: Sat, 30 Jul 2016 18:06:08 +0200 Subject: Ordering search: memoise relevance metric Recalculating the metric all the time was proving costly (it was obvious even on small queries). --- toplevel/search.ml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/toplevel/search.ml b/toplevel/search.ml index e4db764759..e1b56b1319 100644 --- a/toplevel/search.ml +++ b/toplevel/search.ml @@ -116,7 +116,11 @@ let generic_search glnumopt fn = required of a search. *) module ConstrPriority = struct - type t = Globnames.global_reference * Environ.env * Constr.t + (* The priority is memoised here. Because of the very localised use + of this module, it is not worth it making a convenient interface. *) + type t = + Globnames.global_reference * Environ.env * Constr.t * priority + and priority = int module ConstrSet = CSet.Make(Constr) @@ -137,10 +141,11 @@ module ConstrPriority = struct let num_symbols t = ConstrSet.(cardinal (symbols empty t)) + let priority t : priority = -(3*(num_symbols t) + size t) - let compare (_,_,t1) (_,_,t2) = - compare (priority t1) (priority t2) + let compare (_,_,_,p1) (_,_,_,p2) = + compare p1 p2 end module PriorityQueue = Heap.Functional(ConstrPriority) @@ -154,7 +159,7 @@ let rec iter_priority_queue q fn = with Heap.EmptyHeap -> None end in match next with - | Some (gref,env,t) -> + | Some (gref,env,t,_) -> fn gref env t; iter_priority_queue (PriorityQueue.remove q) fn | None -> () @@ -162,7 +167,8 @@ let rec iter_priority_queue q fn = let prioritize_search seq fn = let acc = ref PriorityQueue.empty in let iter gref env t = - acc := PriorityQueue.add (gref,env,t) !acc + let p = ConstrPriority.priority t in + acc := PriorityQueue.add (gref,env,t,p) !acc in let () = seq iter in iter_priority_queue !acc fn -- cgit v1.2.3 From a79a62c9fb5690ff1043d9c0dd44f61cd535cc12 Mon Sep 17 00:00:00 2001 From: Arnaud Spiwack Date: Mon, 26 Sep 2016 09:11:42 +0200 Subject: tclDISPATCH: more informative error message "expected _n_ tactics" -> "exected _n_ tactics, was given _k_". Also affect other similar tacticals from `Proofview`. I used that for debugging once, I thought I might as well propose it for mergeing. --- engine/proofview.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/proofview.ml b/engine/proofview.ml index 21227ed198..660f737c69 100644 --- a/engine/proofview.ml +++ b/engine/proofview.ml @@ -423,11 +423,11 @@ let tclFOCUSID id t = exception SizeMismatch of int*int let _ = CErrors.register_handler begin function - | SizeMismatch (i,_) -> + | SizeMismatch (i,j) -> let open Pp in let errmsg = str"Incorrect number of goals" ++ spc() ++ - str"(expected "++int i++str(String.plural i " tactic") ++ str")." + str"(expected "++int i++str(String.plural i " tactic") ++ str", was given "++ int j++str")." in CErrors.user_err errmsg | _ -> raise CErrors.Unhandled -- cgit v1.2.3 From ffc59564a143b2ec9bbf33729271bb1cce19c6f9 Mon Sep 17 00:00:00 2001 From: Arnaud Spiwack Date: Tue, 8 Nov 2016 08:54:35 +0100 Subject: Complete a truncated comment Introduce by myself, I'm afraid, in #308. Noticed by PMP during the review, but I forgot to fix it before merge. --- lib/monad.mli | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/monad.mli b/lib/monad.mli index f7de71f53a..7b0a3e600f 100644 --- a/lib/monad.mli +++ b/lib/monad.mli @@ -66,7 +66,8 @@ module type ListS = sig its second argument in a tail position. *) val iter : ('a -> unit t) -> 'a list -> unit t - (** Like the regular {!CList.map_filter}. The monadic effects are threaded left*) + (** Like the regular {!CList.map_filter}. The monadic effects are + threaded left to right. *) val map_filter : ('a -> 'b option t) -> 'a list -> 'b list t -- cgit v1.2.3 From cadb9e6614a1e72bf18f80acf0aabaeed4e9f057 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Tue, 8 Nov 2016 09:00:13 +0100 Subject: Rewording from Enrico --- doc/refman/RefMan-pre.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/refman/RefMan-pre.tex b/doc/refman/RefMan-pre.tex index 8f75353bb3..4f4f404422 100644 --- a/doc/refman/RefMan-pre.tex +++ b/doc/refman/RefMan-pre.tex @@ -1098,8 +1098,9 @@ over 100 contributions integrated. The main user visible changes are: can outperform the previous version by an order of magnitude, by Jacques-Henri Jourdan. \item In CoqIDE and other asynchronous interfaces, more fine-grained - asynchronous processing and error reporting by Enrico Tassi (ability - to jump to any error in the document). + asynchronous processing and error reporting by Enrico Tassi. In + asynchronous mode {\Coq} is now capable of recovering from errors + and continue processing the document. \item More access to the proof engine features from Ltac: goal management primitives, range selectors and a {\tt typeclasses eauto} engine handling multiple goals and multiple successes, by -- cgit v1.2.3 From c60d155c2213461b8e4392b729445486086302d9 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Tue, 8 Nov 2016 09:36:42 +0100 Subject: Update documentation of Arguments after recent changes. --- doc/refman/RefMan-ext.tex | 12 ++++++------ doc/refman/RefMan-syn.tex | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/refman/RefMan-ext.tex b/doc/refman/RefMan-ext.tex index 51e881bff4..b475a5233c 100644 --- a/doc/refman/RefMan-ext.tex +++ b/doc/refman/RefMan-ext.tex @@ -1315,10 +1315,10 @@ command: \begin{quote} \tt Arguments {\qualid} \nelist{\possiblybracketedident}{} \end{quote} -where the list of {\possiblybracketedident} is the list of all arguments of -{\qualid} where the ones to be declared implicit are surrounded by -square brackets and the ones to be declared as maximally inserted implicits -are surrounded by curly braces. +where the list of {\possiblybracketedident} is a prefix of the list of arguments +of {\qualid} where the ones to be declared implicit are surrounded by square +brackets and the ones to be declared as maximally inserted implicits are +surrounded by curly braces. After the above declaration is issued, implicit arguments can just (and have to) be skipped in any expression involving an application of @@ -1591,7 +1591,7 @@ Implicit arguments names can be redefined using the following syntax: {\tt Arguments {\qualid} \nelist{\name}{} : rename} \end{quote} -Without the {\tt rename} flag, {\tt Arguments} can be used to assert +With the {\tt assert} flag, {\tt Arguments} can be used to assert that a given object has the expected number of arguments and that these arguments are named as expected. @@ -1600,7 +1600,7 @@ these arguments are named as expected. Arguments p [s t] _ [u] _: rename. Check (p r1 (u:=c)). Check (p (s:=a) (t:=b) r1 (u:=c) r2). -Fail Arguments p [s t] _ [w] _. +Fail Arguments p [s t] _ [w] _ : assert. \end{coq_example} diff --git a/doc/refman/RefMan-syn.tex b/doc/refman/RefMan-syn.tex index 92107b750b..1fcc1c0df4 100644 --- a/doc/refman/RefMan-syn.tex +++ b/doc/refman/RefMan-syn.tex @@ -811,13 +811,13 @@ constant have to be interpreted in a given scope. The command is \begin{quote} {\tt Arguments} {\qualid} \nelist{\name {\tt \%}\scope}{} \end{quote} -where the list is the list of the arguments of {\qualid} eventually -annotated with their {\scope}. Grouping round parentheses can -be used to decorate multiple arguments with the same scope. -{\scope} can be either a scope name or its delimiting key. For example -the following command puts the first two arguments of {\tt plus\_fct} -in the scope delimited by the key {\tt F} ({\tt Rfun\_scope}) and the -last argument in the scope delimited by the key {\tt R} ({\tt R\_scope}). +where the list is a prefix of the list of the arguments of {\qualid} eventually +annotated with their {\scope}. Grouping round parentheses can be used to +decorate multiple arguments with the same scope. {\scope} can be either a scope +name or its delimiting key. For example the following command puts the first two +arguments of {\tt plus\_fct} in the scope delimited by the key {\tt F} ({\tt + Rfun\_scope}) and the last argument in the scope delimited by the key {\tt R} +({\tt R\_scope}). \begin{coq_example*} Arguments plus_fct (f1 f2)%F x%R. -- cgit v1.2.3 From b385fbbbb7868f0994d5ec00cb918cea1e8f18cf Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Fri, 4 Nov 2016 15:55:52 +0100 Subject: Use pf_get_type_of to avoid blowup in pose proof of large proof terms --- proofs/tacmach.mli | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/proofs/tacmach.mli b/proofs/tacmach.mli index f79fa1d4b3..59f296f64e 100644 --- a/proofs/tacmach.mli +++ b/proofs/tacmach.mli @@ -108,8 +108,16 @@ module New : sig val pf_env : ('a, 'r) Proofview.Goal.t -> Environ.env val pf_concl : ([ `NF ], 'r) Proofview.Goal.t -> types + (** WRONG: To be avoided at all costs, it typechecks the term entirely but + forgets the universe constraints necessary to retypecheck it *) val pf_unsafe_type_of : ('a, 'r) Proofview.Goal.t -> Term.constr -> Term.types + + (** This function does no type inference and expects an already well-typed term. + It recomputes its type in the fastest way possible (no conversion is ever involved) *) val pf_get_type_of : ('a, 'r) Proofview.Goal.t -> Term.constr -> Term.types + + (** This function entirely type-checks the term and computes its type + and the implied universe constraints. *) val pf_type_of : ('a, 'r) Proofview.Goal.t -> Term.constr -> evar_map * Term.types val pf_conv_x : ('a, 'r) Proofview.Goal.t -> Term.constr -> Term.constr -> bool -- cgit v1.2.3 From a279547e2d4e6cad75c266e4a9e436b524f5df99 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Thu, 10 Nov 2016 11:45:59 +0100 Subject: Updating a comment in test-suite. --- test-suite/output/PatternsInBinders.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-suite/output/PatternsInBinders.v b/test-suite/output/PatternsInBinders.v index fff86d6fae..6fa357a90c 100644 --- a/test-suite/output/PatternsInBinders.v +++ b/test-suite/output/PatternsInBinders.v @@ -58,7 +58,7 @@ Definition F '(n,p) : Type := (Fin n * Fin p)%type. Definition both_z '(n,p) : F (n,p) := (Z _,Z _). Print both_z. -(** These tests show examples which do not factorize binders *) +(** Test factorization of binders *) Check fun '((x,y) : A*B) '(z,t) => swap (x,y) = (z,t). Check forall '(x,y) '((z,t) : B*A), swap (x,y) = (z,t). -- cgit v1.2.3 From 034db0eae27c427a09092c337874c713474f50cb Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Wed, 9 Nov 2016 14:15:12 +0100 Subject: Update CHANGES and credits for 8.6beta1. --- CHANGES | 155 ++++++++++++++++++++++++++++++++++++++++------ doc/refman/RefMan-pre.tex | 13 ++-- 2 files changed, 143 insertions(+), 25 deletions(-) diff --git a/CHANGES b/CHANGES index 4a70584da7..5f4b36151b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,22 +1,9 @@ Changes from V8.5 to V8.6beta1 ============================== -Bugfixes +Kernel -- #4527: when typechecking the statement of a lemma using universe polymorphic - definitions with explicit universe binders, check that the type can indeed be - typechecked using only those universes (after minimization of the other, - flexible universes), or raise an error (fixed scripts can be made forward - compatible). -- #4726: treat user-provided sorts of universe polymorphic records as rigid - (i.e. non-minimizable). -- #4592, #4932: notations sharing recursive patterns or sharing - binders made more robust. -- #4780: Induction with universe polymorphism on was creating ill-typed terms. -- #3070: fixing "subst" in the presence of a chain of dependencies. -- When used as an argument of an ltac function, "auto" without "with" - nor "using" clause now correctly uses only the core hint database by - default. +- A new, faster state-of-the-art universe constraint checker. Specification language @@ -60,9 +47,9 @@ Tactics given a free identifier, it is not bound in subsequent tactics anymore. In order to introduce a binding, use e.g. the "fresh" primitive instead (potential source of incompatibilities). -- New tactics is_ind, is_const, is_proj, is_constructor for use in Ltac (DOC TODO). -- New goal selectors. Sets of goals can be selected by select by listing - integers ranges. Example: "1,4-7,24: tac" focuses "tac" on goals 1,4,5,6,7,24. +- New tactics is_ind, is_const, is_proj, is_constructor for use in Ltac. +- New goal selectors. Sets of goals can be selected by listing integers + ranges. Example: "1,4-7,24: tac" focuses "tac" on goals 1,4,5,6,7,24. - For uniformity with "destruct"/"induction" and for a more natural behavior, "injection" can now work in place by activating option "Structural Injection". In this case, hypotheses are also put in the @@ -78,6 +65,11 @@ Tactics - New tactics "notypeclasses refine" and "simple notypeclasses refine" that disallow typeclass resolution when typechecking their argument, for use in typeclass hints. +- Integration of LtacProf, a profiler for Ltac. +- Reduction tactics now accept more fine-grained flags: iota is now a shorthand + for the new flags match, fix and cofix. +- The ssreflect subterm selection algorithm is now accessible to tactic writers + through the ssrmatching plugin. Hints @@ -108,6 +100,13 @@ Notations - "Bind Scope" can once again bind "Funclass" and "Sortclass". +General infrastructure +- New configurable warning system which can be controlled with the vernacular + command "Set Warnings", or, under coqc/coqtop, with the flag "-w". In + particular, the default is now that warnings are printed by coqc. +- In asynchronous mode, Coq is now capable of recovering from errors and + continue processing the document. + Tools - coqc accepts a -o option to specify the output file name @@ -120,6 +119,126 @@ Tools Verbose Compat vernacular, since these warnings can now be silenced or turned into errors using "-w". +Bugfixes + +- #2498: Coqide navigation preferences delayed effect +- #3035: Avoiding trailing arguments in the Arguments command +- #3070: fixing "subst" in the presence of a chain of dependencies. +- #3317: spurious type error with primitive projections. +- #3441: Use pf_get_type_of to avoid blowup +- #3450: [End foo.] is slower in trunk in some cases. +- #3683: add references to the web site for the bug tracker +- #3753: anomaly with implicit arguments and renamings +- #3849: hyp_list passing isn't transitive +- #3920: eapply masks an hypothesis name. +- #3957: ML Tactic Extension failure +- #4058: STM: if_verbose on "Checking task ..." +- #4095: constr forces typeclass resolution that it did not previously force +- #4368: CoqIDE: Errors are sticky +- #4421: Messages dialog in Coqide resets. +- #4437: CoqIDE doesn't preserve unix encoding under windows +- #4464: "Anomaly: variable H' unbound. Please report.". +- #4471: [generalize dependent] permits ill-typed terms in trunk. +- #4479: "Error: Rewriting base foo does not exist." should be catchable. +- #4527: when typechecking the statement of a lemma using universe polymorphic + definitions with explicit universe binders, check that the type can indeed be + typechecked using only those universes (after minimization of the other, + flexible universes), or raise an error (fixed scripts can be made forward + compatible). +- #4553: CoqIDE gives warnings about deprecated GTK features. +- #4592, #4932: notations sharing recursive patterns or sharing +- #4592, #4932: notations sharing recursive patterns or sharing + binders made more robust. +- #4595: making notations containing "ltac:" unused for printing. +- #4609: document an option governing the generation of equalities +- #4610: Fails to build with camlp4 since the TACTIC EXTEND move. +- #4622: [injection] on an equality between records with primitive projections + generates a match with invalid information +- #4661: Cannot mask the absolute name. +- #4679: weakened setoid_rewrite unification +- #4723: "Obligations: Cannot infer this placeholder of type" +- #4724: get_host_port error message +- #4726: treat user-provided sorts of universe polymorphic records as rigid + (i.e. non-minimizable). +- #4750: Change format of inconsistent assumptions message. +- #4756: STM: nested Abort is like nested Qed +- #4763, #4955: regressions in unification +- #4764: Syntactic notation externalization breaks. +- #4768: CoqIDE much slower than coqc -quick +- #4780: Induction with universe polymorphism on was creating ill-typed terms. +- #4784: [Set Printing Width] to >= 114 causes (some?) syntax errors to print in + the wrong location, confusing emacs mode +- #4785: use [ ] for vector nil +- #4787: Unset Bracketing Last Introduction Pattern not working. +- #4793: Coq 8.6 should accept -compat 8.6 +- #4798: compat notations should not modify the parser. +- #4816: Global universes and constraints should not depend on local ones +- #4825: [clear] should not dependency-check hypotheses that come above it. +- #4828: "make" broken on Widows +- #4836: Anomaly: Uncaught exception Invalid_argument. +- #4842: Time prints in multiple lines +- #4854: Notations with binders +- #4864: Argument : assert does fail if no arg is given +- #4865: deciding on which arguments to recompute scopes was not robust. +- #4869, allow Prop, Set, and level names in constraints. +- #4873: transparency option not used. +- #4893: not_evar: unexpected failure. +- #4904: [Import] does not load intermediately unqualified names of aliases. +- #4906: regression in printing an error message. +- #4914: LtacProf printout has too many newlines. +- #4919: Warning: Unused local entry "move_location" +- #4923: Warning: appcontext is deprecated. +- #4924: CoqIDE should have an option to use Unix-style newlines on Windows +- #4932: anomaly when using binders as terms in recursive notations. +- #4939: LtacProf prints tactic notations weirdly. +- #4940: Tactic notation printing could be more informative. +- #4941: ~/.coqrc file confusing locations +- #4958: [debug auto] should specify hint databases. +- #4964: Severe inefficiency with evars +- #4968: STM: sideff: report safe_id correctly +- #4978: priorities of Equivalence instances +- #5003: more careful generalisation of dependent terms. +- #5005: micromega tactics is now robust to failure of 'abstract'. +- #5011: Anomaly on [Existing Class]. +- #5023: JSON extraction doesn't generate "for xxx". +- #5029: anomaly on user-inputted projection name. +- #5036: autorewrite, sections and universes +- #5045: [generalize] creates ill-typed terms in 8.6. +- #5048: Casts in pattern raise an anomaly in Constrintern. +- #5051: Large outputs are garbled. +- #5061: Warnings flag has no discernible value +- #5066: Anomaly: cannot find Coq.Logic.JMeq.JMeq. +- #5069: Scheme Equality gives anomalies in sections. +- #5073: regression of micromega plugin +- #5078: wrong detection of evaluable local hypotheses. +- #5079: LtacProf: fix reset_profile +- #5080: LtacProf: "Show Ltac Profile CutOff $N" +- #5087: Improve the error message on record with duplicated fields. +- #5090: Effect of -Q depends on coqtop's current directory. +- #5093: typeclasses eauto depth arg does not accept a var. +- #5096: [vm_compute] is exponentially slower than [native_compute]. +- #5098: Symmetry broken in HoTT. +- #5102: "Illegal begin of vernac" on bullets +- #5116: [Print Ltac] should be able to print strategies. +- #5125: Bad error message when attempting to use where with Class. +- #5133: error reporting delayed. +- #5136: Stopping warning on unrecognized unicode character in notation. +- #5139: Anomalies should not be caught by || / try. +- #5141: Bogus message "Error: Cannot infer type of pattern-matching". +- #5145: Anomaly: index to an anonymous variable. +- #5149: [subst] breaks evars +- #5161: case of a notation with unability to detect a recursive binder. +- #5164: regression in locating error in argument of "refine". +- #5181: [Arguments] no longer correctly checks the length of arguments lists +- #5182: "Arguments names must be distinct." is bogus and underinformative +- Qcanon : fix names of lemmas Qcle_alt & Qcge_alt (were Qle_alt & Qge_alt) +- When used as an argument of an ltac function, "auto" without "with" + nor "using" clause now correctly uses only the core hint database by + default. + +Some other fixes, minor changes and documentation improvements are not +mentionned here. + Changes from V8.5pl2 to V8.5pl3 =============================== diff --git a/doc/refman/RefMan-pre.tex b/doc/refman/RefMan-pre.tex index 4f4f404422..f36969e821 100644 --- a/doc/refman/RefMan-pre.tex +++ b/doc/refman/RefMan-pre.tex @@ -1094,13 +1094,11 @@ Hugo Herbelin, Matthieu Sozeau and the {\Coq} development team\\ year of (now time-based) development, about 450 bugs were resolved and over 100 contributions integrated. The main user visible changes are: \begin{itemize} -\item A new, state-of-the-art universe constraint checker that - can outperform the previous version by an order of magnitude, by +\item A new, faster state-of-the-art universe constraint checker, by Jacques-Henri Jourdan. \item In CoqIDE and other asynchronous interfaces, more fine-grained - asynchronous processing and error reporting by Enrico Tassi. In - asynchronous mode {\Coq} is now capable of recovering from errors - and continue processing the document. + asynchronous processing and error reporting by Enrico Tassi, making {\Coq} + capable of recovering from errors and continue processing the document. \item More access to the proof engine features from Ltac: goal management primitives, range selectors and a {\tt typeclasses eauto} engine handling multiple goals and multiple successes, by @@ -1111,8 +1109,9 @@ over 100 contributions integrated. The main user visible changes are: into errors or ignore them selectively by Maxime Dénès, Guillaume Melquiond, Pierre-Marie Pédrot and others. \item Irrefutable patterns in abstractions, by Daniel de Rauglaudre. -\item Integration of {\tt ssreflect}'s subterm selection algorithm by - Enrico Tassi. +\item The {\tt ssreflect} subterm selection algorithm by Georges Gonthier and + Enrico Tassi is now accessible to tactic writers through the {\tt ssrmatching} + plugin. \item Integration of {\tt LtacProf}, a profiler for {\tt Ltac} by Jason Gross, Paul Steckler, Enrico Tassi and Tobias Tebbi. \end{itemize} -- cgit v1.2.3 From 76ed02a6b2e282bf394e083a97047678fe807ad3 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Wed, 9 Nov 2016 16:47:52 +0100 Subject: Remove old windows build scripts. --- dev/make-installer-win32.sh | 22 --- dev/make-installer-win64.sh | 28 ---- dev/make-sdk-win32.sh | 370 -------------------------------------------- 3 files changed, 420 deletions(-) delete mode 100755 dev/make-installer-win32.sh delete mode 100755 dev/make-installer-win64.sh delete mode 100755 dev/make-sdk-win32.sh diff --git a/dev/make-installer-win32.sh b/dev/make-installer-win32.sh deleted file mode 100755 index 51d428dd1e..0000000000 --- a/dev/make-installer-win32.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -set -e - -NSIS="$BASE/NSIS/makensis" -ZIP=_make.zip -URL1=http://sourceforge.net/projects/gnuwin32/files/make/3.81/make-3.81-bin.zip/download -URL2=http://sourceforge.net/projects/gnuwin32/files/make/3.81/make-3.81-dep.zip/download - -[ -e config/Makefile ] || ./configure -debug -prefix ./ -with-doc no -make -j2 -if [ ! -e bin/make.exe ]; then - wget -O $ZIP $URL1 && 7z x $ZIP "bin/*" - wget -O $ZIP $URL2 && 7z x $ZIP "bin/*" - rm -rf $ZIP -fi -VERSION=`grep ^VERSION= config/Makefile | cut -d = -f 2` -cd dev/nsis -"$NSIS" -DVERSION=$VERSION -DGTK_RUNTIME="`cygpath -w $BASE`" -DARCH="win32" coq.nsi -echo Installer: -ls -h $PWD/*exe -cd ../.. diff --git a/dev/make-installer-win64.sh b/dev/make-installer-win64.sh deleted file mode 100755 index 438f4ae5b7..0000000000 --- a/dev/make-installer-win64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -set -e - -NSIS="$BASE/NSIS/makensis" -ZIP=_make.zip -URL1=http://sourceforge.net/projects/gnuwin32/files/make/3.81/make-3.81-bin.zip/download -URL2=http://sourceforge.net/projects/gnuwin32/files/make/3.81/make-3.81-dep.zip/download - -[ -e config/Makefile ] || ./configure -debug -prefix ./ -with-doc no -make -j2 coqide -mkdir -p bin32 -cp bin/* bin32/ -make clean -make archclean -( . ${BASE}_64/environ && ./configure -debug -prefix ./ -with-doc no && make -j2 && make ide/coqidetop.cmxs ) -cp bin32/coqide* bin/ -if [ ! -e bin/make.exe ]; then - wget -O $ZIP $URL1 && 7z x $ZIP "bin/*" - wget -O $ZIP $URL2 && 7z x $ZIP "bin/*" - rm -rf $ZIP -fi -VERSION=`grep ^VERSION= config/Makefile | cut -d = -f 2` -cd dev/nsis -"$NSIS" -DVERSION=$VERSION -DGTK_RUNTIME="`cygpath -w $BASE`" -DARCH="win64" coq.nsi -echo Installer: -ls -h $PWD/*exe -cd ../.. diff --git a/dev/make-sdk-win32.sh b/dev/make-sdk-win32.sh deleted file mode 100755 index 0112324d4d..0000000000 --- a/dev/make-sdk-win32.sh +++ /dev/null @@ -1,370 +0,0 @@ -#!/bin/bash - -# To run this script install cygwin by running setup-x86.exe from cygwin.com -# Install the standard packages plus wget. Then run this script. - -# Sworn by Enrico Tassi -# Modified to support other directories and almost support spaces in paths -# by Jason Gross -# License: Expat/MIT http://opensource.org/licenses/MIT - -# This script reads the following environment variables: -# VERBOSE - set to non-empty to have wget/this script be more verbose, for debugging purposes -# BASE - set to non-empty to give a different location for the zip file, e.g., if /cygdrive/c is full or doesn't exist - -set -e -if [ ! -z "$VERBOSE" ] -then - set -x -fi - -# Resources -ocaml=ocaml-4.01.0-i686-mingw64-installer3.exe -glib=base-windows-0.18.1.1.13.356@BUILD_ec06e9.txz -gtk=base-gtk-2.24.18.1.58@BUILD_594ca8.txz -lablgtk=lablgtk-2.18.0.tar.gz -camlp5=camlp5-6.11.tgz -nsis=nsis-2.46-setup.exe - -ocaml_URL='http://yquem.inria.fr/~protzenk/caml-installer/'$ocaml -lablgtk_URL='https://forge.ocamlcore.org/frs/download.php/1261/'$lablgtk -glib_URL='http://dl.arirux.de/5/binaries32/'$glib -gtk_URL='http://dl.arirux.de/5/binaries32/'$gtk -camlp5_URL='http://pauillac.inria.fr/~ddr/camlp5/distrib/src/'$camlp5 -nsis_URL='http://netcologne.dl.sourceforge.net/project/nsis/NSIS%202/2.46/'$nsis - -cygwin=setup-${HOSTTYPE/i6/x}.exe -cygwin_URL='http://cygwin.com/'$cygwin -cygwin_PKGS=p7zip,zip,sed,make,mingw64-i686-gcc-g++,mingw64-i686-gcc-core,mingw64-i686-gcc,patch,rlwrap,libreadline6,diffutils - -has_spaces() { - test -z "$2" -} -# utilities -# http://www.dependencywalker.com/depends22_x86.zip - -# The SDK itself -REVISION=85-1 -# support for working on computers that don't have a C: drive -if [ -z "$BASE" ] -then - TRUE_BASE=/cygdrive/c -else - # get absolute path - TRUE_BASE="$(readlink -f "$BASE")" -fi -BASE="$TRUE_BASE/CoqSDK-$REVISION" - -if [ -z "$VERBOSE" ] -then - WGET_ARGS="-N -q" -else - WGET_ARGS="-N" -fi - -# Windows has a version of FIND in C:/Windows/system32/find, and we don't want to use that -if [ -x /usr/bin/find ] -then - FIND=/usr/bin/find -else - echo "WARNING: /usr/bin/find does not exist. Falling back on:" - which find - FIND=find -fi - -WGET_ARGS="-N -q" - -if [ "$(has_spaces $BASE; echo $?)" -ne 0 ]; then - echo "ERROR: The current base directory ($BASE) has spaces." - echo "ERROR: building lablgtk would fail." - exit 1 -fi - -cyg_install() { - if [ ! -e "$cygwin" ]; then wget $WGET_ARGS "$cygwin_URL"; fi - chmod a+x "$cygwin" - cygstart -w "$cygwin" -q -P $@ -} - -sanity_check() { - echo "Check: wget." - (which wget) || \ - (echo "Please install wget using the cygwin installer and retry.";\ - exit 1) - echo "Check: 7z, gcc. If it fails wait for cygwin to complete and retry" - (which 7z && which i686-w64-mingw32-gcc) || \ - (echo "Some cygwin package is not installed.";\ - echo "Please wait for cygwin to finish and retry.";\ - cyg_install $cygwin_PKGS;\ - exit 1) -} - -install_base() { - echo "Setting up $BASE" - rm -rf "$BASE" - mkdir -p "$BASE" -} - -make_environ() { - echo "Setting up $BASE/environ" - pushd "$BASE" >/dev/null - cat > environ <<- EOF - cyg_install() { - if [ ! -e "$cygwin" ]; then wget $WGET_ARGS "$cygwin_URL"; fi - chmod a+x "$cygwin" - cygstart -w "$cygwin" -q -P \$@ - } - # Sanity checks: is the mingw64-i686-gcc package installed? - (which i686-w64-mingw32-gcc && which make && which sed) || \\ - (echo "Some cygwin package is not installed.";\\ - echo "Please wait for cygwin to finish and retry.";\\ - cyg_install $cygwin_PKGS;\\ - exit 1) || exit 1 - - export BASE="\$( cd "\$( dirname "\${BASH_SOURCE[0]}" )" && pwd )" - export PATH="\$BASE/bin:\$PATH" - export OCAMLLIB="\$(cygpath -m "\$BASE")/lib" - export OCAMLFIND_CONF="\$(cygpath -m "\$BASE")/etc/findlib.conf" - sed s"|@BASE@|\$(cygpath -m "\$BASE")|g" "\$BASE/lib/ld.conf.in" \\ - > "\$BASE/lib/ld.conf" - sed s"|@BASE@|\$(cygpath -m "\$BASE")|g" "\$BASE/lib/topfind.in" \\ - > "\$BASE/lib/topfind" - sed s"|@BASE@|\$(cygpath -m "\$BASE")|g" "\$BASE/etc/findlib.conf.in" \\ - > "\$BASE/etc/findlib.conf" - echo "Good. You can now build Coq and Coqide from cygwin." - EOF - popd >/dev/null -} - -download() { - echo "Downloading some software:" - if [ ! -e "$ocaml" ]; then - echo "- downloading OCaml..." - wget $WGET_ARGS "$ocaml_URL" - fi - chmod a+x "$ocaml" - if [ ! -e "$lablgtk" ]; then - echo "- downloading lablgtk..." - wget $WGET_ARGS --no-check-certificate "$lablgtk_URL" - fi - if [ ! -e "$gtk" ]; then - echo "- downloading gtk..." - wget $WGET_ARGS "$gtk_URL" - fi - if [ ! -e "$glib" ]; then - echo "- downloading glib..." - wget $WGET_ARGS "$glib_URL" - fi - if [ ! -e "$camlp5" ]; then - echo "- downloading camlp5..." - wget $WGET_ARGS "$camlp5_URL" - fi - if [ ! -e "$nsis" ]; then - echo "- downloading nsis..." - wget $WGET_ARGS "$nsis_URL" - fi -} - -cleanup() { - rm -rf tmp build -} - -install_gtk() { - echo "Installing $glib" - tar -xJf "$glib" -C "$BASE" - echo "Installing $gtk" - tar -xJf "$gtk" -C "$BASE" -} - -install_ocaml() { - echo "Installing $ocaml" - mkdir -p tmp - 7z -otmp x "$ocaml" >/dev/null - cp -r tmp/\$_OUTDIR/bin "$BASE/" - cp -r tmp/bin "$BASE/" - cp -r tmp/\$_OUTDIR/lib "$BASE/" - cp -r tmp/lib "$BASE/" - cp -r tmp/\$_OUTDIR/etc "$BASE/" - "$FIND" "$BASE" -name '*.dll' -o -name '*.exe' | tr '\n' '\0' \ - | xargs -0 chmod a+x - mv "$BASE/lib/topfind" "$BASE/lib/topfind.in" - sed -i 's|@SITELIB@|@BASE@/lib/site-lib|g' "$BASE/lib/topfind.in" - cat > "$BASE/lib/ld.conf.in" <<- EOF - @BASE@/lib - @BASE@/lib/stublibs - EOF - cat > "$BASE/etc/findlib.conf.in" <<- EOF - destdir="@BASE@/lib/site-lib" - path="@BASE@/lib/site-lib" - stdlib="@BASE@/lib" - ldconf="@BASE@/lib/ld.conf" - ocamlc="ocamlc.opt" - ocamlopt="ocamlopt.opt" - ocamldep="ocamldep.opt" - ocamldoc="ocamldoc.opt" - EOF - cp "$BASE/lib/topdirs.cmi" "$BASE/lib/compiler-libs/" -} - -build_install_lablgtk() { - echo "Building $lablgtk" - mkdir -p build - tar -xzf "$lablgtk" -C build - cd build/lablgtk-* - patch -p1 < channel -+ val channel_of_descr_socket : Unix.file_descr -> channel - val add_watch : - cond:condition list -> callback:(condition list -> bool) -> ?prio:int -> channel -> id - val remove : id -> unit ---- lablgtk-2.18.0/src/glib.ml 2013-10-01 01:31:50.000000000 -0700 -+++ lablgtk-2.18.0.new/src/glib.ml 2013-12-06 11:57:53.070804800 -0800 -@@ -72,6 +72,8 @@ - type id - external channel_of_descr : Unix.file_descr -> channel - = "ml_g_io_channel_unix_new" -+ external channel_of_descr_socket : Unix.file_descr -> channel -+ = "ml_g_io_channel_unix_new_socket" - external remove : id -> unit = "ml_g_source_remove" - external add_watch : - cond:condition list -> callback:(condition list -> bool) -> ?prio:int -> channel -> id ---- lablgtk-2.18.0/src/ml_glib.c 2013-10-01 01:31:50.000000000 -0700 -+++ lablgtk-2.18.0.new/src/ml_glib.c 2013-12-10 02:03:33.940371800 -0800 -@@ -25,6 +25,8 @@ - #include - #include - #ifdef _WIN32 -+/* to kill a #warning: include winsock2.h before windows.h */ -+#include - #include "win32.h" - #include - #include -@@ -38,6 +40,11 @@ - #include - #include - -+#ifdef _WIN32 -+/* for Socket_val */ -+#include -+#endif -+ - #include "wrappers.h" - #include "ml_glib.h" - #include "glib_tags.h" -@@ -325,14 +332,23 @@ - - #ifndef _WIN32 - ML_1 (g_io_channel_unix_new, Int_val, Val_GIOChannel_noref) -+CAMLprim value ml_g_io_channel_unix_new_socket (value arg1) { -+ return Val_GIOChannel_noref (g_io_channel_unix_new (Int_val (arg1))); -+} - - #else - CAMLprim value ml_g_io_channel_unix_new(value wh) - { - return Val_GIOChannel_noref -- (g_io_channel_unix_new -+ (g_io_channel_win32_new_fd - (_open_osfhandle((long)*(HANDLE*)Data_custom_val(wh), O_BINARY))); - } -+ -+CAMLprim value ml_g_io_channel_unix_new_socket(value wh) -+{ -+ return Val_GIOChannel_noref -+ (g_io_channel_win32_new_socket(Socket_val(wh))); -+} - #endif - - static gboolean ml_g_io_channel_watch(GIOChannel *s, GIOCondition c, -EOT - #sed -i s'/$PKG_CONFIG/"$PKG_CONFIG"/g' configure - #sed -i s'/""$PKG_CONFIG""/"$PKG_CONFIG"/g' configure - ./configure --disable-gtktest --prefix="$(cygpath -m "$BASE")" \ - >log-configure 2>&1 - sed -i 's?\\?/?g' config.make - make >log-make 2>&1 - make opt >>log-make 2>&1 - #echo "Testing $lablgtk" - #cd src - #./lablgtk2 ../examples/calc.ml - #./lablgtk2 -all ../examples/calc.ml - #cd .. - echo "Installing $lablgtk" - make install >>log-make 2>&1 - cd ../.. -} - -build_install_camlp5() { - echo "Building $camlp5" - mkdir -p build - tar -xzf "$camlp5" -C build - cd build/camlp5-* - ./configure >log-configure 2>&1 - sed -i 's/EXT_OBJ=.obj/EXT_OBJ=.o/' config/Makefile - sed -i 's/EXT_LIB=.lib/EXT_LIB=.a/' config/Makefile - make world.opt >log-make 2>&1 - echo "Installing $camlp5" - make install >>log-make 2>&1 - cd ../.. -} - -install_nsis() { - echo "Installing $nsis" - rm -rf tmp - mkdir -p tmp - 7z -otmp x $nsis >/dev/null - mkdir "$BASE/NSIS" - cp -r tmp/\$_OUTDIR/* "$BASE/NSIS" - rm -rf tmp/\$_OUTDIR - rm -rf tmp/\$PLUGINSDIR - cp -r tmp/* "$BASE/NSIS" -} - -zip_sdk() { - echo "Generating CoqSDK-${REVISION}.zip" - here="`pwd`" - cd "$BASE/.." - rm -f "$here/CoqSDK-${REVISION}.zip" - zip -q -r "$here/CoqSDK-${REVISION}.zip" "$(basename "$BASE")" - cd "$here" -} - -diet_sdk() { - rm -rf "$BASE"/+* - rm -rf "$BASE"/bin/camlp4* - rm -rf "$BASE"/lib/camlp4/ - rm -rf "$BASE"/lib/site-lib/camlp4/ -} - -victory(){ - echo "Output file: CoqSDK-${REVISION}.zip "\ - "(`du -sh CoqSDK-${REVISION}.zip | cut -f 1`)" - echo "Usage: unpack and source the environ file at its root" -} - -if [ -z "$1" ]; then - sanity_check - download - cleanup - install_base - install_nsis - install_ocaml - install_gtk - make_environ - . "$BASE/environ" - build_install_lablgtk - build_install_camlp5 - diet_sdk - make_environ - zip_sdk - cleanup - victory -else - # just one step - $1 -fi -- cgit v1.2.3 From 3e19c53bffa95c6c6f4fd5006d54668f36694dd2 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Thu, 10 Nov 2016 12:25:24 +0100 Subject: Add Michael Soegtrop's new script to build windows installer. --- dev/build/windows/CAVEATS.txt | 22 + dev/build/windows/MakeCoq_84pl6_abs_ocaml.bat | 10 + dev/build/windows/MakeCoq_85pl2_abs_ocaml.bat | 10 + dev/build/windows/MakeCoq_85pl3_abs_ocaml.bat | 10 + dev/build/windows/MakeCoq_85pl3_installer.bat | 8 + dev/build/windows/MakeCoq_85pl3_installer_32.bat | 8 + dev/build/windows/MakeCoq_86git_abs_ocaml.bat | 10 + .../windows/MakeCoq_86git_abs_ocaml_gtksrc.bat | 11 + dev/build/windows/MakeCoq_86git_installer.bat | 8 + dev/build/windows/MakeCoq_86git_installer2.bat | 8 + dev/build/windows/MakeCoq_86git_installer_32.bat | 8 + dev/build/windows/MakeCoq_MinGW.bat | 445 +++++++ dev/build/windows/MakeCoq_SetRootPath.bat | 16 + dev/build/windows/MakeCoq_regtest_noproxy.bat | 18 + dev/build/windows/MakeCoq_regtests.bat | 16 + dev/build/windows/ReadMe.txt | 460 +++++++ dev/build/windows/configure_profile.sh | 32 + dev/build/windows/difftar-folder.sh | 86 ++ dev/build/windows/makecoq_mingw.sh | 1271 ++++++++++++++++++++ dev/build/windows/patches_coq/ReplaceInFile.nsh | 67 ++ dev/build/windows/patches_coq/StrRep.nsh | 60 + dev/build/windows/patches_coq/camlp4-4.02+6.patch | 11 + dev/build/windows/patches_coq/coq-8.4pl2.patch | 11 + dev/build/windows/patches_coq/coq-8.4pl6.patch | 13 + dev/build/windows/patches_coq/coq_new.nsi | 223 ++++ dev/build/windows/patches_coq/flexdll-0.34.patch | 14 + dev/build/windows/patches_coq/glib-2.46.0.patch | 30 + .../windows/patches_coq/gtksourceview-2.11.2.patch | 213 ++++ dev/build/windows/patches_coq/isl-0.14.patch | 11 + dev/build/windows/patches_coq/lablgtk-2.18.3.patch | 87 ++ dev/build/windows/patches_coq/ln.c | 137 +++ 31 files changed, 3334 insertions(+) create mode 100644 dev/build/windows/CAVEATS.txt create mode 100644 dev/build/windows/MakeCoq_84pl6_abs_ocaml.bat create mode 100644 dev/build/windows/MakeCoq_85pl2_abs_ocaml.bat create mode 100644 dev/build/windows/MakeCoq_85pl3_abs_ocaml.bat create mode 100644 dev/build/windows/MakeCoq_85pl3_installer.bat create mode 100644 dev/build/windows/MakeCoq_85pl3_installer_32.bat create mode 100644 dev/build/windows/MakeCoq_86git_abs_ocaml.bat create mode 100644 dev/build/windows/MakeCoq_86git_abs_ocaml_gtksrc.bat create mode 100644 dev/build/windows/MakeCoq_86git_installer.bat create mode 100644 dev/build/windows/MakeCoq_86git_installer2.bat create mode 100644 dev/build/windows/MakeCoq_86git_installer_32.bat create mode 100644 dev/build/windows/MakeCoq_MinGW.bat create mode 100644 dev/build/windows/MakeCoq_SetRootPath.bat create mode 100644 dev/build/windows/MakeCoq_regtest_noproxy.bat create mode 100644 dev/build/windows/MakeCoq_regtests.bat create mode 100644 dev/build/windows/ReadMe.txt create mode 100644 dev/build/windows/configure_profile.sh create mode 100644 dev/build/windows/difftar-folder.sh create mode 100644 dev/build/windows/makecoq_mingw.sh create mode 100644 dev/build/windows/patches_coq/ReplaceInFile.nsh create mode 100644 dev/build/windows/patches_coq/StrRep.nsh create mode 100644 dev/build/windows/patches_coq/camlp4-4.02+6.patch create mode 100644 dev/build/windows/patches_coq/coq-8.4pl2.patch create mode 100644 dev/build/windows/patches_coq/coq-8.4pl6.patch create mode 100644 dev/build/windows/patches_coq/coq_new.nsi create mode 100644 dev/build/windows/patches_coq/flexdll-0.34.patch create mode 100644 dev/build/windows/patches_coq/glib-2.46.0.patch create mode 100644 dev/build/windows/patches_coq/gtksourceview-2.11.2.patch create mode 100644 dev/build/windows/patches_coq/isl-0.14.patch create mode 100644 dev/build/windows/patches_coq/lablgtk-2.18.3.patch create mode 100644 dev/build/windows/patches_coq/ln.c diff --git a/dev/build/windows/CAVEATS.txt b/dev/build/windows/CAVEATS.txt new file mode 100644 index 0000000000..cb1ae3aaaf --- /dev/null +++ b/dev/build/windows/CAVEATS.txt @@ -0,0 +1,22 @@ +===== Environemt SIZE ===== + +find and xargs can fail if the environment is to large. I think the limit is 8k. + +xargs --show-limits + +shows the actual environment size + +The configure_profile.sh script sets ORIGINAL_PATH (set by cygwin) to "" to +avoid issues + +===== OCAMLLIB ===== + +If the environment variable OCAMLLIB is defined, it takes precedence over the +internal paths of ocaml tools. This usually messes up things considerably. A +typical failure is + +Error: Error on dynamically loaded library: .\dlllablgtk2.dll: %1 is not a valid Win32 application. + +The configure_profile.sh script clears OCAMLLIB, but if you use the ocaml +compiler from outside the provided cygwin shell, OCAMLLIB might be defined. + diff --git a/dev/build/windows/MakeCoq_84pl6_abs_ocaml.bat b/dev/build/windows/MakeCoq_84pl6_abs_ocaml.bat new file mode 100644 index 0000000000..bdcb01db92 --- /dev/null +++ b/dev/build/windows/MakeCoq_84pl6_abs_ocaml.bat @@ -0,0 +1,10 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -mode=absolute ^ + -ocaml=Y ^ + -make=Y ^ + -coqver=8.4pl6 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_84pl6_abs ^ + -destcoq=%ROOTPATH%\coq64_84pl6_abs diff --git a/dev/build/windows/MakeCoq_85pl2_abs_ocaml.bat b/dev/build/windows/MakeCoq_85pl2_abs_ocaml.bat new file mode 100644 index 0000000000..2e4a692e9c --- /dev/null +++ b/dev/build/windows/MakeCoq_85pl2_abs_ocaml.bat @@ -0,0 +1,10 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -mode=absolute ^ + -ocaml=Y ^ + -make=Y ^ + -coqver=8.5pl2 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_85pl2_abs ^ + -destcoq=%ROOTPATH%\coq64_85pl2_abs diff --git a/dev/build/windows/MakeCoq_85pl3_abs_ocaml.bat b/dev/build/windows/MakeCoq_85pl3_abs_ocaml.bat new file mode 100644 index 0000000000..6e4e440a2c --- /dev/null +++ b/dev/build/windows/MakeCoq_85pl3_abs_ocaml.bat @@ -0,0 +1,10 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -mode=absolute ^ + -ocaml=Y ^ + -make=Y ^ + -coqver=8.5pl3 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_85pl3_abs ^ + -destcoq=%ROOTPATH%\coq64_85pl3_abs diff --git a/dev/build/windows/MakeCoq_85pl3_installer.bat b/dev/build/windows/MakeCoq_85pl3_installer.bat new file mode 100644 index 0000000000..c305e2f52d --- /dev/null +++ b/dev/build/windows/MakeCoq_85pl3_installer.bat @@ -0,0 +1,8 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -installer=Y ^ + -coqver=8.5pl3 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_85pl3_inst ^ + -destcoq=%ROOTPATH%\coq64_85pl3_inst diff --git a/dev/build/windows/MakeCoq_85pl3_installer_32.bat b/dev/build/windows/MakeCoq_85pl3_installer_32.bat new file mode 100644 index 0000000000..d87ff59197 --- /dev/null +++ b/dev/build/windows/MakeCoq_85pl3_installer_32.bat @@ -0,0 +1,8 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=32 ^ + -installer=Y ^ + -coqver=8.5pl3 ^ + -destcyg=%ROOTPATH%\cygwin_coq32_85pl3_inst ^ + -destcoq=%ROOTPATH%\coq32_85pl3_inst diff --git a/dev/build/windows/MakeCoq_86git_abs_ocaml.bat b/dev/build/windows/MakeCoq_86git_abs_ocaml.bat new file mode 100644 index 0000000000..f1d855a028 --- /dev/null +++ b/dev/build/windows/MakeCoq_86git_abs_ocaml.bat @@ -0,0 +1,10 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -mode=absolute ^ + -ocaml=Y ^ + -make=Y ^ + -coqver=git-v8.6 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_86git_abs ^ + -destcoq=%ROOTPATH%\coq64_86git_abs diff --git a/dev/build/windows/MakeCoq_86git_abs_ocaml_gtksrc.bat b/dev/build/windows/MakeCoq_86git_abs_ocaml_gtksrc.bat new file mode 100644 index 0000000000..70ab42bc36 --- /dev/null +++ b/dev/build/windows/MakeCoq_86git_abs_ocaml_gtksrc.bat @@ -0,0 +1,11 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -mode=absolute ^ + -ocaml=Y ^ + -make=Y ^ + -gtksrc=Y ^ + -coqver=git-v8.6 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_86git_abs_gtksrc ^ + -destcoq=%ROOTPATH%\coq64_86git_abs_gtksrc diff --git a/dev/build/windows/MakeCoq_86git_installer.bat b/dev/build/windows/MakeCoq_86git_installer.bat new file mode 100644 index 0000000000..40506318e1 --- /dev/null +++ b/dev/build/windows/MakeCoq_86git_installer.bat @@ -0,0 +1,8 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -installer=Y ^ + -coqver=git-v8.6 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_86git_inst ^ + -destcoq=%ROOTPATH%\coq64_86git_inst diff --git a/dev/build/windows/MakeCoq_86git_installer2.bat b/dev/build/windows/MakeCoq_86git_installer2.bat new file mode 100644 index 0000000000..d184f0e30e --- /dev/null +++ b/dev/build/windows/MakeCoq_86git_installer2.bat @@ -0,0 +1,8 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -installer=Y ^ + -coqver=git-v8.6 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_86git_inst2 ^ + -destcoq=%ROOTPATH%\coq64_86git_inst2 diff --git a/dev/build/windows/MakeCoq_86git_installer_32.bat b/dev/build/windows/MakeCoq_86git_installer_32.bat new file mode 100644 index 0000000000..b9127c9454 --- /dev/null +++ b/dev/build/windows/MakeCoq_86git_installer_32.bat @@ -0,0 +1,8 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=32 ^ + -installer=Y ^ + -coqver=git-v8.6 ^ + -destcyg=%ROOTPATH%\cygwin_coq32_86git_inst ^ + -destcoq=%ROOTPATH%\coq32_86git_inst diff --git a/dev/build/windows/MakeCoq_MinGW.bat b/dev/build/windows/MakeCoq_MinGW.bat new file mode 100644 index 0000000000..1e08cc5a3c --- /dev/null +++ b/dev/build/windows/MakeCoq_MinGW.bat @@ -0,0 +1,445 @@ +@ECHO OFF + +REM ========== COPYRIGHT/COPYLEFT ========== + +REM (C) 2016 Intel Deutschland GmbH +REM Author: Michael Soegtrop + +REM Released to the public by Intel under the +REM GNU Lesser General Public License Version 2.1 or later +REM See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html + +REM ========== NOTES ========== + +REM For Cygwin setup command line options +REM see https://cygwin.com/faq/faq.html#faq.setup.cli + +REM ========== DEFAULT VALUES FOR PARAMETERS ========== + +REM For a description of all parameters, see ReadMe.txt + +SET BATCHFILE=%0 +SET BATCHDIR=%~dp0 + +REM see -arch in ReadMe.txt, but values are x86_64 or i686 (not 64 or 32) +SET ARCH=x86_64 + +REM see -mode in ReadMe.txt +SET INSTALLMODE=absolute + +REM see -installer in ReadMe.txt +SET MAKEINSTALLER=N + +REM see -ocaml in ReadMe.txt +SET INSTALLOCAML=N + +REM see -make in ReadMe.txt +SET INSTALLMAKE=Y + +REM see -destcyg in ReadMe.txt +SET DESTCYG=C:\bin\cygwin_coq + +REM see -destcoq in ReadMe.txt +SET DESTCOQ=C:\bin\coq + +REM see -setup in ReadMe.txt +SET SETUP=setup-x86_64.exe + +REM see -proxy in ReadMe.txt +IF DEFINED HTTP_PROXY ( + SET PROXY="%HTTP_PROXY:http://=%" +) else ( + SET PROXY="" +) + +REM see -cygrepo in ReadMe.txt +SET CYGWIN_REPOSITORY=http://ftp.inf.tu-dresden.de/software/windows/cygwin32 + +REM see -cygcache in ReadMe.txt +SET CYGWIN_LOCAL_CACHE_WFMT=%BATCHDIR%cygwin_cache + +REM see -cyglocal in ReadMe.txt +SET CYGWIN_FROM_CACHE=N + +REM see -cygquiet in ReadMe.txt +SET CYGWIN_QUIET=Y + +REM see -srccache in ReadMe.txt +SET SOURCE_LOCAL_CACHE_WFMT=%BATCHDIR%source_cache + +REM see -coqver in ReadMe.txt +SET COQ_VERSION=8.5pl3 + +REM see -gtksrc in ReadMe.txt +SET GTK_FROM_SOURCES=N + +REM see -threads in ReadMe.txt +SET MAKE_THREADS=8 + +REM ========== PARSE COMMAND LINE PARAMETERS ========== + +SHIFT + +:Parse + +IF "%0" == "-arch" ( + IF "%1" == "32" ( + SET ARCH=i686 + SET SETUP=setup-x86.exe + ) ELSE ( + IF "%1" == "64" ( + SET ARCH=x86_64 + SET SETUP=setup-x86_64.exe + ) ELSE ( + ECHO "Invalid -arch, valid are 32 and 64" + GOTO :EOF + ) + ) + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-mode" ( + IF "%1" == "mingwincygwin" ( + SET INSTALLMODE=%1 + ) ELSE ( + IF "%1" == "absolute" ( + SET INSTALLMODE=%1 + ) ELSE ( + IF "%1" == "relocatable" ( + SET INSTALLMODE=%1 + ) ELSE ( + ECHO "Invalid -mode, valid are mingwincygwin, absolute and relocatable" + GOTO :EOF + ) + ) + ) + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-installer" ( + SET MAKEINSTALLER=%1 + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-ocaml" ( + SET INSTALLOCAML=%1 + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-make" ( + SET INSTALLMAKE=%1 + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-destcyg" ( + SET DESTCYG=%1 + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-destcoq" ( + SET DESTCOQ=%1 + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-setup" ( + SET SETUP=%1 + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-proxy" ( + SET PROXY="%1" + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-cygrepo" ( + SET CYGWIN_REPOSITORY="%1" + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-cygcache" ( + SET CYGWIN_LOCAL_CACHE_WFMT="%1" + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-cyglocal" ( + SET CYGWIN_FROM_CACHE=%1 + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-cygquiet" ( + SET CYGWIN_QUIET=%1 + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-srccache" ( + SET SOURCE_LOCAL_CACHE_WFMT="%1" + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-coqver" ( + SET COQ_VERSION=%1 + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-gtksrc" ( + SET GTK_FROM_SOURCES=%1 + SHIFT + SHIFT + GOTO Parse +) + +IF "%0" == "-threads" ( + SET MAKE_THREADS=%1 + SHIFT + SHIFT + GOTO Parse +) + +IF NOT "%0" == "" ( + ECHO Install cygwin and download, compile and install OCaml and Coq for MinGW + ECHO !!! Illegal parameter %0 + ECHO Usage: + ECHO MakeCoq_MinGW + CALL :PrintPars + goto :EOF +) + +IF NOT EXIST %SETUP% ( + ECHO The cygwin setup program %SETUP% doesn't exist. You must download it from https://cygwin.com/install.html. + GOTO :EOF +) + +REM ========== ADJUST PARAMETERS ========== + +IF "%INSTALLMODE%" == "mingwincygwin" ( + SET DESTCOQ=%DESTCYG%\usr\%ARCH%-w64-mingw32\sys-root\mingw +) + +IF "%MAKEINSTALLER%" == "Y" ( + SET INSTALLMODE=relocatable + SET INSTALLOCAML=Y + SET INSTALLMAKE=Y +) + +REM ========== CONFIRM PARAMETERS ========== + +CALL :PrintPars +REM Note: DOS batch replaces variables on parsing, so one can't use a variable just set in an () block +IF "%COQREGTESTING%"=="Y" (GOTO :DontAsk) + SET /p ANSWER=Is this correct? y/n + IF NOT "%ANSWER%"=="y" (GOTO :EOF) +:DontAsk + +REM ========== DERIVED VARIABLES ========== + +SET CYGWIN_INSTALLDIR_WFMT=%DESTCYG% +SET RESULT_INSTALLDIR_WFMT=%DESTCOQ% +SET TARGET_ARCH=%ARCH%-w64-mingw32 +SET BASH=%CYGWIN_INSTALLDIR_WFMT%\bin\bash + +REM Convert pathes to various formats +REM WFMT = windows format (C:\..) Used in this batch file. +REM CFMT = cygwin format (\cygdrive\c\..) Used for Cygwin PATH varible, which is : separated, so C: doesn't work. +REM MFMT = MinGW format (C:/...) Used for the build, because \\ requires escaping. Mingw can handle \ and /. + +SET CYGWIN_INSTALLDIR_MFMT=%CYGWIN_INSTALLDIR_WFMT:\=/% +SET RESULT_INSTALLDIR_MFMT=%RESULT_INSTALLDIR_WFMT:\=/% +SET SOURCE_LOCAL_CACHE_MFMT=%SOURCE_LOCAL_CACHE_WFMT:\=/% + +SET CYGWIN_INSTALLDIR_CFMT=%CYGWIN_INSTALLDIR_MFMT:C:/=/cygdrive/c/% +SET RESULT_INSTALLDIR_CFMT=%RESULT_INSTALLDIR_MFMT:C:/=/cygdrive/c/% +SET SOURCE_LOCAL_CACHE_CFMT=%SOURCE_LOCAL_CACHE_MFMT:C:/=/cygdrive/c/% + +SET CYGWIN_INSTALLDIR_CFMT=%CYGWIN_INSTALLDIR_CFMT:D:/=/cygdrive/d/% +SET RESULT_INSTALLDIR_CFMT=%RESULT_INSTALLDIR_CFMT:D:/=/cygdrive/d/% +SET SOURCE_LOCAL_CACHE_CFMT=%SOURCE_LOCAL_CACHE_CFMT:D:/=/cygdrive/d/% + +SET CYGWIN_INSTALLDIR_CFMT=%CYGWIN_INSTALLDIR_CFMT:E:/=/cygdrive/e/% +SET RESULT_INSTALLDIR_CFMT=%RESULT_INSTALLDIR_CFMT:E:/=/cygdrive/e/% +SET SOURCE_LOCAL_CACHE_CFMT=%SOURCE_LOCAL_CACHE_CFMT:E:/=/cygdrive/e/% + +ECHO CYGWIN INSTALL DIR (WIN) = %CYGWIN_INSTALLDIR_WFMT% +ECHO CYGWIN INSTALL DIR (MINGW) = %CYGWIN_INSTALLDIR_MFMT% +ECHO CYGWIN INSTALL DIR (CYGWIN) = %CYGWIN_INSTALLDIR_CFMT% +ECHO RESULT INSTALL DIR (WIN) = %RESULT_INSTALLDIR_WFMT% +ECHO RESULT INSTALL DIR (MINGW) = %RESULT_INSTALLDIR_MFMT% +ECHO RESULT INSTALL DIR (CYGWIN) = %RESULT_INSTALLDIR_CFMT% + +REM WARNING: Add a space after the = in case you want set this to empty, otherwise the variable will be unset +SET MAKE_OPT=-j %MAKE_THREADS% + +REM ========== DERIVED CYGWIN SETUP OPTIONS ========== + +REM WARNING: Add a space after the = otherwise the variable will be unset +SET CYGWIN_OPT= + +IF "%CYGWIN_FROM_CACHE%" == "Y" ( + SET CYGWIN_OPT= %CYGWIN_OPT% -L +) + +IF "%CYGWIN_QUIET%" == "Y" ( + SET CYGWIN_OPT= %CYGWIN_OPT% -q --no-admin +) + +IF "%GTK_FROM_SOURCES%"=="N" ( + SET CYGWIN_OPT= %CYGWIN_OPT% -P mingw64-%ARCH%-gtk2.0,mingw64-%ARCH%-gtksourceview2.0 +) + +ECHO ========== INSTALL CYGWIN ========== + +REM Cygwin setup sets proper ACLs (permissions) for folders it CREATES. +REM Otherwise chmod won't work and e.g. the ocaml build will fail. +REM Cygwin setup does not touch the ACLs of existing folders. +REM => Create the setup log in a temporary location and move it later. + +REM Get Unique temporary file name +:logfileloop +SET LOGFILE=%TEMP%\CygwinSetUp%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.log +if exist "%LOGFILE%" goto :logfileloop + +REM Run Cygwin Setup + +SET RUNSETUP=Y +IF EXIST "%CYGWIN_INSTALLDIR_WFMT%\etc\setup\installed.db" ( + SET RUNSETUP=N +) +IF NOT "%CYGWIN_QUIET%" == "Y" ( + SET RUNSETUP=Y +) + +IF "%RUNSETUP%"=="Y" ( + %SETUP% ^ + --proxy %PROXY% ^ + --site %CYGWIN_REPOSITORY% ^ + --root %CYGWIN_INSTALLDIR_WFMT% ^ + --local-package-dir %CYGWIN_LOCAL_CACHE_WFMT% ^ + --no-shortcuts ^ + %CYGWIN_OPT% ^ + -P wget,curl,git,make,unzip ^ + -P gcc-core,gcc-g++ ^ + -P gdb,liblzma5 ^ + -P patch,automake1.14,automake1.15 ^ + -P mingw64-%ARCH%-binutils,mingw64-%ARCH%-gcc-core,mingw64-%ARCH%-gcc-g++,mingw64-%ARCH%-pkg-config,mingw64-%ARCH%-windows_default_manifest ^ + -P mingw64-%ARCH%-headers,mingw64-%ARCH%-runtime,mingw64-%ARCH%-pthreads,mingw64-%ARCH%-zlib ^ + -P libiconv-devel,libunistring-devel,libncurses-devel ^ + -P gettext-devel,libgettextpo-devel ^ + -P libglib2.0-devel,libgdk_pixbuf2.0-devel ^ + -P libfontconfig1 ^ + -P gtk-update-icon-cache ^ + -P libtool,automake ^ + -P intltool ^ + > "%LOGFILE%" ^ + || GOTO :Error + + MKDIR %CYGWIN_INSTALLDIR_WFMT%\build + MKDIR %CYGWIN_INSTALLDIR_WFMT%\build\buildlogs + MOVE "%LOGFILE%" %CYGWIN_INSTALLDIR_WFMT%\build\buildlogs\cygwinsetup.log || GOTO :Error +) + + +IF NOT "%CYGWIN_QUIET%" == "Y" ( + REM Like most setup programs, cygwin setup starts the real setup as a separate process, so wait for it. + REM This is not required with the -cygquiet=Y and the resulting --no-admin option. + :waitsetup + tasklist /fi "imagename eq %SETUP%" | find ":" > NUL + IF ERRORLEVEL 1 GOTO waitsetup +) + +ECHO ========== CONFIGURE CYGWIN USER ACCOUNT ========== + +copy %BATCHDIR%\configure_profile.sh %CYGWIN_INSTALLDIR_WFMT%\var\tmp || GOTO :Error +%BASH% --login %CYGWIN_INSTALLDIR_CFMT%\var\tmp\configure_profile.sh %PROXY% || GOTO :Error + +ECHO ========== BUILD COQ ========== + +MKDIR %CYGWIN_INSTALLDIR_WFMT%\build +MKDIR %CYGWIN_INSTALLDIR_WFMT%\build\patches + +COPY %BATCHDIR%\makecoq_mingw.sh %CYGWIN_INSTALLDIR_WFMT%\build || GOTO :Error +COPY %BATCHDIR%\patches_coq\*.* %CYGWIN_INSTALLDIR_WFMT%\build\patches || GOTO :Error + +%BASH% --login %CYGWIN_INSTALLDIR_CFMT%\build\makecoq_mingw.sh || GOTO :Error + +ECHO ========== FINISHED ========== + +GOTO :EOF + +ECHO ========== BATCH FUNCTIONS ========== + +:PrintPars + REM 01234567890123456789012345678901234567890123456789012345678901234567890123456789 + ECHO -arch ^ Set cygwin, ocaml and coq to 32 or 64 bit + ECHO -mode ^ + ECHO ^ + ECHO ^ + ECHO -installer^ create a windows installer (will be in /build/coq/dev/nsis) + ECHO -ocaml ^ install OCaml in Coq folder (Y) or just in cygwin folder (N) + ECHO -make ^ install GNU Make in Coq folder (Y) or not (N) + ECHO -destcyg ^ + ECHO -destcoq ^ + ECHO -setup ^ (auto adjusted to -arch) + ECHO -proxy ^ + ECHO -cygrepo ^ + ECHO -cygcache ^ + ECHO -cyglocal ^ install cygwin from cache + ECHO -cygquiet ^ install cygwin without user interaction + ECHO -srccache ^ + ECHO -coqver ^ + ECHO -gtksrc ^ build GTK ^(90 min^) or use cygwin version + ECHO -threads ^<1..N^> Number of make threads + ECHO( + ECHO See ReadMe.txt for a detailed description of all parameters + ECHO( + ECHO Parameter values (default or currently set): + ECHO -arch = %ARCH% + ECHO -mode = %INSTALLMODE% + ECHO -ocaml = %INSTALLOCAML% + ECHO -installer= %MAKEINSTALLER% + ECHO -make = %INSTALLMAKE% + ECHO -destcyg = %DESTCYG% + ECHO -destcoq = %DESTCOQ% + ECHO -setup = %SETUP% + ECHO -proxy = %PROXY% + ECHO -cygrepo = %CYGWIN_REPOSITORY% + ECHO -cygcache = %CYGWIN_LOCAL_CACHE_WFMT% + ECHO -cyglocal = %CYGWIN_FROM_CACHE% + ECHO -cygquiet = %CYGWIN_QUIET% + ECHO -srccache = %SOURCE_LOCAL_CACHE_WFMT% + ECHO -coqver = %COQ_VERSION% + ECHO -gtksrc = %GTK_FROM_SOURCES% + ECHO -threads = %MAKE_THREADS% + GOTO :EOF + +:Error +ECHO Building Coq failed with error code %errorlevel% +EXIT /b %errorlevel% diff --git a/dev/build/windows/MakeCoq_SetRootPath.bat b/dev/build/windows/MakeCoq_SetRootPath.bat new file mode 100644 index 0000000000..3a3711724f --- /dev/null +++ b/dev/build/windows/MakeCoq_SetRootPath.bat @@ -0,0 +1,16 @@ +@ ECHO OFF + +REM Figure out a root path for coq and cygwin + +REM For the \nul trick for testing folders see +REM https://support.microsoft.com/en-us/kb/65994 + +IF EXIST D:\bin\nul ( + SET ROOTPATH=D:\bin +) else if EXIST C:\bin ( + SET ROOTPATH=C:\bin +) else ( + SET ROOTPATH=C: +) + +ECHO ROOTPATH set to %ROOTPATH% diff --git a/dev/build/windows/MakeCoq_regtest_noproxy.bat b/dev/build/windows/MakeCoq_regtest_noproxy.bat new file mode 100644 index 0000000000..2b0b83fed5 --- /dev/null +++ b/dev/build/windows/MakeCoq_regtest_noproxy.bat @@ -0,0 +1,18 @@ +call MakeCoq_SetRootPath + +SET HTTP_PROXY= +EXPORT HTTP_PROXY= +MKDIR C:\Temp\srccache + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -mode=absolute ^ + -ocaml=Y ^ + -make=Y ^ + -coqver 8.5pl2 ^ + -srccache C:\Temp\srccache ^ + -cygquiet=Y ^ + -destcyg %ROOTPATH%\cygwin_coq64_85pl2_abs ^ + -destcoq %ROOTPATH%\coq64_85pl2_abs + +pause \ No newline at end of file diff --git a/dev/build/windows/MakeCoq_regtests.bat b/dev/build/windows/MakeCoq_regtests.bat new file mode 100644 index 0000000000..6e36d01404 --- /dev/null +++ b/dev/build/windows/MakeCoq_regtests.bat @@ -0,0 +1,16 @@ +SET COQREGTESTING=Y + +REM Bleeding edge +call MakeCoq_86git_abs_ocaml.bat +call MakeCoq_86git_installer.bat +call MakeCoq_86git_installer_32.bat +call MakeCoq_86git_abs_ocaml_gtksrc.bat + +REM Current stable +call MakeCoq_85pl3_abs_ocaml.bat +call MakeCoq_85pl3_installer.bat +call MakeCoq_85pl3_installer_32.bat + +REM Old but might still be used +call MakeCoq_85pl2_abs_ocaml.bat +call MakeCoq_84pl6_abs_ocaml.bat diff --git a/dev/build/windows/ReadMe.txt b/dev/build/windows/ReadMe.txt new file mode 100644 index 0000000000..0faf5bc53f --- /dev/null +++ b/dev/build/windows/ReadMe.txt @@ -0,0 +1,460 @@ +==================== Purpose / Goal ==================== + +The main purpose of these scripts is to build Coq for Windows in a reproducible +and at least by this script documented way without using binary libraries and +executables from various sources. These scripts use only MinGW libraries +provided by Cygwin or compile things from sources. For some libraries there are +options to build them from sources or to use the Cygwin version. + +Another goal (which is not yet achieved) is to have a Coq installer for +Windows, which includes all tools required for native compute and Coq plugin +development without Cygwin. + +Coq requires OCaml for this and OCaml requires binutils, gcc and a posix shell. +Since the standard Windows OCaml installation requires Cygwin to deliver some of +these components, you might be able to imagine that this is not so easy. + +These scripts can produce the following: + +- Coq running on MinGW + +- OCaml producing MinGW code and running on MinGW + +- GCC producing MinGW code and running on MinGW + +- binutils producing MinGW code and running on MinGW + +With "running on MinGW" I mean that the tools accept paths like +"C:\myfolder\myfile.txt" and that they don't link to a Cygwin or msys DLL. The +MinGW gcc and binutils provided by Cygwin produce MinGW code, but they run only +on Cygwin. + +With "producing MinGW code" I mean that the programs created by the tools accept +paths like "C:\myfolder\myfile.txt" and that they don't link to a Cygwin or msys +DLL. + +The missing piece is a posix shell running on plain Windows (without msys or +Cygwin DLL) and not beeing a binary from obscure sources. I am working on it ... + +Since compiling gcc and binutils takes a while and it is not of much use without +a shell, the building of these components is currently disabled. OCaml is built +anyway, because this MinGW/MinGW OCaml (rather than a Cygwin/MinGW OCaml) is +used to compile Coq. + +Until the shell is there, the Cygwin created by these scripts is required to run +OCaml tools. When everything is finished, this will no longer be required. + +==================== Usage ==================== + +The Script MakeCoq_MinGW does: +- download Cygwin (except the Setup.exe or Setup64.exe) +- install Cygwin +- either installs MinGW GTK via Cygwin or compiles it fom sources +- download, compile and install OCaml, CamlP5, Menhir, lablgtk +- download, compile and install Coq +- create a Windows installer (NSIS based) + +The parameters are described below. Mostly paths and the HTTP proxy need to be +set. + +There are two main usages: + +- Compile and install OCaml and Coq in a given folder + + This works reliably, because absolute library paths can be compiled into Coq + and OCaml. + + WARNING: See the "Purpose / Goal" section above for status. + + See MakeCoq_85pl2_abs_ocaml.bat for parameters. + +- Create a Windows installer. + + This works well for Coq but not so well for OCaml. + + WARNING: See the "Purpose / Goal" section above for status. + + See MakeCoq_85pl2_installer.bat for parameters. + +There is also an option to compile OCaml and Coq inside Cygwin, but this is +currently not recommended. The resulting Coq and OCaml work, but Coq is slow +because it scans the largish Cygwin share folder. This will be fixed in a future +version. + +Procedure: + +- Unzip contents of CoqSetup.zip in a folder + +- Adjust parameters in MakeCoq_85pl2_abs_ocaml.bat or in MakeCoq_85pl2_installer.bat. + +- Download Cygwin setup from https://Cygwin.com/install.html + For 32 bit Coq : setup-x86.exe (https://Cygwin.com/setup-x86.exe) + For 64 bit Coq : setup-x86_64.exe (https://Cygwin.com/setup-x86_64.exe) + +- Run MakeCoq_85pl3_abs_ocaml.bat or MakeCoq_85pl3_installer.bat + +- Check MakeCoq_regtests.bat to see what combinations of options are tested + +==================== MakeCoq_MinGW Parameters ==================== + +===== -arch ===== + +Set the target architecture. + +Possible values: + +32: Install/build Cygwin, ocaml and coq for 32 bit windows + +64: Install/build Cygwin, ocaml and coq for 64 bit windows + +Default value: 64 + + +===== -mode ===== + +Set the installation mode / target folder structure. + +Possible values: + +mingwinCygwin: Install coq in the default Cygwin mingw sysroot folder. + This is %DESTCYG%\usr\%ARCH%-w64-mingw32\sys-root\mingw. + Todo: The coq share folder should be configured to e.g. /share/coq. + As is, coqc scans the complete share folder, which slows it down 5x for short files. + +absoloute: Install coq in the absolute path given with -destcoq. + The resulting Coq will not be relocatable. + That is the root folder must not be renamed/moved. + +relocatable: Install coq in the absolute path given with -destcoq. + The resulting Coq will be relocatable. + That is the root folder may be renamed/moved. + If OCaml is installed, please note that OCaml cannot be build really relocatable. + If the root folder is moved, the environment variable OCAMLLIB must be set to the libocaml sub folder. + Also the file \libocaml\ld.conf must be adjusted. + +Default value: absolute + + +===== -installer ===== + +Create a Windows installer (it will be in build/coq-8.xplx/dev/nsis) + +Possible values: + +Y: Create a windows installer - this forces -mode=relocatable. + +N: Don't create a windows installer - use the created Coq installation as is. + +Default value: N + + +===== -ocaml ===== + +Install OCaml for later use with Coq or just for building. + +Possible values: + +Y: Install OCaml in the same root as Coq (as given with -coqdest) + This also copies all .o, .cmo, .a, .cmxa files in the lib folder required for compiling plugins. + +N: Install OCaml in the default Cygwin mingw sysroot folder. + This is %DESTCYG%\usr\%ARCH%-w64-mingw32\sys-root\mingw. + +Default value: N + + +===== -make ===== + +Build and install MinGW GNU make + +Possible values: + +Y: Install MinGW GNU make in the same root as Coq (as given with -coqdest). + +N: Don't build or install MinGW GNU make. + For building everything always Cygwin GNU make is used. + +Default value: Y + + +===== -destcyg ===== + +Destination folder in which Cygwin is installed. + +This must be an absolute path in Windows format (with drive letter and \\). + +>>>>> This folder may be deleted after the Coq build is finished! <<<<< + +Default value: C:\bin\Cygwin_coq + + +===== -destcoq ===== + +Destination folder in which Coq is installed. + +This must be an absolute path in Windows format (with drive letter and \\). + +This option is not required if -mode mingwinCygwin is used. + +Default value: C:\bin\coq + + +===== -setup ===== + +Name/path of the Cygwin setup program. + +The Cygwin setup program is called setup-x86.exe or setup-x86_64.exe. +It can be downloaded from: https://Cygwin.com/install.html. + +Default value: setup-x86.exe or setup-x86_64.exe, depending on -arch. + + +===== -proxy ===== + +Internet proxy setting for downloading Cygwin, ocaml and coq. + +The format is :, e.g. proxy.mycompany.com:911 + +The same proxy is used for HTTP, HTTPS and FTP. +If you need separate proxies for separate protocols, you please put your proxies directly into configure_profile.sh (line 11..13). + +Default value: Value of HTTP_PROXY environment variable or none if this variable does not exist. + +ATTENTION: With the --proxy setting of the Cygwin setup, it is possible to +supply a proxy server, but if this parameter is "", Cygwin setup might use proxy +settings from previous setups. If you once did a Cygwin setup behind a firewall +and now want to do a Cygwin setup without a firewall, use the -cygquiet=N +setting to perform a GUI install, where you can adjust the proxy setting. + +===== -cygrepo ===== + +The online repository, from which Cygwin packages are downloaded. + +Note: although most repositories end with Cygwin32, they are good for 32 and 64 bit Cygwin. + +Default value: http://ftp.inf.tu-dresden.de/software/windows/Cygwin32 + +>>>>> If you are not in Europe, you might want to change this! <<<<< + + +===== -cygcache ===== + +The local cache folder for Cygwin repositories. + +You can also copy files here from a backup/reference and set -cyglocal. +The setup will then not download/update from the internet but only use the local cache. + +Default value: \Cygwin_cache + + +===== -cyglocal ===== + +Control if the Cygwin setup uses the latest version from the internet or the version as is in the local folder. + +Possible values: + +Y: Install exactly the Cygwin version from the local repository cache. + Don't update from the internet. + +N: Download the latest Cygwin version from the internet. + Update the local repository cache with the latest version. + +Default value: N + + +===== -cygquiet ===== + +Control if the Cygwin setup runs quitely or interactive. + +Possible values: + +Y: Install Cygwin quitely without user interaction. + +N: Install Cygwin interactively (allows to select additional packages). + +Default value: Y + + +===== -srccache ===== + +The local cache folder for ocaml/coq/... sources. + +Default value: \source_cache + + +===== -coqver ===== + +The version of Coq to download and compile. + +Possible values: 8.4pl6, 8.5pl2, 8.5pl3, git-v8.6 + Others might work, but are untested. + 8.4 is only tested in mode=absoloute + +Default value: 8.5pl3 + +If git- is prepended, the Coq sources are loaded from git. + +ATTENTION: with default options, the scripts cache source tar balls in two +places, the /build/tarballs folder and the /source_cache +folder. If you modified something in git, you need to delete the cached tar ball +in both places! + +===== -gtksrc ===== + +Control if GTK and its prerequisites are build from sources or if binary MinGW packages from Cygwin are used + +Possible values: + +Y: Build GTK from sources, takes about 90 minutes extra. + This is useful, if you want to debug/fix GTK or library issues. + +N: Use prebuilt MinGW libraries from Cygwin + + +===== -threads ===== + +Control the maximum number of make threads for modules which support parallel make. + +Possible values: 1..N. + Should not be more than 1.5x the number of cores. + Should not be more than available RAM/2GB (e.g. 4 for 8GB) + + +==================== TODO ==================== + +- Installer doesn't remove OCAMLLIB environment variables (it is in the script, but doesn't seem to work) +- CoqIDE doesn't find theme files +- Finish / test mingw_in_Cygwin mode (coqide doesn't start, coqc slow cause of scanning complete share folder) +- Possibly create/login as specific user to bash (not sure if it makes sense - nead to create additional bash login link then) +- maybe move share/doc/menhir somehwere else (reduces coqc startup time) +- Use original installed file list for removing files in uninstaller + +==================== Issues with relocation ==================== + +Coq and OCaml are built in a specific folder and are not really intended for relocation e.g. by an installer. +Some absolute paths in config files are patched in coq_new.nsi. + +Coq is made fairly relocatable by first configuring it with PREFIX=./ and then PREFIX=. +OCaml is made relocatable mostly by defining the OCAMLLIB environment variable and by patching some files. +If you have issues with one of the remaining (unpatched) files below, please let me know. + +Text files patched by the installer: + +./ocamllib/ld.conf +./etc/findlib.conf:destdir="D:\\bin\\coq64_buildtest_reloc_ocaml20\\libocaml\\site-lib" +./etc/findlib.conf:path="D:\\bin\\coq64_buildtest_reloc_ocaml20\\libocaml\\site-lib" + +Text files containing the install folder path after install: + +./bin/mkcamlp5:LIB=D:/bin/coq64_buildtest_reloc_ocaml20/libocaml/camlp5 +./bin/mkcamlp5.opt:LIB=D:/bin/coq64_buildtest_reloc_ocaml20/libocaml/camlp5 +./libocaml/Makefile.config:PREFIX=D:/bin/coq64_buildtest_reloc_ocaml20 +./libocaml/Makefile.config:LIBDIR=D:/bin/coq64_buildtest_reloc_ocaml20/libocaml +./libocaml/site-lib/findlib/Makefile.config:OCAML_CORE_BIN=/cygdrive/d/bin/coq64_buildtest_reloc_ocaml20/bin +./libocaml/site-lib/findlib/Makefile.config:OCAML_SITELIB=D:/bin/coq64_buildtest_reloc_ocaml20\libocaml\site-lib +./libocaml/site-lib/findlib/Makefile.config:OCAMLFIND_BIN=D:/bin/coq64_buildtest_reloc_ocaml20\bin +./libocaml/site-lib/findlib/Makefile.config:OCAMLFIND_CONF=D:/bin/coq64_buildtest_reloc_ocaml20\etc\findlib.conf +./libocaml/topfind:#directory "D:\\bin\\coq64_buildtest_reloc_ocaml20\\libocaml\\site-lib/findlib";; +./libocaml/topfind: Topdirs.dir_load Format.err_formatter "D:\\bin\\coq64_buildtest_reloc_ocaml20\\libocaml\\site-lib/findlib/findlib.cma"; +./libocaml/topfind: Topdirs.dir_load Format.err_formatter "D:\\bin\\coq64_buildtest_reloc_ocaml20\\libocaml\\site-lib/findlib/findlib_top.cma"; +./libocaml/topfind:(* #load "D:\\bin\\coq64_buildtest_reloc_ocaml20\\libocaml\\site-lib/findlib/findlib.cma";; *) +./libocaml/topfind:(* #load "D:\\bin\\coq64_buildtest_reloc_ocaml20\\libocaml\\site-lib/findlib/findlib_top.cma";; *) +./man/man1/camlp5.1:These files are installed in the directory D:/bin/coq64_buildtest_reloc_ocaml20/libocaml/camlp5. +./man/man1/camlp5.1:D:/bin/coq64_buildtest_reloc_ocaml20/libocaml/camlp5 + +Binary files containing the build folder path after install: + +$ find . -type f -exec grep "Cygwin_coq64_buildtest_reloc_ocaml20" {} /dev/null \; +Binary file ./bin/coqtop.byte.exe matches +Binary file ./bin/coqtop.exe matches +Binary file ./bin/ocamldoc.exe matches +Binary file ./bin/ocamldoc.opt.exe matches +Binary file ./libocaml/ocamldoc/odoc_info.a matches +Binary file ./libocaml/ocamldoc/odoc_info.cma matches + +Binary files containing the install folder path after install: + +$ find . -type f -exec grep "coq64_buildtest_reloc_ocaml20" {} /dev/null \; +Binary file ./bin/camlp4.exe matches +Binary file ./bin/camlp4boot.exe matches +Binary file ./bin/camlp4o.exe matches +Binary file ./bin/camlp4o.opt.exe matches +Binary file ./bin/camlp4of.exe matches +Binary file ./bin/camlp4of.opt.exe matches +Binary file ./bin/camlp4oof.exe matches +Binary file ./bin/camlp4oof.opt.exe matches +Binary file ./bin/camlp4orf.exe matches +Binary file ./bin/camlp4orf.opt.exe matches +Binary file ./bin/camlp4r.exe matches +Binary file ./bin/camlp4r.opt.exe matches +Binary file ./bin/camlp4rf.exe matches +Binary file ./bin/camlp4rf.opt.exe matches +Binary file ./bin/camlp5.exe matches +Binary file ./bin/camlp5o.exe matches +Binary file ./bin/camlp5o.opt matches +Binary file ./bin/camlp5r.exe matches +Binary file ./bin/camlp5r.opt matches +Binary file ./bin/camlp5sch.exe matches +Binary file ./bin/coqc.exe matches +Binary file ./bin/coqchk.exe matches +Binary file ./bin/coqdep.exe matches +Binary file ./bin/coqdoc.exe matches +Binary file ./bin/coqide.exe matches +Binary file ./bin/coqmktop.exe matches +Binary file ./bin/coqtop.byte.exe matches +Binary file ./bin/coqtop.exe matches +Binary file ./bin/coqworkmgr.exe matches +Binary file ./bin/coq_makefile.exe matches +Binary file ./bin/menhir matches +Binary file ./bin/mkcamlp4.exe matches +Binary file ./bin/ocaml.exe matches +Binary file ./bin/ocamlbuild.byte.exe matches +Binary file ./bin/ocamlbuild.exe matches +Binary file ./bin/ocamlbuild.native.exe matches +Binary file ./bin/ocamlc.exe matches +Binary file ./bin/ocamlc.opt.exe matches +Binary file ./bin/ocamldebug.exe matches +Binary file ./bin/ocamldep.exe matches +Binary file ./bin/ocamldep.opt.exe matches +Binary file ./bin/ocamldoc.exe matches +Binary file ./bin/ocamldoc.opt.exe matches +Binary file ./bin/ocamlfind.exe matches +Binary file ./bin/ocamlmklib.exe matches +Binary file ./bin/ocamlmktop.exe matches +Binary file ./bin/ocamlobjinfo.exe matches +Binary file ./bin/ocamlopt.exe matches +Binary file ./bin/ocamlopt.opt.exe matches +Binary file ./bin/ocamlprof.exe matches +Binary file ./bin/ocamlrun.exe matches +Binary file ./bin/ocpp5.exe matches +Binary file ./lib/config/coq_config.cmo matches +Binary file ./lib/config/coq_config.o matches +Binary file ./lib/grammar/grammar.cma matches +Binary file ./lib/ide/ide_win32_stubs.o matches +Binary file ./lib/lib/clib.a matches +Binary file ./lib/lib/clib.cma matches +Binary file ./lib/libcoqrun.a matches +Binary file ./libocaml/camlp4/camlp4fulllib.a matches +Binary file ./libocaml/camlp4/camlp4fulllib.cma matches +Binary file ./libocaml/camlp4/camlp4lib.a matches +Binary file ./libocaml/camlp4/camlp4lib.cma matches +Binary file ./libocaml/camlp4/camlp4o.cma matches +Binary file ./libocaml/camlp4/camlp4of.cma matches +Binary file ./libocaml/camlp4/camlp4oof.cma matches +Binary file ./libocaml/camlp4/camlp4orf.cma matches +Binary file ./libocaml/camlp4/camlp4r.cma matches +Binary file ./libocaml/camlp4/camlp4rf.cma matches +Binary file ./libocaml/camlp5/odyl.cma matches +Binary file ./libocaml/compiler-libs/ocamlcommon.a matches +Binary file ./libocaml/compiler-libs/ocamlcommon.cma matches +Binary file ./libocaml/dynlink.cma matches +Binary file ./libocaml/expunge.exe matches +Binary file ./libocaml/extract_crc.exe matches +Binary file ./libocaml/libcamlrun.a matches +Binary file ./libocaml/ocamlbuild/ocamlbuildlib.a matches +Binary file ./libocaml/ocamlbuild/ocamlbuildlib.cma matches +Binary file ./libocaml/ocamldoc/odoc_info.a matches +Binary file ./libocaml/ocamldoc/odoc_info.cma matches +Binary file ./libocaml/site-lib/findlib/findlib.a matches +Binary file ./libocaml/site-lib/findlib/findlib.cma matches +Binary file ./libocaml/site-lib/findlib/findlib.cmxs matches diff --git a/dev/build/windows/configure_profile.sh b/dev/build/windows/configure_profile.sh new file mode 100644 index 0000000000..09a9cf35a1 --- /dev/null +++ b/dev/build/windows/configure_profile.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +rcfile=~/.bash_profile +donefile=~/.bash_profile.upated + +if [ ! -f $donefile ] ; then + + echo >> $rcfile + + if [ -n "$1" ]; then + echo export http_proxy="http://$1" >> $rcfile + echo export https_proxy="http://$1" >> $rcfile + echo export ftp_proxy="http://$1" >> $rcfile + fi + + mkdir -p $RESULT_INSTALLDIR_CFMT/bin + + # A tightly controlled path helps to avoid issues + # Note: the order is important: first have the cygwin binaries, then the mingw binaries in the path! + # Note: /bin is mounted at /usr/bin and /lib at /usr/lib and it is common to use /usr/bin in PATH + # See cat /proc/mounts + echo "export PATH=/usr/local/bin:/usr/bin:$RESULT_INSTALLDIR_CFMT/bin:/usr/$TARGET_ARCH/sys-root/mingw/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows" >> $rcfile + + # find and xargs complain if the environment is larger than (I think) 8k. + # ORIGINAL_PATH (set by cygwin) can be a few k and exceed the limit + echo unset ORIGINAL_PATH >> $rcfile + + # Other installations of OCaml will mess up things + echo unset OCAMLLIB >> $rcfile + + touch $donefile +fi \ No newline at end of file diff --git a/dev/build/windows/difftar-folder.sh b/dev/build/windows/difftar-folder.sh new file mode 100644 index 0000000000..65278d5c9c --- /dev/null +++ b/dev/build/windows/difftar-folder.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +###################### COPYRIGHT/COPYLEFT ###################### + +# (C) 2016 Intel Deutschland GmbH +# Author: Michael Soegtrop +# +# Released to the public by Intel under the +# GNU Lesser General Public License Version 2.1 or later +# See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html +# +# With very valuable help on building GTK from +# https://wiki.gnome.org/Projects/GTK+/Win32/MSVCCompilationOfGTKStack +# http://www.gaia-gis.it/spatialite-3.0.0-BETA/mingw64_how_to.html + +###################### Script safety and debugging settings ###################### + +set -o nounset + +# Print usage + +if [ "$#" -lt 1 ] ; then + echo 'Diff a tar (or compressed tar) file with a folder' + echo 'difftar-folder.sh [] [strip]' + echo default for folder is . + echo default for strip is 0. + echo 'strip must be 0 or 1.' + exit 1 +fi + +# Parse parameters + +tarfile=$1 + +if [ "$#" -ge 2 ] ; then + folder=$2 +else + folder=. +fi + +if [ "$#" -ge 3 ] ; then + strip=$3 +else + strip=0 +fi + +# Get path prefix if --strip is used + +if [ "$strip" -gt 0 ] ; then + prefix=`tar -t -f $tarfile | head -1` +else + prefix= +fi + +# Original folder + +if [ "$strip" -gt 0 ] ; then + orig=${prefix%/}.orig +elif [ "$folder" = "." ] ; then + orig=${tarfile##*/} + orig=./${orig%%.tar*}.orig +elif [ "$folder" = "" ] ; then + orig=${tarfile##*/} + orig=${orig%%.tar*}.orig +else + orig=$folder.orig +fi +echo $orig +mkdir -p "$orig" + + +# Make sure tar uses english output (for Mod time differs) +export LC_ALL=C + +# Search all files with a deviating modification time using tar --diff +tar --diff -a -f "$tarfile" --strip $strip --directory "$folder" | grep "Mod time differs" | while read -r file ; do + # Substitute ': Mod time differs' with nothing + file=${file/: Mod time differs/} + # Check if file exists + if [ -f "$folder/$file" ] ; then + # Extract original file + tar -x -a -f "$tarfile" --strip $strip --directory "$orig" "$prefix$file" + # Compute diff + diff -u "$orig/$file" "$folder/$file" + fi +done \ No newline at end of file diff --git a/dev/build/windows/makecoq_mingw.sh b/dev/build/windows/makecoq_mingw.sh new file mode 100644 index 0000000000..bfc7ce4dd1 --- /dev/null +++ b/dev/build/windows/makecoq_mingw.sh @@ -0,0 +1,1271 @@ +#!/bin/bash + +###################### COPYRIGHT/COPYLEFT ###################### + +# (C) 2016 Intel Deutschland GmbH +# Author: Michael Soegtrop +# +# Released to the public by Intel under the +# GNU Lesser General Public License Version 2.1 or later +# See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html +# +# With very valuable help on building GTK from +# https://wiki.gnome.org/Projects/GTK+/Win32/MSVCCompilationOfGTKStack +# http://www.gaia-gis.it/spatialite-3.0.0-BETA/mingw64_how_to.html + +###################### Script safety and debugging settings ###################### + +set -o nounset +set -o errexit +set -x + +# Set this to 1 if all module directories shall be removed before build (no incremental make) +RMDIR_BEFORE_BUILD=1 + +###################### NOTES ##################### + +# - This file goes together with MakeCoq_ForMignGW.bat, which sets up cygwin +# with all required packages and then calls this script. +# +# - This script uses set -o errexit, so if anything fails, the script will stop +# +# - cygwin provided mingw64 packages like mingw64-x86_64-zlib are installed to +# /usr/$TARGET_ARCH/sys-root/mingw, so we use this as install prefix +# +# - if mingw64-x86_64-pkg-config is installed BEFORE building libpng or pixman, +# the .pc files are properly created in /usr/$TARGET_ARCH/sys-root/mingw/lib/pkgconfig +# +# - pango and some others uses pkg-config executable names without path, which doesn't work in cross compile mode +# There are several possible solutions +# 1.) patch build files to get the prefix from pkg-config and use $prefix/bin/ as path +# - doesn't work for pango because automake goes wild +# - mingw tools are not able to handle cygwin path (they need absolute windows paths) +# 2.) export PATH=$PATH:/usr/$TARGET_ARCH/sys-root/mingw/bin +# - a bit dangerous because this exposes much more than required +# - mingw tools are not able to handle cygwin path (they need absolute windows paths) +# 3.) Install required tools via cygwin modules libglib2.0-devel and libgdk_pixbuf2.0-devel +# - Possibly version compatibility issues +# - Possibly mingw/cygwin compatibility issues, e.g. when building font or terminfo databases +# 4.) Build required tools for mingw and cygwin +# - Possibly mingw/cygwin compatibility issues, e.g. when building font or terminfo databases +# +# We use method 3 below +# Method 2 can be tried by putting the cross tools in the path before the cygwin tools (in configure_profile.sh) +# +# - It is tricky to build 64 bit binaries with 32 bit cross tools and vice versa. +# This is because the linker needs to load DLLs from C:\windows\system32, which contains +# both 32 bit and 64 bit DLLs, and which one you get depends by some black magic on if the using +# app is a 32 bit or 64 bit app. So better build 32 bit mingw with 32 bit cygwin and 64 with 64. +# Alternatively the required 32 bit or 64 bit DLLs need to be copied with a 32 bit/64bit cp to some +# folder without such black magic. +# +# - The file selection for the Coq Windows Installer is done with make install (unlike the original script) +# Relocatble builds are first configured with prefix=./ then build and then +# reconfigured with prefix= before make install. + + +###################### ARCHITECTURES ##################### + +# The OS on which the build of the tool/lib runs +BUILD=`gcc -dumpmachine` + +# The OS on which the tool runs +# "`find /bin -name "*mingw32-gcc.exe"`" -dumpmachine +HOST=$TARGET_ARCH + +# The OS for which the tool creates code/for which the libs are +TARGET=$TARGET_ARCH + +# Cygwin uses different arch name for 32 bit than mingw/gcc +case $ARCH in + x86_64) CYGWINARCH=x86_64 ;; + i686) CYGWINARCH=x86 ;; + *) false ;; +esac + +###################### PATHS ##################### + +# Name and create some 'global' folders +PATCHES=/build/patches +BUILDLOGS=/build/buildlogs +FLAGFILES=/build/flagfiles +TARBALLS=/build/tarballs +FILELISTS=/build/filelists + +mkdir -p $BUILDLOGS +mkdir -p $FLAGFILES +mkdir -p $TARBALLS +mkdir -p $FILELISTS +cd /build + + +# sysroot prefix for the above /build/host/target combination +PREFIX=$CYGWIN_INSTALLDIR_MFMT/usr/$TARGET_ARCH/sys-root/mingw + +# Install / Prefix folder for COQ +PREFIXCOQ=$RESULT_INSTALLDIR_MFMT + +# Install / Prefix folder for OCaml +if [ "$INSTALLOCAML" == "Y" ]; then + PREFIXOCAML=$PREFIXCOQ +else + PREFIXOCAML=$PREFIX +fi + +mkdir -p $PREFIX/bin +mkdir -p $PREFIXCOQ/bin +mkdir -p $PREFIXOCAML/bin + +###################### Copy Cygwin Setup Info ##################### + +# Copy Cygwin repo ini file and installed files db to tarballs folder. +# Both files together document the exact selection and version of cygwin packages. +# Do this as early as possible to avoid changes by other setups (the repo folder is shared). + +# Escape URL to folder name +CYGWIN_REPO_FOLDER=${CYGWIN_REPOSITORY}/ +CYGWIN_REPO_FOLDER=${CYGWIN_REPO_FOLDER//:/%3a} +CYGWIN_REPO_FOLDER=${CYGWIN_REPO_FOLDER//\//%2f} + +# Copy files +cp $CYGWIN_LOCAL_CACHE_WFMT/$CYGWIN_REPO_FOLDER/$CYGWINARCH/setup.ini $TARBALLS +cp /etc/setup/installed.db $TARBALLS + +###################### LOGGING ##################### + +# The folder which receives log files +mkdir -p buildlogs +LOGS=`pwd`/buildlogs + +# The current log target (first part of the log file name) +LOGTARGET=other + +log1() { + "$@" > $LOGS/$LOGTARGET-$1.log 2> $LOGS/$LOGTARGET-$1.err +} + +log2() { + "$@" > $LOGS/$LOGTARGET-$1-$2.log 2> $LOGS/$LOGTARGET-$1-$2.err +} + +log_1_3() { + "$@" > $LOGS/$LOGTARGET-$1-$3.log 2> $LOGS/$LOGTARGET-$1-$3.err +} + +logn() { + LOGTARGETEX=$1 + shift + "$@" > $LOGS/$LOGTARGET-$LOGTARGETEX.log 2> $LOGS/$LOGTARGET-$LOGTARGETEX.err +} + +###################### UTILITY FUNCTIONS ##################### + +# ------------------------------------------------------------------------------ +# Get a source tar ball, expand and patch it +# - get source archive from $SOURCE_LOCAL_CACHE_CFMT or online using wget +# - create build folder +# - extract source archive +# - patch source file if patch exists +# +# Parameters +# $1 file server name including protocol prefix +# $2 file name (without extension) +# $3 file extension +# $4 number of path levels to strip from tar (usually 1) +# $5 module name (if different from archive) +# $6 expand folder name (if different from module name) +# ------------------------------------------------------------------------------ + +function get_expand_source_tar { + # Handle optional parameters + if [ "$#" -ge 4 ] ; then + strip=$4 + else + strip=1 + fi + + if [ "$#" -ge 5 ] ; then + name=$5 + else + name=$2 + fi + + if [ "$#" -ge 6 ] ; then + folder=$6 + else + folder=$name + fi + + # Set logging target + logtargetold=$LOGTARGET + LOGTARGET=$name + + # Get the source archive either from the source cache or online + if [ ! -f $TARBALLS/$name.$3 ] ; then + if [ -f $SOURCE_LOCAL_CACHE_CFMT/$name.$3 ] ; then + cp $SOURCE_LOCAL_CACHE_CFMT/$name.$3 $TARBALLS + else + wget $1/$2.$3 + if [ ! "$2.$3" == "$name.$3" ] ; then + mv $2.$3 $name.$3 + fi + mv $name.$3 $TARBALLS + # Save the source archive in the source cache + if [ -d $SOURCE_LOCAL_CACHE_CFMT ] ; then + cp $TARBALLS/$name.$3 $SOURCE_LOCAL_CACHE_CFMT + fi + fi + fi + + # Remove build directory (clean build) + if [ $RMDIR_BEFORE_BUILD -eq 1 ] ; then + rm -f -r $folder + fi + + # Create build directory and cd + mkdir -p $folder + cd $folder + + # Extract source archive + if [ "$3" == "zip" ] ; then + log1 unzip $TARBALLS/$name.$3 + if [ "$strip" == "1" ] ; then + # Ok, this is dirty, but it works and it fails if there are name clashes + mv */* . + else + echo "Unzip strip count not supported" + return 1 + fi + else + logn untar tar xvaf $TARBALLS/$name.$3 --strip $strip + fi + + # Patch if patch file exists + if [ -f $PATCHES/$name.patch ] ; then + log1 patch -p1 -i $PATCHES/$name.patch + fi + + # Go back to base folder + cd .. + + LOGTARGET=$logtargetold +} + +# ------------------------------------------------------------------------------ +# Prepare a module build +# - check if build is already done (name.finished file exists) - if so return 1 +# - create name.started +# - get source archive from $SOURCE_LOCAL_CACHE_CFMT or online using wget +# - create build folder +# - cd to build folder and extract source archive +# - create bin_special subfolder and add it to $PATH +# - remember things for build_post +# +# Parameters +# $1 file server name including protocol prefix +# $2 file name (without extension) +# $3 file extension +# $4 [optional] number of path levels to strip from tar (usually 1) +# $5 [optional] module name (if different from archive) +# ------------------------------------------------------------------------------ + +function build_prep { + # Handle optional parameters + if [ "$#" -ge 4 ] ; then + strip=$4 + else + strip=1 + fi + + if [ "$#" -ge 5 ] ; then + name=$5 + else + name=$2 + fi + + # Check if build is already done + if [ ! -f flagfiles/$name.finished ] ; then + BUILD_PACKAGE_NAME=$name + BUILD_OLDPATH=$PATH + BUILD_OLDPWD=`pwd` + LOGTARGET=$name + + touch flagfiles/$name.started + + get_expand_source_tar $1 $2 $3 $strip $name + + cd $name + + # Create a folder and add it to path, where we can put special binaries + # The path is restored in build_post + mkdir bin_special + PATH=`pwd`/bin_special:$PATH + + return 0 + else + return 1 + fi +} + +# ------------------------------------------------------------------------------ +# Finalize a module build +# - create name.finished +# - go back to base folder +# ------------------------------------------------------------------------------ + +function build_post { + if [ ! -f flagfiles/$BUILD_PACKAGE_NAME.finished ]; then + cd $BUILD_OLDPWD + touch flagfiles/$BUILD_PACKAGE_NAME.finished + PATH=$BUILD_OLDPATH + LOGTARGET=other + fi +} + +# ------------------------------------------------------------------------------ +# Build and install a module using the standard configure/make/make install process +# - prepare build (as above) +# - configure +# - make +# - make install +# - finalize build (as above) +# +# parameters +# $1 file server name including protocol prefix +# $2 file name (without extension) +# $3 file extension +# $4 patch function to call between untar and configure (or true if none) +# $5.. extra configure arguments +# ------------------------------------------------------------------------------ + +function build_conf_make_inst { + if build_prep $1 $2 $3 ; then + $4 + logn configure ./configure --build=$BUILD --host=$HOST --target=$TARGET --prefix=$PREFIX "${@:5}" + log1 make $MAKE_OPT + log2 make install + log2 make clean + build_post + fi +} + +# ------------------------------------------------------------------------------ +# Install all files given by a glob pattern to a given folder +# +# parameters +# $1 glob pattern (in '') +# $2 target folder +# ------------------------------------------------------------------------------ + +function install_glob { + # Check if any files matching the pattern exist + if [ "$(echo $1)" != "$1" ] ; then + install -D -t $2 $1 + fi +} + + +# ------------------------------------------------------------------------------ +# Recursively Install all files given by a glob pattern to a given folder +# +# parameters +# $1 source path +# $2 pattern (in '') +# $3 target folder +# ------------------------------------------------------------------------------ + +function install_rec { + ( cd $1 && find -type f -name "$2" -exec install -D -T $1/{} $3/{} \; ) +} + +# ------------------------------------------------------------------------------ +# Write a file list of the target folder +# The file lists are used to create file lists for the windows installer +# +# parameters +# $1 name of file list +# ------------------------------------------------------------------------------ + +function list_files { + if [ ! -e "/build/filelists/$1" ] ; then + ( cd $PREFIXCOQ && find -type f | sort > /build/filelists/$1 ) + fi +} + +# ------------------------------------------------------------------------------ +# Compute the set difference of two file lists +# +# parameters +# $1 name of list A-B (set difference of set A minus set B) +# $2 name of list A +# $3 name of list B +# ------------------------------------------------------------------------------ + +function diff_files { + # See http://www.catonmat.net/blog/set-operations-in-unix-shell/ for file list set operations + comm -23 <(sort "/build/filelists/$2") <(sort "/build/filelists/$3") > "/build/filelists/$1" +} + +# ------------------------------------------------------------------------------ +# Filter a list of files with a regular expression +# +# parameters +# $1 name of output file list +# $2 name of input file list +# $3 name of filter regexp +# ------------------------------------------------------------------------------ + +function filter_files { + egrep "$3" "/build/filelists/$2" > "/build/filelists/$1" +} + +# ------------------------------------------------------------------------------ +# Convert a file list to NSIS installer format +# +# parameters +# $1 name of file list file (output file is the same with extension .nsi) +# ------------------------------------------------------------------------------ + +function files_to_nsis { + # Split the path in the file list into path and filename and create SetOutPath and File instructions + # Note: File /oname cannot be used, because it does not create the paths as SetOutPath does + # Note: I didn't check if the redundant SetOutPath instructions have a bad impact on installer size or install time + cat "/build/filelists/$1" | tr '/' '\\' | sed -r 's/^\.(.*)\\([^\\]+)$/SetOutPath $INSTDIR\\\1\nFile ${COQ_SRC_PATH}\\\1\\\2/' > "/build/filelists/$1.nsh" +} + + +###################### MODULE BUILD FUNCTIONS ##################### + +##### LIBPNG ##### + +function make_libpng { + build_conf_make_inst http://prdownloads.sourceforge.net/libpng libpng-1.6.18 tar.gz true +} + +##### PIXMAN ##### + +function make_pixman { + build_conf_make_inst http://cairographics.org/releases pixman-0.32.8 tar.gz true +} + +##### FREETYPE ##### + +function make_freetype { + build_conf_make_inst http://sourceforge.net/projects/freetype/files/freetype2/2.6.1 freetype-2.6.1 tar.bz2 true +} + +##### EXPAT ##### + +function make_expat { + build_conf_make_inst http://sourceforge.net/projects/expat/files/expat/2.1.0 expat-2.1.0 tar.gz true +} + +##### FONTCONFIG ##### + +function make_fontconfig { + make_freetype + make_expat + # CONFIGURE PARAMETERS + # build/install fails without --disable-docs + build_conf_make_inst http://www.freedesktop.org/software/fontconfig/release fontconfig-2.11.94 tar.gz true --disable-docs +} + +##### ICONV ##### + +function make_libiconv { + build_conf_make_inst http://ftp.gnu.org/pub/gnu/libiconv libiconv-1.14 tar.gz true +} + +##### UNISTRING ##### + +function make_libunistring { + build_conf_make_inst http://ftp.gnu.org/gnu/libunistring libunistring-0.9.5 tar.xz true +} + +##### NCURSES ##### + +function make_ncurses { + # NOTE: ncurses is not required below. This is just kept for documentary purposes in case I need it later. + # + # NOTE: make install fails building the terminfo database because + # : ${TIC_PATH:=unknown} in run_tic.sh + # As a result pkg-config .pc files are not generated + # Also configure of gettext gives two "considers" + # checking where terminfo library functions come from... not found, consider installing GNU ncurses + # checking where termcap library functions come from... not found, consider installing GNU ncurses + # gettext make/make install work anyway + # + # CONFIGURE PARAMETERS + # --enable-term-driver --enable-sp-funcs is rewuired for mingw (see README.MinGW) + # additional changes + # ADD --with-pkg-config + # ADD --enable-pc-files + # ADD --without-manpages + # REM --with-pthread + build_conf_make_inst http://ftp.gnu.org/gnu/ncurses ncurses-5.9 tar.gz true --disable-home-terminfo --enable-reentrant --enable-sp-funcs --enable-term-driver --enable-interop --with-pkg-config --enable-pc-files --without-manpages +} + +##### GETTEXT ##### + +function make_gettext { + # Cygwin packet dependencies: (not 100% sure) libiconv-devel,libunistring-devel,libncurses-devel + # Cygwin packet dependencies for gettext users: (not 100% sure) gettext-devel,libgettextpo-devel + # gettext configure complains that ncurses is also required, but it builds without it + # Ncurses is tricky to install/configure for mingw64, so I dropped ncurses + make_libiconv + make_libunistring + build_conf_make_inst http://ftp.gnu.org/pub/gnu/gettext gettext-0.19 tar.gz true +} + +##### LIBFFI ##### + +function make_libffi { + # NOTE: The official download server is down ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz + build_conf_make_inst http://www.mirrorservice.org/sites/sourceware.org/pub/libffi libffi-3.2.1 tar.gz true +} + +##### LIBEPOXY ##### + +function make_libepoxy { + build_conf_make_inst https://github.com/anholt/libepoxy/releases/download/v1.3.1 libepoxy-1.3.1 tar.bz2 true +} + +##### LIBPCRE ##### + +function make_libpcre { + build_conf_make_inst ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre pcre-8.39 tar.bz2 true +} + +function make_libpcre2 { + build_conf_make_inst ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre pcre2-10.22 tar.bz2 true +} + +##### GLIB ##### + +function make_glib { + # Cygwin packet dependencies: mingw64-x86_64-zlib + make_gettext + make_libffi + make_libpcre + # build_conf_make_inst http://ftp.gnome.org/pub/gnome/sources/glib/2.46 glib-2.46.0 tar.xz true + build_conf_make_inst http://ftp.gnome.org/pub/gnome/sources/glib/2.47 glib-2.47.5 tar.xz true +} + +##### ATK ##### + +function make_atk { + make_gettext + make_glib + build_conf_make_inst http://ftp.gnome.org/pub/gnome/sources/atk/2.18 atk-2.18.0 tar.xz true +} + +##### PIXBUF ##### + +function make_gdk-pixbuf { + # Cygwin packet dependencies: mingw64-x86_64-zlib + make_libpng + make_gettext + make_glib + # CONFIGURE PARAMETERS + # --with-included-loaders=yes statically links the image file format handlers + # This avoids "Cannot open pixbuf loader module file '/usr/x86_64-w64-mingw32/sys-root/mingw/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory" + build_conf_make_inst http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.32 gdk-pixbuf-2.32.1 tar.xz true --with-included-loaders=yes +} + +##### CAIRO ##### + +function make_cairo { + # Cygwin packet dependencies: mingw64-x86_64-zlib + make_libpng + make_glib + make_pixman + make_fontconfig + build_conf_make_inst http://cairographics.org/releases cairo-1.14.2 tar.xz true +} + +##### PANGO ##### + +function make_pango { + make_cairo + make_glib + make_fontconfig + build_conf_make_inst http://ftp.gnome.org/pub/GNOME/sources/pango/1.38 pango-1.38.0 tar.xz true +} + +##### GTK2 ##### + +function patch_gtk2 { + rm gtk/gtk.def +} + +function make_gtk2 { + # Cygwin packet dependencies: gtk-update-icon-cache + if [ "$GTK_FROM_SOURCES" == "Y" ]; then + make_glib + make_atk + make_pango + make_gdk-pixbuf + make_cairo + build_conf_make_inst http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24 gtk+-2.24.28 tar.xz patch_gtk2 + fi +} + +##### GTK3 ##### + +function make_gtk3 { + make_glib + make_atk + make_pango + make_gdk-pixbuf + make_cairo + make_libepoxy + build_conf_make_inst http://ftp.gnome.org/pub/gnome/sources/gtk+/3.16 gtk+-3.16.7 tar.xz true + + # make all incl. tests and examples runs through fine + # make install fails with issue with + # + # make[5]: Entering directory '/home/soegtrop/GTK/gtk+-3.16.7/demos/gtk-demo' + # test -n "" || ../../gtk/gtk-update-icon-cache --ignore-theme-index --force "/usr/x86_64-w64-mingw32/sys-root/mingw/share/icons/hicolor" + # gtk-update-icon-cache.exe: Failed to open file /usr/x86_64-w64-mingw32/sys-root/mingw/share/icons/hicolor/.icon-theme.cache : No such file or directory + # Makefile:1373: recipe for target 'install-update-icon-cache' failed + # make[5]: *** [install-update-icon-cache] Error 1 + # make[5]: Leaving directory '/home/soegtrop/GTK/gtk+-3.16.7/demos/gtk-demo' +} + +##### LIBXML2 ##### + +function make_libxml2 { + # Cygwin packet dependencies: libtool automake + # Note: latest release version 2.9.2 fails during configuring lzma, so using 2.9.1 + # Note: python binding requires which doesn't exist on cygwin + if build_prep https://git.gnome.org/browse/libxml2/snapshot libxml2-2.9.1 tar.xz ; then + # ./autogen.sh --build=$BUILD --host=$HOST --target=$TARGET --prefix=$PREFIX --disable-shared --without-python + # shared library required by gtksourceview + ./autogen.sh --build=$BUILD --host=$HOST --target=$TARGET --prefix=$PREFIX --without-python + log1 make $MAKE_OPT all + log2 make install + log2 make clean + build_post + fi +} + +##### GTK-SOURCEVIEW2 ##### + +function make_gtk_sourceview2 { + # Cygwin packet dependencies: intltool + # gtksourceview-2.11.2 requires GTK2 + # gtksourceview-2.91.9 requires GTK3 + # => We use gtksourceview-2.11.2 which seems to be the newest GTK2 based one + if [ "$GTK_FROM_SOURCES" == "Y" ]; then + make_gtk2 + make_libxml2 + build_conf_make_inst https://download.gnome.org/sources/gtksourceview/2.11 gtksourceview-2.11.2 tar.bz2 true + fi +} + +##### FLEXDLL FLEXLINK ##### + +# Note: there is a circular dependency between flexlink and ocaml (resolved in Ocaml 4.03.) +# For MinGW it is not even possible to first build an Ocaml without flexlink support, +# Because Makefile.nt doesn't support this. So we have to use a binary flexlink. +# One could of cause do a bootstrap run ... + +# Install flexdll objects + +function install_flexdll { + cp flexdll.h /usr/$TARGET_ARCH/sys-root/mingw/include + if [ "$TARGET_ARCH" == "i686-w64-mingw32" ]; then + cp flexdll*_mingw.o /usr/$TARGET_ARCH/bin + cp flexdll*_mingw.o $PREFIXOCAML/bin + elif [ "$TARGET_ARCH" == "x86_64-w64-mingw32" ]; then + cp flexdll*_mingw64.o /usr/$TARGET_ARCH/bin + cp flexdll*_mingw64.o $PREFIXOCAML/bin + else + echo "Unknown target architecture" + return 1 + fi +} + +# Install flexlink + +function install_flexlink { + cp flexlink.exe /usr/$TARGET_ARCH/bin + + cp flexlink.exe $PREFIXOCAML/bin +} + +# Get binary flexdll flexlink for building OCaml +# An alternative is to first build an OCaml without shared library support and build flexlink with it + +function get_flex_dll_link_bin { + if build_prep http://alain.frisch.fr/flexdll flexdll-bin-0.34 zip 1 ; then + install_flexdll + install_flexlink + build_post + fi +} + +# Build flexdll and flexlink from sources after building OCaml + +function make_flex_dll_link { + if build_prep http://alain.frisch.fr/flexdll flexdll-0.34 tar.gz ; then + if [ "$TARGET_ARCH" == "i686-w64-mingw32" ]; then + log1 make $MAKE_OPT build_mingw flexlink.exe + elif [ "$TARGET_ARCH" == "x86_64-w64-mingw32" ]; then + log1 make $MAKE_OPT build_mingw64 flexlink.exe + else + echo "Unknown target architecture" + return 1 + fi + install_flexdll + install_flexlink + log2 make clean + build_post + fi +} + +##### LN replacement ##### + +# Note: this does support symlinks, but symlinks require special user rights on Windows. +# ocamlbuild uses symlinks to link the executables in the build folder to the base folder. +# For this purpose hard links are better. + +function make_ln { + if [ ! -f flagfiles/myln.finished ] ; then + touch flagfiles/myln.started + mkdir -p myln + cd myln + cp $PATCHES/ln.c . + $TARGET_ARCH-gcc -DUNICODE -D_UNICODE -DIGNORE_SYMBOLIC -mconsole -o ln.exe ln.c + install -D ln.exe $PREFIXCOQ/bin/ln.exe + cd .. + touch flagfiles/myln.finished + fi +} + +##### OCAML ##### + +function make_ocaml { + get_flex_dll_link_bin + if build_prep http://caml.inria.fr/pub/distrib/ocaml-4.02 ocaml-4.02.3 tar.gz 1 ; then + # if build_prep http://caml.inria.fr/pub/distrib/ocaml-4.01 ocaml-4.01.0 tar.gz 1 ; then + # See README.win32 + cp config/m-nt.h config/m.h + cp config/s-nt.h config/s.h + if [ "$TARGET_ARCH" == "i686-w64-mingw32" ]; then + cp config/Makefile.mingw config/Makefile + elif [ "$TARGET_ARCH" == "x86_64-w64-mingw32" ]; then + cp config/Makefile.mingw64 config/Makefile + else + echo "Unknown target architecture" + return 1 + fi + + # Prefix is fixed in make file - replace it with the real one + sed -i "s|^PREFIX=.*|PREFIX=$PREFIXOCAML|" config/Makefile + + # We don't want to mess up Coq's dirctory structure so put the OCaml library in a separate folder + # If we refer to the make variable ${PREFIX} below, camlp4 ends up having a wrong path: + # D:\bin\coq64_buildtest_abs_ocaml4\bin>ocamlc -where => D:/bin/coq64_buildtest_abs_ocaml4/libocaml + # D:\bin\coq64_buildtest_abs_ocaml4\bin>camlp4 -where => ${PREFIX}/libocaml\camlp4 + # So we put an explicit path in there + sed -i "s|^LIBDIR=.*|LIBDIR=$PREFIXOCAML/libocaml|" config/Makefile + + # Note: ocaml doesn't support -j 8, so don't pass MAKE_OPT + # I verified that 4.02.3 still doesn't support parallel build + log2 make world -f Makefile.nt + log2 make bootstrap -f Makefile.nt + log2 make opt -f Makefile.nt + log2 make opt.opt -f Makefile.nt + log2 make install -f Makefile.nt + # TODO log2 make clean -f Makefile.nt Temporarily disabled for ocamlbuild development + + # Move license files and other into into special folder + if [ "$INSTALLMODE" == "absolute" ] || [ "$INSTALLMODE" == "relocatable" ]; then + mkdir -p $PREFIXOCAML/license_readme/ocaml + # 4.01 installs these files, 4.02 doesn't. So delete them and copy them from the sources. + rm -f *.txt + cp LICENSE $PREFIXOCAML/license_readme/ocaml/License.txt + cp INSTALL $PREFIXOCAML/license_readme/ocaml/Install.txt + cp README $PREFIXOCAML/license_readme/ocaml/ReadMe.txt + cp README.win32 $PREFIXOCAML/license_readme/ocaml/ReadMeWin32.txt + cp VERSION $PREFIXOCAML/license_readme/ocaml/Version.txt + cp Changes $PREFIXOCAML/license_readme/ocaml/Changes.txt + fi + + build_post + fi + make_flex_dll_link +} + +##### FINDLIB Ocaml library manager ##### + +function make_findlib { + make_ocaml + if build_prep http://download.camlcity.org/download findlib-1.5.6 tar.gz 1 ; then + ./configure -bindir $PREFIXOCAML\\bin -sitelib $PREFIXOCAML\\libocaml\\site-lib -config $PREFIXOCAML\\etc\\findlib.conf + # Note: findlib doesn't support -j 8, so don't pass MAKE_OPT + log2 make all + log2 make opt + log2 make install + log2 make clean + build_post + fi +} + +##### MENHIR Ocaml Parser Generator ##### + +function make_menhir { + make_ocaml + make_findlib + # if build_prep http://gallium.inria.fr/~fpottier/menhir menhir-20151112 tar.gz 1 ; then + # For Ocaml 4.02 + # if build_prep http://gallium.inria.fr/~fpottier/menhir menhir-20151012 tar.gz 1 ; then + # For Ocaml 4.01 + if build_prep http://gallium.inria.fr/~fpottier/menhir menhir-20140422 tar.gz 1 ; then + # Note: menhir doesn't support -j 8, so don't pass MAKE_OPT + log2 make all PREFIX=$PREFIXOCAML + log2 make install PREFIX=$PREFIXOCAML + mv $PREFIXOCAML/bin/menhir $PREFIXOCAML/bin/menhir.exe + build_post + fi +} + +##### CAMLP4 Ocaml Preprocessor ##### + +function make_camlp4 { + # OCaml up to 4.01 includes camlp4, from 4.02 it isn't included + # Check if command camlp4 exists, if not build camlp4 + if ! command camlp4 ; then + make_ocaml + make_findlib + if build_prep https://github.com/ocaml/camlp4/archive 4.02+6 tar.gz 1 camlp4-4.02+6 ; then + # See https://github.com/ocaml/camlp4/issues/41#issuecomment-112018910 + logn configure ./configure + # Note: camlp4 doesn't support -j 8, so don't pass MAKE_OPT + log2 make all + log2 make install + log2 make clean + build_post + fi + fi +} + +##### CAMLP5 Ocaml Preprocessor ##### + +function make_camlp5 { + make_ocaml + make_findlib + if build_prep http://camlp5.gforge.inria.fr/distrib/src camlp5-6.14 tgz 1 ; then + logn configure ./configure + # Somehow my virus scanner has the boot.new/SAVED directory locked after the move for a second => repeat until success + sed -i 's/mv boot.new boot/until mv boot.new boot; do sleep 1; done/' Makefile + log1 make world.opt $MAKE_OPT + log2 make install + # For some reason gramlib.a is not copied, but it is required by Coq + cp lib/gramlib.a $PREFIXOCAML/libocaml/camlp5/ + log2 make clean + build_post + fi +} + +##### LABLGTK Ocaml GTK binding ##### + +# Note: when rebuilding lablgtk by deleting the .finished file, +# also delete \usr\x86_64-w64-mingw32\sys-root\mingw\lib\site-lib +# Otherwise make install fails + +function make_lablgtk { + make_ocaml + make_findlib + make_camlp4 + if build_prep https://forge.ocamlcore.org/frs/download.php/1479 lablgtk-2.18.3 tar.gz 1 ; then + # configure should be fixed to search for $TARGET_ARCH-pkg-config.exe + cp /bin/$TARGET_ARCH-pkg-config.exe bin_special/pkg-config.exe + logn configure ./configure --build=$BUILD --host=$HOST --target=$TARGET --prefix=$PREFIXOCAML + + # lablgtk shows occasional errors with -j, so don't pass $MAKE_OPT + + # See https://sympa.inria.fr/sympa/arc/caml-list/2015-10/msg00204.html for the make || true + strip + logn make-world-pre make world || true + $TARGET_ARCH-strip.exe --strip-unneeded src/dlllablgtk2.dll + + log2 make world + log2 make install + log2 make clean + build_post + fi +} + +##### Ocaml Stdint ##### + +function make_stdint { + make_ocaml + make_findlib + if build_prep https://github.com/andrenth/ocaml-stdint/archive 0.3.0 tar.gz 1 Stdint-0.3.0; then + # Note: the setup gets the proper install path from ocamlfind, but for whatever reason it wants + # to create an empty folder in some folder which defaults to C:\Program Files. + # The --preifx overrides this. Id didn't see any files created in /tmp/extra. + log_1_3 ocaml setup.ml -configure --prefix /tmp/extra + log_1_3 ocaml setup.ml -build + log_1_3 ocaml setup.ml -install + log_1_3 ocaml setup.ml -clean + build_post + fi +} + +##### COQ ##### + +# Copy one DLLfrom cygwin MINGW packages to Coq install folder + +function copy_coq_dll { + if [ "$INSTALLMODE" == "absolute" ] || [ "$INSTALLMODE" == "relocatable" ]; then + cp /usr/${ARCH}-w64-mingw32/sys-root/mingw/bin/$1 $PREFIXCOQ/bin/$1 + fi +} + +# Copy required DLLs from cygwin MINGW packages to Coq install folder + +function copy_coq_dlls { + # HOW TO CREATE THE DLL LIST + # With the list empty, after the build/install is finished, open coqide in dependency walker. + # See http://www.dependencywalker.com/ + # Make sure to use the 32 bit / 64 bit version of depends matching the target architecture. + # Select all missing DLLs from the module list, right click "copy filenames" + # Delay loaded DLLs from Windows can be ignored (hour-glass icon at begin of line) + # Do this recursively until there are no further missing DLLs (File close + reopen) + # For running this quickly, just do "cd coq- ; call copy_coq_dlls ; cd .." at the end of this script. + # Do the same for coqc and ocamlc (usually doesn't result in additional files) + + copy_coq_dll LIBATK-1.0-0.DLL + copy_coq_dll LIBCAIRO-2.DLL + copy_coq_dll LIBEXPAT-1.DLL + copy_coq_dll LIBFFI-6.DLL + copy_coq_dll LIBFONTCONFIG-1.DLL + copy_coq_dll LIBFREETYPE-6.DLL + copy_coq_dll LIBGDK-WIN32-2.0-0.DLL + copy_coq_dll LIBGDK_PIXBUF-2.0-0.DLL + copy_coq_dll LIBGIO-2.0-0.DLL + copy_coq_dll LIBGLIB-2.0-0.DLL + copy_coq_dll LIBGMODULE-2.0-0.DLL + copy_coq_dll LIBGOBJECT-2.0-0.DLL + copy_coq_dll LIBGTK-WIN32-2.0-0.DLL + copy_coq_dll LIBINTL-8.DLL + copy_coq_dll LIBPANGO-1.0-0.DLL + copy_coq_dll LIBPANGOCAIRO-1.0-0.DLL + copy_coq_dll LIBPANGOWIN32-1.0-0.DLL + copy_coq_dll LIBPIXMAN-1-0.DLL + copy_coq_dll LIBPNG16-16.DLL + copy_coq_dll LIBXML2-2.DLL + copy_coq_dll ZLIB1.DLL + + # Depends on if GTK is built from sources + if [ "$GTK_FROM_SOURCES" == "Y" ]; then + copy_coq_dll libiconv-2.dll + copy_coq_dll libpcre-1.dll + else + copy_coq_dll ICONV.DLL + copy_coq_dll LIBBZ2-1.DLL + copy_coq_dll LIBGTKSOURCEVIEW-2.0-0.DLL + copy_coq_dll LIBHARFBUZZ-0.DLL + copy_coq_dll LIBLZMA-5.DLL + copy_coq_dll LIBPANGOFT2-1.0-0.DLL + fi; + + # Architecture dependent files + case $ARCH in + x86_64) copy_coq_dll LIBGCC_S_SEH-1.DLL ;; + i686) copy_coq_dll LIBGCC_S_SJLJ-1.DLL ;; + *) false ;; + esac + + # Win pthread version change + copy_coq_dll LIBWINPTHREAD-1.DLL +} + +function copy_coq_objects { + # copy objects only from folders which exist in the target lib directory + find . -type d | while read FOLDER ; do + if [ -e $PREFIXCOQ/lib/$FOLDER ] ; then + install_glob $FOLDER/'*.cmxa' $PREFIXCOQ/lib/$FOLDER + install_glob $FOLDER/'*.cmi' $PREFIXCOQ/lib/$FOLDER + install_glob $FOLDER/'*.cma' $PREFIXCOQ/lib/$FOLDER + install_glob $FOLDER/'*.cmo' $PREFIXCOQ/lib/$FOLDER + install_glob $FOLDER/'*.a' $PREFIXCOQ/lib/$FOLDER + install_glob $FOLDER/'*.o' $PREFIXCOQ/lib/$FOLDER + fi + done +} + +# Copy required GTK config and suport files + +function copq_coq_gtk { + echo 'gtk-theme-name = "MS-Windows"' > $PREFIX/etc/gtk-2.0/gtkrc + echo 'gtk-fallback-icon-theme = "Tango"' >> $PREFIX/etc/gtk-2.0/gtkrc + + if [ "$INSTALLMODE" == "absolute" ] || [ "$INSTALLMODE" == "relocatable" ]; then + install_glob $PREFIX/etc/gtk-2.0/'*' $PREFIXCOQ/gtk-2.0 + install_glob $PREFIX/share/gtksourceview-2.0/language-specs/'*' $PREFIXCOQ/share/gtksourceview-2.0/language-specs + install_glob $PREFIX/share/gtksourceview-2.0/styles/'*' $PREFIXCOQ/share/gtksourceview-2.0/styles + install_rec $PREFIX/share/themes/ '*' $PREFIXCOQ/share/themes + + # This below item look like a bug in make install + if [[ ! $COQ_VERSION == 8.4* ]] ; then + mv $PREFIXCOQ/share/coq/*.lang $PREFIXCOQ/share/gtksourceview-2.0/language-specs + mv $PREFIXCOQ/share/coq/*.xml $PREFIXCOQ/share/gtksourceview-2.0/styles + fi + mkdir -p $PREFIXCOQ/ide + mv $PREFIXCOQ/share/coq/*.png $PREFIXCOQ/ide + rmdir $PREFIXCOQ/share/coq + fi +} + +# Copy license and other info files + +function copy_coq_license { + if [ "$INSTALLMODE" == "absolute" ] || [ "$INSTALLMODE" == "relocatable" ]; then + install -D doc/LICENSE $PREFIXCOQ/license_readme/coq/LicenseDoc.txt + install -D LICENSE $PREFIXCOQ/license_readme/coq/License.txt + install -D plugins/micromega/LICENSE.sos $PREFIXCOQ/license_readme/coq/LicenseMicromega.txt + install -D README $PREFIXCOQ/license_readme/coq/ReadMe.txt || true + install -D README.md $PREFIXCOQ/license_readme/coq/ReadMe.md || true + install -D README.win $PREFIXCOQ/license_readme/coq/ReadMeWindows.txt + install -D README.doc $PREFIXCOQ/license_readme/coq/ReadMeDoc.txt + install -D CHANGES $PREFIXCOQ/license_readme/coq/Changes.txt + install -D INSTALL $PREFIXCOQ/license_readme/coq/Install.txt + install -D INSTALL.doc $PREFIXCOQ/license_readme/coq/InstallDoc.txt + install -D INSTALL.ide $PREFIXCOQ/license_readme/coq/InstallIde.txt + fi +} + +# Main function for creating Coq + +function make_coq { + make_ocaml + make_lablgtk + make_camlp5 + if + case $COQ_VERSION in + git-*) build_prep https://github.com/coq/coq/archive ${COQ_VERSION##git-} zip 1 coq-${COQ_VERSION} ;; + *) build_prep https://coq.inria.fr/distrib/V$COQ_VERSION/files coq-$COQ_VERSION tar.gz ;; + esac + then + if [ "$INSTALLMODE" == "relocatable" ]; then + # HACK: for relocatable builds, first configure with ./, then build but before install reconfigure with the real target path + logn configure ./configure -debug -with-doc no -prefix ./ -libdir ./lib -mandir ./man + elif [ "$INSTALLMODE" == "absolute" ]; then + logn configure ./configure -debug -with-doc no -prefix $PREFIXCOQ -libdir $PREFIXCOQ/lib -mandir $PREFIXCOQ/man + else + logn configure ./configure -debug -with-doc no -prefix $PREFIXCOQ + fi + + # The windows resource compiler binary name is hard coded + sed -i "s/i686-w64-mingw32-windres/$TARGET_ARCH-windres/" Makefile.build + sed -i "s/i686-w64-mingw32-windres/$TARGET_ARCH-windres/" Makefile.ide || true + + # 8.4x doesn't support parallel make + if [[ $COQ_VERSION == 8.4* ]] ; then + log1 make + else + log1 make $MAKE_OPT + fi + + if [ "$INSTALLMODE" == "relocatable" ]; then + ./configure -debug -with-doc no -prefix $PREFIXCOQ -libdir $PREFIXCOQ/lib -mandir $PREFIXCOQ/man + fi + + log2 make install + log1 copy_coq_dlls + if [ "$INSTALLOCAML" == "Y" ]; then + log1 copy_coq_objects + fi + + copq_coq_gtk + copy_coq_license + + # make clean seems to br broken for 8.5pl2 + # 1.) find | xargs fails on cygwin, can be fixed by sed -i 's|\| xargs rm -f|-exec rm -fv \{\} \+|' Makefile + # 2.) clean of test suites fails with "cannot run complexity tests (no bogomips found)" + # make clean + + build_post + fi +} + +##### GNU Make for MinGW ##### + +function make_mingw_make { + if build_prep http://ftp.gnu.org/gnu/make make-4.2 tar.bz2 ; then + # The config.h.win32 file is fine - don't edit it + # We need to copy the mingw gcc here as "gcc" - then the batch file will use it + cp /usr/bin/${ARCH}-w64-mingw32-gcc-5.4.0.exe ./gcc.exe + # By some magic cygwin bash can run batch files + logn build ./build_w32.bat gcc + # Copy make to Coq folder + cp GccRel/gnumake.exe $PREFIXCOQ/bin/make.exe + build_post + fi +} + +##### GNU binutils for native OCaml ##### + +function make_binutils { + if build_prep http://ftp.gnu.org/gnu/binutils binutils-2.27 tar.gz ; then + logn configure ./configure --build=$BUILD --host=$HOST --target=$TARGET --prefix=$PREFIXCOQ --program-prefix=$TARGET- + log1 make $MAKE_OPT + log2 make install + # log2 make clean + build_post + fi +} + +##### GNU GCC for native OCaml ##### + +function make_gcc { + # Note: the bz2 file is smaller, but decompressing bz2 really takes ages + if build_prep ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-5.4.0 gcc-5.4.0 tar.gz ; then + # This is equivalent to "contrib/download_prerequisites" but uses caching + # Update versions when updating gcc version + get_expand_source_tar ftp://gcc.gnu.org/pub/gcc/infrastructure mpfr-2.4.2 tar.bz2 1 mpfr-2.4.2 mpfr + get_expand_source_tar ftp://gcc.gnu.org/pub/gcc/infrastructure gmp-4.3.2 tar.bz2 1 gmp-4.3.2 gmp + get_expand_source_tar ftp://gcc.gnu.org/pub/gcc/infrastructure mpc-0.8.1 tar.gz 1 mpc-0.8.1 mpc + get_expand_source_tar ftp://gcc.gnu.org/pub/gcc/infrastructure isl-0.14 tar.bz2 1 isl-0.14 isl + + # For whatever reason gcc needs this (although it never puts anything into it) + # Error: "The directory that should contain system headers does not exist:" + # mkdir -p /mingw/include without --with-sysroot + mkdir -p $PREFIXCOQ/mingw/include + + # See https://gcc.gnu.org/install/configure.html + logn configure ./configure --build=$BUILD --host=$HOST --target=$TARGET \ + --prefix=$PREFIXCOQ --program-prefix=$TARGET- --disable-win32-registry --with-sysroot=$PREFIXCOQ \ + --enable-languages=c --disable-nls \ + --disable-libsanitizer --disable-libssp --disable-libquadmath --disable-libgomp --disable-libvtv --disable-lto + # --disable-decimal-float seems to be required + # --with-sysroot=$PREFIX results in configure error that this is not an absolute path + log1 make $MAKE_OPT + log2 make install + # log2 make clean + build_post + fi +} + +##### Get sources for Cygwin MinGW packages ##### + +function get_cygwin_mingw_sources { + if [ ! -f flagfiles/cygwin_mingw_sources.finished ] ; then + touch flagfiles/cygwin_mingw_sources.started + + # Find all installed files with mingw in the name and download the corresponding source code file from cygwin + # Steps: + # grep /etc/setup/installed.db for mingw => mingw64-x86_64-gcc-g++ mingw64-x86_64-gcc-g++-5.4.0-2.tar.bz2 1 + # remove archive ending and trailing number => mingw64-x86_64-gcc-g++ mingw64-x86_64-gcc-g++-5.4.0-2 + # replace space with / => ${ARCHIVE} = mingw64-x86_64-gcc-g++/mingw64-x86_64-gcc-g++-5.4.0-2 + # escape + signs using ${var//pattern/replace} => ${ARCHIVEESC} = mingw64-x86_64-gcc-g++/mingw64-x86_64-gcc-g\+\+-5.4.0-2 + # grep cygwin setup.ini for installed line + next line (the -A 1 option includes and "after context" of 1 line) + # Note that the folders of the installed binaries and source are different. So we cannot grep just for the source line. + # We could strip off the path and just grep for the file, though. + # => install: x86_64/release/mingw64-x86_64-gcc/mingw64-x86_64-gcc-g++/mingw64-x86_64-gcc-g++-5.4.0-2.tar.xz 10163848 2f8cb7ba3e16ac8ce0455af01de490ded09061b1b06a9a8e367426635b5a33ce230e04005f059d4ea7b52580757da1f6d5bae88eba6b9da76d1bd95e8844b705 + # source: x86_64/release/mingw64-x86_64-gcc/mingw64-x86_64-gcc-5.4.0-2-src.tar.xz 95565368 03f22997b7173b243fff65ea46a39613a2e4e75fc7e6cf0fa73b7bcb86071e15ba6d0ca29d330c047fb556a5e684cad57cd2f5adb6e794249e4b01fe27f92c95 + # Take the 2nd field of the last line => ${SOURCE} = x86_64/release/mingw64-x86_64-gcc/mingw64-x86_64-gcc-5.4.0-2-src.tar.xz + # Remove that path part => ${SOURCEFILE} = mingw64-x86_64-gcc-5.4.0-2-src.tar.xz + + grep "mingw" /etc/setup/installed.db | sed 's/\.tar\.bz2 [0-1]$//' | sed 's/ /\//' | while read ARCHIVE ; do + local ARCHIVEESC=${ARCHIVE//+/\\+} + local SOURCE=`egrep -A 1 "install: ($CYGWINARCH|noarch)/release/[-+_/a-z0-9]*$ARCHIVEESC" $TARBALLS/setup.ini | tail -1 | cut -d " " -f 2` + local SOURCEFILE=${SOURCE##*/} + + # Get the source file (either from the source cache or online) + if [ ! -f $TARBALLS/$SOURCEFILE ] ; then + if [ -f $SOURCE_LOCAL_CACHE_CFMT/$SOURCEFILE ] ; then + cp $SOURCE_LOCAL_CACHE_CFMT/$SOURCEFILE $TARBALLS + else + wget "$CYGWIN_REPOSITORY/$SOURCE" + mv $SOURCEFILE $TARBALLS + # Save the source archive in the source cache + if [ -d $SOURCE_LOCAL_CACHE_CFMT ] ; then + cp $TARBALLS/$SOURCEFILE $SOURCE_LOCAL_CACHE_CFMT + fi + fi + fi + + done + + touch flagfiles/cygwin_mingw_sources.finished + fi +} + +##### Coq Windows Installer ##### + +function make_coq_installer { + make_coq + make_mingw_make + get_cygwin_mingw_sources + + # Prepare the file lists for the installer. We created to file list dumps of the target folder during the build: + # ocaml: ocaml + menhir + camlp5 + findlib + # ocal_coq: as above + coq + + # Create coq file list as ocaml_coq / ocaml + diff_files coq ocaml_coq ocaml + + # Filter out object files + filter_files coq_objects coq '\.(cmxa|cmi|cma|cmo|a|o)$' + + # Filter out plugin object files + filter_files coq_objects_plugins coq_objects '/lib/plugins/.*\.(cmxa|cmi|cma|cmo|a|o)$' + + # Coq objects objects required for plugin development = coq objects except those for pre installed plugins + diff_files coq_plugindev coq_objects coq_objects_plugins + + # Coq files, except objects needed only for plugin development + diff_files coq_base coq coq_plugindev + + # Convert section files to NSIS format + files_to_nsis coq_base + files_to_nsis coq_plugindev + files_to_nsis ocaml + + # Get and extract NSIS Binaries + if build_prep http://downloads.sourceforge.net/project/nsis/NSIS%202/2.51 nsis-2.51 zip ; then + NSIS=`pwd`/makensis.exe + chmod u+x "$NSIS" + # Change to Coq folder + cd ../coq-${COQ_VERSION} + # Copy patched nsi file + cp ../patches/coq_new.nsi dev/nsis + cp ../patches/StrRep.nsh dev/nsis + cp ../patches/ReplaceInFile.nsh dev/nsis + VERSION=`grep ^VERSION= config/Makefile | cut -d = -f 2` + cd dev/nsis + logn nsis-installer "$NSIS" -DVERSION=$VERSION -DARCH=$ARCH -DCOQ_SRC_PATH=$PREFIXCOQ -DCOQ_ICON=..\\..\\ide\\coq.ico coq_new.nsi + + build_post + fi +} + +###################### TOP LEVEL BUILD ##################### + +make_gtk2 +make_gtk_sourceview2 + +make_ocaml +make_findlib +make_lablgtk +make_camlp4 +make_camlp5 +make_menhir +make_stdint +list_files ocaml +make_coq + +if [ "$INSTALLMAKE" == "Y" ] ; then + make_mingw_make +fi + +list_files ocaml_coq + +if [ "$MAKEINSTALLER" == "Y" ] ; then + make_coq_installer +fi + diff --git a/dev/build/windows/patches_coq/ReplaceInFile.nsh b/dev/build/windows/patches_coq/ReplaceInFile.nsh new file mode 100644 index 0000000000..27c7eb2fd9 --- /dev/null +++ b/dev/build/windows/patches_coq/ReplaceInFile.nsh @@ -0,0 +1,67 @@ +; From NSIS Wiki http://nsis.sourceforge.net/ReplaceInFile +; Modifications: +; - Replace only once per line +; - Don't keep original as .old +; - Use StrRep instead of StrReplace (seems to be cleaner) + +Function Func_ReplaceInFile + ClearErrors + + Exch $0 ; REPLACEMENT + Exch + Exch $1 ; SEARCH_TEXT + Exch 2 + Exch $2 ; SOURCE_FILE + + Push $R0 ; SOURCE_FILE file handle + Push $R1 ; temporary file handle + Push $R2 ; unique temporary file name + Push $R3 ; a line to search and replace / save + Push $R4 ; shift puffer + + IfFileExists $2 +1 error ; Check if file exists and open it + FileOpen $R0 $2 "r" + + GetTempFileName $R2 ; Create temporary output file + FileOpen $R1 $R2 "w" + + loop: ; Loop over lines of file + FileRead $R0 $R3 ; Read line + IfErrors finished + Push "$R3" ; Replacine string in line once + Push "$1" + Push "$0" + Call Func_StrRep + Pop $R3 + FileWrite $R1 "$R3" ; Write result + Goto loop + + finished: + FileClose $R1 ; Close files + FileClose $R0 + Delete "$2" ; Delete original file and rename temporary file to target + Rename "$R2" "$2" + ClearErrors + Goto out + + error: + SetErrors + + out: + Pop $R4 + Pop $R3 + Pop $R2 + Pop $R1 + Pop $R0 + Pop $2 + Pop $0 + Pop $1 +FunctionEnd + +!macro ReplaceInFile SOURCE_FILE SEARCH_TEXT REPLACEMENT + Push "${SOURCE_FILE}" + Push "${SEARCH_TEXT}" + Push "${REPLACEMENT}" + Call Func_ReplaceInFile +!macroend + diff --git a/dev/build/windows/patches_coq/StrRep.nsh b/dev/build/windows/patches_coq/StrRep.nsh new file mode 100644 index 0000000000..d94a9f88b4 --- /dev/null +++ b/dev/build/windows/patches_coq/StrRep.nsh @@ -0,0 +1,60 @@ +; From NSIS Wiki http://nsis.sourceforge.net/StrRep +; Slightly modified + +Function Func_StrRep + Exch $R2 ;new + Exch 1 + Exch $R1 ;old + Exch 2 + Exch $R0 ;string + Push $R3 + Push $R4 + Push $R5 + Push $R6 + Push $R7 + Push $R8 + Push $R9 + + StrCpy $R3 0 + StrLen $R4 $R1 + StrLen $R6 $R0 + StrLen $R9 $R2 + loop: + StrCpy $R5 $R0 $R4 $R3 + StrCmp $R5 $R1 found + StrCmp $R3 $R6 done + IntOp $R3 $R3 + 1 ;move offset by 1 to check the next character + Goto loop + found: + StrCpy $R5 $R0 $R3 + IntOp $R8 $R3 + $R4 + StrCpy $R7 $R0 "" $R8 + StrCpy $R0 $R5$R2$R7 + StrLen $R6 $R0 + IntOp $R3 $R3 + $R9 ;move offset by length of the replacement string + Goto loop + done: + + Pop $R9 + Pop $R8 + Pop $R7 + Pop $R6 + Pop $R5 + Pop $R4 + Pop $R3 + Push $R0 + Push $R1 + Pop $R0 + Pop $R1 + Pop $R0 + Pop $R2 + Exch $R1 +FunctionEnd + +!macro StrRep output string old new + Push `${string}` + Push `${old}` + Push `${new}` + Call Func_StrRep + Pop ${output} +!macroend diff --git a/dev/build/windows/patches_coq/camlp4-4.02+6.patch b/dev/build/windows/patches_coq/camlp4-4.02+6.patch new file mode 100644 index 0000000000..0cdb4a929b --- /dev/null +++ b/dev/build/windows/patches_coq/camlp4-4.02+6.patch @@ -0,0 +1,11 @@ +--- camlp4-4.02-6.orig/myocamlbuild.ml 2015-06-17 13:37:36.000000000 +0200 ++++ camlp4-4.02+6/myocamlbuild.ml 2016-10-13 13:57:35.512213600 +0200 +@@ -86,7 +86,7 @@ + let dep = "camlp4"/"boot"/exe in + let cmd = + let ( / ) = Filename.concat in +- "camlp4"/"boot"/exe ++ String.escaped (String.escaped ("camlp4"/"boot"/exe)) + in + (Some dep, cmd) + in diff --git a/dev/build/windows/patches_coq/coq-8.4pl2.patch b/dev/build/windows/patches_coq/coq-8.4pl2.patch new file mode 100644 index 0000000000..45a66d0bfa --- /dev/null +++ b/dev/build/windows/patches_coq/coq-8.4pl2.patch @@ -0,0 +1,11 @@ +--- configure 2014-04-14 22:28:39.174177924 +0200 ++++ configure 2014-04-14 22:29:23.253025166 +0200 +@@ -335,7 +335,7 @@ + MAKEVERSION=`$MAKE -v | head -1 | cut -d" " -f3` + MAKEVERSIONMAJOR=`echo $MAKEVERSION | cut -d. -f1` + MAKEVERSIONMINOR=`echo $MAKEVERSION | cut -d. -f2` +- if [ "$MAKEVERSIONMAJOR" -eq 3 -a "$MAKEVERSIONMINOR" -ge 81 ]; then ++ if [ "$MAKEVERSIONMAJOR" -eq 3 -a "$MAKEVERSIONMINOR" -ge 81 ] || [ "$MAKEVERSIONMAJOR" -ge 4 ] ; then + echo "You have GNU Make $MAKEVERSION. Good!" + else + OK="no" \ No newline at end of file diff --git a/dev/build/windows/patches_coq/coq-8.4pl6.patch b/dev/build/windows/patches_coq/coq-8.4pl6.patch new file mode 100644 index 0000000000..c3b7f8574e --- /dev/null +++ b/dev/build/windows/patches_coq/coq-8.4pl6.patch @@ -0,0 +1,13 @@ +coq-8.4pl6.orig +--- coq-8.4pl6.orig/configure 2015-04-09 15:59:35.000000000 +0200 ++++ coq-8.4pl6//configure 2016-11-09 13:29:42.235319800 +0100 +@@ -309,9 +309,6 @@ + # executable extension + + case "$ARCH,$CYGWIN" in +- win32,yes) +- EXE=".exe" +- DLLEXT=".so";; + win32,*) + EXE=".exe" + DLLEXT=".dll";; diff --git a/dev/build/windows/patches_coq/coq_new.nsi b/dev/build/windows/patches_coq/coq_new.nsi new file mode 100644 index 0000000000..b88aa066d8 --- /dev/null +++ b/dev/build/windows/patches_coq/coq_new.nsi @@ -0,0 +1,223 @@ +; This script is used to build the Windows install program for Coq. + +; NSIS Modern User Interface +; Written by Joost Verburg +; Modified by Julien Narboux, Pierre Letouzey, Enrico Tassi and Michael Soegtrop + +; The following command line defines are expected: +; VERSION Coq version, e.g. 8.5-pl2 +; ARCH The target architecture, either x86_64 or i686 +; COQ_SRC_PATH path of Coq installation in Windows or MinGW format (either \\ or /, but with drive letter) +; COQ_ICON path of Coq icon file in Windows or MinGW format + +; Enable compression after debugging. +; SetCompress off +SetCompressor lzma + +!define MY_PRODUCT "Coq" ;Define your own software name here +!define OUTFILE "coq-installer-${VERSION}-${ARCH}.exe" + +!include "MUI2.nsh" +!include "FileAssociation.nsh" +!include "StrRep.nsh" +!include "ReplaceInFile.nsh" +!include "winmessages.nsh" + +Var COQ_SRC_PATH_BS ; COQ_SRC_PATH with \ instead of / +Var COQ_SRC_PATH_DBS ; COQ_SRC_PATH with \\ instead of / +Var INSTDIR_DBS ; INSTDIR with \\ instead of \ + +;-------------------------------- +;Configuration + + Name "Coq" + + ;General + OutFile "${OUTFILE}" + + ;Folder selection page + InstallDir "C:\${MY_PRODUCT}" + + ;Remember install folder + InstallDirRegKey HKCU "Software\${MY_PRODUCT}" "" + +;-------------------------------- +;Modern UI Configuration + + !define MUI_ICON "${COQ_ICON}" + + !insertmacro MUI_PAGE_WELCOME + !insertmacro MUI_PAGE_LICENSE "${COQ_SRC_PATH}/license_readme/coq/License.txt" + !insertmacro MUI_PAGE_COMPONENTS + !define MUI_DIRECTORYPAGE_TEXT_TOP "Select where to install Coq. The path MUST NOT include spaces." + !insertmacro MUI_PAGE_DIRECTORY + !insertmacro MUI_PAGE_INSTFILES + !insertmacro MUI_PAGE_FINISH + + !insertmacro MUI_UNPAGE_WELCOME + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_INSTFILES + !insertmacro MUI_UNPAGE_FINISH + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +;Language Strings + + ;Description + LangString DESC_1 ${LANG_ENGLISH} "This package contains Coq and CoqIDE." + LangString DESC_2 ${LANG_ENGLISH} "This package contains an OCaml compiler for Coq native compute and plugin development." + LangString DESC_3 ${LANG_ENGLISH} "This package contains the development files needed in order to build a plugin for Coq." + LangString DESC_4 ${LANG_ENGLISH} "Set the OCAMLLIB environment variable for the current user." + LangString DESC_5 ${LANG_ENGLISH} "Set the OCAMLLIB environment variable for all users." + +;-------------------------------- +; Check for white spaces +Function .onVerifyInstDir + StrLen $0 "$INSTDIR" + StrCpy $1 0 + ${While} $1 < $0 + StrCpy $3 $INSTDIR 1 $1 + StrCmp $3 " " SpacesInPath + IntOp $1 $1 + 1 + ${EndWhile} + Goto done + SpacesInPath: + Abort + done: +FunctionEnd + +;-------------------------------- +;Installer Sections + + +Section "Coq" Sec1 + + SetOutPath "$INSTDIR\" + !include "..\..\..\filelists\coq_base.nsh" + + ${registerExtension} "$INSTDIR\bin\coqide.exe" ".v" "Coq Script File" + + ;Store install folder + WriteRegStr HKCU "Software\${MY_PRODUCT}" "" $INSTDIR + + ;Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Coq" \ + "DisplayName" "Coq Version ${VERSION}" + WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Coq" \ + "UninstallString" '"$INSTDIR\Uninstall.exe"' + WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Coq" \ + "DisplayVersion" "${VERSION}" + WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Coq" \ + "NoModify" "1" + WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Coq" \ + "NoRepair" "1" + WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Coq" \ + "URLInfoAbout" "http://coq.inria.fr" + + ; Create start menu entries + ; SetOutPath is required for the path in the .lnk files + SetOutPath "$INSTDIR" + CreateDirectory "$SMPROGRAMS\Coq" + ; The first shortcut set here is treated as main application by Windows 7/8. + ; Use CoqIDE as main application + CreateShortCut "$SMPROGRAMS\Coq\CoqIde.lnk" "$INSTDIR\bin\coqide.exe" + CreateShortCut "$SMPROGRAMS\Coq\Coq.lnk" "$INSTDIR\bin\coqtop.exe" + WriteINIStr "$SMPROGRAMS\Coq\The Coq HomePage.url" "InternetShortcut" "URL" "http://coq.inria.fr" + WriteINIStr "$SMPROGRAMS\Coq\The Coq Standard Library.url" "InternetShortcut" "URL" "http://coq.inria.fr/library" + CreateShortCut "$SMPROGRAMS\Coq\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 + +SectionEnd + +;OCAML Section "Ocaml for native compute and plugin development" Sec2 +;OCAML SetOutPath "$INSTDIR\" +;OCAML !include "..\..\..\filelists\ocaml.nsh" +;OCAML +;OCAML ; Create a few slash / backslash variants of the source and install path +;OCAML ; Note: NSIS has variables, written as $VAR and defines, written as ${VAR} +;OCAML !insertmacro StrRep $COQ_SRC_PATH_BS ${COQ_SRC_PATH} "/" "\" +;OCAML !insertmacro StrRep $COQ_SRC_PATH_DBS ${COQ_SRC_PATH} "/" "\\" +;OCAML !insertmacro StrRep $INSTDIR_DBS $INSTDIR "\" "\\" +;OCAML +;OCAML ; Replace absolute paths in some OCaml config files +;OCAML ; These are not all, see ReadMe.txt +;OCAML !insertmacro ReplaceInFile "$INSTDIR\libocaml\ld.conf" "/" "\" +;OCAML !insertmacro ReplaceInFile "$INSTDIR\libocaml\ld.conf" "$COQ_SRC_PATH_BS" "$INSTDIR" +;OCAML !insertmacro ReplaceInFile "$INSTDIR\etc\findlib.conf" "$COQ_SRC_PATH_DBS" "$INSTDIR_DBS" +;OCAML SectionEnd + +Section "Coq files for plugin developers" Sec3 + SetOutPath "$INSTDIR\" + !include "..\..\..\filelists\coq_plugindev.nsh" +SectionEnd + +;OCAML Section "OCAMLLIB current user" Sec4 +;OCAML WriteRegStr HKCU "Environment" "OCAMLLIB" "$INSTDIR\libocaml" +;OCAML ; This is required, so that a newly started shell gets the new environment variable +;OCAML ; But it really takes a few seconds +;OCAML DetailPrint "Broadcasting OCAMLLIB environment variable change (current user)" +;OCAML SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=1000 +;OCAML SectionEnd + +;OCAML Section "OCAMLLIB all users" Sec5 +;OCAML WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "OCAMLLIB" "$INSTDIR\libocaml" +;OCAML ; This is required, so that a newly started shell gets the new environment variable +;OCAML ; But it really takes a few seconds +;OCAML DetailPrint "Broadcasting OCAMLLIB environment variable change (all users)" +;OCAML SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=1000 +;OCAML SectionEnd + +;-------------------------------- +;Descriptions + +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${Sec1} $(DESC_1) + ;OCAML !insertmacro MUI_DESCRIPTION_TEXT ${Sec2} $(DESC_2) + !insertmacro MUI_DESCRIPTION_TEXT ${Sec3} $(DESC_3) + ;OCAML !insertmacro MUI_DESCRIPTION_TEXT ${Sec4} $(DESC_4) + ;OCAML !insertmacro MUI_DESCRIPTION_TEXT ${Sec5} $(DESC_5) +!insertmacro MUI_FUNCTION_DESCRIPTION_END + +;-------------------------------- +;Uninstaller Section + +Section "Uninstall" + ; Files and folders + RMDir /r "$INSTDIR\bin" + RMDir /r "$INSTDIR\dev" + RMDir /r "$INSTDIR\etc" + RMDir /r "$INSTDIR\lib" + RMDir /r "$INSTDIR\libocaml" + RMDir /r "$INSTDIR\share" + RMDir /r "$INSTDIR\ide" + RMDir /r "$INSTDIR\gtk-2.0" + RMDir /r "$INSTDIR\latex" + RMDir /r "$INSTDIR\license_readme" + RMDir /r "$INSTDIR\man" + RMDir /r "$INSTDIR\emacs" + + ; Start Menu + Delete "$SMPROGRAMS\Coq\Coq.lnk" + Delete "$SMPROGRAMS\Coq\CoqIde.lnk" + Delete "$SMPROGRAMS\Coq\Uninstall.lnk" + Delete "$SMPROGRAMS\Coq\The Coq HomePage.url" + Delete "$SMPROGRAMS\Coq\The Coq Standard Library.url" + Delete "$INSTDIR\Uninstall.exe" + + ; Registry keys + DeleteRegKey HKCU "Software\${MY_PRODUCT}" + DeleteRegKey HKLM "SOFTWARE\Coq" + DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Coq" + DeleteRegKey HKCU "Environment\OCAMLLIB" + DeleteRegKey HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment\OCAMLLIB" + ${unregisterExtension} ".v" "Coq Script File" + + ; Root folders + RMDir "$INSTDIR" + RMDir "$SMPROGRAMS\Coq" + +SectionEnd diff --git a/dev/build/windows/patches_coq/flexdll-0.34.patch b/dev/build/windows/patches_coq/flexdll-0.34.patch new file mode 100644 index 0000000000..16389baca3 --- /dev/null +++ b/dev/build/windows/patches_coq/flexdll-0.34.patch @@ -0,0 +1,14 @@ +reloc.ml +--- orig.flexdll-0.34/reloc.ml 2015-01-22 17:30:07.000000000 +0100 ++++ flexdll-0.34/reloc.ml 2016-10-12 11:59:16.885829700 +0200 +@@ -117,8 +117,8 @@ + + let new_cmdline () = + let rf = match !toolchain with +- | `MSVC | `MSVC64 | `LIGHTLD -> true +- | `MINGW | `MINGW64 | `GNAT | `CYGWIN | `CYGWIN64 -> false ++ | `MSVC | `MSVC64 | `LIGHTLD | `MINGW | `MINGW64 -> true ++ | `GNAT | `CYGWIN | `CYGWIN64 -> false + in + { + may_use_response_file = rf; diff --git a/dev/build/windows/patches_coq/glib-2.46.0.patch b/dev/build/windows/patches_coq/glib-2.46.0.patch new file mode 100644 index 0000000000..9082460bf0 --- /dev/null +++ b/dev/build/windows/patches_coq/glib-2.46.0.patch @@ -0,0 +1,30 @@ +diff -u -r glib-2.46.0/gio/glocalfile.c glib-2.46.0.patched/gio/glocalfile.c +--- glib-2.46.0/gio/glocalfile.c 2015-08-27 05:32:26.000000000 +0200 ++++ glib-2.46.0.patched/gio/glocalfile.c 2016-01-27 13:08:30.059736400 +0100 +@@ -2682,7 +2682,10 @@ + (!g_path_is_absolute (filename) || len > g_path_skip_root (filename) - filename)) + wfilename[len] = '\0'; + +- retval = _wstat32i64 (wfilename, &buf); ++ // MSoegtrop: _wstat32i64 is the wrong function for GLocalFileStat = struct _stati64 ++ // The correct function is _wstati64, see https://msdn.microsoft.com/en-us/library/14h5k7ff.aspx ++ // Also _wstat32i64 is a VC function, not a windows SDK function, see https://msdn.microsoft.com/en-us/library/aa273365(v=vs.60).aspx ++ retval = _wstati64 (wfilename, &buf); + save_errno = errno; + + g_free (wfilename); +diff -u -r glib-2.46.0/glib/gstdio.c glib-2.46.0.patched/glib/gstdio.c +--- glib-2.46.0/glib/gstdio.c 2015-02-26 13:57:09.000000000 +0100 ++++ glib-2.46.0.patched/glib/gstdio.c 2016-01-27 13:31:12.708987700 +0100 +@@ -493,7 +493,10 @@ + (!g_path_is_absolute (filename) || len > g_path_skip_root (filename) - filename)) + wfilename[len] = '\0'; + +- retval = _wstat (wfilename, buf); ++ // MSoegtrop: _wstat32i64 is the wrong function for GLocalFileStat = struct _stati64 ++ // The correct function is _wstati64, see https://msdn.microsoft.com/en-us/library/14h5k7ff.aspx ++ // Also _wstat32i64 is a VC function, not a windows SDK function, see https://msdn.microsoft.com/en-us/library/aa273365(v=vs.60).aspx ++ retval = _wstati64 (wfilename, buf); + save_errno = errno; + + g_free (wfilename); diff --git a/dev/build/windows/patches_coq/gtksourceview-2.11.2.patch b/dev/build/windows/patches_coq/gtksourceview-2.11.2.patch new file mode 100644 index 0000000000..73a098d12a --- /dev/null +++ b/dev/build/windows/patches_coq/gtksourceview-2.11.2.patch @@ -0,0 +1,213 @@ +diff -c -r gtksourceview-2.11.2.orig/gtksourceview/gtksourceiter.c gtksourceview-2.11.2.patched/gtksourceview/gtksourceiter.c +*** gtksourceview-2.11.2.orig/gtksourceview/gtksourceiter.c 2010-05-30 12:24:14.000000000 +0200 +--- gtksourceview-2.11.2.patched/gtksourceview/gtksourceiter.c 2015-10-27 14:58:54.422888400 +0100 +*************** +*** 80,86 **** + /* If string contains prefix, check that prefix is not followed + * by a unicode mark symbol, e.g. that trailing 'a' in prefix + * is not part of two-char a-with-hat symbol in string. */ +! return type != G_UNICODE_COMBINING_MARK && + type != G_UNICODE_ENCLOSING_MARK && + type != G_UNICODE_NON_SPACING_MARK; + } +--- 80,86 ---- + /* If string contains prefix, check that prefix is not followed + * by a unicode mark symbol, e.g. that trailing 'a' in prefix + * is not part of two-char a-with-hat symbol in string. */ +! return type != G_UNICODE_SPACING_MARK && + type != G_UNICODE_ENCLOSING_MARK && + type != G_UNICODE_NON_SPACING_MARK; + } +diff -c -r gtksourceview-2.11.2.orig/gtksourceview/gtksourcelanguagemanager.c gtksourceview-2.11.2.patched/gtksourceview/gtksourcelanguagemanager.c +*** gtksourceview-2.11.2.orig/gtksourceview/gtksourcelanguagemanager.c 2010-05-30 12:24:14.000000000 +0200 +--- gtksourceview-2.11.2.patched/gtksourceview/gtksourcelanguagemanager.c 2015-10-27 14:55:30.294477600 +0100 +*************** +*** 274,280 **** + * containg a list of language files directories. + * The array is owned by @lm and must not be modified. + */ +! G_CONST_RETURN gchar* G_CONST_RETURN * + gtk_source_language_manager_get_search_path (GtkSourceLanguageManager *lm) + { + g_return_val_if_fail (GTK_IS_SOURCE_LANGUAGE_MANAGER (lm), NULL); +--- 274,280 ---- + * containg a list of language files directories. + * The array is owned by @lm and must not be modified. + */ +! const gchar* const * + gtk_source_language_manager_get_search_path (GtkSourceLanguageManager *lm) + { + g_return_val_if_fail (GTK_IS_SOURCE_LANGUAGE_MANAGER (lm), NULL); +*************** +*** 392,398 **** + * available languages or %NULL if no language is available. The array + * is owned by @lm and must not be modified. + */ +! G_CONST_RETURN gchar* G_CONST_RETURN * + gtk_source_language_manager_get_language_ids (GtkSourceLanguageManager *lm) + { + g_return_val_if_fail (GTK_IS_SOURCE_LANGUAGE_MANAGER (lm), NULL); +--- 392,398 ---- + * available languages or %NULL if no language is available. The array + * is owned by @lm and must not be modified. + */ +! const gchar* const * + gtk_source_language_manager_get_language_ids (GtkSourceLanguageManager *lm) + { + g_return_val_if_fail (GTK_IS_SOURCE_LANGUAGE_MANAGER (lm), NULL); +diff -c -r gtksourceview-2.11.2.orig/gtksourceview/gtksourcelanguagemanager.h gtksourceview-2.11.2.patched/gtksourceview/gtksourcelanguagemanager.h +*** gtksourceview-2.11.2.orig/gtksourceview/gtksourcelanguagemanager.h 2009-11-15 00:41:33.000000000 +0100 +--- gtksourceview-2.11.2.patched/gtksourceview/gtksourcelanguagemanager.h 2015-10-27 14:55:30.518500000 +0100 +*************** +*** 62,74 **** + + GtkSourceLanguageManager *gtk_source_language_manager_get_default (void); + +! G_CONST_RETURN gchar* G_CONST_RETURN * + gtk_source_language_manager_get_search_path (GtkSourceLanguageManager *lm); + + void gtk_source_language_manager_set_search_path (GtkSourceLanguageManager *lm, + gchar **dirs); + +! G_CONST_RETURN gchar* G_CONST_RETURN * + gtk_source_language_manager_get_language_ids (GtkSourceLanguageManager *lm); + + GtkSourceLanguage *gtk_source_language_manager_get_language (GtkSourceLanguageManager *lm, +--- 62,74 ---- + + GtkSourceLanguageManager *gtk_source_language_manager_get_default (void); + +! const gchar* const * + gtk_source_language_manager_get_search_path (GtkSourceLanguageManager *lm); + + void gtk_source_language_manager_set_search_path (GtkSourceLanguageManager *lm, + gchar **dirs); + +! const gchar* const * + gtk_source_language_manager_get_language_ids (GtkSourceLanguageManager *lm); + + GtkSourceLanguage *gtk_source_language_manager_get_language (GtkSourceLanguageManager *lm, +diff -c -r gtksourceview-2.11.2.orig/gtksourceview/gtksourcestylescheme.c gtksourceview-2.11.2.patched/gtksourceview/gtksourcestylescheme.c +*** gtksourceview-2.11.2.orig/gtksourceview/gtksourcestylescheme.c 2010-05-30 12:24:14.000000000 +0200 +--- gtksourceview-2.11.2.patched/gtksourceview/gtksourcestylescheme.c 2015-10-27 14:55:30.545502700 +0100 +*************** +*** 310,316 **** + * + * Since: 2.0 + */ +! G_CONST_RETURN gchar* G_CONST_RETURN * + gtk_source_style_scheme_get_authors (GtkSourceStyleScheme *scheme) + { + g_return_val_if_fail (GTK_IS_SOURCE_STYLE_SCHEME (scheme), NULL); +--- 310,316 ---- + * + * Since: 2.0 + */ +! const gchar* const * + gtk_source_style_scheme_get_authors (GtkSourceStyleScheme *scheme) + { + g_return_val_if_fail (GTK_IS_SOURCE_STYLE_SCHEME (scheme), NULL); +*************** +*** 318,324 **** + if (scheme->priv->authors == NULL) + return NULL; + +! return (G_CONST_RETURN gchar* G_CONST_RETURN *)scheme->priv->authors->pdata; + } + + /** +--- 318,324 ---- + if (scheme->priv->authors == NULL) + return NULL; + +! return (const gchar* const *)scheme->priv->authors->pdata; + } + + /** +diff -c -r gtksourceview-2.11.2.orig/gtksourceview/gtksourcestylescheme.h gtksourceview-2.11.2.patched/gtksourceview/gtksourcestylescheme.h +*** gtksourceview-2.11.2.orig/gtksourceview/gtksourcestylescheme.h 2010-03-29 15:02:56.000000000 +0200 +--- gtksourceview-2.11.2.patched/gtksourceview/gtksourcestylescheme.h 2015-10-27 14:55:30.565504700 +0100 +*************** +*** 61,67 **** + const gchar *gtk_source_style_scheme_get_name (GtkSourceStyleScheme *scheme); + const gchar *gtk_source_style_scheme_get_description(GtkSourceStyleScheme *scheme); + +! G_CONST_RETURN gchar* G_CONST_RETURN * + gtk_source_style_scheme_get_authors (GtkSourceStyleScheme *scheme); + + const gchar *gtk_source_style_scheme_get_filename (GtkSourceStyleScheme *scheme); +--- 61,67 ---- + const gchar *gtk_source_style_scheme_get_name (GtkSourceStyleScheme *scheme); + const gchar *gtk_source_style_scheme_get_description(GtkSourceStyleScheme *scheme); + +! const gchar* const * + gtk_source_style_scheme_get_authors (GtkSourceStyleScheme *scheme); + + const gchar *gtk_source_style_scheme_get_filename (GtkSourceStyleScheme *scheme); +diff -c -r gtksourceview-2.11.2.orig/gtksourceview/gtksourcestyleschememanager.c gtksourceview-2.11.2.patched/gtksourceview/gtksourcestyleschememanager.c +*** gtksourceview-2.11.2.orig/gtksourceview/gtksourcestyleschememanager.c 2010-05-30 12:24:14.000000000 +0200 +--- gtksourceview-2.11.2.patched/gtksourceview/gtksourcestyleschememanager.c 2015-10-27 14:55:30.583506500 +0100 +*************** +*** 515,521 **** + * of string containing the search path. + * The array is owned by the @manager and must not be modified. + */ +! G_CONST_RETURN gchar* G_CONST_RETURN * + gtk_source_style_scheme_manager_get_search_path (GtkSourceStyleSchemeManager *manager) + { + g_return_val_if_fail (GTK_IS_SOURCE_STYLE_SCHEME_MANAGER (manager), NULL); +--- 515,521 ---- + * of string containing the search path. + * The array is owned by the @manager and must not be modified. + */ +! const gchar* const * + gtk_source_style_scheme_manager_get_search_path (GtkSourceStyleSchemeManager *manager) + { + g_return_val_if_fail (GTK_IS_SOURCE_STYLE_SCHEME_MANAGER (manager), NULL); +*************** +*** 554,560 **** + * of string containing the ids of the available style schemes or %NULL if no + * style scheme is available. The array is owned by the @manager and must not be modified. + */ +! G_CONST_RETURN gchar* G_CONST_RETURN * + gtk_source_style_scheme_manager_get_scheme_ids (GtkSourceStyleSchemeManager *manager) + { + g_return_val_if_fail (GTK_IS_SOURCE_STYLE_SCHEME_MANAGER (manager), NULL); +--- 554,560 ---- + * of string containing the ids of the available style schemes or %NULL if no + * style scheme is available. The array is owned by the @manager and must not be modified. + */ +! const gchar* const * + gtk_source_style_scheme_manager_get_scheme_ids (GtkSourceStyleSchemeManager *manager) + { + g_return_val_if_fail (GTK_IS_SOURCE_STYLE_SCHEME_MANAGER (manager), NULL); +diff -c -r gtksourceview-2.11.2.orig/gtksourceview/gtksourcestyleschememanager.h gtksourceview-2.11.2.patched/gtksourceview/gtksourcestyleschememanager.h +*** gtksourceview-2.11.2.orig/gtksourceview/gtksourcestyleschememanager.h 2009-11-15 00:41:33.000000000 +0100 +--- gtksourceview-2.11.2.patched/gtksourceview/gtksourcestyleschememanager.h 2015-10-27 14:56:24.498897500 +0100 +*************** +*** 73,84 **** + void gtk_source_style_scheme_manager_prepend_search_path (GtkSourceStyleSchemeManager *manager, + const gchar *path); + +! G_CONST_RETURN gchar* G_CONST_RETURN * + gtk_source_style_scheme_manager_get_search_path (GtkSourceStyleSchemeManager *manager); + + void gtk_source_style_scheme_manager_force_rescan (GtkSourceStyleSchemeManager *manager); + +! G_CONST_RETURN gchar* G_CONST_RETURN * + gtk_source_style_scheme_manager_get_scheme_ids (GtkSourceStyleSchemeManager *manager); + + GtkSourceStyleScheme *gtk_source_style_scheme_manager_get_scheme (GtkSourceStyleSchemeManager *manager, +--- 73,84 ---- + void gtk_source_style_scheme_manager_prepend_search_path (GtkSourceStyleSchemeManager *manager, + const gchar *path); + +! const gchar* const * + gtk_source_style_scheme_manager_get_search_path (GtkSourceStyleSchemeManager *manager); + + void gtk_source_style_scheme_manager_force_rescan (GtkSourceStyleSchemeManager *manager); + +! const gchar* const * + gtk_source_style_scheme_manager_get_scheme_ids (GtkSourceStyleSchemeManager *manager); + + GtkSourceStyleScheme *gtk_source_style_scheme_manager_get_scheme (GtkSourceStyleSchemeManager *manager, diff --git a/dev/build/windows/patches_coq/isl-0.14.patch b/dev/build/windows/patches_coq/isl-0.14.patch new file mode 100644 index 0000000000..f3b8ead1ab --- /dev/null +++ b/dev/build/windows/patches_coq/isl-0.14.patch @@ -0,0 +1,11 @@ +--- orig.isl-0.14/configure 2014-10-26 08:36:32.000000000 +0100 ++++ isl-0.14/configure 2016-10-10 18:16:01.430224500 +0200 +@@ -8134,7 +8134,7 @@ + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( +- /*) ++ /*|[A-Z]:\\*|[A-Z]:/*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') diff --git a/dev/build/windows/patches_coq/lablgtk-2.18.3.patch b/dev/build/windows/patches_coq/lablgtk-2.18.3.patch new file mode 100644 index 0000000000..0691c1fc8f --- /dev/null +++ b/dev/build/windows/patches_coq/lablgtk-2.18.3.patch @@ -0,0 +1,87 @@ +diff -u -r lablgtk-2.18.3/configure lablgtk-2.18.3.patched/configure +--- lablgtk-2.18.3/configure 2014-10-29 08:51:05.000000000 +0100 ++++ lablgtk-2.18.3.patched/configure 2015-10-29 08:58:08.543985500 +0100 +@@ -2667,7 +2667,7 @@ + fi + + +-if test "`$OCAMLFIND printconf stdlib`" != "`$CAMLC -where`"; then ++if test "`$OCAMLFIND printconf stdlib | tr '\\' '/'`" != "`$CAMLC -where | tr '\\' '/'`"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring ocamlfind" >&5 + $as_echo "$as_me: WARNING: Ignoring ocamlfind" >&2;} + OCAMLFIND=no + +diff -u -r lablgtk-2.18.3/src/glib.mli lablgtk-2.18.3.patched/src/glib.mli +--- lablgtk-2.18.3/src/glib.mli 2014-10-29 08:51:06.000000000 +0100 ++++ lablgtk-2.18.3.patched/src/glib.mli 2016-01-25 09:50:59.884715200 +0100 +@@ -75,6 +75,7 @@ + type condition = [ `ERR | `HUP | `IN | `NVAL | `OUT | `PRI] + type id + val channel_of_descr : Unix.file_descr -> channel ++ val channel_of_descr_socket : Unix.file_descr -> channel + val add_watch : + cond:condition list -> callback:(condition list -> bool) -> ?prio:int -> channel -> id + val remove : id -> unit + +diff -u -r lablgtk-2.18.3/src/glib.ml lablgtk-2.18.3.patched/src/glib.ml +--- lablgtk-2.18.3/src/glib.ml 2014-10-29 08:51:06.000000000 +0100 ++++ lablgtk-2.18.3.patched/src/glib.ml 2016-01-25 09:50:59.891715900 +0100 +@@ -72,6 +72,8 @@ + type id + external channel_of_descr : Unix.file_descr -> channel + = "ml_g_io_channel_unix_new" ++ external channel_of_descr_socket : Unix.file_descr -> channel ++ = "ml_g_io_channel_unix_new_socket" + external remove : id -> unit = "ml_g_source_remove" + external add_watch : + cond:condition list -> callback:(condition list -> bool) -> ?prio:int -> channel -> id + +diff -u -r lablgtk-2.18.3/src/ml_glib.c lablgtk-2.18.3.patched/src/ml_glib.c +--- lablgtk-2.18.3/src/ml_glib.c 2014-10-29 08:51:06.000000000 +0100 ++++ lablgtk-2.18.3.patched/src/ml_glib.c 2016-01-25 09:50:59.898716600 +0100 +@@ -25,6 +25,8 @@ + #include + #include + #ifdef _WIN32 ++/* to kill a #warning: include winsock2.h before windows.h */ ++#include + #include "win32.h" + #include + #include +@@ -38,6 +40,11 @@ + #include + #include + ++#ifdef _WIN32 ++/* for Socket_val */ ++#include ++#endif ++ + #include "wrappers.h" + #include "ml_glib.h" + #include "glib_tags.h" +@@ -325,14 +332,23 @@ + + #ifndef _WIN32 + ML_1 (g_io_channel_unix_new, Int_val, Val_GIOChannel_noref) ++CAMLprim value ml_g_io_channel_unix_new_socket (value arg1) { ++ return Val_GIOChannel_noref (g_io_channel_unix_new (Int_val (arg1))); ++} + + #else + CAMLprim value ml_g_io_channel_unix_new(value wh) + { + return Val_GIOChannel_noref +- (g_io_channel_unix_new ++ (g_io_channel_win32_new_fd + (_open_osfhandle((long)*(HANDLE*)Data_custom_val(wh), O_BINARY))); + } ++ ++CAMLprim value ml_g_io_channel_unix_new_socket(value wh) ++{ ++ return Val_GIOChannel_noref ++ (g_io_channel_win32_new_socket(Socket_val(wh))); ++} + #endif + + static gboolean ml_g_io_channel_watch(GIOChannel *s, GIOCondition c, diff --git a/dev/build/windows/patches_coq/ln.c b/dev/build/windows/patches_coq/ln.c new file mode 100644 index 0000000000..5e02c72bb7 --- /dev/null +++ b/dev/build/windows/patches_coq/ln.c @@ -0,0 +1,137 @@ +// (C) 2016 Intel Deutschland GmbH +// Author: Michael Soegtrop +// Released to the public under CC0 +// See https://creativecommons.org/publicdomain/zero/1.0/ + +// Windows drop in repacement for Linux ln +// Supports command form "ln TARGET LINK_NAME" +// Supports -s and -f options +// Does not support hard links to folders (but symlinks are ok) + +#include +#include +#include + +// Cygwin MinGW doesn't have this Vista++ function in windows.h +#ifdef UNICODE + WINBASEAPI BOOLEAN APIENTRY CreateSymbolicLinkW ( LPCWSTR, LPCWSTR, DWORD ); + #define CreateSymbolicLink CreateSymbolicLinkW + #define CommandLineToArgv CommandLineToArgvW +#else + WINBASEAPI BOOLEAN APIENTRY CreateSymbolicLinkA ( LPCSTR, LPCSTR, DWORD ); + #define CreateSymbolicLink CreateSymbolicLinkA + #define CommandLineToArgv CommandLineToArgvA +#endif +#define SYMBOLIC_LINK_FLAG_DIRECTORY 1 + +int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLineA, int nShowCmd ) +{ + int iarg; + BOOL symbolic = FALSE; + BOOL force = FALSE; + BOOL folder; + const _TCHAR *target; + const _TCHAR *link; + LPTSTR lpCmdLine; + int argc; + LPTSTR *argv; + + // Parse command line + // This is done explicitly here for two reasons + // 1.) MinGW doesn't seem to support _tmain, wWinMain and the like + // 2.) We want to make sure that CommandLineToArgv is used + lpCmdLine = GetCommandLine(); + argv = CommandLineToArgv( lpCmdLine, &argc ); + + // Get target and link name + if( argc<3 ) + { + _ftprintf( stderr, _T("Expecting at least 2 arguments, got %d\n"), argc-1 ); + return 1; + } + target = argv[argc-2]; + link = argv[argc-1]; + + // Parse options + // The last two arguments are interpreted as file names + // All other arguments must be -s or -f os multi letter options like -sf + for(iarg=1; iarg '%s'!\n"), link, target ); + return 1; + } + } + else + { + if( folder ) + { + _ftprintf( stderr, _T("Cannot create hard link to folder") ); + return 1; + } + else + { + if( !CreateHardLink( link, target, NULL ) ) + { + _ftprintf( stderr, _T("Error creating hard link '%s' -> '%s'!\n"), link, target ); + return 1; + } + } + } + + // Everything is fine + return 0; +} \ No newline at end of file -- cgit v1.2.3 From 5a95de009158be1166b3998b99cafbccf4a0b2fa Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Thu, 10 Nov 2016 12:27:20 +0100 Subject: Move OSX script. --- dev/build/osx/make-macos-dmg.sh | 35 +++++++++++++++++++++++++++++++++++ dev/make-macos-dmg.sh | 35 ----------------------------------- 2 files changed, 35 insertions(+), 35 deletions(-) create mode 100755 dev/build/osx/make-macos-dmg.sh delete mode 100755 dev/make-macos-dmg.sh diff --git a/dev/build/osx/make-macos-dmg.sh b/dev/build/osx/make-macos-dmg.sh new file mode 100755 index 0000000000..b43ada9076 --- /dev/null +++ b/dev/build/osx/make-macos-dmg.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Fail on first error +set -e + +# Configuration setup +eval `opam config env` +make distclean +OUTDIR=$PWD/_install +DMGDIR=$PWD/_dmg +./configure -debug -prefix $OUTDIR -native-compiler no +VERSION=$(sed -n -e '/^let coq_version/ s/^[^"]*"\([^"]*\)"$/\1/p' configure.ml) +APP=bin/CoqIDE_${VERSION}.app + +# Create a .app file with CoqIDE +~/.local/bin/jhbuild run make -j -l2 $APP + +# Build Coq and run test-suite +make && make check + +# Add Coq to the .app file +make OLDROOT=$OUTDIR COQINSTALLPREFIX=$APP/Contents/Resources/ install-coq install-ide-toploop + +# Sign the .app file +codesign -f -s - $APP + +# Create the dmg bundle +mkdir -p $DMGDIR +ln -sf /Applications $DMGDIR/Applications +cp -r $APP $DMGDIR + +# Temporary countermeasure to hdiutil error 5341 +head -c9703424 /dev/urandom > $DMGDIR/.padding + +hdiutil create -imagekey zlib-level=9 -volname CoqIDE_$VERSION -srcfolder $DMGDIR -ov -format UDZO CoqIDE_$VERSION.dmg diff --git a/dev/make-macos-dmg.sh b/dev/make-macos-dmg.sh deleted file mode 100755 index b43ada9076..0000000000 --- a/dev/make-macos-dmg.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# Fail on first error -set -e - -# Configuration setup -eval `opam config env` -make distclean -OUTDIR=$PWD/_install -DMGDIR=$PWD/_dmg -./configure -debug -prefix $OUTDIR -native-compiler no -VERSION=$(sed -n -e '/^let coq_version/ s/^[^"]*"\([^"]*\)"$/\1/p' configure.ml) -APP=bin/CoqIDE_${VERSION}.app - -# Create a .app file with CoqIDE -~/.local/bin/jhbuild run make -j -l2 $APP - -# Build Coq and run test-suite -make && make check - -# Add Coq to the .app file -make OLDROOT=$OUTDIR COQINSTALLPREFIX=$APP/Contents/Resources/ install-coq install-ide-toploop - -# Sign the .app file -codesign -f -s - $APP - -# Create the dmg bundle -mkdir -p $DMGDIR -ln -sf /Applications $DMGDIR/Applications -cp -r $APP $DMGDIR - -# Temporary countermeasure to hdiutil error 5341 -head -c9703424 /dev/urandom > $DMGDIR/.padding - -hdiutil create -imagekey zlib-level=9 -volname CoqIDE_$VERSION -srcfolder $DMGDIR -ov -format UDZO CoqIDE_$VERSION.dmg -- cgit v1.2.3 From 5da573031d36c5a1df5dcf64cc8764f489f774f7 Mon Sep 17 00:00:00 2001 From: CJ Bell Date: Thu, 10 Nov 2016 22:28:13 -0500 Subject: Remove unused feedback_content: Goals --- ide/xmlprotocol.ml | 3 --- lib/feedback.ml | 1 - lib/feedback.mli | 1 - 3 files changed, 5 deletions(-) diff --git a/ide/xmlprotocol.ml b/ide/xmlprotocol.ml index aecb317bcb..5f82a8898b 100644 --- a/ide/xmlprotocol.ml +++ b/ide/xmlprotocol.ml @@ -816,7 +816,6 @@ let to_feedback_content = do_match "feedback_content" (fun s a -> match s,a with | "workerstatus", [ns] -> let n, s = to_pair to_string to_string ns in WorkerStatus(n,s) - | "goals", [loc;s] -> Goals (to_loc loc, to_string s) | "custom", [loc;name;x]-> Custom (to_loc loc, to_string name, x) | "filedependency", [from; dep] -> FileDependency (to_option to_string from, to_string dep) @@ -849,8 +848,6 @@ let of_feedback_content = function | WorkerStatus(n,s) -> constructor "feedback_content" "workerstatus" [of_pair of_string of_string (n,s)] - | Goals (loc,s) -> - constructor "feedback_content" "goals" [of_loc loc;of_string s] | Custom (loc, name, x) -> constructor "feedback_content" "custom" [of_loc loc; of_string name; x] | FileDependency (from, depends_on) -> diff --git a/lib/feedback.ml b/lib/feedback.ml index 44b3ee35d7..57c6f30a41 100644 --- a/lib/feedback.ml +++ b/lib/feedback.ml @@ -27,7 +27,6 @@ type feedback_content = | ProcessingIn of string | InProgress of int | WorkerStatus of string * string - | Goals of Loc.t * string | AddedAxiom | GlobRef of Loc.t * string * string * string * string | GlobDef of Loc.t * string * string * string diff --git a/lib/feedback.mli b/lib/feedback.mli index 5160bd5bc1..b4bed8793d 100644 --- a/lib/feedback.mli +++ b/lib/feedback.mli @@ -36,7 +36,6 @@ type feedback_content = | InProgress of int | WorkerStatus of string * string (* Generally useful metadata *) - | Goals of Loc.t * string | AddedAxiom | GlobRef of Loc.t * string * string * string * string | GlobDef of Loc.t * string * string * string -- cgit v1.2.3 From dd47fcfc08c43288a49797cc72829da3f9642094 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Fri, 11 Nov 2016 10:57:47 +0100 Subject: Making explicit that a result is discarded (ocaml warning). --- ide/preferences.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ide/preferences.ml b/ide/preferences.ml index 64327d74f5..b16d45b549 100644 --- a/ide/preferences.ml +++ b/ide/preferences.ml @@ -468,7 +468,7 @@ let create_tag name default = let iter table = let tag = GText.tag ~name () in table#add tag#as_tag; - pref#connect#changed (fun _ -> set_tag tag); + ignore (pref#connect#changed (fun _ -> set_tag tag)); set_tag tag; in List.iter iter [Tags.Script.table; Tags.Proof.table; Tags.Message.table]; -- cgit v1.2.3 From 7e992fa784ee6fa48af8a2e461385c094985587d Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Fri, 11 Nov 2016 11:20:38 +0100 Subject: Coqide: fixing default local links for refman and stdlib. --- ide/preferences.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ide/preferences.ml b/ide/preferences.ml index b16d45b549..f0fd45d77f 100644 --- a/ide/preferences.ml +++ b/ide/preferences.ml @@ -918,7 +918,7 @@ let configure ?(apply=(fun () -> ())) () = in let doc_url = let predefined = [ - "file://"^(List.fold_left Filename.concat (Coq_config.docdir) ["html";"refman";""]); + "file://"^(List.fold_left Filename.concat (Coq_config.docdir) ["refman";"html"]); Coq_config.wwwrefman; use_default_doc_url ] in @@ -931,7 +931,7 @@ let configure ?(apply=(fun () -> ())) () = doc_url#get in let library_url = let predefined = [ - "file://"^(List.fold_left Filename.concat (Coq_config.docdir) ["html";"stdlib";""]); + "file://"^(List.fold_left Filename.concat (Coq_config.docdir) ["stdlib";"html"]); Coq_config.wwwstdlib ] in combo -- cgit v1.2.3 From 30f222b1aad7ec483902b74dfa7dad7aefd5fca3 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Thu, 10 Nov 2016 13:24:28 +0100 Subject: Do not mention "none" in warnings doc, as it is there for compatibility. --- doc/refman/RefMan-oth.tex | 22 +++++++++++----------- toplevel/usage.ml | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/refman/RefMan-oth.tex b/doc/refman/RefMan-oth.tex index 3a9db5ead2..56ce753cd6 100644 --- a/doc/refman/RefMan-oth.tex +++ b/doc/refman/RefMan-oth.tex @@ -914,18 +914,18 @@ This command turns off the normal displaying. \subsection[\tt Unset Silent.]{\tt Unset Silent.\optindex{Silent}} This command turns the normal display on. -\subsection[\tt Set Warnings (\nterm{all}|\nterm{none}|\nterm{w}$_1$,\ldots,% - \nterm{w}$_n$).]{{\tt Set Warnings (\nterm{all}|\nterm{none}|\nterm{w}$_1$,\ldots,% - \nterm{w}$_n$)}.\optindex{Warnings}} +\subsection[\tt Set Warnings ``(\nterm{w}$_1$,\ldots,% + \nterm{w}$_n$)''.]{{\tt Set Warnings ``(\nterm{w}$_1$,\ldots,% + \nterm{w}$_n$)''}.\optindex{Warnings}} \label{SetWarnings} -This command configures the display of warnings. It is experimental, and expects -\texttt{all}, \texttt{none} or a comma-separated list of warning names or -categories. Adding~\texttt{-} in front of a warning disables it, -adding~\texttt{+} makes it an error. It is possible to use the special categories -\texttt{all} and \texttt{default}, the latter containing the warnings enabled by -default. The flags are interpreted from left to right, so in case of an overlap, -the flags on the right have higher priority, meaning that \texttt{A,-A} is -equivalent to \texttt{-A}. +This command configures the display of warnings. It is experimental, and +expects, between quotes, a comma-separated list of warning names or +categories. Adding~\texttt{-} in front of a warning or category disables it, +adding~\texttt{+} makes it an error. It is possible to use the special +categories \texttt{all} and \texttt{default}, the latter containing the warnings +enabled by default. The flags are interpreted from left to right, so in case of +an overlap, the flags on the right have higher priority, meaning that +\texttt{A,-A} is equivalent to \texttt{-A}. \subsection[\tt Set Search Output Name Only.]{\tt Set Search Output Name Only.\optindex{Search Output Name Only} \label{Search-Output-Name-Only} diff --git a/toplevel/usage.ml b/toplevel/usage.ml index 2bde1dc46b..956a402617 100644 --- a/toplevel/usage.ml +++ b/toplevel/usage.ml @@ -61,8 +61,8 @@ let print_usage_channel co command = \n -v print Coq version and exit\ \n -list-tags print highlight color tags known by Coq and exit\ \n\ -\n -quiet unset display of extra information (implies -w none)\ -\n -w (all|none|w1,..,wn) configure display of warnings\ +\n -quiet unset display of extra information (implies -w \"-all\")\ +\n -w (w1,..,wn) configure display of warnings\ \n -color (yes|no|auto) configure color output\ \n\ \n -q skip loading of rcfile\ -- cgit v1.2.3 From 8fe6da32544ee73201f7c64b3dd45afb56c75b71 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Thu, 10 Nov 2016 13:24:54 +0100 Subject: Fix bug in warnings: -w foo was silent when foo did not exist. --- lib/cWarnings.ml | 14 ++++++++++---- toplevel/coqtop.ml | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/cWarnings.ml b/lib/cWarnings.ml index 1a1944d61f..cc2463e224 100644 --- a/lib/cWarnings.ml +++ b/lib/cWarnings.ml @@ -35,6 +35,10 @@ let add_warning_in_category ~name ~category = in Hashtbl.replace categories category (name::ws) +let refine_loc = function + | None when not (Loc.is_ghost !current_loc) -> Some !current_loc + | loc -> loc + let create ~name ~category ?(default=Enabled) pp = Hashtbl.add warnings name { default; category; status = default }; add_warning_in_category ~name ~category; @@ -44,15 +48,17 @@ let create ~name ~category ?(default=Enabled) pp = match w.status with | Disabled -> () | AsError -> - let loc = Option.default !current_loc loc in - CErrors.user_err_loc (loc,"_",pp x) + begin match refine_loc loc with + | Some loc -> CErrors.user_err_loc (loc,"_",pp x) + | None -> CErrors.errorlabstrm "_" (pp x) + end | Enabled -> let msg = pp x ++ spc () ++ str "[" ++ str name ++ str "," ++ str category ++ str "]" in - let loc = Option.default !current_loc loc in - Feedback.msg_warning ~loc msg + let loc = refine_loc loc in + Feedback.msg_warning ?loc msg let warn_unknown_warning = create ~name:"unknown-warning" ~category:"toplevel" diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml index 5ae1c36ed8..d9f8ed8815 100644 --- a/toplevel/coqtop.ml +++ b/toplevel/coqtop.ml @@ -524,7 +524,7 @@ let parse_args arglist = |"-control-channel" -> Spawned.control_channel := get_host_port opt (next()) |"-vio2vo" -> add_compile false (next ()); Flags.compilation_mode := Vio2Vo |"-toploop" -> set_toploop (next ()) - |"-w" | "-W" -> CWarnings.set_flags (next ()) + |"-w" | "-W" -> CWarnings.set_flags (CWarnings.normalize_flags_string (next ())) |"-o" -> Flags.compilation_output_name := Some (next()) (* Options with zero arg *) -- cgit v1.2.3 From 5c78ca4d8fcaa37ab72d91b408223f683c1a48ac Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Mon, 14 Nov 2016 13:57:21 +0100 Subject: Remove the list of bug fixes from CHANGES. We could not produce an exhaustive list of such fixes, and the usefulness of such a list is not clear. --- CHANGES | 126 ++++------------------------------------------------------------ 1 file changed, 6 insertions(+), 120 deletions(-) diff --git a/CHANGES b/CHANGES index 5f4b36151b..c08d782b75 100644 --- a/CHANGES +++ b/CHANGES @@ -70,7 +70,10 @@ Tactics for the new flags match, fix and cofix. - The ssreflect subterm selection algorithm is now accessible to tactic writers through the ssrmatching plugin. - +- When used as an argument of an ltac function, "auto" without "with" + nor "using" clause now correctly uses only the core hint database by + default. + Hints - Revised the syntax of [Hint Cut] to follow standard notation for regexps. @@ -119,125 +122,8 @@ Tools Verbose Compat vernacular, since these warnings can now be silenced or turned into errors using "-w". -Bugfixes - -- #2498: Coqide navigation preferences delayed effect -- #3035: Avoiding trailing arguments in the Arguments command -- #3070: fixing "subst" in the presence of a chain of dependencies. -- #3317: spurious type error with primitive projections. -- #3441: Use pf_get_type_of to avoid blowup -- #3450: [End foo.] is slower in trunk in some cases. -- #3683: add references to the web site for the bug tracker -- #3753: anomaly with implicit arguments and renamings -- #3849: hyp_list passing isn't transitive -- #3920: eapply masks an hypothesis name. -- #3957: ML Tactic Extension failure -- #4058: STM: if_verbose on "Checking task ..." -- #4095: constr forces typeclass resolution that it did not previously force -- #4368: CoqIDE: Errors are sticky -- #4421: Messages dialog in Coqide resets. -- #4437: CoqIDE doesn't preserve unix encoding under windows -- #4464: "Anomaly: variable H' unbound. Please report.". -- #4471: [generalize dependent] permits ill-typed terms in trunk. -- #4479: "Error: Rewriting base foo does not exist." should be catchable. -- #4527: when typechecking the statement of a lemma using universe polymorphic - definitions with explicit universe binders, check that the type can indeed be - typechecked using only those universes (after minimization of the other, - flexible universes), or raise an error (fixed scripts can be made forward - compatible). -- #4553: CoqIDE gives warnings about deprecated GTK features. -- #4592, #4932: notations sharing recursive patterns or sharing -- #4592, #4932: notations sharing recursive patterns or sharing - binders made more robust. -- #4595: making notations containing "ltac:" unused for printing. -- #4609: document an option governing the generation of equalities -- #4610: Fails to build with camlp4 since the TACTIC EXTEND move. -- #4622: [injection] on an equality between records with primitive projections - generates a match with invalid information -- #4661: Cannot mask the absolute name. -- #4679: weakened setoid_rewrite unification -- #4723: "Obligations: Cannot infer this placeholder of type" -- #4724: get_host_port error message -- #4726: treat user-provided sorts of universe polymorphic records as rigid - (i.e. non-minimizable). -- #4750: Change format of inconsistent assumptions message. -- #4756: STM: nested Abort is like nested Qed -- #4763, #4955: regressions in unification -- #4764: Syntactic notation externalization breaks. -- #4768: CoqIDE much slower than coqc -quick -- #4780: Induction with universe polymorphism on was creating ill-typed terms. -- #4784: [Set Printing Width] to >= 114 causes (some?) syntax errors to print in - the wrong location, confusing emacs mode -- #4785: use [ ] for vector nil -- #4787: Unset Bracketing Last Introduction Pattern not working. -- #4793: Coq 8.6 should accept -compat 8.6 -- #4798: compat notations should not modify the parser. -- #4816: Global universes and constraints should not depend on local ones -- #4825: [clear] should not dependency-check hypotheses that come above it. -- #4828: "make" broken on Widows -- #4836: Anomaly: Uncaught exception Invalid_argument. -- #4842: Time prints in multiple lines -- #4854: Notations with binders -- #4864: Argument : assert does fail if no arg is given -- #4865: deciding on which arguments to recompute scopes was not robust. -- #4869, allow Prop, Set, and level names in constraints. -- #4873: transparency option not used. -- #4893: not_evar: unexpected failure. -- #4904: [Import] does not load intermediately unqualified names of aliases. -- #4906: regression in printing an error message. -- #4914: LtacProf printout has too many newlines. -- #4919: Warning: Unused local entry "move_location" -- #4923: Warning: appcontext is deprecated. -- #4924: CoqIDE should have an option to use Unix-style newlines on Windows -- #4932: anomaly when using binders as terms in recursive notations. -- #4939: LtacProf prints tactic notations weirdly. -- #4940: Tactic notation printing could be more informative. -- #4941: ~/.coqrc file confusing locations -- #4958: [debug auto] should specify hint databases. -- #4964: Severe inefficiency with evars -- #4968: STM: sideff: report safe_id correctly -- #4978: priorities of Equivalence instances -- #5003: more careful generalisation of dependent terms. -- #5005: micromega tactics is now robust to failure of 'abstract'. -- #5011: Anomaly on [Existing Class]. -- #5023: JSON extraction doesn't generate "for xxx". -- #5029: anomaly on user-inputted projection name. -- #5036: autorewrite, sections and universes -- #5045: [generalize] creates ill-typed terms in 8.6. -- #5048: Casts in pattern raise an anomaly in Constrintern. -- #5051: Large outputs are garbled. -- #5061: Warnings flag has no discernible value -- #5066: Anomaly: cannot find Coq.Logic.JMeq.JMeq. -- #5069: Scheme Equality gives anomalies in sections. -- #5073: regression of micromega plugin -- #5078: wrong detection of evaluable local hypotheses. -- #5079: LtacProf: fix reset_profile -- #5080: LtacProf: "Show Ltac Profile CutOff $N" -- #5087: Improve the error message on record with duplicated fields. -- #5090: Effect of -Q depends on coqtop's current directory. -- #5093: typeclasses eauto depth arg does not accept a var. -- #5096: [vm_compute] is exponentially slower than [native_compute]. -- #5098: Symmetry broken in HoTT. -- #5102: "Illegal begin of vernac" on bullets -- #5116: [Print Ltac] should be able to print strategies. -- #5125: Bad error message when attempting to use where with Class. -- #5133: error reporting delayed. -- #5136: Stopping warning on unrecognized unicode character in notation. -- #5139: Anomalies should not be caught by || / try. -- #5141: Bogus message "Error: Cannot infer type of pattern-matching". -- #5145: Anomaly: index to an anonymous variable. -- #5149: [subst] breaks evars -- #5161: case of a notation with unability to detect a recursive binder. -- #5164: regression in locating error in argument of "refine". -- #5181: [Arguments] no longer correctly checks the length of arguments lists -- #5182: "Arguments names must be distinct." is bogus and underinformative -- Qcanon : fix names of lemmas Qcle_alt & Qcge_alt (were Qle_alt & Qge_alt) -- When used as an argument of an ltac function, "auto" without "with" - nor "using" clause now correctly uses only the core hint database by - default. - -Some other fixes, minor changes and documentation improvements are not -mentionned here. +Many bug fixes, minor changes and documentation improvements are not mentioned +here. Changes from V8.5pl2 to V8.5pl3 =============================== -- cgit v1.2.3 From 36fd5ebe558b8a51c2929077bde9f0460c4313c3 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Mon, 14 Nov 2016 14:08:31 +0100 Subject: Set version number to 8.6beta1. --- INSTALL | 4 ++-- configure.ml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/INSTALL b/INSTALL index 5a300010d7..df9e855274 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,5 @@ - INSTALLATION PROCEDURES FOR THE COQ V8.5 SYSTEM + INSTALLATION PROCEDURES FOR THE COQ V8.6 SYSTEM ----------------------------------------------- @@ -27,7 +27,7 @@ WHAT DO YOU NEED ? port install coq - To compile Coq V8.5 yourself, you need: + To compile Coq V8.6 yourself, you need: - Objective Caml version 4.01.0 or later (available at http://caml.inria.fr/) diff --git a/configure.ml b/configure.ml index 507fd351a7..b97bf9a71b 100644 --- a/configure.ml +++ b/configure.ml @@ -11,11 +11,11 @@ #load "str.cma" open Printf -let coq_version = "8.6.0" -let coq_macos_version = "8.4.90" (** "[...] should be a string comprised of +let coq_version = "8.6beta1" +let coq_macos_version = "8.5.90" (** "[...] should be a string comprised of three non-negative, period-separated integers [...]" *) -let vo_magic = 8511 -let state_magic = 58511 +let vo_magic = 8591 +let state_magic = 58591 let distributed_exec = ["coqtop";"coqc";"coqchk";"coqdoc";"coqmktop";"coqworkmgr"; "coqdoc";"coq_makefile";"coq-tex";"gallina";"coqwc";"csdpcert";"coqdep"] -- cgit v1.2.3 From dfefd12ee432e5b0d145934e74bb939ddecfa522 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Mon, 14 Nov 2016 14:09:08 +0100 Subject: Remove README.win until we come up with new instructions. The recommended way to install Coq under windows is anyway to use the precompiled installer. --- README.win | 44 -------------------------------------- dev/build/windows/makecoq_mingw.sh | 1 - 2 files changed, 45 deletions(-) delete mode 100644 README.win diff --git a/README.win b/README.win deleted file mode 100644 index 8302a707f6..0000000000 --- a/README.win +++ /dev/null @@ -1,44 +0,0 @@ -THE COQ V8 SYSTEM -================= - - This file contains remarks specific to the windows port of Coq. - -INSTALLATION. -============= - - The Coq package for Windows comes with an auto-installer. It will -install Coq binaries and libraries under any directory you specify -(C:\Coq is the default path). It also creates shortcuts -in the Windows menus. Binaries, like coqc.exe, -are in the bin sub-directory of the installation -(C:\Coq\bin by default). - -COMPILATION. -============ - - If you want to install coq, you had better transfer the precompiled - distribution. If you really need to recompile under Windows, here - are some indications: - - 1- Install cygwin and the wget package - See: http://cygwin.com - - 2- Download and unzip in C:\ the SDK for windows - See: https://coq.inria.fr/distrib/current/files/ - - 3- From the cygwin prompt type - - . /cygdrive/c/CoqSDK-85-1/environ - - The first time the script installs the C toolchain. - - 4- Then Coq can be compiled as follows: - - ./configure -local - make - - 5- To build the installer, type: - - dev/make-installer-win32.sh - - The Coq Team. diff --git a/dev/build/windows/makecoq_mingw.sh b/dev/build/windows/makecoq_mingw.sh index bfc7ce4dd1..52b158871b 100644 --- a/dev/build/windows/makecoq_mingw.sh +++ b/dev/build/windows/makecoq_mingw.sh @@ -1029,7 +1029,6 @@ function copy_coq_license { install -D plugins/micromega/LICENSE.sos $PREFIXCOQ/license_readme/coq/LicenseMicromega.txt install -D README $PREFIXCOQ/license_readme/coq/ReadMe.txt || true install -D README.md $PREFIXCOQ/license_readme/coq/ReadMe.md || true - install -D README.win $PREFIXCOQ/license_readme/coq/ReadMeWindows.txt install -D README.doc $PREFIXCOQ/license_readme/coq/ReadMeDoc.txt install -D CHANGES $PREFIXCOQ/license_readme/coq/Changes.txt install -D INSTALL $PREFIXCOQ/license_readme/coq/Install.txt -- cgit v1.2.3 From 4b8f19c58a2b6cc841db2c011d23aa8106211fd6 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Tue, 15 Nov 2016 13:53:57 +0100 Subject: Revert part of a477dc, disallow_shelved In only_classes mode we do not try to implement a stricter semantics for shelved goals in 8.6. Leaving this for 8.7. Update the documentation as well. Remove a spurious printf call as well. Fix test-suite now that shelved goals are allowed --- doc/refman/Classes.tex | 13 ++++++------- tactics/class_tactics.ml | 24 +----------------------- test-suite/bugs/closed/3513.v | 3 ++- test-suite/bugs/closed/4095.v | 4 ++-- test-suite/success/Typeclasses.v | 2 +- test-suite/success/bteauto.v | 6 +++--- 6 files changed, 15 insertions(+), 37 deletions(-) diff --git a/doc/refman/Classes.tex b/doc/refman/Classes.tex index 58ae7191f8..7c4bd4d201 100644 --- a/doc/refman/Classes.tex +++ b/doc/refman/Classes.tex @@ -392,13 +392,12 @@ than {\tt eauto} and {\tt auto}. The main differences are the following: backtracking on subgoals that are entirely independent. \item When called with no arguments, {\tt typeclasses eauto} uses the {\tt typeclass\_instances} database by default (instead of {\tt core}) - and will try to solve \emph{only} typeclass goals. If some subgoal of - a hint/instance is non-dependent and not of class type, that hint - application will fail. Dependent subgoals are automatically shelved - and \emph{must be} resolved entirely when the other typeclass subgoals - are resolved or the proof search will fail \emph{globally}, - \emph{without} the possibility to find another complete solution with - no shelved subgoals. + and will try to solve \emph{only} typeclass goals, shelving the other + goals. If some subgoal of a hint/instance is non-dependent and not of + class type, the hint application will fail when faced with that + subgoal. Dependent subgoals are automatically shelved, and shelved + goals can remain after resolution ends (following the behavior of + \Coq{} 8.5). \emph{Note: } As of Coq 8.6, {\tt all:once (typeclasses eauto)} faithfully mimicks what happens during typeclass resolution when it is diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 262b308932..99a1a98993 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -1176,7 +1176,7 @@ module Search = struct (fun e' -> if CErrors.noncritical (fst e') then (pr_error e'; aux (merge_exceptions e e') tl) - else (Printf.printf "raising again\n%!"; iraise e')) + else iraise e') and aux e = function | x :: xs -> onetac e x xs | [] -> @@ -1274,27 +1274,6 @@ module Search = struct | (e,ie) -> Proofview.tclZERO ~info:ie e) in aux 1 - let disallow_shelved initshelf tac = - let open Proofview in - let casefn = function - | Fail (e,info) -> tclZERO ~info e - | Next ((shelved, result), k) -> - if not (List.is_empty shelved) then - begin - Proofview.tclEVARMAP >>= fun sigma -> - let gls = prlist_with_sep spc (pr_ev sigma) shelved in - (if !typeclasses_debug > 0 then - let initgls = prlist_with_sep spc (pr_ev sigma) initshelf in - Feedback.msg_debug (str"Non-empty shelf at end of resolution:" ++ gls - ++ str" initially: " ++ initgls ++ str".")); - Tacticals.New.tclZEROMSG (str"Proof search failed: " ++ - str"shelved goals remain: " ++ gls) - end - else - tclOR (tclUNIT result) (fun e -> k e >>= fun (gls, result) -> tclUNIT result) - in - tclCASE (with_shelf tac) >>= casefn - let eauto_tac ?(st=full_transparent_state) ?(unique=false) ~only_classes ?strategy ~depth ~dep hints = let open Proofview in @@ -1342,7 +1321,6 @@ module Search = struct str " in regular mode" ++ match depth with None -> str ", unbounded" | Some i -> str ", with depth limit " ++ int i)); - let tac = if only_classes then disallow_shelved initshelf tac else tac in tac let run_on_evars p evm tac = diff --git a/test-suite/bugs/closed/3513.v b/test-suite/bugs/closed/3513.v index ff515038ec..9ed0926a66 100644 --- a/test-suite/bugs/closed/3513.v +++ b/test-suite/bugs/closed/3513.v @@ -89,5 +89,6 @@ Debug: 2.2.1.1.1.1: apply ILFun_ILogic on (ILogic OPred) Show Existentials. Set Typeclasses Debug Verbosity 2. Set Printing All. - Fail apply reflexivity. + (* As in 8.5, allow a shelved subgoal to remain *) + apply reflexivity. \ No newline at end of file diff --git a/test-suite/bugs/closed/4095.v b/test-suite/bugs/closed/4095.v index 83d4ed69d4..ffd33d3813 100644 --- a/test-suite/bugs/closed/4095.v +++ b/test-suite/bugs/closed/4095.v @@ -1,10 +1,10 @@ (* File reduced by coq-bug-finder from original input, then from 5752 lines to 3828 lines, then from 2707 lines to 558 lines, then from 472 lines to 168 lines, then from 110 lines to 101 lines, then from 96 lines to 77 lines, then from 80 lines to 64 lines, then from 92 lines to 79 lines *) (* coqc version 8.5beta1 (February 2015) compiled on Feb 23 2015 18:32:3 with OCaml 4.01.0 coqtop version cagnode15:/afs/csail.mit.edu/u/j/jgross/coq-8.5,v8.5 (ebfc19d792492417b129063fb511aa423e9d9e08) *) -Require Import TestSuite.admit. Require Import Coq.Setoids.Setoid. Generalizable All Variables. Axiom admit : forall {T}, T. +Ltac admit := apply admit. Class Equiv (A : Type) := equiv : relation A. Class type (A : Type) {e : Equiv A} := eq_equiv : Equivalence equiv. Class ILogicOps Frm := { lentails: relation Frm; @@ -71,7 +71,7 @@ Goal forall (T : Type) (O0 : T -> OPred) (O1 : T -> PointedOPred) refine (P _ _) end. Undo. - lazymatch goal with + Fail lazymatch goal with | |- ?R (?f ?a ?b) (?f ?a' ?b') => let P := constr:(fun H H' => Morphisms.proper_prf a a' H b b' H') in set(p:=P) diff --git a/test-suite/success/Typeclasses.v b/test-suite/success/Typeclasses.v index 6885717ec5..5557ba8379 100644 --- a/test-suite/success/Typeclasses.v +++ b/test-suite/success/Typeclasses.v @@ -6,7 +6,7 @@ Module onlyclasses. Goal Foo * Foo. split. shelve. Set Typeclasses Debug. - Fail typeclasses eauto. + Fail (unshelve typeclasses eauto); fail. typeclasses eauto with typeclass_instances. Unshelve. typeclasses eauto with typeclass_instances. Qed. diff --git a/test-suite/success/bteauto.v b/test-suite/success/bteauto.v index 3178c6fc15..0af367781a 100644 --- a/test-suite/success/bteauto.v +++ b/test-suite/success/bteauto.v @@ -24,9 +24,9 @@ Module Backtracking. Fail all:((once (typeclasses eauto with typeclass_instances)) + apply eq_refl). (* Does backtrack if other goals fail *) - all:[> typeclasses eauto + reflexivity .. ]. + all:[> (unshelve typeclasses eauto; fail) + reflexivity .. ]. Undo 1. - all:(typeclasses eauto + reflexivity). (* Note "+" is a focussing combinator *) + all:((unshelve typeclasses eauto; fail) + reflexivity). (* Note "+" is a focussing combinator *) Show Proof. Qed. @@ -66,7 +66,7 @@ Module Backtracking. unshelve evar (t : A). all:cycle 1. refine (@ex_intro _ _ t _). all:cycle 1. - all:(typeclasses eauto + reflexivity). + all:((unshelve typeclasses eauto; fail) + reflexivity). Qed. End Leivant. End Backtracking. -- cgit v1.2.3 From 1053c873bdaedf37c1fd35be4e7021bfc806c23d Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Wed, 16 Nov 2016 11:17:39 +0100 Subject: [doc] Mention XML protocol on changes. It may be worth it, also added a note about file reorganization. --- CHANGES | 5 +++++ dev/doc/changes.txt | 2 ++ 2 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index c08d782b75..984e91946b 100644 --- a/CHANGES +++ b/CHANGES @@ -104,6 +104,7 @@ Notations - "Bind Scope" can once again bind "Funclass" and "Sortclass". General infrastructure + - New configurable warning system which can be controlled with the vernacular command "Set Warnings", or, under coqc/coqtop, with the flag "-w". In particular, the default is now that warnings are printed by coqc. @@ -122,6 +123,10 @@ Tools Verbose Compat vernacular, since these warnings can now be silenced or turned into errors using "-w". +XML protocol + +- message format has changed, see dev/doc/changes.txt for more details. + Many bug fixes, minor changes and documentation improvements are not mentioned here. diff --git a/dev/doc/changes.txt b/dev/doc/changes.txt index 79a0c6312a..d052468f99 100644 --- a/dev/doc/changes.txt +++ b/dev/doc/changes.txt @@ -14,6 +14,8 @@ kernel/closure.ml{,i} -> kernel/cClosure.ml{,i} lib/errors.ml{,i} -> lib/cErrors.ml{,i} toplevel/cerror.ml{,i} -> toplevel/explainErr.mli{,i} +All IDE-specific files, including the XML protocol have been moved to ide/ + ** Reduction functions ** In closure.ml, we introduced the more precise reduction flags fMATCH, fFIX, -- cgit v1.2.3 From 968c8cad1c67bdf2f06d9bb12ed89c47a0ef0074 Mon Sep 17 00:00:00 2001 From: Yann Régis-Gianas Date: Wed, 16 Nov 2016 14:54:54 +0100 Subject: lib/Unicodetable: Update. This code has been generated from the latest Unicode tables using UUCD, an OCaml library to parse the official Unicode tables. --- lib/unicodetable.ml | 5552 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 5180 insertions(+), 372 deletions(-) diff --git a/lib/unicodetable.ml b/lib/unicodetable.ml index f4e978d695..b607058c64 100644 --- a/lib/unicodetable.ml +++ b/lib/unicodetable.ml @@ -1,5 +1,4 @@ - -(** Unicode tables generated from Camomile. *) +(** Unicode tables generated using UUCD. *) (* Letter, Uppercase *) let lu = [ @@ -139,12 +138,25 @@ let lu = [ (0x0022E,0x0022E); (0x00230,0x00230); (0x00232,0x00232); + (0x0023A,0x0023B); + (0x0023D,0x0023E); + (0x00241,0x00241); + (0x00243,0x00246); + (0x00248,0x00248); + (0x0024A,0x0024A); + (0x0024C,0x0024C); + (0x0024E,0x0024E); + (0x00370,0x00370); + (0x00372,0x00372); + (0x00376,0x00376); + (0x0037F,0x0037F); (0x00386,0x00386); (0x00388,0x0038A); (0x0038C,0x0038C); (0x0038E,0x0038F); (0x00391,0x003A1); (0x003A3,0x003AB); + (0x003CF,0x003CF); (0x003D2,0x003D4); (0x003D8,0x003D8); (0x003DA,0x003DA); @@ -159,7 +171,9 @@ let lu = [ (0x003EC,0x003EC); (0x003EE,0x003EE); (0x003F4,0x003F4); - (0x00400,0x0042F); + (0x003F7,0x003F7); + (0x003F9,0x003FA); + (0x003FD,0x0042F); (0x00460,0x00460); (0x00462,0x00462); (0x00464,0x00464); @@ -230,7 +244,11 @@ let lu = [ (0x004F0,0x004F0); (0x004F2,0x004F2); (0x004F4,0x004F4); + (0x004F6,0x004F6); (0x004F8,0x004F8); + (0x004FA,0x004FA); + (0x004FC,0x004FC); + (0x004FE,0x004FE); (0x00500,0x00500); (0x00502,0x00502); (0x00504,0x00504); @@ -239,8 +257,27 @@ let lu = [ (0x0050A,0x0050A); (0x0050C,0x0050C); (0x0050E,0x0050E); + (0x00510,0x00510); + (0x00512,0x00512); + (0x00514,0x00514); + (0x00516,0x00516); + (0x00518,0x00518); + (0x0051A,0x0051A); + (0x0051C,0x0051C); + (0x0051E,0x0051E); + (0x00520,0x00520); + (0x00522,0x00522); + (0x00524,0x00524); + (0x00526,0x00526); + (0x00528,0x00528); + (0x0052A,0x0052A); + (0x0052C,0x0052C); + (0x0052E,0x0052E); (0x00531,0x00556); (0x010A0,0x010C5); + (0x010C7,0x010C7); + (0x010CD,0x010CD); + (0x013A0,0x013F5); (0x01E00,0x01E00); (0x01E02,0x01E02); (0x01E04,0x01E04); @@ -316,6 +353,7 @@ let lu = [ (0x01E90,0x01E90); (0x01E92,0x01E92); (0x01E94,0x01E94); + (0x01E9E,0x01E9E); (0x01EA0,0x01EA0); (0x01EA2,0x01EA2); (0x01EA4,0x01EA4); @@ -361,6 +399,9 @@ let lu = [ (0x01EF4,0x01EF4); (0x01EF6,0x01EF6); (0x01EF8,0x01EF8); + (0x01EFA,0x01EFA); + (0x01EFC,0x01EFC); + (0x01EFE,0x01EFE); (0x01F08,0x01F0F); (0x01F18,0x01F1D); (0x01F28,0x01F2F); @@ -386,12 +427,176 @@ let lu = [ (0x02126,0x02126); (0x02128,0x02128); (0x0212A,0x0212D); - (0x02130,0x02131); - (0x02133,0x02133); + (0x02130,0x02133); (0x0213E,0x0213F); (0x02145,0x02145); + (0x02183,0x02183); + (0x02C00,0x02C2E); + (0x02C60,0x02C60); + (0x02C62,0x02C64); + (0x02C67,0x02C67); + (0x02C69,0x02C69); + (0x02C6B,0x02C6B); + (0x02C6D,0x02C70); + (0x02C72,0x02C72); + (0x02C75,0x02C75); + (0x02C7E,0x02C80); + (0x02C82,0x02C82); + (0x02C84,0x02C84); + (0x02C86,0x02C86); + (0x02C88,0x02C88); + (0x02C8A,0x02C8A); + (0x02C8C,0x02C8C); + (0x02C8E,0x02C8E); + (0x02C90,0x02C90); + (0x02C92,0x02C92); + (0x02C94,0x02C94); + (0x02C96,0x02C96); + (0x02C98,0x02C98); + (0x02C9A,0x02C9A); + (0x02C9C,0x02C9C); + (0x02C9E,0x02C9E); + (0x02CA0,0x02CA0); + (0x02CA2,0x02CA2); + (0x02CA4,0x02CA4); + (0x02CA6,0x02CA6); + (0x02CA8,0x02CA8); + (0x02CAA,0x02CAA); + (0x02CAC,0x02CAC); + (0x02CAE,0x02CAE); + (0x02CB0,0x02CB0); + (0x02CB2,0x02CB2); + (0x02CB4,0x02CB4); + (0x02CB6,0x02CB6); + (0x02CB8,0x02CB8); + (0x02CBA,0x02CBA); + (0x02CBC,0x02CBC); + (0x02CBE,0x02CBE); + (0x02CC0,0x02CC0); + (0x02CC2,0x02CC2); + (0x02CC4,0x02CC4); + (0x02CC6,0x02CC6); + (0x02CC8,0x02CC8); + (0x02CCA,0x02CCA); + (0x02CCC,0x02CCC); + (0x02CCE,0x02CCE); + (0x02CD0,0x02CD0); + (0x02CD2,0x02CD2); + (0x02CD4,0x02CD4); + (0x02CD6,0x02CD6); + (0x02CD8,0x02CD8); + (0x02CDA,0x02CDA); + (0x02CDC,0x02CDC); + (0x02CDE,0x02CDE); + (0x02CE0,0x02CE0); + (0x02CE2,0x02CE2); + (0x02CEB,0x02CEB); + (0x02CED,0x02CED); + (0x02CF2,0x02CF2); + (0x0A640,0x0A640); + (0x0A642,0x0A642); + (0x0A644,0x0A644); + (0x0A646,0x0A646); + (0x0A648,0x0A648); + (0x0A64A,0x0A64A); + (0x0A64C,0x0A64C); + (0x0A64E,0x0A64E); + (0x0A650,0x0A650); + (0x0A652,0x0A652); + (0x0A654,0x0A654); + (0x0A656,0x0A656); + (0x0A658,0x0A658); + (0x0A65A,0x0A65A); + (0x0A65C,0x0A65C); + (0x0A65E,0x0A65E); + (0x0A660,0x0A660); + (0x0A662,0x0A662); + (0x0A664,0x0A664); + (0x0A666,0x0A666); + (0x0A668,0x0A668); + (0x0A66A,0x0A66A); + (0x0A66C,0x0A66C); + (0x0A680,0x0A680); + (0x0A682,0x0A682); + (0x0A684,0x0A684); + (0x0A686,0x0A686); + (0x0A688,0x0A688); + (0x0A68A,0x0A68A); + (0x0A68C,0x0A68C); + (0x0A68E,0x0A68E); + (0x0A690,0x0A690); + (0x0A692,0x0A692); + (0x0A694,0x0A694); + (0x0A696,0x0A696); + (0x0A698,0x0A698); + (0x0A69A,0x0A69A); + (0x0A722,0x0A722); + (0x0A724,0x0A724); + (0x0A726,0x0A726); + (0x0A728,0x0A728); + (0x0A72A,0x0A72A); + (0x0A72C,0x0A72C); + (0x0A72E,0x0A72E); + (0x0A732,0x0A732); + (0x0A734,0x0A734); + (0x0A736,0x0A736); + (0x0A738,0x0A738); + (0x0A73A,0x0A73A); + (0x0A73C,0x0A73C); + (0x0A73E,0x0A73E); + (0x0A740,0x0A740); + (0x0A742,0x0A742); + (0x0A744,0x0A744); + (0x0A746,0x0A746); + (0x0A748,0x0A748); + (0x0A74A,0x0A74A); + (0x0A74C,0x0A74C); + (0x0A74E,0x0A74E); + (0x0A750,0x0A750); + (0x0A752,0x0A752); + (0x0A754,0x0A754); + (0x0A756,0x0A756); + (0x0A758,0x0A758); + (0x0A75A,0x0A75A); + (0x0A75C,0x0A75C); + (0x0A75E,0x0A75E); + (0x0A760,0x0A760); + (0x0A762,0x0A762); + (0x0A764,0x0A764); + (0x0A766,0x0A766); + (0x0A768,0x0A768); + (0x0A76A,0x0A76A); + (0x0A76C,0x0A76C); + (0x0A76E,0x0A76E); + (0x0A779,0x0A779); + (0x0A77B,0x0A77B); + (0x0A77D,0x0A77E); + (0x0A780,0x0A780); + (0x0A782,0x0A782); + (0x0A784,0x0A784); + (0x0A786,0x0A786); + (0x0A78B,0x0A78B); + (0x0A78D,0x0A78D); + (0x0A790,0x0A790); + (0x0A792,0x0A792); + (0x0A796,0x0A796); + (0x0A798,0x0A798); + (0x0A79A,0x0A79A); + (0x0A79C,0x0A79C); + (0x0A79E,0x0A79E); + (0x0A7A0,0x0A7A0); + (0x0A7A2,0x0A7A2); + (0x0A7A4,0x0A7A4); + (0x0A7A6,0x0A7A6); + (0x0A7A8,0x0A7A8); + (0x0A7AA,0x0A7AE); + (0x0A7B0,0x0A7B4); + (0x0A7B6,0x0A7B6); (0x0FF21,0x0FF3A); - (0x10400,0x10425); + (0x10400,0x10427); + (0x104B0,0x104D3); + (0x10C80,0x10CB2); + (0x118A0,0x118BF); (0x1D400,0x1D419); (0x1D434,0x1D44D); (0x1D468,0x1D481); @@ -421,14 +626,13 @@ let lu = [ (0x1D6E2,0x1D6FA); (0x1D71C,0x1D734); (0x1D756,0x1D76E); - (0x1D790,0x1D7A8) + (0x1D790,0x1D7A8); + (0x1D7CA,0x1D7CA) ] (* Letter, Lowercase *) let ll = [ (0x00061,0x0007A); - (0x000AA,0x000AA); (0x000B5,0x000B5); - (0x000BA,0x000BA); (0x000DF,0x000F6); (0x000F8,0x000FF); (0x00101,0x00101); @@ -554,6 +758,7 @@ let ll = [ (0x0021B,0x0021B); (0x0021D,0x0021D); (0x0021F,0x0021F); + (0x00221,0x00221); (0x00223,0x00223); (0x00225,0x00225); (0x00227,0x00227); @@ -562,8 +767,20 @@ let ll = [ (0x0022D,0x0022D); (0x0022F,0x0022F); (0x00231,0x00231); - (0x00233,0x00233); - (0x00250,0x002AD); + (0x00233,0x00239); + (0x0023C,0x0023C); + (0x0023F,0x00240); + (0x00242,0x00242); + (0x00247,0x00247); + (0x00249,0x00249); + (0x0024B,0x0024B); + (0x0024D,0x0024D); + (0x0024F,0x00293); + (0x00295,0x002AF); + (0x00371,0x00371); + (0x00373,0x00373); + (0x00377,0x00377); + (0x0037B,0x0037D); (0x00390,0x00390); (0x003AC,0x003CE); (0x003D0,0x003D1); @@ -581,6 +798,8 @@ let ll = [ (0x003ED,0x003ED); (0x003EF,0x003F3); (0x003F5,0x003F5); + (0x003F8,0x003F8); + (0x003FB,0x003FC); (0x00430,0x0045F); (0x00461,0x00461); (0x00463,0x00463); @@ -632,7 +851,7 @@ let ll = [ (0x004C8,0x004C8); (0x004CA,0x004CA); (0x004CC,0x004CC); - (0x004CE,0x004CE); + (0x004CE,0x004CF); (0x004D1,0x004D1); (0x004D3,0x004D3); (0x004D5,0x004D5); @@ -652,7 +871,11 @@ let ll = [ (0x004F1,0x004F1); (0x004F3,0x004F3); (0x004F5,0x004F5); + (0x004F7,0x004F7); (0x004F9,0x004F9); + (0x004FB,0x004FB); + (0x004FD,0x004FD); + (0x004FF,0x004FF); (0x00501,0x00501); (0x00503,0x00503); (0x00505,0x00505); @@ -661,7 +884,28 @@ let ll = [ (0x0050B,0x0050B); (0x0050D,0x0050D); (0x0050F,0x0050F); + (0x00511,0x00511); + (0x00513,0x00513); + (0x00515,0x00515); + (0x00517,0x00517); + (0x00519,0x00519); + (0x0051B,0x0051B); + (0x0051D,0x0051D); + (0x0051F,0x0051F); + (0x00521,0x00521); + (0x00523,0x00523); + (0x00525,0x00525); + (0x00527,0x00527); + (0x00529,0x00529); + (0x0052B,0x0052B); + (0x0052D,0x0052D); + (0x0052F,0x0052F); (0x00561,0x00587); + (0x013F8,0x013FD); + (0x01C80,0x01C88); + (0x01D00,0x01D2B); + (0x01D6B,0x01D77); + (0x01D79,0x01D9A); (0x01E01,0x01E01); (0x01E03,0x01E03); (0x01E05,0x01E05); @@ -736,7 +980,8 @@ let ll = [ (0x01E8F,0x01E8F); (0x01E91,0x01E91); (0x01E93,0x01E93); - (0x01E95,0x01E9B); + (0x01E95,0x01E9D); + (0x01E9F,0x01E9F); (0x01EA1,0x01EA1); (0x01EA3,0x01EA3); (0x01EA5,0x01EA5); @@ -782,7 +1027,9 @@ let ll = [ (0x01EF5,0x01EF5); (0x01EF7,0x01EF7); (0x01EF9,0x01EF9); - (0x01F00,0x01F07); + (0x01EFB,0x01EFB); + (0x01EFD,0x01EFD); + (0x01EFF,0x01F07); (0x01F10,0x01F15); (0x01F20,0x01F27); (0x01F30,0x01F37); @@ -803,28 +1050,198 @@ let ll = [ (0x01FE0,0x01FE7); (0x01FF2,0x01FF4); (0x01FF6,0x01FF7); - (0x02071,0x02071); - (0x0207F,0x0207F); (0x0210A,0x0210A); (0x0210E,0x0210F); (0x02113,0x02113); (0x0212F,0x0212F); (0x02134,0x02134); (0x02139,0x02139); - (0x0213D,0x0213D); + (0x0213C,0x0213D); (0x02146,0x02149); + (0x0214E,0x0214E); + (0x02184,0x02184); + (0x02C30,0x02C5E); + (0x02C61,0x02C61); + (0x02C65,0x02C66); + (0x02C68,0x02C68); + (0x02C6A,0x02C6A); + (0x02C6C,0x02C6C); + (0x02C71,0x02C71); + (0x02C73,0x02C74); + (0x02C76,0x02C7B); + (0x02C81,0x02C81); + (0x02C83,0x02C83); + (0x02C85,0x02C85); + (0x02C87,0x02C87); + (0x02C89,0x02C89); + (0x02C8B,0x02C8B); + (0x02C8D,0x02C8D); + (0x02C8F,0x02C8F); + (0x02C91,0x02C91); + (0x02C93,0x02C93); + (0x02C95,0x02C95); + (0x02C97,0x02C97); + (0x02C99,0x02C99); + (0x02C9B,0x02C9B); + (0x02C9D,0x02C9D); + (0x02C9F,0x02C9F); + (0x02CA1,0x02CA1); + (0x02CA3,0x02CA3); + (0x02CA5,0x02CA5); + (0x02CA7,0x02CA7); + (0x02CA9,0x02CA9); + (0x02CAB,0x02CAB); + (0x02CAD,0x02CAD); + (0x02CAF,0x02CAF); + (0x02CB1,0x02CB1); + (0x02CB3,0x02CB3); + (0x02CB5,0x02CB5); + (0x02CB7,0x02CB7); + (0x02CB9,0x02CB9); + (0x02CBB,0x02CBB); + (0x02CBD,0x02CBD); + (0x02CBF,0x02CBF); + (0x02CC1,0x02CC1); + (0x02CC3,0x02CC3); + (0x02CC5,0x02CC5); + (0x02CC7,0x02CC7); + (0x02CC9,0x02CC9); + (0x02CCB,0x02CCB); + (0x02CCD,0x02CCD); + (0x02CCF,0x02CCF); + (0x02CD1,0x02CD1); + (0x02CD3,0x02CD3); + (0x02CD5,0x02CD5); + (0x02CD7,0x02CD7); + (0x02CD9,0x02CD9); + (0x02CDB,0x02CDB); + (0x02CDD,0x02CDD); + (0x02CDF,0x02CDF); + (0x02CE1,0x02CE1); + (0x02CE3,0x02CE4); + (0x02CEC,0x02CEC); + (0x02CEE,0x02CEE); + (0x02CF3,0x02CF3); + (0x02D00,0x02D25); + (0x02D27,0x02D27); + (0x02D2D,0x02D2D); + (0x0A641,0x0A641); + (0x0A643,0x0A643); + (0x0A645,0x0A645); + (0x0A647,0x0A647); + (0x0A649,0x0A649); + (0x0A64B,0x0A64B); + (0x0A64D,0x0A64D); + (0x0A64F,0x0A64F); + (0x0A651,0x0A651); + (0x0A653,0x0A653); + (0x0A655,0x0A655); + (0x0A657,0x0A657); + (0x0A659,0x0A659); + (0x0A65B,0x0A65B); + (0x0A65D,0x0A65D); + (0x0A65F,0x0A65F); + (0x0A661,0x0A661); + (0x0A663,0x0A663); + (0x0A665,0x0A665); + (0x0A667,0x0A667); + (0x0A669,0x0A669); + (0x0A66B,0x0A66B); + (0x0A66D,0x0A66D); + (0x0A681,0x0A681); + (0x0A683,0x0A683); + (0x0A685,0x0A685); + (0x0A687,0x0A687); + (0x0A689,0x0A689); + (0x0A68B,0x0A68B); + (0x0A68D,0x0A68D); + (0x0A68F,0x0A68F); + (0x0A691,0x0A691); + (0x0A693,0x0A693); + (0x0A695,0x0A695); + (0x0A697,0x0A697); + (0x0A699,0x0A699); + (0x0A69B,0x0A69B); + (0x0A723,0x0A723); + (0x0A725,0x0A725); + (0x0A727,0x0A727); + (0x0A729,0x0A729); + (0x0A72B,0x0A72B); + (0x0A72D,0x0A72D); + (0x0A72F,0x0A731); + (0x0A733,0x0A733); + (0x0A735,0x0A735); + (0x0A737,0x0A737); + (0x0A739,0x0A739); + (0x0A73B,0x0A73B); + (0x0A73D,0x0A73D); + (0x0A73F,0x0A73F); + (0x0A741,0x0A741); + (0x0A743,0x0A743); + (0x0A745,0x0A745); + (0x0A747,0x0A747); + (0x0A749,0x0A749); + (0x0A74B,0x0A74B); + (0x0A74D,0x0A74D); + (0x0A74F,0x0A74F); + (0x0A751,0x0A751); + (0x0A753,0x0A753); + (0x0A755,0x0A755); + (0x0A757,0x0A757); + (0x0A759,0x0A759); + (0x0A75B,0x0A75B); + (0x0A75D,0x0A75D); + (0x0A75F,0x0A75F); + (0x0A761,0x0A761); + (0x0A763,0x0A763); + (0x0A765,0x0A765); + (0x0A767,0x0A767); + (0x0A769,0x0A769); + (0x0A76B,0x0A76B); + (0x0A76D,0x0A76D); + (0x0A76F,0x0A76F); + (0x0A771,0x0A778); + (0x0A77A,0x0A77A); + (0x0A77C,0x0A77C); + (0x0A77F,0x0A77F); + (0x0A781,0x0A781); + (0x0A783,0x0A783); + (0x0A785,0x0A785); + (0x0A787,0x0A787); + (0x0A78C,0x0A78C); + (0x0A78E,0x0A78E); + (0x0A791,0x0A791); + (0x0A793,0x0A795); + (0x0A797,0x0A797); + (0x0A799,0x0A799); + (0x0A79B,0x0A79B); + (0x0A79D,0x0A79D); + (0x0A79F,0x0A79F); + (0x0A7A1,0x0A7A1); + (0x0A7A3,0x0A7A3); + (0x0A7A5,0x0A7A5); + (0x0A7A7,0x0A7A7); + (0x0A7A9,0x0A7A9); + (0x0A7B5,0x0A7B5); + (0x0A7B7,0x0A7B7); + (0x0A7FA,0x0A7FA); + (0x0AB30,0x0AB5A); + (0x0AB60,0x0AB65); + (0x0AB70,0x0ABBF); (0x0FB00,0x0FB06); (0x0FB13,0x0FB17); (0x0FF41,0x0FF5A); - (0x10428,0x1044D); + (0x10428,0x1044F); + (0x104D8,0x104FB); + (0x10CC0,0x10CF2); + (0x118C0,0x118DF); (0x1D41A,0x1D433); (0x1D44E,0x1D454); (0x1D456,0x1D467); (0x1D482,0x1D49B); (0x1D4B6,0x1D4B9); (0x1D4BB,0x1D4BB); - (0x1D4BD,0x1D4C0); - (0x1D4C2,0x1D4C3); + (0x1D4BD,0x1D4C3); (0x1D4C5,0x1D4CF); (0x1D4EA,0x1D503); (0x1D51E,0x1D537); @@ -834,7 +1251,7 @@ let ll = [ (0x1D5EE,0x1D607); (0x1D622,0x1D63B); (0x1D656,0x1D66F); - (0x1D68A,0x1D6A3); + (0x1D68A,0x1D6A5); (0x1D6C2,0x1D6DA); (0x1D6DC,0x1D6E1); (0x1D6FC,0x1D714); @@ -844,7 +1261,8 @@ let ll = [ (0x1D770,0x1D788); (0x1D78A,0x1D78F); (0x1D7AA,0x1D7C2); - (0x1D7C4,0x1D7C9) + (0x1D7C4,0x1D7C9); + (0x1D7CB,0x1D7CB) ] (* Letter, Titlecase *) let lt = [ @@ -856,21 +1274,19 @@ let lt = [ (0x01F98,0x01F9F); (0x01FA8,0x01FAF); (0x01FBC,0x01FBC); - (0x01FCC,0x01FCC); - (0x01FFC,0x01FFC) + (0x01FCC,0x01FCC) ] (* Mark, Non-Spacing *) let mn = [ - (0x00300,0x0034F); - (0x00360,0x0036F); - (0x00483,0x00486); - (0x00591,0x005A1); - (0x005A3,0x005B9); - (0x005BB,0x005BD); + (0x00300,0x0036F); + (0x00483,0x00487); + (0x00591,0x005BD); (0x005BF,0x005BF); (0x005C1,0x005C2); - (0x005C4,0x005C4); - (0x0064B,0x00655); + (0x005C4,0x005C5); + (0x005C7,0x005C7); + (0x00610,0x0061A); + (0x0064B,0x0065F); (0x00670,0x00670); (0x006D6,0x006DC); (0x006DF,0x006E4); @@ -879,46 +1295,65 @@ let mn = [ (0x00711,0x00711); (0x00730,0x0074A); (0x007A6,0x007B0); - (0x00901,0x00902); + (0x007EB,0x007F3); + (0x00816,0x00819); + (0x0081B,0x00823); + (0x00825,0x00827); + (0x00829,0x0082D); + (0x00859,0x0085B); + (0x008D4,0x008E1); + (0x008E3,0x00902); + (0x0093A,0x0093A); (0x0093C,0x0093C); (0x00941,0x00948); (0x0094D,0x0094D); - (0x00951,0x00954); + (0x00951,0x00957); (0x00962,0x00963); (0x00981,0x00981); (0x009BC,0x009BC); (0x009C1,0x009C4); (0x009CD,0x009CD); (0x009E2,0x009E3); - (0x00A02,0x00A02); + (0x00A01,0x00A02); (0x00A3C,0x00A3C); (0x00A41,0x00A42); (0x00A47,0x00A48); (0x00A4B,0x00A4D); + (0x00A51,0x00A51); (0x00A70,0x00A71); + (0x00A75,0x00A75); (0x00A81,0x00A82); (0x00ABC,0x00ABC); (0x00AC1,0x00AC5); (0x00AC7,0x00AC8); (0x00ACD,0x00ACD); + (0x00AE2,0x00AE3); (0x00B01,0x00B01); (0x00B3C,0x00B3C); (0x00B3F,0x00B3F); - (0x00B41,0x00B43); + (0x00B41,0x00B44); (0x00B4D,0x00B4D); (0x00B56,0x00B56); + (0x00B62,0x00B63); (0x00B82,0x00B82); (0x00BC0,0x00BC0); (0x00BCD,0x00BCD); + (0x00C00,0x00C00); (0x00C3E,0x00C40); (0x00C46,0x00C48); (0x00C4A,0x00C4D); (0x00C55,0x00C56); + (0x00C62,0x00C63); + (0x00C81,0x00C81); + (0x00CBC,0x00CBC); (0x00CBF,0x00CBF); (0x00CC6,0x00CC6); (0x00CCC,0x00CCD); - (0x00D41,0x00D43); + (0x00CE2,0x00CE3); + (0x00D01,0x00D01); + (0x00D41,0x00D44); (0x00D4D,0x00D4D); + (0x00D62,0x00D63); (0x00DCA,0x00DCA); (0x00DD2,0x00DD4); (0x00DD6,0x00DD6); @@ -936,46 +1371,211 @@ let mn = [ (0x00F71,0x00F7E); (0x00F80,0x00F84); (0x00F86,0x00F87); - (0x00F90,0x00F97); + (0x00F8D,0x00F97); (0x00F99,0x00FBC); (0x00FC6,0x00FC6); (0x0102D,0x01030); - (0x01032,0x01032); - (0x01036,0x01037); - (0x01039,0x01039); + (0x01032,0x01037); + (0x01039,0x0103A); + (0x0103D,0x0103E); (0x01058,0x01059); + (0x0105E,0x01060); + (0x01071,0x01074); + (0x01082,0x01082); + (0x01085,0x01086); + (0x0108D,0x0108D); + (0x0109D,0x0109D); + (0x0135D,0x0135F); (0x01712,0x01714); (0x01732,0x01734); (0x01752,0x01753); (0x01772,0x01773); + (0x017B4,0x017B5); (0x017B7,0x017BD); (0x017C6,0x017C6); (0x017C9,0x017D3); + (0x017DD,0x017DD); (0x0180B,0x0180D); + (0x01885,0x01886); (0x018A9,0x018A9); + (0x01920,0x01922); + (0x01927,0x01928); + (0x01932,0x01932); + (0x01939,0x0193B); + (0x01A17,0x01A18); + (0x01A1B,0x01A1B); + (0x01A56,0x01A56); + (0x01A58,0x01A5E); + (0x01A60,0x01A60); + (0x01A62,0x01A62); + (0x01A65,0x01A6C); + (0x01A73,0x01A7C); + (0x01A7F,0x01A7F); + (0x01AB0,0x01ABD); + (0x01B00,0x01B03); + (0x01B34,0x01B34); + (0x01B36,0x01B3A); + (0x01B3C,0x01B3C); + (0x01B42,0x01B42); + (0x01B6B,0x01B73); + (0x01B80,0x01B81); + (0x01BA2,0x01BA5); + (0x01BA8,0x01BA9); + (0x01BAB,0x01BAD); + (0x01BE6,0x01BE6); + (0x01BE8,0x01BE9); + (0x01BED,0x01BED); + (0x01BEF,0x01BF1); + (0x01C2C,0x01C33); + (0x01C36,0x01C37); + (0x01CD0,0x01CD2); + (0x01CD4,0x01CE0); + (0x01CE2,0x01CE8); + (0x01CED,0x01CED); + (0x01CF4,0x01CF4); + (0x01CF8,0x01CF9); + (0x01DC0,0x01DF5); + (0x01DFB,0x01DFF); (0x020D0,0x020DC); (0x020E1,0x020E1); - (0x020E5,0x020EA); - (0x0302A,0x0302F); + (0x020E5,0x020F0); + (0x02CEF,0x02CF1); + (0x02D7F,0x02D7F); + (0x02DE0,0x02DFF); + (0x0302A,0x0302D); (0x03099,0x0309A); + (0x0A66F,0x0A66F); + (0x0A674,0x0A67D); + (0x0A69E,0x0A69F); + (0x0A6F0,0x0A6F1); + (0x0A802,0x0A802); + (0x0A806,0x0A806); + (0x0A80B,0x0A80B); + (0x0A825,0x0A826); + (0x0A8C4,0x0A8C5); + (0x0A8E0,0x0A8F1); + (0x0A926,0x0A92D); + (0x0A947,0x0A951); + (0x0A980,0x0A982); + (0x0A9B3,0x0A9B3); + (0x0A9B6,0x0A9B9); + (0x0A9BC,0x0A9BC); + (0x0A9E5,0x0A9E5); + (0x0AA29,0x0AA2E); + (0x0AA31,0x0AA32); + (0x0AA35,0x0AA36); + (0x0AA43,0x0AA43); + (0x0AA4C,0x0AA4C); + (0x0AA7C,0x0AA7C); + (0x0AAB0,0x0AAB0); + (0x0AAB2,0x0AAB4); + (0x0AAB7,0x0AAB8); + (0x0AABE,0x0AABF); + (0x0AAC1,0x0AAC1); + (0x0AAEC,0x0AAED); + (0x0AAF6,0x0AAF6); + (0x0ABE5,0x0ABE5); + (0x0ABE8,0x0ABE8); + (0x0ABED,0x0ABED); (0x0FB1E,0x0FB1E); (0x0FE00,0x0FE0F); - (0x0FE20,0x0FE23); + (0x0FE20,0x0FE2F); + (0x101FD,0x101FD); + (0x102E0,0x102E0); + (0x10376,0x1037A); + (0x10A01,0x10A03); + (0x10A05,0x10A06); + (0x10A0C,0x10A0F); + (0x10A38,0x10A3A); + (0x10A3F,0x10A3F); + (0x10AE5,0x10AE6); + (0x11001,0x11001); + (0x11038,0x11046); + (0x1107F,0x11081); + (0x110B3,0x110B6); + (0x110B9,0x110BA); + (0x11100,0x11102); + (0x11127,0x1112B); + (0x1112D,0x11134); + (0x11173,0x11173); + (0x11180,0x11181); + (0x111B6,0x111BE); + (0x111CA,0x111CC); + (0x1122F,0x11231); + (0x11234,0x11234); + (0x11236,0x11237); + (0x1123E,0x1123E); + (0x112DF,0x112DF); + (0x112E3,0x112EA); + (0x11300,0x11301); + (0x1133C,0x1133C); + (0x11340,0x11340); + (0x11366,0x1136C); + (0x11370,0x11374); + (0x11438,0x1143F); + (0x11442,0x11444); + (0x11446,0x11446); + (0x114B3,0x114B8); + (0x114BA,0x114BA); + (0x114BF,0x114C0); + (0x114C2,0x114C3); + (0x115B2,0x115B5); + (0x115BC,0x115BD); + (0x115BF,0x115C0); + (0x115DC,0x115DD); + (0x11633,0x1163A); + (0x1163D,0x1163D); + (0x1163F,0x11640); + (0x116AB,0x116AB); + (0x116AD,0x116AD); + (0x116B0,0x116B5); + (0x116B7,0x116B7); + (0x1171D,0x1171F); + (0x11722,0x11725); + (0x11727,0x1172B); + (0x11C30,0x11C36); + (0x11C38,0x11C3D); + (0x11C3F,0x11C3F); + (0x11C92,0x11CA7); + (0x11CAA,0x11CB0); + (0x11CB2,0x11CB3); + (0x11CB5,0x11CB6); + (0x16AF0,0x16AF4); + (0x16B30,0x16B36); + (0x16F8F,0x16F92); + (0x1BC9D,0x1BC9E); (0x1D167,0x1D169); (0x1D17B,0x1D182); (0x1D185,0x1D18B); - (0x1D1AA,0x1D1AD) + (0x1D1AA,0x1D1AD); + (0x1D242,0x1D244); + (0x1DA00,0x1DA36); + (0x1DA3B,0x1DA6C); + (0x1DA75,0x1DA75); + (0x1DA84,0x1DA84); + (0x1DA9B,0x1DA9F); + (0x1DAA1,0x1DAAF); + (0x1E000,0x1E006); + (0x1E008,0x1E018); + (0x1E01B,0x1E021); + (0x1E023,0x1E024); + (0x1E026,0x1E02A); + (0x1E8D0,0x1E8D6); + (0x1E944,0x1E94A) ] (* Mark, Spacing Combining *) let mc = [ (0x00903,0x00903); + (0x0093B,0x0093B); (0x0093E,0x00940); (0x00949,0x0094C); + (0x0094E,0x0094F); (0x00982,0x00983); (0x009BE,0x009C0); (0x009C7,0x009C8); (0x009CB,0x009CC); (0x009D7,0x009D7); + (0x00A03,0x00A03); (0x00A3E,0x00A40); (0x00A83,0x00A83); (0x00ABE,0x00AC0); @@ -1011,20 +1611,119 @@ let mc = [ (0x00DF2,0x00DF3); (0x00F3E,0x00F3F); (0x00F7F,0x00F7F); - (0x0102C,0x0102C); + (0x0102B,0x0102C); (0x01031,0x01031); (0x01038,0x01038); + (0x0103B,0x0103C); (0x01056,0x01057); - (0x017B4,0x017B6); + (0x01062,0x01064); + (0x01067,0x0106D); + (0x01083,0x01084); + (0x01087,0x0108C); + (0x0108F,0x0108F); + (0x0109A,0x0109C); + (0x017B6,0x017B6); (0x017BE,0x017C5); (0x017C7,0x017C8); - (0x1D165,0x1D166); - (0x1D16D,0x1D172) + (0x01923,0x01926); + (0x01929,0x0192B); + (0x01930,0x01931); + (0x01933,0x01938); + (0x01A19,0x01A1A); + (0x01A55,0x01A55); + (0x01A57,0x01A57); + (0x01A61,0x01A61); + (0x01A63,0x01A64); + (0x01A6D,0x01A72); + (0x01B04,0x01B04); + (0x01B35,0x01B35); + (0x01B3B,0x01B3B); + (0x01B3D,0x01B41); + (0x01B43,0x01B44); + (0x01B82,0x01B82); + (0x01BA1,0x01BA1); + (0x01BA6,0x01BA7); + (0x01BAA,0x01BAA); + (0x01BE7,0x01BE7); + (0x01BEA,0x01BEC); + (0x01BEE,0x01BEE); + (0x01BF2,0x01BF3); + (0x01C24,0x01C2B); + (0x01C34,0x01C35); + (0x01CE1,0x01CE1); + (0x01CF2,0x01CF3); + (0x0302E,0x0302F); + (0x0A823,0x0A824); + (0x0A827,0x0A827); + (0x0A880,0x0A881); + (0x0A8B4,0x0A8C3); + (0x0A952,0x0A953); + (0x0A983,0x0A983); + (0x0A9B4,0x0A9B5); + (0x0A9BA,0x0A9BB); + (0x0A9BD,0x0A9C0); + (0x0AA2F,0x0AA30); + (0x0AA33,0x0AA34); + (0x0AA4D,0x0AA4D); + (0x0AA7B,0x0AA7B); + (0x0AA7D,0x0AA7D); + (0x0AAEB,0x0AAEB); + (0x0AAEE,0x0AAEF); + (0x0AAF5,0x0AAF5); + (0x0ABE3,0x0ABE4); + (0x0ABE6,0x0ABE7); + (0x0ABE9,0x0ABEA); + (0x0ABEC,0x0ABEC); + (0x11000,0x11000); + (0x11002,0x11002); + (0x11082,0x11082); + (0x110B0,0x110B2); + (0x110B7,0x110B8); + (0x1112C,0x1112C); + (0x11182,0x11182); + (0x111B3,0x111B5); + (0x111BF,0x111C0); + (0x1122C,0x1122E); + (0x11232,0x11233); + (0x11235,0x11235); + (0x112E0,0x112E2); + (0x11302,0x11303); + (0x1133E,0x1133F); + (0x11341,0x11344); + (0x11347,0x11348); + (0x1134B,0x1134D); + (0x11357,0x11357); + (0x11362,0x11363); + (0x11435,0x11437); + (0x11440,0x11441); + (0x11445,0x11445); + (0x114B0,0x114B2); + (0x114B9,0x114B9); + (0x114BB,0x114BE); + (0x114C1,0x114C1); + (0x115AF,0x115B1); + (0x115B8,0x115BB); + (0x115BE,0x115BE); + (0x11630,0x11632); + (0x1163B,0x1163C); + (0x1163E,0x1163E); + (0x116AC,0x116AC); + (0x116AE,0x116AF); + (0x116B6,0x116B6); + (0x11720,0x11721); + (0x11726,0x11726); + (0x11C2F,0x11C2F); + (0x11C3E,0x11C3E); + (0x11CA9,0x11CA9); + (0x11CB1,0x11CB1); + (0x11CB4,0x11CB4); + (0x16F51,0x16F7E); + (0x1D165,0x1D166) ] (* Mark, Enclosing *) let me = [ (0x00488,0x00489); - (0x006DE,0x006DE); + (0x01ABE,0x01ABE); (0x020DD,0x020E0); (0x020E2,0x020E4) ] @@ -1033,33 +1732,70 @@ let nd = [ (0x00030,0x00039); (0x00660,0x00669); (0x006F0,0x006F9); + (0x007C0,0x007C9); (0x00966,0x0096F); (0x009E6,0x009EF); (0x00A66,0x00A6F); (0x00AE6,0x00AEF); (0x00B66,0x00B6F); - (0x00BE7,0x00BEF); + (0x00BE6,0x00BEF); (0x00C66,0x00C6F); (0x00CE6,0x00CEF); (0x00D66,0x00D6F); + (0x00DE6,0x00DEF); (0x00E50,0x00E59); (0x00ED0,0x00ED9); (0x00F20,0x00F29); (0x01040,0x01049); - (0x01369,0x01371); + (0x01090,0x01099); (0x017E0,0x017E9); (0x01810,0x01819); + (0x01946,0x0194F); + (0x019D0,0x019D9); + (0x01A80,0x01A89); + (0x01A90,0x01A99); + (0x01B50,0x01B59); + (0x01BB0,0x01BB9); + (0x01C40,0x01C49); + (0x01C50,0x01C59); + (0x0A620,0x0A629); + (0x0A8D0,0x0A8D9); + (0x0A900,0x0A909); + (0x0A9D0,0x0A9D9); + (0x0A9F0,0x0A9F9); + (0x0AA50,0x0AA59); + (0x0ABF0,0x0ABF9); (0x0FF10,0x0FF19); + (0x104A0,0x104A9); + (0x11066,0x1106F); + (0x110F0,0x110F9); + (0x11136,0x1113F); + (0x111D0,0x111D9); + (0x112F0,0x112F9); + (0x11450,0x11459); + (0x114D0,0x114D9); + (0x11650,0x11659); + (0x116C0,0x116C9); + (0x11730,0x11739); + (0x118E0,0x118E9); + (0x11C50,0x11C59); + (0x16A60,0x16A69); + (0x16B50,0x16B59); (0x1D7CE,0x1D7FF) ] (* Number, Letter *) let nl = [ (0x016EE,0x016F0); - (0x02160,0x02183); + (0x02160,0x02182); + (0x02185,0x02188); (0x03007,0x03007); (0x03021,0x03029); (0x03038,0x0303A); - (0x1034A,0x1034A) + (0x0A6E6,0x0A6EF); + (0x10140,0x10174); + (0x10341,0x10341); + (0x1034A,0x1034A); + (0x103D1,0x103D5) ] (* Number, Other *) let no = [ @@ -1067,116 +1803,139 @@ let no = [ (0x000B9,0x000B9); (0x000BC,0x000BE); (0x009F4,0x009F9); + (0x00B72,0x00B77); (0x00BF0,0x00BF2); + (0x00C78,0x00C7E); + (0x00D58,0x00D5E); + (0x00D70,0x00D78); (0x00F2A,0x00F33); - (0x01372,0x0137C); + (0x01369,0x0137C); + (0x017F0,0x017F9); + (0x019DA,0x019DA); (0x02070,0x02070); (0x02074,0x02079); (0x02080,0x02089); - (0x02153,0x0215F); + (0x02150,0x0215F); + (0x02189,0x02189); (0x02460,0x0249B); - (0x024EA,0x024FE); + (0x024EA,0x024FF); (0x02776,0x02793); + (0x02CFD,0x02CFD); (0x03192,0x03195); (0x03220,0x03229); + (0x03248,0x0324F); (0x03251,0x0325F); (0x03280,0x03289); (0x032B1,0x032BF); - (0x10320,0x10323) + (0x0A830,0x0A835); + (0x10107,0x10133); + (0x10175,0x10178); + (0x1018A,0x1018B); + (0x102E1,0x102FB); + (0x10320,0x10323); + (0x10858,0x1085F); + (0x10879,0x1087F); + (0x108A7,0x108AF); + (0x108FB,0x108FF); + (0x10916,0x1091B); + (0x109BC,0x109BD); + (0x109C0,0x109CF); + (0x109D2,0x109FF); + (0x10A40,0x10A47); + (0x10A7D,0x10A7E); + (0x10A9D,0x10A9F); + (0x10AEB,0x10AEF); + (0x10B58,0x10B5F); + (0x10B78,0x10B7F); + (0x10BA9,0x10BAF); + (0x10CFA,0x10CFF); + (0x10E60,0x10E7E); + (0x11052,0x11065); + (0x111E1,0x111F4); + (0x1173A,0x1173B); + (0x118EA,0x118F2); + (0x11C5A,0x11C6C); + (0x16B5B,0x16B61); + (0x1D360,0x1D371); + (0x1E8C7,0x1E8CF) ] (* Separator, Space *) let zs = [ (0x00020,0x00020); (0x000A0,0x000A0); (0x01680,0x01680); - (0x02000,0x0200B); + (0x02000,0x0200A); (0x0202F,0x0202F); - (0x0205F,0x0205F); - (0x03000,0x03000) + (0x0205F,0x0205F) ] (* Separator, Line *) let zl = [ - (0x02028,0x02028) + ] (* Separator, Paragraph *) let zp = [ - (0x02029,0x02029) + ] (* Other, Control *) let cc = [ - (0x00000,0x0001F); - (0x0007F,0x0009F) + (0x00000,0x0001F) ] (* Other, Format *) let cf = [ + (0x000AD,0x000AD); + (0x00600,0x00605); + (0x0061C,0x0061C); (0x006DD,0x006DD); (0x0070F,0x0070F); + (0x008E2,0x008E2); (0x0180E,0x0180E); - (0x0200C,0x0200F); + (0x0200B,0x0200F); (0x0202A,0x0202E); - (0x02060,0x02063); - (0x0206A,0x0206F); + (0x02060,0x02064); + (0x02066,0x0206F); (0x0FEFF,0x0FEFF); (0x0FFF9,0x0FFFB); + (0x110BD,0x110BD); + (0x1BCA0,0x1BCA3); (0x1D173,0x1D17A); - (0xE0001,0xE0001); - (0xE0020,0xE007F) + (0xE0001,0xE0001) ] (* Other, Surrogate *) let cs = [ - (0x0D800,0x0DEFE); - (0x0DFFF,0x0DFFF) + ] (* Other, Private Use *) let co = [ - (0x0E000,0x0F8FF) + (0x0E000,0x0F8FF); + (0xF0000,0xFFFFD) ] (* Other, Not Assigned *) let cn = [ - (0x00221,0x00221); - (0x00234,0x0024F); - (0x002AE,0x002AF); - (0x002EF,0x002FF); - (0x00350,0x0035F); - (0x00370,0x00373); - (0x00376,0x00379); - (0x0037B,0x0037D); - (0x0037F,0x00383); + (0x00378,0x00379); + (0x00380,0x00383); (0x0038B,0x0038B); (0x0038D,0x0038D); (0x003A2,0x003A2); - (0x003CF,0x003CF); - (0x003F7,0x003FF); - (0x00487,0x00487); - (0x004CF,0x004CF); - (0x004F6,0x004F7); - (0x004FA,0x004FF); - (0x00510,0x00530); + (0x00530,0x00530); (0x00557,0x00558); (0x00560,0x00560); (0x00588,0x00588); - (0x0058B,0x00590); - (0x005A2,0x005A2); - (0x005BA,0x005BA); - (0x005C5,0x005CF); + (0x0058B,0x0058C); + (0x00590,0x00590); + (0x005C8,0x005CF); (0x005EB,0x005EF); - (0x005F5,0x0060B); - (0x0060D,0x0061A); - (0x0061C,0x0061E); - (0x00620,0x00620); - (0x0063B,0x0063F); - (0x00656,0x0065F); - (0x006EE,0x006EF); - (0x006FF,0x006FF); + (0x005F5,0x005FF); + (0x0061D,0x0061D); (0x0070E,0x0070E); - (0x0072D,0x0072F); - (0x0074B,0x0077F); - (0x007B2,0x00900); - (0x00904,0x00904); - (0x0093A,0x0093B); - (0x0094E,0x0094F); - (0x00955,0x00957); - (0x00971,0x00980); + (0x0074B,0x0074C); + (0x007B2,0x007BF); + (0x007FB,0x007FF); + (0x0082E,0x0082F); + (0x0083F,0x0083F); + (0x0085C,0x0085D); + (0x0085F,0x0089F); + (0x008B5,0x008B5); + (0x008BE,0x008D3); (0x00984,0x00984); (0x0098D,0x0098E); (0x00991,0x00992); @@ -1184,15 +1943,14 @@ let cn = [ (0x009B1,0x009B1); (0x009B3,0x009B5); (0x009BA,0x009BB); - (0x009BD,0x009BD); (0x009C5,0x009C6); (0x009C9,0x009CA); - (0x009CE,0x009D6); + (0x009CF,0x009D6); (0x009D8,0x009DB); (0x009DE,0x009DE); (0x009E4,0x009E5); - (0x009FB,0x00A01); - (0x00A03,0x00A04); + (0x009FC,0x00A00); + (0x00A04,0x00A04); (0x00A0B,0x00A0E); (0x00A11,0x00A12); (0x00A29,0x00A29); @@ -1203,12 +1961,12 @@ let cn = [ (0x00A3D,0x00A3D); (0x00A43,0x00A46); (0x00A49,0x00A4A); - (0x00A4E,0x00A58); + (0x00A4E,0x00A50); + (0x00A52,0x00A58); (0x00A5D,0x00A5D); (0x00A5F,0x00A65); - (0x00A75,0x00A80); + (0x00A76,0x00A80); (0x00A84,0x00A84); - (0x00A8C,0x00A8C); (0x00A8E,0x00A8E); (0x00A92,0x00A92); (0x00AA9,0x00AA9); @@ -1219,22 +1977,23 @@ let cn = [ (0x00ACA,0x00ACA); (0x00ACE,0x00ACF); (0x00AD1,0x00ADF); - (0x00AE1,0x00AE5); - (0x00AF0,0x00B00); + (0x00AE4,0x00AE5); + (0x00AF2,0x00AF8); + (0x00AFA,0x00B00); (0x00B04,0x00B04); (0x00B0D,0x00B0E); (0x00B11,0x00B12); (0x00B29,0x00B29); (0x00B31,0x00B31); - (0x00B34,0x00B35); + (0x00B34,0x00B34); (0x00B3A,0x00B3B); - (0x00B44,0x00B46); + (0x00B45,0x00B46); (0x00B49,0x00B4A); (0x00B4E,0x00B55); (0x00B58,0x00B5B); (0x00B5E,0x00B5E); - (0x00B62,0x00B65); - (0x00B71,0x00B81); + (0x00B64,0x00B65); + (0x00B78,0x00B81); (0x00B84,0x00B84); (0x00B8B,0x00B8D); (0x00B91,0x00B91); @@ -1244,49 +2003,48 @@ let cn = [ (0x00BA0,0x00BA2); (0x00BA5,0x00BA7); (0x00BAB,0x00BAD); - (0x00BB6,0x00BB6); (0x00BBA,0x00BBD); (0x00BC3,0x00BC5); (0x00BC9,0x00BC9); - (0x00BCE,0x00BD6); - (0x00BD8,0x00BE6); - (0x00BF3,0x00C00); + (0x00BCE,0x00BCF); + (0x00BD1,0x00BD6); + (0x00BD8,0x00BE5); + (0x00BFB,0x00BFF); (0x00C04,0x00C04); (0x00C0D,0x00C0D); (0x00C11,0x00C11); (0x00C29,0x00C29); - (0x00C34,0x00C34); - (0x00C3A,0x00C3D); + (0x00C3A,0x00C3C); (0x00C45,0x00C45); (0x00C49,0x00C49); (0x00C4E,0x00C54); - (0x00C57,0x00C5F); - (0x00C62,0x00C65); - (0x00C70,0x00C81); + (0x00C57,0x00C57); + (0x00C5B,0x00C5F); + (0x00C64,0x00C65); + (0x00C70,0x00C77); (0x00C84,0x00C84); (0x00C8D,0x00C8D); (0x00C91,0x00C91); (0x00CA9,0x00CA9); (0x00CB4,0x00CB4); - (0x00CBA,0x00CBD); + (0x00CBA,0x00CBB); (0x00CC5,0x00CC5); (0x00CC9,0x00CC9); (0x00CCE,0x00CD4); (0x00CD7,0x00CDD); (0x00CDF,0x00CDF); - (0x00CE2,0x00CE5); - (0x00CF0,0x00D01); + (0x00CE4,0x00CE5); + (0x00CF0,0x00CF0); + (0x00CF3,0x00D00); (0x00D04,0x00D04); (0x00D0D,0x00D0D); (0x00D11,0x00D11); - (0x00D29,0x00D29); - (0x00D3A,0x00D3D); - (0x00D44,0x00D45); + (0x00D3B,0x00D3C); + (0x00D45,0x00D45); (0x00D49,0x00D49); - (0x00D4E,0x00D56); - (0x00D58,0x00D5F); - (0x00D62,0x00D65); - (0x00D70,0x00D81); + (0x00D50,0x00D53); + (0x00D64,0x00D65); + (0x00D80,0x00D81); (0x00D84,0x00D84); (0x00D97,0x00D99); (0x00DB2,0x00DB2); @@ -1296,7 +2054,8 @@ let cn = [ (0x00DCB,0x00DCE); (0x00DD5,0x00DD5); (0x00DD7,0x00DD7); - (0x00DE0,0x00DF1); + (0x00DE0,0x00DE5); + (0x00DF0,0x00DF1); (0x00DF5,0x00E00); (0x00E3B,0x00E3E); (0x00E5C,0x00E80); @@ -1317,56 +2076,38 @@ let cn = [ (0x00EC7,0x00EC7); (0x00ECE,0x00ECF); (0x00EDA,0x00EDB); - (0x00EDE,0x00EFF); + (0x00EE0,0x00EFF); (0x00F48,0x00F48); - (0x00F6B,0x00F70); - (0x00F8C,0x00F8F); + (0x00F6D,0x00F70); (0x00F98,0x00F98); (0x00FBD,0x00FBD); - (0x00FCD,0x00FCE); - (0x00FD0,0x00FFF); - (0x01022,0x01022); - (0x01028,0x01028); - (0x0102B,0x0102B); - (0x01033,0x01035); - (0x0103A,0x0103F); - (0x0105A,0x0109F); - (0x010C6,0x010CF); - (0x010F9,0x010FA); - (0x010FC,0x010FF); - (0x0115A,0x0115E); - (0x011A3,0x011A7); - (0x011FA,0x011FF); - (0x01207,0x01207); - (0x01247,0x01247); + (0x00FCD,0x00FCD); + (0x00FDB,0x00FFF); + (0x010C6,0x010C6); + (0x010C8,0x010CC); + (0x010CE,0x010CF); (0x01249,0x01249); (0x0124E,0x0124F); (0x01257,0x01257); (0x01259,0x01259); (0x0125E,0x0125F); - (0x01287,0x01287); (0x01289,0x01289); (0x0128E,0x0128F); - (0x012AF,0x012AF); (0x012B1,0x012B1); (0x012B6,0x012B7); (0x012BF,0x012BF); (0x012C1,0x012C1); (0x012C6,0x012C7); - (0x012CF,0x012CF); (0x012D7,0x012D7); - (0x012EF,0x012EF); - (0x0130F,0x0130F); (0x01311,0x01311); (0x01316,0x01317); - (0x0131F,0x0131F); - (0x01347,0x01347); - (0x0135B,0x01360); - (0x0137D,0x0139F); - (0x013F5,0x01400); - (0x01677,0x0167F); + (0x0135B,0x0135C); + (0x0137D,0x0137F); + (0x0139A,0x0139F); + (0x013F6,0x013F7); + (0x013FE,0x013FF); (0x0169D,0x0169F); - (0x016F1,0x016FF); + (0x016F9,0x016FF); (0x0170D,0x0170D); (0x01715,0x0171F); (0x01737,0x0173F); @@ -1374,14 +2115,40 @@ let cn = [ (0x0176D,0x0176D); (0x01771,0x01771); (0x01774,0x0177F); - (0x017DD,0x017DF); - (0x017EA,0x017FF); + (0x017DE,0x017DF); + (0x017EA,0x017EF); + (0x017FA,0x017FF); (0x0180F,0x0180F); (0x0181A,0x0181F); (0x01878,0x0187F); - (0x018AA,0x01DFF); - (0x01E9C,0x01E9F); - (0x01EFA,0x01EFF); + (0x018AB,0x018AF); + (0x018F6,0x018FF); + (0x0191F,0x0191F); + (0x0192C,0x0192F); + (0x0193C,0x0193F); + (0x01941,0x01943); + (0x0196E,0x0196F); + (0x01975,0x0197F); + (0x019AC,0x019AF); + (0x019CA,0x019CF); + (0x019DB,0x019DD); + (0x01A1C,0x01A1D); + (0x01A5F,0x01A5F); + (0x01A7D,0x01A7E); + (0x01A8A,0x01A8F); + (0x01A9A,0x01A9F); + (0x01AAE,0x01AAF); + (0x01ABF,0x01AFF); + (0x01B4C,0x01B4F); + (0x01B7D,0x01B7F); + (0x01BF4,0x01BFB); + (0x01C38,0x01C3A); + (0x01C4A,0x01C4C); + (0x01C89,0x01CBF); + (0x01CC8,0x01CCF); + (0x01CF7,0x01CF7); + (0x01CFA,0x01CFF); + (0x01DF6,0x01DFA); (0x01F16,0x01F17); (0x01F1E,0x01F1F); (0x01F46,0x01F47); @@ -1398,37 +2165,40 @@ let cn = [ (0x01FF0,0x01FF1); (0x01FF5,0x01FF5); (0x01FFF,0x01FFF); - (0x02053,0x02056); - (0x02058,0x0205E); - (0x02064,0x02069); + (0x02065,0x02065); (0x02072,0x02073); - (0x0208F,0x0209F); - (0x020B2,0x020CF); - (0x020EB,0x020FF); - (0x0213B,0x0213C); - (0x0214C,0x02152); - (0x02184,0x0218F); - (0x023CF,0x023FF); + (0x0208F,0x0208F); + (0x0209D,0x0209F); + (0x020BF,0x020CF); + (0x020F1,0x020FF); + (0x0218C,0x0218F); + (0x023FF,0x023FF); (0x02427,0x0243F); (0x0244B,0x0245F); - (0x024FF,0x024FF); - (0x02614,0x02615); - (0x02618,0x02618); - (0x0267E,0x0267F); - (0x0268A,0x02700); - (0x02705,0x02705); - (0x0270A,0x0270B); - (0x02728,0x02728); - (0x0274C,0x0274C); - (0x0274E,0x0274E); - (0x02753,0x02755); - (0x02757,0x02757); - (0x0275F,0x02760); - (0x02795,0x02797); - (0x027B0,0x027B0); - (0x027BF,0x027CF); - (0x027EC,0x027EF); - (0x02B00,0x02E7F); + (0x02B74,0x02B75); + (0x02B96,0x02B97); + (0x02BBA,0x02BBC); + (0x02BC9,0x02BC9); + (0x02BD2,0x02BEB); + (0x02BF0,0x02BFF); + (0x02C2F,0x02C2F); + (0x02C5F,0x02C5F); + (0x02CF4,0x02CF8); + (0x02D26,0x02D26); + (0x02D28,0x02D2C); + (0x02D2E,0x02D2F); + (0x02D68,0x02D6E); + (0x02D71,0x02D7E); + (0x02D97,0x02D9F); + (0x02DA7,0x02DA7); + (0x02DAF,0x02DAF); + (0x02DB7,0x02DB7); + (0x02DBF,0x02DBF); + (0x02DC7,0x02DC7); + (0x02DCF,0x02DCF); + (0x02DD7,0x02DD7); + (0x02DDF,0x02DDF); + (0x02E45,0x02E7F); (0x02E9A,0x02E9A); (0x02EF4,0x02EFF); (0x02FD6,0x02FEF); @@ -1436,25 +2206,49 @@ let cn = [ (0x03040,0x03040); (0x03097,0x03098); (0x03100,0x03104); - (0x0312D,0x03130); + (0x0312E,0x03130); (0x0318F,0x0318F); - (0x031B8,0x031EF); - (0x0321D,0x0321F); - (0x03244,0x03250); - (0x0327C,0x0327E); - (0x032CC,0x032CF); + (0x031BB,0x031BF); + (0x031E4,0x031EF); + (0x0321F,0x0321F); (0x032FF,0x032FF); - (0x03377,0x0337A); - (0x033DE,0x033DF); - (0x033FF,0x033FF); - (0x04DB6,0x04DFF); - (0x09FA6,0x09FFF); + (0x04DB6,0x04DBF); + (0x09FD6,0x09FFF); (0x0A48D,0x0A48F); - (0x0A4C7,0x0ABFF); - (0x0D7A4,0x0D7FF); - (0x0DEFF,0x0DFFE); - (0x0FA2E,0x0FA2F); - (0x0FA6B,0x0FAFF); + (0x0A4C7,0x0A4CF); + (0x0A62C,0x0A63F); + (0x0A6F8,0x0A6FF); + (0x0A7AF,0x0A7AF); + (0x0A7B8,0x0A7F6); + (0x0A82C,0x0A82F); + (0x0A83A,0x0A83F); + (0x0A878,0x0A87F); + (0x0A8C6,0x0A8CD); + (0x0A8DA,0x0A8DF); + (0x0A8FE,0x0A8FF); + (0x0A954,0x0A95E); + (0x0A97D,0x0A97F); + (0x0A9CE,0x0A9CE); + (0x0A9DA,0x0A9DD); + (0x0A9FF,0x0A9FF); + (0x0AA37,0x0AA3F); + (0x0AA4E,0x0AA4F); + (0x0AA5A,0x0AA5B); + (0x0AAC3,0x0AADA); + (0x0AAF7,0x0AB00); + (0x0AB07,0x0AB08); + (0x0AB0F,0x0AB10); + (0x0AB17,0x0AB1F); + (0x0AB27,0x0AB27); + (0x0AB2F,0x0AB2F); + (0x0AB66,0x0AB6F); + (0x0ABEE,0x0ABEF); + (0x0ABFA,0x0ABFF); + (0x0D7A4,0x0D7AF); + (0x0D7C7,0x0D7CA); + (0x0D7FC,0x0D7FF); + (0x0FA6E,0x0FA6F); + (0x0FADA,0x0FAFF); (0x0FB07,0x0FB12); (0x0FB18,0x0FB1C); (0x0FB37,0x0FB37); @@ -1462,14 +2256,12 @@ let cn = [ (0x0FB3F,0x0FB3F); (0x0FB42,0x0FB42); (0x0FB45,0x0FB45); - (0x0FBB2,0x0FBD2); + (0x0FBC2,0x0FBD2); (0x0FD40,0x0FD4F); (0x0FD90,0x0FD91); (0x0FDC8,0x0FDEF); - (0x0FDFD,0x0FDFF); - (0x0FE10,0x0FE1F); - (0x0FE24,0x0FE2F); - (0x0FE47,0x0FE48); + (0x0FDFE,0x0FDFF); + (0x0FE1A,0x0FE1F); (0x0FE53,0x0FE53); (0x0FE67,0x0FE67); (0x0FE6C,0x0FE6F); @@ -1483,15 +2275,171 @@ let cn = [ (0x0FFDD,0x0FFDF); (0x0FFE7,0x0FFE7); (0x0FFEF,0x0FFF8); - (0x0FFFE,0x102FF); - (0x1031F,0x1031F); + (0x0FFFE,0x0FFFF); + (0x1000C,0x1000C); + (0x10027,0x10027); + (0x1003B,0x1003B); + (0x1003E,0x1003E); + (0x1004E,0x1004F); + (0x1005E,0x1007F); + (0x100FB,0x100FF); + (0x10103,0x10106); + (0x10134,0x10136); + (0x1018F,0x1018F); + (0x1019C,0x1019F); + (0x101A1,0x101CF); + (0x101FE,0x1027F); + (0x1029D,0x1029F); + (0x102D1,0x102DF); + (0x102FC,0x102FF); (0x10324,0x1032F); - (0x1034B,0x103FF); - (0x10426,0x10427); - (0x1044E,0x1CFFF); + (0x1034B,0x1034F); + (0x1037B,0x1037F); + (0x1039E,0x1039E); + (0x103C4,0x103C7); + (0x103D6,0x103FF); + (0x1049E,0x1049F); + (0x104AA,0x104AF); + (0x104D4,0x104D7); + (0x104FC,0x104FF); + (0x10528,0x1052F); + (0x10564,0x1056E); + (0x10570,0x105FF); + (0x10737,0x1073F); + (0x10756,0x1075F); + (0x10768,0x107FF); + (0x10806,0x10807); + (0x10809,0x10809); + (0x10836,0x10836); + (0x10839,0x1083B); + (0x1083D,0x1083E); + (0x10856,0x10856); + (0x1089F,0x108A6); + (0x108B0,0x108DF); + (0x108F3,0x108F3); + (0x108F6,0x108FA); + (0x1091C,0x1091E); + (0x1093A,0x1093E); + (0x10940,0x1097F); + (0x109B8,0x109BB); + (0x109D0,0x109D1); + (0x10A04,0x10A04); + (0x10A07,0x10A0B); + (0x10A14,0x10A14); + (0x10A18,0x10A18); + (0x10A34,0x10A37); + (0x10A3B,0x10A3E); + (0x10A48,0x10A4F); + (0x10A59,0x10A5F); + (0x10AA0,0x10ABF); + (0x10AE7,0x10AEA); + (0x10AF7,0x10AFF); + (0x10B36,0x10B38); + (0x10B56,0x10B57); + (0x10B73,0x10B77); + (0x10B92,0x10B98); + (0x10B9D,0x10BA8); + (0x10BB0,0x10BFF); + (0x10C49,0x10C7F); + (0x10CB3,0x10CBF); + (0x10CF3,0x10CF9); + (0x10D00,0x10E5F); + (0x10E7F,0x10FFF); + (0x1104E,0x11051); + (0x11070,0x1107E); + (0x110C2,0x110CF); + (0x110E9,0x110EF); + (0x110FA,0x110FF); + (0x11135,0x11135); + (0x11144,0x1114F); + (0x11177,0x1117F); + (0x111CE,0x111CF); + (0x111E0,0x111E0); + (0x111F5,0x111FF); + (0x11212,0x11212); + (0x1123F,0x1127F); + (0x11287,0x11287); + (0x11289,0x11289); + (0x1128E,0x1128E); + (0x1129E,0x1129E); + (0x112AA,0x112AF); + (0x112EB,0x112EF); + (0x112FA,0x112FF); + (0x11304,0x11304); + (0x1130D,0x1130E); + (0x11311,0x11312); + (0x11329,0x11329); + (0x11331,0x11331); + (0x11334,0x11334); + (0x1133A,0x1133B); + (0x11345,0x11346); + (0x11349,0x1134A); + (0x1134E,0x1134F); + (0x11351,0x11356); + (0x11358,0x1135C); + (0x11364,0x11365); + (0x1136D,0x1136F); + (0x11375,0x113FF); + (0x1145A,0x1145A); + (0x1145C,0x1145C); + (0x1145E,0x1147F); + (0x114C8,0x114CF); + (0x114DA,0x1157F); + (0x115B6,0x115B7); + (0x115DE,0x115FF); + (0x11645,0x1164F); + (0x1165A,0x1165F); + (0x1166D,0x1167F); + (0x116B8,0x116BF); + (0x116CA,0x116FF); + (0x1171A,0x1171C); + (0x1172C,0x1172F); + (0x11740,0x1189F); + (0x118F3,0x118FE); + (0x11900,0x11ABF); + (0x11AF9,0x11BFF); + (0x11C09,0x11C09); + (0x11C37,0x11C37); + (0x11C46,0x11C4F); + (0x11C6D,0x11C6F); + (0x11C90,0x11C91); + (0x11CA8,0x11CA8); + (0x11CB7,0x11FFF); + (0x1239A,0x123FF); + (0x1246F,0x1246F); + (0x12475,0x1247F); + (0x12544,0x12FFF); + (0x1342F,0x143FF); + (0x14647,0x167FF); + (0x16A39,0x16A3F); + (0x16A5F,0x16A5F); + (0x16A6A,0x16A6D); + (0x16A70,0x16ACF); + (0x16AEE,0x16AEF); + (0x16AF6,0x16AFF); + (0x16B46,0x16B4F); + (0x16B5A,0x16B5A); + (0x16B62,0x16B62); + (0x16B78,0x16B7C); + (0x16B90,0x16EFF); + (0x16F45,0x16F4F); + (0x16F7F,0x16F8E); + (0x16FA0,0x16FDF); + (0x16FE1,0x16FFF); + (0x187ED,0x187FF); + (0x18AF3,0x1AFFF); + (0x1B002,0x1BBFF); + (0x1BC6B,0x1BC6F); + (0x1BC7D,0x1BC7F); + (0x1BC89,0x1BC8F); + (0x1BC9A,0x1BC9B); + (0x1BCA4,0x1CFFF); (0x1D0F6,0x1D0FF); - (0x1D127,0x1D129); - (0x1D1DE,0x1D3FF); + (0x1D127,0x1D128); + (0x1D1E9,0x1D1FF); + (0x1D246,0x1D2FF); + (0x1D357,0x1D35F); + (0x1D372,0x1D3FF); (0x1D455,0x1D455); (0x1D49D,0x1D49D); (0x1D4A0,0x1D4A1); @@ -1500,7 +2448,6 @@ let cn = [ (0x1D4AD,0x1D4AD); (0x1D4BA,0x1D4BA); (0x1D4BC,0x1D4BC); - (0x1D4C1,0x1D4C1); (0x1D4C4,0x1D4C4); (0x1D506,0x1D506); (0x1D50B,0x1D50C); @@ -1511,63 +2458,195 @@ let cn = [ (0x1D545,0x1D545); (0x1D547,0x1D549); (0x1D551,0x1D551); - (0x1D6A4,0x1D6A7); - (0x1D7CA,0x1D7CD); - (0x1D800,0x1FFFF); - (0x2A6D7,0x2F7FF); + (0x1D6A6,0x1D6A7); + (0x1D7CC,0x1D7CD); + (0x1DA8C,0x1DA9A); + (0x1DAA0,0x1DAA0); + (0x1DAB0,0x1DFFF); + (0x1E007,0x1E007); + (0x1E019,0x1E01A); + (0x1E022,0x1E022); + (0x1E025,0x1E025); + (0x1E02B,0x1E7FF); + (0x1E8C5,0x1E8C6); + (0x1E8D7,0x1E8FF); + (0x1E94B,0x1E94F); + (0x1E95A,0x1E95D); + (0x1E960,0x1EDFF); + (0x1EE04,0x1EE04); + (0x1EE20,0x1EE20); + (0x1EE23,0x1EE23); + (0x1EE25,0x1EE26); + (0x1EE28,0x1EE28); + (0x1EE33,0x1EE33); + (0x1EE38,0x1EE38); + (0x1EE3A,0x1EE3A); + (0x1EE3C,0x1EE41); + (0x1EE43,0x1EE46); + (0x1EE48,0x1EE48); + (0x1EE4A,0x1EE4A); + (0x1EE4C,0x1EE4C); + (0x1EE50,0x1EE50); + (0x1EE53,0x1EE53); + (0x1EE55,0x1EE56); + (0x1EE58,0x1EE58); + (0x1EE5A,0x1EE5A); + (0x1EE5C,0x1EE5C); + (0x1EE5E,0x1EE5E); + (0x1EE60,0x1EE60); + (0x1EE63,0x1EE63); + (0x1EE65,0x1EE66); + (0x1EE6B,0x1EE6B); + (0x1EE73,0x1EE73); + (0x1EE78,0x1EE78); + (0x1EE7D,0x1EE7D); + (0x1EE7F,0x1EE7F); + (0x1EE8A,0x1EE8A); + (0x1EE9C,0x1EEA0); + (0x1EEA4,0x1EEA4); + (0x1EEAA,0x1EEAA); + (0x1EEBC,0x1EEEF); + (0x1EEF2,0x1EFFF); + (0x1F02C,0x1F02F); + (0x1F094,0x1F09F); + (0x1F0AF,0x1F0B0); + (0x1F0C0,0x1F0C0); + (0x1F0D0,0x1F0D0); + (0x1F0F6,0x1F0FF); + (0x1F10D,0x1F10F); + (0x1F12F,0x1F12F); + (0x1F16C,0x1F16F); + (0x1F1AD,0x1F1E5); + (0x1F203,0x1F20F); + (0x1F23C,0x1F23F); + (0x1F249,0x1F24F); + (0x1F252,0x1F2FF); + (0x1F6D3,0x1F6DF); + (0x1F6ED,0x1F6EF); + (0x1F6F7,0x1F6FF); + (0x1F774,0x1F77F); + (0x1F7D5,0x1F7FF); + (0x1F80C,0x1F80F); + (0x1F848,0x1F84F); + (0x1F85A,0x1F85F); + (0x1F888,0x1F88F); + (0x1F8AE,0x1F90F); + (0x1F91F,0x1F91F); + (0x1F928,0x1F92F); + (0x1F931,0x1F932); + (0x1F93F,0x1F93F); + (0x1F94C,0x1F94F); + (0x1F95F,0x1F97F); + (0x1F992,0x1F9BF); + (0x1F9C1,0x1FFFF); + (0x2A6D7,0x2A6FF); + (0x2B735,0x2B73F); + (0x2B81E,0x2B81F); + (0x2CEA2,0x2F7FF); (0x2FA1E,0xE0000); (0xE0002,0xE001F); - (0xE0080,0x7FFFFFFF) + (0xE0080,0xE00FF); + (0xE01F0,0xEFFFF); + (0xFFFFE,0xFFFFF) ] (* Letter, Modifier *) let lm = [ - (0x002B0,0x002B8); - (0x002BB,0x002C1); - (0x002D0,0x002D1); + (0x002B0,0x002C1); + (0x002C6,0x002D1); (0x002E0,0x002E4); + (0x002EC,0x002EC); (0x002EE,0x002EE); + (0x00374,0x00374); (0x0037A,0x0037A); (0x00559,0x00559); (0x00640,0x00640); (0x006E5,0x006E6); + (0x007F4,0x007F5); + (0x007FA,0x007FA); + (0x0081A,0x0081A); + (0x00824,0x00824); + (0x00828,0x00828); + (0x00971,0x00971); (0x00E46,0x00E46); (0x00EC6,0x00EC6); + (0x010FC,0x010FC); (0x017D7,0x017D7); (0x01843,0x01843); + (0x01AA7,0x01AA7); + (0x01C78,0x01C7D); + (0x01D2C,0x01D6A); + (0x01D78,0x01D78); + (0x01D9B,0x01DBF); + (0x02071,0x02071); + (0x0207F,0x0207F); + (0x02090,0x0209C); + (0x02C7C,0x02C7D); + (0x02D6F,0x02D6F); + (0x02E2F,0x02E2F); (0x03005,0x03005); (0x03031,0x03035); (0x0303B,0x0303B); (0x0309D,0x0309E); (0x030FC,0x030FE); + (0x0A015,0x0A015); + (0x0A4F8,0x0A4FD); + (0x0A60C,0x0A60C); + (0x0A67F,0x0A67F); + (0x0A69C,0x0A69D); + (0x0A717,0x0A71F); + (0x0A770,0x0A770); + (0x0A788,0x0A788); + (0x0A7F8,0x0A7F9); + (0x0A9CF,0x0A9CF); + (0x0A9E6,0x0A9E6); + (0x0AA70,0x0AA70); + (0x0AADD,0x0AADD); + (0x0AAF3,0x0AAF4); + (0x0AB5C,0x0AB5F); (0x0FF70,0x0FF70); - (0x0FF9E,0x0FF9F) + (0x0FF9E,0x0FF9F); + (0x16B40,0x16B43); + (0x16F93,0x16F9F) ] (* Letter, Other *) let lo = [ + (0x000AA,0x000AA); + (0x000BA,0x000BA); (0x001BB,0x001BB); (0x001C0,0x001C3); + (0x00294,0x00294); (0x005D0,0x005EA); (0x005F0,0x005F2); - (0x00621,0x0063A); + (0x00620,0x0063F); (0x00641,0x0064A); (0x0066E,0x0066F); (0x00671,0x006D3); (0x006D5,0x006D5); + (0x006EE,0x006EF); (0x006FA,0x006FC); + (0x006FF,0x006FF); (0x00710,0x00710); - (0x00712,0x0072C); - (0x00780,0x007A5); + (0x00712,0x0072F); + (0x0074D,0x007A5); (0x007B1,0x007B1); - (0x00905,0x00939); + (0x007CA,0x007EA); + (0x00800,0x00815); + (0x00840,0x00858); + (0x008A0,0x008B4); + (0x008B6,0x008BD); + (0x00904,0x00939); (0x0093D,0x0093D); (0x00950,0x00950); (0x00958,0x00961); + (0x00972,0x00980); (0x00985,0x0098C); (0x0098F,0x00990); (0x00993,0x009A8); (0x009AA,0x009B0); (0x009B2,0x009B2); (0x009B6,0x009B9); + (0x009BD,0x009BD); + (0x009CE,0x009CE); (0x009DC,0x009DD); (0x009DF,0x009E1); (0x009F0,0x009F1); @@ -1581,8 +2660,7 @@ let lo = [ (0x00A59,0x00A5C); (0x00A5E,0x00A5E); (0x00A72,0x00A74); - (0x00A85,0x00A8B); - (0x00A8D,0x00A8D); + (0x00A85,0x00A8D); (0x00A8F,0x00A91); (0x00A93,0x00AA8); (0x00AAA,0x00AB0); @@ -1590,16 +2668,18 @@ let lo = [ (0x00AB5,0x00AB9); (0x00ABD,0x00ABD); (0x00AD0,0x00AD0); - (0x00AE0,0x00AE0); + (0x00AE0,0x00AE1); + (0x00AF9,0x00AF9); (0x00B05,0x00B0C); (0x00B0F,0x00B10); (0x00B13,0x00B28); (0x00B2A,0x00B30); (0x00B32,0x00B33); - (0x00B36,0x00B39); + (0x00B35,0x00B39); (0x00B3D,0x00B3D); (0x00B5C,0x00B5D); (0x00B5F,0x00B61); + (0x00B71,0x00B71); (0x00B83,0x00B83); (0x00B85,0x00B8A); (0x00B8E,0x00B90); @@ -1609,26 +2689,33 @@ let lo = [ (0x00B9E,0x00B9F); (0x00BA3,0x00BA4); (0x00BA8,0x00BAA); - (0x00BAE,0x00BB5); - (0x00BB7,0x00BB9); + (0x00BAE,0x00BB9); + (0x00BD0,0x00BD0); (0x00C05,0x00C0C); (0x00C0E,0x00C10); (0x00C12,0x00C28); - (0x00C2A,0x00C33); - (0x00C35,0x00C39); + (0x00C2A,0x00C39); + (0x00C3D,0x00C3D); + (0x00C58,0x00C5A); (0x00C60,0x00C61); + (0x00C80,0x00C80); (0x00C85,0x00C8C); (0x00C8E,0x00C90); (0x00C92,0x00CA8); (0x00CAA,0x00CB3); (0x00CB5,0x00CB9); + (0x00CBD,0x00CBD); (0x00CDE,0x00CDE); (0x00CE0,0x00CE1); + (0x00CF1,0x00CF2); (0x00D05,0x00D0C); (0x00D0E,0x00D10); - (0x00D12,0x00D28); - (0x00D2A,0x00D39); - (0x00D60,0x00D61); + (0x00D12,0x00D3A); + (0x00D3D,0x00D3D); + (0x00D4E,0x00D4E); + (0x00D54,0x00D56); + (0x00D5F,0x00D61); + (0x00D7A,0x00D7F); (0x00D85,0x00D96); (0x00D9A,0x00DB1); (0x00DB3,0x00DBB); @@ -1652,49 +2739,43 @@ let lo = [ (0x00EB2,0x00EB3); (0x00EBD,0x00EBD); (0x00EC0,0x00EC4); - (0x00EDC,0x00EDD); + (0x00EDC,0x00EDF); (0x00F00,0x00F00); (0x00F40,0x00F47); - (0x00F49,0x00F6A); - (0x00F88,0x00F8B); - (0x01000,0x01021); - (0x01023,0x01027); - (0x01029,0x0102A); + (0x00F49,0x00F6C); + (0x00F88,0x00F8C); + (0x01000,0x0102A); + (0x0103F,0x0103F); (0x01050,0x01055); - (0x010D0,0x010F8); - (0x01100,0x01159); - (0x0115F,0x011A2); - (0x011A8,0x011F9); - (0x01200,0x01206); - (0x01208,0x01246); - (0x01248,0x01248); + (0x0105A,0x0105D); + (0x01061,0x01061); + (0x01065,0x01066); + (0x0106E,0x01070); + (0x01075,0x01081); + (0x0108E,0x0108E); + (0x010D0,0x010FA); + (0x010FD,0x01248); (0x0124A,0x0124D); (0x01250,0x01256); (0x01258,0x01258); (0x0125A,0x0125D); - (0x01260,0x01286); - (0x01288,0x01288); + (0x01260,0x01288); (0x0128A,0x0128D); - (0x01290,0x012AE); - (0x012B0,0x012B0); + (0x01290,0x012B0); (0x012B2,0x012B5); (0x012B8,0x012BE); (0x012C0,0x012C0); (0x012C2,0x012C5); - (0x012C8,0x012CE); - (0x012D0,0x012D6); - (0x012D8,0x012EE); - (0x012F0,0x0130E); - (0x01310,0x01310); + (0x012C8,0x012D6); + (0x012D8,0x01310); (0x01312,0x01315); - (0x01318,0x0131E); - (0x01320,0x01346); - (0x01348,0x0135A); - (0x013A0,0x013F4); + (0x01318,0x0135A); + (0x01380,0x0138F); (0x01401,0x0166C); - (0x0166F,0x01676); + (0x0166F,0x0167F); (0x01681,0x0169A); (0x016A0,0x016EA); + (0x016F1,0x016F8); (0x01700,0x0170C); (0x0170E,0x01711); (0x01720,0x01731); @@ -1705,24 +2786,103 @@ let lo = [ (0x017DC,0x017DC); (0x01820,0x01842); (0x01844,0x01877); - (0x01880,0x018A8); + (0x01880,0x01884); + (0x01887,0x018A8); + (0x018AA,0x018AA); + (0x018B0,0x018F5); + (0x01900,0x0191E); + (0x01950,0x0196D); + (0x01970,0x01974); + (0x01980,0x019AB); + (0x019B0,0x019C9); + (0x01A00,0x01A16); + (0x01A20,0x01A54); + (0x01B05,0x01B33); + (0x01B45,0x01B4B); + (0x01B83,0x01BA0); + (0x01BAE,0x01BAF); + (0x01BBA,0x01BE5); + (0x01C00,0x01C23); + (0x01C4D,0x01C4F); + (0x01C5A,0x01C77); + (0x01CE9,0x01CEC); + (0x01CEE,0x01CF1); + (0x01CF5,0x01CF6); (0x02135,0x02138); + (0x02D30,0x02D67); + (0x02D80,0x02D96); + (0x02DA0,0x02DA6); + (0x02DA8,0x02DAE); + (0x02DB0,0x02DB6); + (0x02DB8,0x02DBE); + (0x02DC0,0x02DC6); + (0x02DC8,0x02DCE); + (0x02DD0,0x02DD6); + (0x02DD8,0x02DDE); (0x03006,0x03006); (0x0303C,0x0303C); (0x03041,0x03096); (0x0309F,0x0309F); (0x030A1,0x030FA); (0x030FF,0x030FF); - (0x03105,0x0312C); + (0x03105,0x0312D); (0x03131,0x0318E); - (0x031A0,0x031B7); + (0x031A0,0x031BA); (0x031F0,0x031FF); (0x03400,0x04DB5); - (0x04E00,0x09FA5); - (0x0A000,0x0A48C); + (0x04E00,0x09FD5); + (0x0A000,0x0A014); + (0x0A016,0x0A48C); + (0x0A4D0,0x0A4F7); + (0x0A500,0x0A60B); + (0x0A610,0x0A61F); + (0x0A62A,0x0A62B); + (0x0A66E,0x0A66E); + (0x0A6A0,0x0A6E5); + (0x0A78F,0x0A78F); + (0x0A7F7,0x0A7F7); + (0x0A7FB,0x0A801); + (0x0A803,0x0A805); + (0x0A807,0x0A80A); + (0x0A80C,0x0A822); + (0x0A840,0x0A873); + (0x0A882,0x0A8B3); + (0x0A8F2,0x0A8F7); + (0x0A8FB,0x0A8FB); + (0x0A8FD,0x0A8FD); + (0x0A90A,0x0A925); + (0x0A930,0x0A946); + (0x0A960,0x0A97C); + (0x0A984,0x0A9B2); + (0x0A9E0,0x0A9E4); + (0x0A9E7,0x0A9EF); + (0x0A9FA,0x0A9FE); + (0x0AA00,0x0AA28); + (0x0AA40,0x0AA42); + (0x0AA44,0x0AA4B); + (0x0AA60,0x0AA6F); + (0x0AA71,0x0AA76); + (0x0AA7A,0x0AA7A); + (0x0AA7E,0x0AAAF); + (0x0AAB1,0x0AAB1); + (0x0AAB5,0x0AAB6); + (0x0AAB9,0x0AABD); + (0x0AAC0,0x0AAC0); + (0x0AAC2,0x0AAC2); + (0x0AADB,0x0AADC); + (0x0AAE0,0x0AAEA); + (0x0AAF2,0x0AAF2); + (0x0AB01,0x0AB06); + (0x0AB09,0x0AB0E); + (0x0AB11,0x0AB16); + (0x0AB20,0x0AB26); + (0x0AB28,0x0AB2E); + (0x0ABC0,0x0ABE2); (0x0AC00,0x0D7A3); - (0x0F900,0x0FA2D); - (0x0FA30,0x0FA6A); + (0x0D7B0,0x0D7C6); + (0x0D7CB,0x0D7FB); + (0x0F900,0x0FA6D); + (0x0FA70,0x0FAD9); (0x0FB1D,0x0FB1D); (0x0FB1F,0x0FB28); (0x0FB2A,0x0FB36); @@ -1744,35 +2904,183 @@ let lo = [ (0x0FFCA,0x0FFCF); (0x0FFD2,0x0FFD7); (0x0FFDA,0x0FFDC); - (0x10300,0x1031E); - (0x10330,0x10349); + (0x10000,0x1000B); + (0x1000D,0x10026); + (0x10028,0x1003A); + (0x1003C,0x1003D); + (0x1003F,0x1004D); + (0x10050,0x1005D); + (0x10080,0x100FA); + (0x10280,0x1029C); + (0x102A0,0x102D0); + (0x10300,0x1031F); + (0x10330,0x10340); + (0x10342,0x10349); + (0x10350,0x10375); + (0x10380,0x1039D); + (0x103A0,0x103C3); + (0x103C8,0x103CF); + (0x10450,0x1049D); + (0x10500,0x10527); + (0x10530,0x10563); + (0x10600,0x10736); + (0x10740,0x10755); + (0x10760,0x10767); + (0x10800,0x10805); + (0x10808,0x10808); + (0x1080A,0x10835); + (0x10837,0x10838); + (0x1083C,0x1083C); + (0x1083F,0x10855); + (0x10860,0x10876); + (0x10880,0x1089E); + (0x108E0,0x108F2); + (0x108F4,0x108F5); + (0x10900,0x10915); + (0x10920,0x10939); + (0x10980,0x109B7); + (0x109BE,0x109BF); + (0x10A00,0x10A00); + (0x10A10,0x10A13); + (0x10A15,0x10A17); + (0x10A19,0x10A33); + (0x10A60,0x10A7C); + (0x10A80,0x10A9C); + (0x10AC0,0x10AC7); + (0x10AC9,0x10AE4); + (0x10B00,0x10B35); + (0x10B40,0x10B55); + (0x10B60,0x10B72); + (0x10B80,0x10B91); + (0x10C00,0x10C48); + (0x11003,0x11037); + (0x11083,0x110AF); + (0x110D0,0x110E8); + (0x11103,0x11126); + (0x11150,0x11172); + (0x11176,0x11176); + (0x11183,0x111B2); + (0x111C1,0x111C4); + (0x111DA,0x111DA); + (0x111DC,0x111DC); + (0x11200,0x11211); + (0x11213,0x1122B); + (0x11280,0x11286); + (0x11288,0x11288); + (0x1128A,0x1128D); + (0x1128F,0x1129D); + (0x1129F,0x112A8); + (0x112B0,0x112DE); + (0x11305,0x1130C); + (0x1130F,0x11310); + (0x11313,0x11328); + (0x1132A,0x11330); + (0x11332,0x11333); + (0x11335,0x11339); + (0x1133D,0x1133D); + (0x11350,0x11350); + (0x1135D,0x11361); + (0x11400,0x11434); + (0x11447,0x1144A); + (0x11480,0x114AF); + (0x114C4,0x114C5); + (0x114C7,0x114C7); + (0x11580,0x115AE); + (0x115D8,0x115DB); + (0x11600,0x1162F); + (0x11644,0x11644); + (0x11680,0x116AA); + (0x11700,0x11719); + (0x118FF,0x118FF); + (0x11AC0,0x11AF8); + (0x11C00,0x11C08); + (0x11C0A,0x11C2E); + (0x11C40,0x11C40); + (0x11C72,0x11C8F); + (0x12000,0x12399); + (0x12480,0x12543); + (0x13000,0x1342E); + (0x14400,0x14646); + (0x16800,0x16A38); + (0x16A40,0x16A5E); + (0x16AD0,0x16AED); + (0x16B00,0x16B2F); + (0x16B63,0x16B77); + (0x16B7D,0x16B8F); + (0x16F00,0x16F44); + (0x16F50,0x16F50); + (0x17000,0x187EC); + (0x18800,0x18AF2); + (0x1B000,0x1B001); + (0x1BC00,0x1BC6A); + (0x1BC70,0x1BC7C); + (0x1BC80,0x1BC88); + (0x1BC90,0x1BC99); + (0x1E800,0x1E8C4); + (0x1EE00,0x1EE03); + (0x1EE05,0x1EE1F); + (0x1EE21,0x1EE22); + (0x1EE24,0x1EE24); + (0x1EE27,0x1EE27); + (0x1EE29,0x1EE32); + (0x1EE34,0x1EE37); + (0x1EE39,0x1EE39); + (0x1EE3B,0x1EE3B); + (0x1EE42,0x1EE42); + (0x1EE47,0x1EE47); + (0x1EE49,0x1EE49); + (0x1EE4B,0x1EE4B); + (0x1EE4D,0x1EE4F); + (0x1EE51,0x1EE52); + (0x1EE54,0x1EE54); + (0x1EE57,0x1EE57); + (0x1EE59,0x1EE59); + (0x1EE5B,0x1EE5B); + (0x1EE5D,0x1EE5D); + (0x1EE5F,0x1EE5F); + (0x1EE61,0x1EE62); + (0x1EE64,0x1EE64); + (0x1EE67,0x1EE6A); + (0x1EE6C,0x1EE72); + (0x1EE74,0x1EE77); + (0x1EE79,0x1EE7C); + (0x1EE7E,0x1EE7E); + (0x1EE80,0x1EE89); + (0x1EE8B,0x1EE9B); + (0x1EEA1,0x1EEA3); + (0x1EEA5,0x1EEA9); + (0x1EEAB,0x1EEBB); (0x20000,0x2A6D6); - (0x2F800,0x2FA1D) + (0x2A700,0x2B734); + (0x2B740,0x2B81D); + (0x2B820,0x2CEA1) ] (* Punctuation, Connector *) let pc = [ (0x0005F,0x0005F); (0x0203F,0x02040); - (0x030FB,0x030FB); + (0x02054,0x02054); (0x0FE33,0x0FE34); - (0x0FE4D,0x0FE4F); - (0x0FF3F,0x0FF3F); - (0x0FF65,0x0FF65) + (0x0FE4D,0x0FE4F) ] (* Punctuation, Dash *) let pd = [ (0x0002D,0x0002D); - (0x000AD,0x000AD); (0x0058A,0x0058A); + (0x005BE,0x005BE); + (0x01400,0x01400); (0x01806,0x01806); (0x02010,0x02015); + (0x02E17,0x02E17); + (0x02E1A,0x02E1A); + (0x02E3A,0x02E3B); + (0x02E40,0x02E40); (0x0301C,0x0301C); (0x03030,0x03030); (0x030A0,0x030A0); (0x0FE31,0x0FE32); (0x0FE58,0x0FE58); - (0x0FE63,0x0FE63); - (0x0FF0D,0x0FF0D) + (0x0FE63,0x0FE63) ] (* Punctuation, Open *) let ps = [ @@ -1787,8 +3095,9 @@ let ps = [ (0x02045,0x02045); (0x0207D,0x0207D); (0x0208D,0x0208D); + (0x02308,0x02308); + (0x0230A,0x0230A); (0x02329,0x02329); - (0x023B4,0x023B4); (0x02768,0x02768); (0x0276A,0x0276A); (0x0276C,0x0276C); @@ -1796,9 +3105,12 @@ let ps = [ (0x02770,0x02770); (0x02772,0x02772); (0x02774,0x02774); + (0x027C5,0x027C5); (0x027E6,0x027E6); (0x027E8,0x027E8); (0x027EA,0x027EA); + (0x027EC,0x027EC); + (0x027EE,0x027EE); (0x02983,0x02983); (0x02985,0x02985); (0x02987,0x02987); @@ -1813,6 +3125,11 @@ let ps = [ (0x029D8,0x029D8); (0x029DA,0x029DA); (0x029FC,0x029FC); + (0x02E22,0x02E22); + (0x02E24,0x02E24); + (0x02E26,0x02E26); + (0x02E28,0x02E28); + (0x02E42,0x02E42); (0x03008,0x03008); (0x0300A,0x0300A); (0x0300C,0x0300C); @@ -1823,7 +3140,8 @@ let ps = [ (0x03018,0x03018); (0x0301A,0x0301A); (0x0301D,0x0301D); - (0x0FD3E,0x0FD3E); + (0x0FD3F,0x0FD3F); + (0x0FE17,0x0FE17); (0x0FE35,0x0FE35); (0x0FE37,0x0FE37); (0x0FE39,0x0FE39); @@ -1832,14 +3150,14 @@ let ps = [ (0x0FE3F,0x0FE3F); (0x0FE41,0x0FE41); (0x0FE43,0x0FE43); + (0x0FE47,0x0FE47); (0x0FE59,0x0FE59); (0x0FE5B,0x0FE5B); (0x0FE5D,0x0FE5D); (0x0FF08,0x0FF08); (0x0FF3B,0x0FF3B); (0x0FF5B,0x0FF5B); - (0x0FF5F,0x0FF5F); - (0x0FF62,0x0FF62) + (0x0FF5F,0x0FF5F) ] (* Punctuation, Close *) let pe = [ @@ -1852,8 +3170,9 @@ let pe = [ (0x02046,0x02046); (0x0207E,0x0207E); (0x0208E,0x0208E); + (0x02309,0x02309); + (0x0230B,0x0230B); (0x0232A,0x0232A); - (0x023B5,0x023B5); (0x02769,0x02769); (0x0276B,0x0276B); (0x0276D,0x0276D); @@ -1861,9 +3180,12 @@ let pe = [ (0x02771,0x02771); (0x02773,0x02773); (0x02775,0x02775); + (0x027C6,0x027C6); (0x027E7,0x027E7); (0x027E9,0x027E9); (0x027EB,0x027EB); + (0x027ED,0x027ED); + (0x027EF,0x027EF); (0x02984,0x02984); (0x02986,0x02986); (0x02988,0x02988); @@ -1878,6 +3200,10 @@ let pe = [ (0x029D9,0x029D9); (0x029DB,0x029DB); (0x029FD,0x029FD); + (0x02E23,0x02E23); + (0x02E25,0x02E25); + (0x02E27,0x02E27); + (0x02E29,0x02E29); (0x03009,0x03009); (0x0300B,0x0300B); (0x0300D,0x0300D); @@ -1888,7 +3214,8 @@ let pe = [ (0x03019,0x03019); (0x0301B,0x0301B); (0x0301E,0x0301F); - (0x0FD3F,0x0FD3F); + (0x0FD3E,0x0FD3E); + (0x0FE18,0x0FE18); (0x0FE36,0x0FE36); (0x0FE38,0x0FE38); (0x0FE3A,0x0FE3A); @@ -1897,14 +3224,14 @@ let pe = [ (0x0FE40,0x0FE40); (0x0FE42,0x0FE42); (0x0FE44,0x0FE44); + (0x0FE48,0x0FE48); (0x0FE5A,0x0FE5A); (0x0FE5C,0x0FE5C); (0x0FE5E,0x0FE5E); (0x0FF09,0x0FF09); (0x0FF3D,0x0FF3D); (0x0FF5D,0x0FF5D); - (0x0FF60,0x0FF60); - (0x0FF63,0x0FF63) + (0x0FF60,0x0FF60) ] (* Punctuation, Initial quote *) let pi = [ @@ -1912,14 +3239,24 @@ let pi = [ (0x02018,0x02018); (0x0201B,0x0201C); (0x0201F,0x0201F); - (0x02039,0x02039) + (0x02039,0x02039); + (0x02E02,0x02E02); + (0x02E04,0x02E04); + (0x02E09,0x02E09); + (0x02E0C,0x02E0C); + (0x02E1C,0x02E1C) ] (* Punctuation, Final quote *) let pf = [ (0x000BB,0x000BB); (0x02019,0x02019); (0x0201D,0x0201D); - (0x0203A,0x0203A) + (0x0203A,0x0203A); + (0x02E03,0x02E03); + (0x02E05,0x02E05); + (0x02E0A,0x02E0A); + (0x02E0D,0x02E0D); + (0x02E1D,0x02E1D) ] (* Punctuation, Other *) let po = [ @@ -1932,32 +3269,41 @@ let po = [ (0x0003F,0x00040); (0x0005C,0x0005C); (0x000A1,0x000A1); - (0x000B7,0x000B7); + (0x000A7,0x000A7); + (0x000B6,0x000B7); (0x000BF,0x000BF); (0x0037E,0x0037E); (0x00387,0x00387); (0x0055A,0x0055F); (0x00589,0x00589); - (0x005BE,0x005BE); (0x005C0,0x005C0); (0x005C3,0x005C3); + (0x005C6,0x005C6); (0x005F3,0x005F4); - (0x0060C,0x0060C); + (0x00609,0x0060A); + (0x0060C,0x0060D); (0x0061B,0x0061B); - (0x0061F,0x0061F); + (0x0061E,0x0061F); (0x0066A,0x0066D); (0x006D4,0x006D4); (0x00700,0x0070D); + (0x007F7,0x007F9); + (0x00830,0x0083E); + (0x0085E,0x0085E); (0x00964,0x00965); (0x00970,0x00970); + (0x00AF0,0x00AF0); (0x00DF4,0x00DF4); (0x00E4F,0x00E4F); (0x00E5A,0x00E5B); (0x00F04,0x00F12); + (0x00F14,0x00F14); (0x00F85,0x00F85); + (0x00FD0,0x00FD4); + (0x00FD9,0x00FDA); (0x0104A,0x0104F); (0x010FB,0x010FB); - (0x01361,0x01368); + (0x01360,0x01368); (0x0166D,0x0166E); (0x016EB,0x016ED); (0x01735,0x01736); @@ -1965,16 +3311,61 @@ let po = [ (0x017D8,0x017DA); (0x01800,0x01805); (0x01807,0x0180A); + (0x01944,0x01945); + (0x01A1E,0x01A1F); + (0x01AA0,0x01AA6); + (0x01AA8,0x01AAD); + (0x01B5A,0x01B60); + (0x01BFC,0x01BFF); + (0x01C3B,0x01C3F); + (0x01C7E,0x01C7F); + (0x01CC0,0x01CC7); + (0x01CD3,0x01CD3); (0x02016,0x02017); (0x02020,0x02027); (0x02030,0x02038); (0x0203B,0x0203E); (0x02041,0x02043); (0x02047,0x02051); - (0x02057,0x02057); - (0x023B6,0x023B6); + (0x02053,0x02053); + (0x02055,0x0205E); + (0x02CF9,0x02CFC); + (0x02CFE,0x02CFF); + (0x02D70,0x02D70); + (0x02E00,0x02E01); + (0x02E06,0x02E08); + (0x02E0B,0x02E0B); + (0x02E0E,0x02E16); + (0x02E18,0x02E19); + (0x02E1B,0x02E1B); + (0x02E1E,0x02E1F); + (0x02E2A,0x02E2E); + (0x02E30,0x02E39); + (0x02E3C,0x02E3F); + (0x02E41,0x02E41); + (0x02E43,0x02E44); (0x03001,0x03003); (0x0303D,0x0303D); + (0x030FB,0x030FB); + (0x0A4FE,0x0A4FF); + (0x0A60D,0x0A60F); + (0x0A673,0x0A673); + (0x0A67E,0x0A67E); + (0x0A6F2,0x0A6F7); + (0x0A874,0x0A877); + (0x0A8CE,0x0A8CF); + (0x0A8F8,0x0A8FA); + (0x0A8FC,0x0A8FC); + (0x0A92E,0x0A92F); + (0x0A95F,0x0A95F); + (0x0A9C1,0x0A9CD); + (0x0A9DE,0x0A9DF); + (0x0AA5C,0x0AA5F); + (0x0AADE,0x0AADF); + (0x0AAF0,0x0AAF1); + (0x0ABEB,0x0ABEB); + (0x0FE10,0x0FE16); + (0x0FE19,0x0FE19); (0x0FE30,0x0FE30); (0x0FE45,0x0FE46); (0x0FE49,0x0FE4C); @@ -1992,7 +3383,47 @@ let po = [ (0x0FF1F,0x0FF20); (0x0FF3C,0x0FF3C); (0x0FF61,0x0FF61); - (0x0FF64,0x0FF64) + (0x0FF64,0x0FF65); + (0x10100,0x10102); + (0x1039F,0x1039F); + (0x103D0,0x103D0); + (0x1056F,0x1056F); + (0x10857,0x10857); + (0x1091F,0x1091F); + (0x1093F,0x1093F); + (0x10A50,0x10A58); + (0x10A7F,0x10A7F); + (0x10AF0,0x10AF6); + (0x10B39,0x10B3F); + (0x10B99,0x10B9C); + (0x11047,0x1104D); + (0x110BB,0x110BC); + (0x110BE,0x110C1); + (0x11140,0x11143); + (0x11174,0x11175); + (0x111C5,0x111C9); + (0x111CD,0x111CD); + (0x111DB,0x111DB); + (0x111DD,0x111DF); + (0x11238,0x1123D); + (0x112A9,0x112A9); + (0x1144B,0x1144F); + (0x1145B,0x1145B); + (0x1145D,0x1145D); + (0x114C6,0x114C6); + (0x115C1,0x115D7); + (0x11641,0x11643); + (0x11660,0x1166C); + (0x1173C,0x1173E); + (0x11C41,0x11C45); + (0x11C70,0x11C71); + (0x12470,0x12474); + (0x16A6E,0x16A6F); + (0x16AF5,0x16AF5); + (0x16B37,0x16B3B); + (0x16B44,0x16B44); + (0x1BC9F,0x1BC9F); + (0x1DA87,0x1DA8B) ] (* Symbol, Math *) let sm = [ @@ -2005,10 +3436,12 @@ let sm = [ (0x000D7,0x000D7); (0x000F7,0x000F7); (0x003F6,0x003F6); + (0x00606,0x00608); (0x02044,0x02044); (0x02052,0x02052); (0x0207A,0x0207C); (0x0208A,0x0208C); + (0x02118,0x02118); (0x02140,0x02144); (0x0214B,0x0214B); (0x02190,0x02194); @@ -2021,20 +3454,23 @@ let sm = [ (0x021D2,0x021D2); (0x021D4,0x021D4); (0x021F4,0x022FF); - (0x02308,0x0230B); (0x02320,0x02321); (0x0237C,0x0237C); (0x0239B,0x023B3); + (0x023DC,0x023E1); (0x025B7,0x025B7); (0x025C1,0x025C1); (0x025F8,0x025FF); (0x0266F,0x0266F); - (0x027D0,0x027E5); + (0x027C0,0x027C4); + (0x027C7,0x027E5); (0x027F0,0x027FF); (0x02900,0x02982); (0x02999,0x029D7); (0x029DC,0x029FB); (0x029FE,0x02AFF); + (0x02B30,0x02B44); + (0x02B47,0x02B4C); (0x0FB29,0x0FB29); (0x0FE62,0x0FE62); (0x0FE64,0x0FE66); @@ -2059,15 +3495,20 @@ let sm = [ let sc = [ (0x00024,0x00024); (0x000A2,0x000A5); + (0x0058F,0x0058F); + (0x0060B,0x0060B); (0x009F2,0x009F3); + (0x009FB,0x009FB); + (0x00AF1,0x00AF1); + (0x00BF9,0x00BF9); (0x00E3F,0x00E3F); (0x017DB,0x017DB); - (0x020A0,0x020B1); + (0x020A0,0x020BE); + (0x0A838,0x0A838); (0x0FDFC,0x0FDFC); (0x0FE69,0x0FE69); (0x0FF04,0x0FF04); - (0x0FFE0,0x0FFE1); - (0x0FFE5,0x0FFE6) + (0x0FFE0,0x0FFE1) ] (* Symbol, Modifier *) let sk = [ @@ -2077,11 +3518,12 @@ let sk = [ (0x000AF,0x000AF); (0x000B4,0x000B4); (0x000B8,0x000B8); - (0x002B9,0x002BA); - (0x002C2,0x002CF); + (0x002C2,0x002C5); (0x002D2,0x002DF); - (0x002E5,0x002ED); - (0x00374,0x00375); + (0x002E5,0x002EB); + (0x002ED,0x002ED); + (0x002EF,0x002FF); + (0x00375,0x00375); (0x00384,0x00385); (0x01FBD,0x01FBD); (0x01FBF,0x01FC1); @@ -2090,44 +3532,67 @@ let sk = [ (0x01FED,0x01FEF); (0x01FFD,0x01FFE); (0x0309B,0x0309C); + (0x0A700,0x0A716); + (0x0A720,0x0A721); + (0x0A789,0x0A78A); + (0x0AB5B,0x0AB5B); + (0x0FBB2,0x0FBC1); (0x0FF3E,0x0FF3E); (0x0FF40,0x0FF40); (0x0FFE3,0x0FFE3) ] (* Symbol, Other *) let so = [ - (0x000A6,0x000A7); + (0x000A6,0x000A6); (0x000A9,0x000A9); (0x000AE,0x000AE); (0x000B0,0x000B0); - (0x000B6,0x000B6); (0x00482,0x00482); + (0x0058D,0x0058E); + (0x0060E,0x0060F); + (0x006DE,0x006DE); (0x006E9,0x006E9); (0x006FD,0x006FE); + (0x007F6,0x007F6); (0x009FA,0x009FA); (0x00B70,0x00B70); + (0x00BF3,0x00BF8); + (0x00BFA,0x00BFA); + (0x00C7F,0x00C7F); + (0x00D4F,0x00D4F); + (0x00D79,0x00D79); (0x00F01,0x00F03); - (0x00F13,0x00F17); + (0x00F13,0x00F13); + (0x00F15,0x00F17); (0x00F1A,0x00F1F); (0x00F34,0x00F34); (0x00F36,0x00F36); (0x00F38,0x00F38); (0x00FBE,0x00FC5); (0x00FC7,0x00FCC); - (0x00FCF,0x00FCF); + (0x00FCE,0x00FCF); + (0x00FD5,0x00FD8); + (0x0109E,0x0109F); + (0x01390,0x01399); + (0x01940,0x01940); + (0x019DE,0x019FF); + (0x01B61,0x01B6A); + (0x01B74,0x01B7C); (0x02100,0x02101); (0x02103,0x02106); (0x02108,0x02109); (0x02114,0x02114); - (0x02116,0x02118); + (0x02116,0x02117); (0x0211E,0x02123); (0x02125,0x02125); (0x02127,0x02127); (0x02129,0x02129); (0x0212E,0x0212E); - (0x02132,0x02132); - (0x0213A,0x0213A); + (0x0213A,0x0213B); (0x0214A,0x0214A); + (0x0214C,0x0214D); + (0x0214F,0x0214F); + (0x0218A,0x0218B); (0x02195,0x02199); (0x0219C,0x0219F); (0x021A1,0x021A2); @@ -2142,31 +3607,27 @@ let so = [ (0x02322,0x02328); (0x0232B,0x0237B); (0x0237D,0x0239A); - (0x023B7,0x023CE); + (0x023B4,0x023DB); + (0x023E2,0x023FE); (0x02400,0x02426); (0x02440,0x0244A); (0x0249C,0x024E9); (0x02500,0x025B6); (0x025B8,0x025C0); (0x025C2,0x025F7); - (0x02600,0x02613); - (0x02616,0x02617); - (0x02619,0x0266E); - (0x02670,0x0267D); - (0x02680,0x02689); - (0x02701,0x02704); - (0x02706,0x02709); - (0x0270C,0x02727); - (0x02729,0x0274B); - (0x0274D,0x0274D); - (0x0274F,0x02752); - (0x02756,0x02756); - (0x02758,0x0275E); - (0x02761,0x02767); - (0x02794,0x02794); - (0x02798,0x027AF); - (0x027B1,0x027BE); + (0x02600,0x0266E); + (0x02670,0x02767); + (0x02794,0x027BF); (0x02800,0x028FF); + (0x02B00,0x02B2F); + (0x02B45,0x02B46); + (0x02B4D,0x02B73); + (0x02B76,0x02B95); + (0x02B98,0x02BB9); + (0x02BBD,0x02BC8); + (0x02BCA,0x02BD1); + (0x02BEC,0x02BEF); + (0x02CE5,0x02CEA); (0x02E80,0x02E99); (0x02E9B,0x02EF3); (0x02F00,0x02FD5); @@ -2178,31 +3639,84 @@ let so = [ (0x0303E,0x0303F); (0x03190,0x03191); (0x03196,0x0319F); - (0x03200,0x0321C); - (0x0322A,0x03243); - (0x03260,0x0327B); - (0x0327F,0x0327F); + (0x031C0,0x031E3); + (0x03200,0x0321E); + (0x0322A,0x03247); + (0x03250,0x03250); + (0x03260,0x0327F); (0x0328A,0x032B0); - (0x032C0,0x032CB); - (0x032D0,0x032FE); - (0x03300,0x03376); - (0x0337B,0x033DD); - (0x033E0,0x033FE); + (0x032C0,0x032FE); + (0x03300,0x033FF); + (0x04DC0,0x04DFF); (0x0A490,0x0A4C6); + (0x0A828,0x0A82B); + (0x0A836,0x0A837); + (0x0A839,0x0A839); + (0x0AA77,0x0AA79); + (0x0FDFD,0x0FDFD); (0x0FFE4,0x0FFE4); (0x0FFE8,0x0FFE8); (0x0FFED,0x0FFEE); (0x0FFFC,0x0FFFD); + (0x10137,0x1013F); + (0x10179,0x10189); + (0x1018C,0x1018E); + (0x10190,0x1019B); + (0x101A0,0x101A0); + (0x101D0,0x101FC); + (0x10877,0x10878); + (0x10AC8,0x10AC8); + (0x1173F,0x1173F); + (0x16B3C,0x16B3F); + (0x16B45,0x16B45); + (0x1BC9C,0x1BC9C); (0x1D000,0x1D0F5); (0x1D100,0x1D126); - (0x1D12A,0x1D164); + (0x1D129,0x1D164); (0x1D16A,0x1D16C); (0x1D183,0x1D184); (0x1D18C,0x1D1A9); - (0x1D1AE,0x1D1DD) + (0x1D1AE,0x1D1E8); + (0x1D200,0x1D241); + (0x1D245,0x1D245); + (0x1D300,0x1D356); + (0x1D800,0x1D9FF); + (0x1DA37,0x1DA3A); + (0x1DA6D,0x1DA74); + (0x1DA76,0x1DA83); + (0x1DA85,0x1DA86); + (0x1F000,0x1F02B); + (0x1F030,0x1F093); + (0x1F0A0,0x1F0AE); + (0x1F0B1,0x1F0BF); + (0x1F0C1,0x1F0CF); + (0x1F0D1,0x1F0F5); + (0x1F110,0x1F12E); + (0x1F130,0x1F16B); + (0x1F170,0x1F1AC); + (0x1F1E6,0x1F202); + (0x1F210,0x1F23B); + (0x1F240,0x1F248); + (0x1F250,0x1F251); + (0x1F300,0x1F3FA); + (0x1F400,0x1F6D2); + (0x1F6E0,0x1F6EC); + (0x1F6F0,0x1F6F6); + (0x1F700,0x1F773); + (0x1F780,0x1F7D4); + (0x1F800,0x1F80B); + (0x1F810,0x1F847); + (0x1F850,0x1F859); + (0x1F860,0x1F887); + (0x1F890,0x1F8AD); + (0x1F910,0x1F91E); + (0x1F920,0x1F927); + (0x1F930,0x1F930); + (0x1F933,0x1F93E); + (0x1F940,0x1F94B); + (0x1F950,0x1F95E); + (0x1F980,0x1F991) ] - -(* Conversion to lower case. *) let to_lower = [ (0x00041,0x0005A), `Delta (32); (0x000C0,0x000D6), `Delta (32); @@ -2358,12 +3872,31 @@ let to_lower = [ (0x0022E,0x0022E), `Abs (0x0022F); (0x00230,0x00230), `Abs (0x00231); (0x00232,0x00232), `Abs (0x00233); + (0x0023A,0x0023A), `Abs (0x02C65); + (0x0023B,0x0023B), `Abs (0x0023C); + (0x0023D,0x0023D), `Abs (0x0019A); + (0x0023E,0x0023E), `Abs (0x02C66); + (0x00241,0x00241), `Abs (0x00242); + (0x00243,0x00243), `Abs (0x00180); + (0x00244,0x00244), `Abs (0x00289); + (0x00245,0x00245), `Abs (0x0028C); + (0x00246,0x00246), `Abs (0x00247); + (0x00248,0x00248), `Abs (0x00249); + (0x0024A,0x0024A), `Abs (0x0024B); + (0x0024C,0x0024C), `Abs (0x0024D); + (0x0024E,0x0024E), `Abs (0x0024F); + (0x00370,0x00370), `Abs (0x00371); + (0x00372,0x00372), `Abs (0x00373); + (0x00376,0x00376), `Abs (0x00377); + (0x0037F,0x0037F), `Abs (0x003F3); (0x00386,0x00386), `Abs (0x003AC); (0x00388,0x0038A), `Delta (37); (0x0038C,0x0038C), `Abs (0x003CC); (0x0038E,0x0038F), `Delta (63); (0x00391,0x003A1), `Delta (32); (0x003A3,0x003AB), `Delta (32); + (0x003CF,0x003CF), `Abs (0x003D7); + (0x003D2,0x003D4), `Delta (0); (0x003D8,0x003D8), `Abs (0x003D9); (0x003DA,0x003DA), `Abs (0x003DB); (0x003DC,0x003DC), `Abs (0x003DD); @@ -2377,6 +3910,10 @@ let to_lower = [ (0x003EC,0x003EC), `Abs (0x003ED); (0x003EE,0x003EE), `Abs (0x003EF); (0x003F4,0x003F4), `Abs (0x003B8); + (0x003F7,0x003F7), `Abs (0x003F8); + (0x003F9,0x003F9), `Abs (0x003F2); + (0x003FA,0x003FA), `Abs (0x003FB); + (0x003FD,0x003FF), `Delta (-130); (0x00400,0x0040F), `Delta (80); (0x00410,0x0042F), `Delta (32); (0x00460,0x00460), `Abs (0x00461); @@ -2423,6 +3960,7 @@ let to_lower = [ (0x004BA,0x004BA), `Abs (0x004BB); (0x004BC,0x004BC), `Abs (0x004BD); (0x004BE,0x004BE), `Abs (0x004BF); + (0x004C0,0x004C0), `Abs (0x004CF); (0x004C1,0x004C1), `Abs (0x004C2); (0x004C3,0x004C3), `Abs (0x004C4); (0x004C5,0x004C5), `Abs (0x004C6); @@ -2449,7 +3987,11 @@ let to_lower = [ (0x004F0,0x004F0), `Abs (0x004F1); (0x004F2,0x004F2), `Abs (0x004F3); (0x004F4,0x004F4), `Abs (0x004F5); + (0x004F6,0x004F6), `Abs (0x004F7); (0x004F8,0x004F8), `Abs (0x004F9); + (0x004FA,0x004FA), `Abs (0x004FB); + (0x004FC,0x004FC), `Abs (0x004FD); + (0x004FE,0x004FE), `Abs (0x004FF); (0x00500,0x00500), `Abs (0x00501); (0x00502,0x00502), `Abs (0x00503); (0x00504,0x00504), `Abs (0x00505); @@ -2458,7 +4000,28 @@ let to_lower = [ (0x0050A,0x0050A), `Abs (0x0050B); (0x0050C,0x0050C), `Abs (0x0050D); (0x0050E,0x0050E), `Abs (0x0050F); + (0x00510,0x00510), `Abs (0x00511); + (0x00512,0x00512), `Abs (0x00513); + (0x00514,0x00514), `Abs (0x00515); + (0x00516,0x00516), `Abs (0x00517); + (0x00518,0x00518), `Abs (0x00519); + (0x0051A,0x0051A), `Abs (0x0051B); + (0x0051C,0x0051C), `Abs (0x0051D); + (0x0051E,0x0051E), `Abs (0x0051F); + (0x00520,0x00520), `Abs (0x00521); + (0x00522,0x00522), `Abs (0x00523); + (0x00524,0x00524), `Abs (0x00525); + (0x00526,0x00526), `Abs (0x00527); + (0x00528,0x00528), `Abs (0x00529); + (0x0052A,0x0052A), `Abs (0x0052B); + (0x0052C,0x0052C), `Abs (0x0052D); + (0x0052E,0x0052E), `Abs (0x0052F); (0x00531,0x00556), `Delta (48); + (0x010A0,0x010C5), `Delta (7264); + (0x010C7,0x010C7), `Abs (0x02D27); + (0x010CD,0x010CD), `Abs (0x02D2D); + (0x013A0,0x013EF), `Delta (38864); + (0x013F0,0x013F5), `Delta (8); (0x01E00,0x01E00), `Abs (0x01E01); (0x01E02,0x01E02), `Abs (0x01E03); (0x01E04,0x01E04), `Abs (0x01E05); @@ -2534,6 +4097,7 @@ let to_lower = [ (0x01E90,0x01E90), `Abs (0x01E91); (0x01E92,0x01E92), `Abs (0x01E93); (0x01E94,0x01E94), `Abs (0x01E95); + (0x01E9E,0x01E9E), `Abs (0x000DF); (0x01EA0,0x01EA0), `Abs (0x01EA1); (0x01EA2,0x01EA2), `Abs (0x01EA3); (0x01EA4,0x01EA4), `Abs (0x01EA5); @@ -2579,6 +4143,9 @@ let to_lower = [ (0x01EF4,0x01EF4), `Abs (0x01EF5); (0x01EF6,0x01EF6), `Abs (0x01EF7); (0x01EF8,0x01EF8), `Abs (0x01EF9); + (0x01EFA,0x01EFA), `Abs (0x01EFB); + (0x01EFC,0x01EFC), `Abs (0x01EFD); + (0x01EFE,0x01EFE), `Abs (0x01EFF); (0x01F08,0x01F0F), `Delta (-8); (0x01F18,0x01F1D), `Delta (-8); (0x01F28,0x01F2F), `Delta (-8); @@ -2599,11 +4166,870 @@ let to_lower = [ (0x01FEC,0x01FEC), `Abs (0x01FE5); (0x01FF8,0x01FF9), `Delta (-128); (0x01FFA,0x01FFB), `Delta (-126); + (0x02102,0x02102), `Abs (0x02102); + (0x02107,0x02107), `Abs (0x02107); + (0x0210B,0x0210D), `Delta (0); + (0x02110,0x02112), `Delta (0); + (0x02115,0x02115), `Abs (0x02115); + (0x02119,0x0211D), `Delta (0); + (0x02124,0x02124), `Abs (0x02124); (0x02126,0x02126), `Abs (0x003C9); + (0x02128,0x02128), `Abs (0x02128); (0x0212A,0x0212A), `Abs (0x0006B); (0x0212B,0x0212B), `Abs (0x000E5); + (0x0212C,0x0212D), `Delta (0); + (0x02130,0x02131), `Delta (0); + (0x02132,0x02132), `Abs (0x0214E); + (0x02133,0x02133), `Abs (0x02133); + (0x0213E,0x0213F), `Delta (0); + (0x02145,0x02145), `Abs (0x02145); + (0x02183,0x02183), `Abs (0x02184); + (0x02C00,0x02C2E), `Delta (48); + (0x02C60,0x02C60), `Abs (0x02C61); + (0x02C62,0x02C62), `Abs (0x0026B); + (0x02C63,0x02C63), `Abs (0x01D7D); + (0x02C64,0x02C64), `Abs (0x0027D); + (0x02C67,0x02C67), `Abs (0x02C68); + (0x02C69,0x02C69), `Abs (0x02C6A); + (0x02C6B,0x02C6B), `Abs (0x02C6C); + (0x02C6D,0x02C6D), `Abs (0x00251); + (0x02C6E,0x02C6E), `Abs (0x00271); + (0x02C6F,0x02C6F), `Abs (0x00250); + (0x02C70,0x02C70), `Abs (0x00252); + (0x02C72,0x02C72), `Abs (0x02C73); + (0x02C75,0x02C75), `Abs (0x02C76); + (0x02C7E,0x02C7F), `Delta (-10815); + (0x02C80,0x02C80), `Abs (0x02C81); + (0x02C82,0x02C82), `Abs (0x02C83); + (0x02C84,0x02C84), `Abs (0x02C85); + (0x02C86,0x02C86), `Abs (0x02C87); + (0x02C88,0x02C88), `Abs (0x02C89); + (0x02C8A,0x02C8A), `Abs (0x02C8B); + (0x02C8C,0x02C8C), `Abs (0x02C8D); + (0x02C8E,0x02C8E), `Abs (0x02C8F); + (0x02C90,0x02C90), `Abs (0x02C91); + (0x02C92,0x02C92), `Abs (0x02C93); + (0x02C94,0x02C94), `Abs (0x02C95); + (0x02C96,0x02C96), `Abs (0x02C97); + (0x02C98,0x02C98), `Abs (0x02C99); + (0x02C9A,0x02C9A), `Abs (0x02C9B); + (0x02C9C,0x02C9C), `Abs (0x02C9D); + (0x02C9E,0x02C9E), `Abs (0x02C9F); + (0x02CA0,0x02CA0), `Abs (0x02CA1); + (0x02CA2,0x02CA2), `Abs (0x02CA3); + (0x02CA4,0x02CA4), `Abs (0x02CA5); + (0x02CA6,0x02CA6), `Abs (0x02CA7); + (0x02CA8,0x02CA8), `Abs (0x02CA9); + (0x02CAA,0x02CAA), `Abs (0x02CAB); + (0x02CAC,0x02CAC), `Abs (0x02CAD); + (0x02CAE,0x02CAE), `Abs (0x02CAF); + (0x02CB0,0x02CB0), `Abs (0x02CB1); + (0x02CB2,0x02CB2), `Abs (0x02CB3); + (0x02CB4,0x02CB4), `Abs (0x02CB5); + (0x02CB6,0x02CB6), `Abs (0x02CB7); + (0x02CB8,0x02CB8), `Abs (0x02CB9); + (0x02CBA,0x02CBA), `Abs (0x02CBB); + (0x02CBC,0x02CBC), `Abs (0x02CBD); + (0x02CBE,0x02CBE), `Abs (0x02CBF); + (0x02CC0,0x02CC0), `Abs (0x02CC1); + (0x02CC2,0x02CC2), `Abs (0x02CC3); + (0x02CC4,0x02CC4), `Abs (0x02CC5); + (0x02CC6,0x02CC6), `Abs (0x02CC7); + (0x02CC8,0x02CC8), `Abs (0x02CC9); + (0x02CCA,0x02CCA), `Abs (0x02CCB); + (0x02CCC,0x02CCC), `Abs (0x02CCD); + (0x02CCE,0x02CCE), `Abs (0x02CCF); + (0x02CD0,0x02CD0), `Abs (0x02CD1); + (0x02CD2,0x02CD2), `Abs (0x02CD3); + (0x02CD4,0x02CD4), `Abs (0x02CD5); + (0x02CD6,0x02CD6), `Abs (0x02CD7); + (0x02CD8,0x02CD8), `Abs (0x02CD9); + (0x02CDA,0x02CDA), `Abs (0x02CDB); + (0x02CDC,0x02CDC), `Abs (0x02CDD); + (0x02CDE,0x02CDE), `Abs (0x02CDF); + (0x02CE0,0x02CE0), `Abs (0x02CE1); + (0x02CE2,0x02CE2), `Abs (0x02CE3); + (0x02CEB,0x02CEB), `Abs (0x02CEC); + (0x02CED,0x02CED), `Abs (0x02CEE); + (0x02CF2,0x02CF2), `Abs (0x02CF3); + (0x0A640,0x0A640), `Abs (0x0A641); + (0x0A642,0x0A642), `Abs (0x0A643); + (0x0A644,0x0A644), `Abs (0x0A645); + (0x0A646,0x0A646), `Abs (0x0A647); + (0x0A648,0x0A648), `Abs (0x0A649); + (0x0A64A,0x0A64A), `Abs (0x0A64B); + (0x0A64C,0x0A64C), `Abs (0x0A64D); + (0x0A64E,0x0A64E), `Abs (0x0A64F); + (0x0A650,0x0A650), `Abs (0x0A651); + (0x0A652,0x0A652), `Abs (0x0A653); + (0x0A654,0x0A654), `Abs (0x0A655); + (0x0A656,0x0A656), `Abs (0x0A657); + (0x0A658,0x0A658), `Abs (0x0A659); + (0x0A65A,0x0A65A), `Abs (0x0A65B); + (0x0A65C,0x0A65C), `Abs (0x0A65D); + (0x0A65E,0x0A65E), `Abs (0x0A65F); + (0x0A660,0x0A660), `Abs (0x0A661); + (0x0A662,0x0A662), `Abs (0x0A663); + (0x0A664,0x0A664), `Abs (0x0A665); + (0x0A666,0x0A666), `Abs (0x0A667); + (0x0A668,0x0A668), `Abs (0x0A669); + (0x0A66A,0x0A66A), `Abs (0x0A66B); + (0x0A66C,0x0A66C), `Abs (0x0A66D); + (0x0A680,0x0A680), `Abs (0x0A681); + (0x0A682,0x0A682), `Abs (0x0A683); + (0x0A684,0x0A684), `Abs (0x0A685); + (0x0A686,0x0A686), `Abs (0x0A687); + (0x0A688,0x0A688), `Abs (0x0A689); + (0x0A68A,0x0A68A), `Abs (0x0A68B); + (0x0A68C,0x0A68C), `Abs (0x0A68D); + (0x0A68E,0x0A68E), `Abs (0x0A68F); + (0x0A690,0x0A690), `Abs (0x0A691); + (0x0A692,0x0A692), `Abs (0x0A693); + (0x0A694,0x0A694), `Abs (0x0A695); + (0x0A696,0x0A696), `Abs (0x0A697); + (0x0A698,0x0A698), `Abs (0x0A699); + (0x0A69A,0x0A69A), `Abs (0x0A69B); + (0x0A722,0x0A722), `Abs (0x0A723); + (0x0A724,0x0A724), `Abs (0x0A725); + (0x0A726,0x0A726), `Abs (0x0A727); + (0x0A728,0x0A728), `Abs (0x0A729); + (0x0A72A,0x0A72A), `Abs (0x0A72B); + (0x0A72C,0x0A72C), `Abs (0x0A72D); + (0x0A72E,0x0A72E), `Abs (0x0A72F); + (0x0A732,0x0A732), `Abs (0x0A733); + (0x0A734,0x0A734), `Abs (0x0A735); + (0x0A736,0x0A736), `Abs (0x0A737); + (0x0A738,0x0A738), `Abs (0x0A739); + (0x0A73A,0x0A73A), `Abs (0x0A73B); + (0x0A73C,0x0A73C), `Abs (0x0A73D); + (0x0A73E,0x0A73E), `Abs (0x0A73F); + (0x0A740,0x0A740), `Abs (0x0A741); + (0x0A742,0x0A742), `Abs (0x0A743); + (0x0A744,0x0A744), `Abs (0x0A745); + (0x0A746,0x0A746), `Abs (0x0A747); + (0x0A748,0x0A748), `Abs (0x0A749); + (0x0A74A,0x0A74A), `Abs (0x0A74B); + (0x0A74C,0x0A74C), `Abs (0x0A74D); + (0x0A74E,0x0A74E), `Abs (0x0A74F); + (0x0A750,0x0A750), `Abs (0x0A751); + (0x0A752,0x0A752), `Abs (0x0A753); + (0x0A754,0x0A754), `Abs (0x0A755); + (0x0A756,0x0A756), `Abs (0x0A757); + (0x0A758,0x0A758), `Abs (0x0A759); + (0x0A75A,0x0A75A), `Abs (0x0A75B); + (0x0A75C,0x0A75C), `Abs (0x0A75D); + (0x0A75E,0x0A75E), `Abs (0x0A75F); + (0x0A760,0x0A760), `Abs (0x0A761); + (0x0A762,0x0A762), `Abs (0x0A763); + (0x0A764,0x0A764), `Abs (0x0A765); + (0x0A766,0x0A766), `Abs (0x0A767); + (0x0A768,0x0A768), `Abs (0x0A769); + (0x0A76A,0x0A76A), `Abs (0x0A76B); + (0x0A76C,0x0A76C), `Abs (0x0A76D); + (0x0A76E,0x0A76E), `Abs (0x0A76F); + (0x0A779,0x0A779), `Abs (0x0A77A); + (0x0A77B,0x0A77B), `Abs (0x0A77C); + (0x0A77D,0x0A77D), `Abs (0x01D79); + (0x0A77E,0x0A77E), `Abs (0x0A77F); + (0x0A780,0x0A780), `Abs (0x0A781); + (0x0A782,0x0A782), `Abs (0x0A783); + (0x0A784,0x0A784), `Abs (0x0A785); + (0x0A786,0x0A786), `Abs (0x0A787); + (0x0A78B,0x0A78B), `Abs (0x0A78C); + (0x0A78D,0x0A78D), `Abs (0x00265); + (0x0A790,0x0A790), `Abs (0x0A791); + (0x0A792,0x0A792), `Abs (0x0A793); + (0x0A796,0x0A796), `Abs (0x0A797); + (0x0A798,0x0A798), `Abs (0x0A799); + (0x0A79A,0x0A79A), `Abs (0x0A79B); + (0x0A79C,0x0A79C), `Abs (0x0A79D); + (0x0A79E,0x0A79E), `Abs (0x0A79F); + (0x0A7A0,0x0A7A0), `Abs (0x0A7A1); + (0x0A7A2,0x0A7A2), `Abs (0x0A7A3); + (0x0A7A4,0x0A7A4), `Abs (0x0A7A5); + (0x0A7A6,0x0A7A6), `Abs (0x0A7A7); + (0x0A7A8,0x0A7A8), `Abs (0x0A7A9); + (0x0A7AA,0x0A7AA), `Abs (0x00266); + (0x0A7AB,0x0A7AB), `Abs (0x0025C); + (0x0A7AC,0x0A7AC), `Abs (0x00261); + (0x0A7AD,0x0A7AD), `Abs (0x0026C); + (0x0A7AE,0x0A7AE), `Abs (0x0026A); + (0x0A7B0,0x0A7B0), `Abs (0x0029E); + (0x0A7B1,0x0A7B1), `Abs (0x00287); + (0x0A7B2,0x0A7B2), `Abs (0x0029D); + (0x0A7B3,0x0A7B3), `Abs (0x0AB53); + (0x0A7B4,0x0A7B4), `Abs (0x0A7B5); + (0x0A7B6,0x0A7B6), `Abs (0x0A7B7); (0x0FF21,0x0FF3A), `Delta (32); - (0x10400,0x10425), `Delta (40); + (0x10400,0x10427), `Delta (40); + (0x104B0,0x104D3), `Delta (40); + (0x10C80,0x10CB2), `Delta (64); + (0x118A0,0x118BF), `Delta (32); + (0x1D400,0x1D419), `Delta (0); + (0x1D434,0x1D44D), `Delta (0); + (0x1D468,0x1D481), `Delta (0); + (0x1D49C,0x1D49C), `Abs (0x1D49C); + (0x1D49E,0x1D49F), `Delta (0); + (0x1D4A2,0x1D4A2), `Abs (0x1D4A2); + (0x1D4A5,0x1D4A6), `Delta (0); + (0x1D4A9,0x1D4AC), `Delta (0); + (0x1D4AE,0x1D4B5), `Delta (0); + (0x1D4D0,0x1D4E9), `Delta (0); + (0x1D504,0x1D505), `Delta (0); + (0x1D507,0x1D50A), `Delta (0); + (0x1D50D,0x1D514), `Delta (0); + (0x1D516,0x1D51C), `Delta (0); + (0x1D538,0x1D539), `Delta (0); + (0x1D53B,0x1D53E), `Delta (0); + (0x1D540,0x1D544), `Delta (0); + (0x1D546,0x1D546), `Abs (0x1D546); + (0x1D54A,0x1D550), `Delta (0); + (0x1D56C,0x1D585), `Delta (0); + (0x1D5A0,0x1D5B9), `Delta (0); + (0x1D5D4,0x1D5ED), `Delta (0); + (0x1D608,0x1D621), `Delta (0); + (0x1D63C,0x1D655), `Delta (0); + (0x1D670,0x1D689), `Delta (0); + (0x1D6A8,0x1D6C0), `Delta (0); + (0x1D6E2,0x1D6FA), `Delta (0); + (0x1D71C,0x1D734), `Delta (0); + (0x1D756,0x1D76E), `Delta (0); + (0x1D790,0x1D7A8), `Delta (0); + (0x1D7CA,0x1D7CA), `Abs (0x1D7CA); + (0x1E900,0x1E921), `Delta (34); + (0x00061,0x0007A), `Delta (0); + (0x000B5,0x000B5), `Abs (0x000B5); + (0x000DF,0x000F6), `Delta (0); + (0x000F8,0x000FF), `Delta (0); + (0x00101,0x00101), `Abs (0x00101); + (0x00103,0x00103), `Abs (0x00103); + (0x00105,0x00105), `Abs (0x00105); + (0x00107,0x00107), `Abs (0x00107); + (0x00109,0x00109), `Abs (0x00109); + (0x0010B,0x0010B), `Abs (0x0010B); + (0x0010D,0x0010D), `Abs (0x0010D); + (0x0010F,0x0010F), `Abs (0x0010F); + (0x00111,0x00111), `Abs (0x00111); + (0x00113,0x00113), `Abs (0x00113); + (0x00115,0x00115), `Abs (0x00115); + (0x00117,0x00117), `Abs (0x00117); + (0x00119,0x00119), `Abs (0x00119); + (0x0011B,0x0011B), `Abs (0x0011B); + (0x0011D,0x0011D), `Abs (0x0011D); + (0x0011F,0x0011F), `Abs (0x0011F); + (0x00121,0x00121), `Abs (0x00121); + (0x00123,0x00123), `Abs (0x00123); + (0x00125,0x00125), `Abs (0x00125); + (0x00127,0x00127), `Abs (0x00127); + (0x00129,0x00129), `Abs (0x00129); + (0x0012B,0x0012B), `Abs (0x0012B); + (0x0012D,0x0012D), `Abs (0x0012D); + (0x0012F,0x0012F), `Abs (0x0012F); + (0x00131,0x00131), `Abs (0x00131); + (0x00133,0x00133), `Abs (0x00133); + (0x00135,0x00135), `Abs (0x00135); + (0x00137,0x00138), `Delta (0); + (0x0013A,0x0013A), `Abs (0x0013A); + (0x0013C,0x0013C), `Abs (0x0013C); + (0x0013E,0x0013E), `Abs (0x0013E); + (0x00140,0x00140), `Abs (0x00140); + (0x00142,0x00142), `Abs (0x00142); + (0x00144,0x00144), `Abs (0x00144); + (0x00146,0x00146), `Abs (0x00146); + (0x00148,0x00149), `Delta (0); + (0x0014B,0x0014B), `Abs (0x0014B); + (0x0014D,0x0014D), `Abs (0x0014D); + (0x0014F,0x0014F), `Abs (0x0014F); + (0x00151,0x00151), `Abs (0x00151); + (0x00153,0x00153), `Abs (0x00153); + (0x00155,0x00155), `Abs (0x00155); + (0x00157,0x00157), `Abs (0x00157); + (0x00159,0x00159), `Abs (0x00159); + (0x0015B,0x0015B), `Abs (0x0015B); + (0x0015D,0x0015D), `Abs (0x0015D); + (0x0015F,0x0015F), `Abs (0x0015F); + (0x00161,0x00161), `Abs (0x00161); + (0x00163,0x00163), `Abs (0x00163); + (0x00165,0x00165), `Abs (0x00165); + (0x00167,0x00167), `Abs (0x00167); + (0x00169,0x00169), `Abs (0x00169); + (0x0016B,0x0016B), `Abs (0x0016B); + (0x0016D,0x0016D), `Abs (0x0016D); + (0x0016F,0x0016F), `Abs (0x0016F); + (0x00171,0x00171), `Abs (0x00171); + (0x00173,0x00173), `Abs (0x00173); + (0x00175,0x00175), `Abs (0x00175); + (0x00177,0x00177), `Abs (0x00177); + (0x0017A,0x0017A), `Abs (0x0017A); + (0x0017C,0x0017C), `Abs (0x0017C); + (0x0017E,0x00180), `Delta (0); + (0x00183,0x00183), `Abs (0x00183); + (0x00185,0x00185), `Abs (0x00185); + (0x00188,0x00188), `Abs (0x00188); + (0x0018C,0x0018D), `Delta (0); + (0x00192,0x00192), `Abs (0x00192); + (0x00195,0x00195), `Abs (0x00195); + (0x00199,0x0019B), `Delta (0); + (0x0019E,0x0019E), `Abs (0x0019E); + (0x001A1,0x001A1), `Abs (0x001A1); + (0x001A3,0x001A3), `Abs (0x001A3); + (0x001A5,0x001A5), `Abs (0x001A5); + (0x001A8,0x001A8), `Abs (0x001A8); + (0x001AA,0x001AB), `Delta (0); + (0x001AD,0x001AD), `Abs (0x001AD); + (0x001B0,0x001B0), `Abs (0x001B0); + (0x001B4,0x001B4), `Abs (0x001B4); + (0x001B6,0x001B6), `Abs (0x001B6); + (0x001B9,0x001BA), `Delta (0); + (0x001BD,0x001BF), `Delta (0); + (0x001C6,0x001C6), `Abs (0x001C6); + (0x001C9,0x001C9), `Abs (0x001C9); + (0x001CC,0x001CC), `Abs (0x001CC); + (0x001CE,0x001CE), `Abs (0x001CE); + (0x001D0,0x001D0), `Abs (0x001D0); + (0x001D2,0x001D2), `Abs (0x001D2); + (0x001D4,0x001D4), `Abs (0x001D4); + (0x001D6,0x001D6), `Abs (0x001D6); + (0x001D8,0x001D8), `Abs (0x001D8); + (0x001DA,0x001DA), `Abs (0x001DA); + (0x001DC,0x001DD), `Delta (0); + (0x001DF,0x001DF), `Abs (0x001DF); + (0x001E1,0x001E1), `Abs (0x001E1); + (0x001E3,0x001E3), `Abs (0x001E3); + (0x001E5,0x001E5), `Abs (0x001E5); + (0x001E7,0x001E7), `Abs (0x001E7); + (0x001E9,0x001E9), `Abs (0x001E9); + (0x001EB,0x001EB), `Abs (0x001EB); + (0x001ED,0x001ED), `Abs (0x001ED); + (0x001EF,0x001F0), `Delta (0); + (0x001F3,0x001F3), `Abs (0x001F3); + (0x001F5,0x001F5), `Abs (0x001F5); + (0x001F9,0x001F9), `Abs (0x001F9); + (0x001FB,0x001FB), `Abs (0x001FB); + (0x001FD,0x001FD), `Abs (0x001FD); + (0x001FF,0x001FF), `Abs (0x001FF); + (0x00201,0x00201), `Abs (0x00201); + (0x00203,0x00203), `Abs (0x00203); + (0x00205,0x00205), `Abs (0x00205); + (0x00207,0x00207), `Abs (0x00207); + (0x00209,0x00209), `Abs (0x00209); + (0x0020B,0x0020B), `Abs (0x0020B); + (0x0020D,0x0020D), `Abs (0x0020D); + (0x0020F,0x0020F), `Abs (0x0020F); + (0x00211,0x00211), `Abs (0x00211); + (0x00213,0x00213), `Abs (0x00213); + (0x00215,0x00215), `Abs (0x00215); + (0x00217,0x00217), `Abs (0x00217); + (0x00219,0x00219), `Abs (0x00219); + (0x0021B,0x0021B), `Abs (0x0021B); + (0x0021D,0x0021D), `Abs (0x0021D); + (0x0021F,0x0021F), `Abs (0x0021F); + (0x00221,0x00221), `Abs (0x00221); + (0x00223,0x00223), `Abs (0x00223); + (0x00225,0x00225), `Abs (0x00225); + (0x00227,0x00227), `Abs (0x00227); + (0x00229,0x00229), `Abs (0x00229); + (0x0022B,0x0022B), `Abs (0x0022B); + (0x0022D,0x0022D), `Abs (0x0022D); + (0x0022F,0x0022F), `Abs (0x0022F); + (0x00231,0x00231), `Abs (0x00231); + (0x00233,0x00239), `Delta (0); + (0x0023C,0x0023C), `Abs (0x0023C); + (0x0023F,0x00240), `Delta (0); + (0x00242,0x00242), `Abs (0x00242); + (0x00247,0x00247), `Abs (0x00247); + (0x00249,0x00249), `Abs (0x00249); + (0x0024B,0x0024B), `Abs (0x0024B); + (0x0024D,0x0024D), `Abs (0x0024D); + (0x0024F,0x00293), `Delta (0); + (0x00295,0x002AF), `Delta (0); + (0x00371,0x00371), `Abs (0x00371); + (0x00373,0x00373), `Abs (0x00373); + (0x00377,0x00377), `Abs (0x00377); + (0x0037B,0x0037D), `Delta (0); + (0x00390,0x00390), `Abs (0x00390); + (0x003AC,0x003CE), `Delta (0); + (0x003D0,0x003D1), `Delta (0); + (0x003D5,0x003D7), `Delta (0); + (0x003D9,0x003D9), `Abs (0x003D9); + (0x003DB,0x003DB), `Abs (0x003DB); + (0x003DD,0x003DD), `Abs (0x003DD); + (0x003DF,0x003DF), `Abs (0x003DF); + (0x003E1,0x003E1), `Abs (0x003E1); + (0x003E3,0x003E3), `Abs (0x003E3); + (0x003E5,0x003E5), `Abs (0x003E5); + (0x003E7,0x003E7), `Abs (0x003E7); + (0x003E9,0x003E9), `Abs (0x003E9); + (0x003EB,0x003EB), `Abs (0x003EB); + (0x003ED,0x003ED), `Abs (0x003ED); + (0x003EF,0x003F3), `Delta (0); + (0x003F5,0x003F5), `Abs (0x003F5); + (0x003F8,0x003F8), `Abs (0x003F8); + (0x003FB,0x003FC), `Delta (0); + (0x00430,0x0045F), `Delta (0); + (0x00461,0x00461), `Abs (0x00461); + (0x00463,0x00463), `Abs (0x00463); + (0x00465,0x00465), `Abs (0x00465); + (0x00467,0x00467), `Abs (0x00467); + (0x00469,0x00469), `Abs (0x00469); + (0x0046B,0x0046B), `Abs (0x0046B); + (0x0046D,0x0046D), `Abs (0x0046D); + (0x0046F,0x0046F), `Abs (0x0046F); + (0x00471,0x00471), `Abs (0x00471); + (0x00473,0x00473), `Abs (0x00473); + (0x00475,0x00475), `Abs (0x00475); + (0x00477,0x00477), `Abs (0x00477); + (0x00479,0x00479), `Abs (0x00479); + (0x0047B,0x0047B), `Abs (0x0047B); + (0x0047D,0x0047D), `Abs (0x0047D); + (0x0047F,0x0047F), `Abs (0x0047F); + (0x00481,0x00481), `Abs (0x00481); + (0x0048B,0x0048B), `Abs (0x0048B); + (0x0048D,0x0048D), `Abs (0x0048D); + (0x0048F,0x0048F), `Abs (0x0048F); + (0x00491,0x00491), `Abs (0x00491); + (0x00493,0x00493), `Abs (0x00493); + (0x00495,0x00495), `Abs (0x00495); + (0x00497,0x00497), `Abs (0x00497); + (0x00499,0x00499), `Abs (0x00499); + (0x0049B,0x0049B), `Abs (0x0049B); + (0x0049D,0x0049D), `Abs (0x0049D); + (0x0049F,0x0049F), `Abs (0x0049F); + (0x004A1,0x004A1), `Abs (0x004A1); + (0x004A3,0x004A3), `Abs (0x004A3); + (0x004A5,0x004A5), `Abs (0x004A5); + (0x004A7,0x004A7), `Abs (0x004A7); + (0x004A9,0x004A9), `Abs (0x004A9); + (0x004AB,0x004AB), `Abs (0x004AB); + (0x004AD,0x004AD), `Abs (0x004AD); + (0x004AF,0x004AF), `Abs (0x004AF); + (0x004B1,0x004B1), `Abs (0x004B1); + (0x004B3,0x004B3), `Abs (0x004B3); + (0x004B5,0x004B5), `Abs (0x004B5); + (0x004B7,0x004B7), `Abs (0x004B7); + (0x004B9,0x004B9), `Abs (0x004B9); + (0x004BB,0x004BB), `Abs (0x004BB); + (0x004BD,0x004BD), `Abs (0x004BD); + (0x004BF,0x004BF), `Abs (0x004BF); + (0x004C2,0x004C2), `Abs (0x004C2); + (0x004C4,0x004C4), `Abs (0x004C4); + (0x004C6,0x004C6), `Abs (0x004C6); + (0x004C8,0x004C8), `Abs (0x004C8); + (0x004CA,0x004CA), `Abs (0x004CA); + (0x004CC,0x004CC), `Abs (0x004CC); + (0x004CE,0x004CF), `Delta (0); + (0x004D1,0x004D1), `Abs (0x004D1); + (0x004D3,0x004D3), `Abs (0x004D3); + (0x004D5,0x004D5), `Abs (0x004D5); + (0x004D7,0x004D7), `Abs (0x004D7); + (0x004D9,0x004D9), `Abs (0x004D9); + (0x004DB,0x004DB), `Abs (0x004DB); + (0x004DD,0x004DD), `Abs (0x004DD); + (0x004DF,0x004DF), `Abs (0x004DF); + (0x004E1,0x004E1), `Abs (0x004E1); + (0x004E3,0x004E3), `Abs (0x004E3); + (0x004E5,0x004E5), `Abs (0x004E5); + (0x004E7,0x004E7), `Abs (0x004E7); + (0x004E9,0x004E9), `Abs (0x004E9); + (0x004EB,0x004EB), `Abs (0x004EB); + (0x004ED,0x004ED), `Abs (0x004ED); + (0x004EF,0x004EF), `Abs (0x004EF); + (0x004F1,0x004F1), `Abs (0x004F1); + (0x004F3,0x004F3), `Abs (0x004F3); + (0x004F5,0x004F5), `Abs (0x004F5); + (0x004F7,0x004F7), `Abs (0x004F7); + (0x004F9,0x004F9), `Abs (0x004F9); + (0x004FB,0x004FB), `Abs (0x004FB); + (0x004FD,0x004FD), `Abs (0x004FD); + (0x004FF,0x004FF), `Abs (0x004FF); + (0x00501,0x00501), `Abs (0x00501); + (0x00503,0x00503), `Abs (0x00503); + (0x00505,0x00505), `Abs (0x00505); + (0x00507,0x00507), `Abs (0x00507); + (0x00509,0x00509), `Abs (0x00509); + (0x0050B,0x0050B), `Abs (0x0050B); + (0x0050D,0x0050D), `Abs (0x0050D); + (0x0050F,0x0050F), `Abs (0x0050F); + (0x00511,0x00511), `Abs (0x00511); + (0x00513,0x00513), `Abs (0x00513); + (0x00515,0x00515), `Abs (0x00515); + (0x00517,0x00517), `Abs (0x00517); + (0x00519,0x00519), `Abs (0x00519); + (0x0051B,0x0051B), `Abs (0x0051B); + (0x0051D,0x0051D), `Abs (0x0051D); + (0x0051F,0x0051F), `Abs (0x0051F); + (0x00521,0x00521), `Abs (0x00521); + (0x00523,0x00523), `Abs (0x00523); + (0x00525,0x00525), `Abs (0x00525); + (0x00527,0x00527), `Abs (0x00527); + (0x00529,0x00529), `Abs (0x00529); + (0x0052B,0x0052B), `Abs (0x0052B); + (0x0052D,0x0052D), `Abs (0x0052D); + (0x0052F,0x0052F), `Abs (0x0052F); + (0x00561,0x00587), `Delta (0); + (0x013F8,0x013FD), `Delta (0); + (0x01C80,0x01C88), `Delta (0); + (0x01D00,0x01D2B), `Delta (0); + (0x01D6B,0x01D77), `Delta (0); + (0x01D79,0x01D9A), `Delta (0); + (0x01E01,0x01E01), `Abs (0x01E01); + (0x01E03,0x01E03), `Abs (0x01E03); + (0x01E05,0x01E05), `Abs (0x01E05); + (0x01E07,0x01E07), `Abs (0x01E07); + (0x01E09,0x01E09), `Abs (0x01E09); + (0x01E0B,0x01E0B), `Abs (0x01E0B); + (0x01E0D,0x01E0D), `Abs (0x01E0D); + (0x01E0F,0x01E0F), `Abs (0x01E0F); + (0x01E11,0x01E11), `Abs (0x01E11); + (0x01E13,0x01E13), `Abs (0x01E13); + (0x01E15,0x01E15), `Abs (0x01E15); + (0x01E17,0x01E17), `Abs (0x01E17); + (0x01E19,0x01E19), `Abs (0x01E19); + (0x01E1B,0x01E1B), `Abs (0x01E1B); + (0x01E1D,0x01E1D), `Abs (0x01E1D); + (0x01E1F,0x01E1F), `Abs (0x01E1F); + (0x01E21,0x01E21), `Abs (0x01E21); + (0x01E23,0x01E23), `Abs (0x01E23); + (0x01E25,0x01E25), `Abs (0x01E25); + (0x01E27,0x01E27), `Abs (0x01E27); + (0x01E29,0x01E29), `Abs (0x01E29); + (0x01E2B,0x01E2B), `Abs (0x01E2B); + (0x01E2D,0x01E2D), `Abs (0x01E2D); + (0x01E2F,0x01E2F), `Abs (0x01E2F); + (0x01E31,0x01E31), `Abs (0x01E31); + (0x01E33,0x01E33), `Abs (0x01E33); + (0x01E35,0x01E35), `Abs (0x01E35); + (0x01E37,0x01E37), `Abs (0x01E37); + (0x01E39,0x01E39), `Abs (0x01E39); + (0x01E3B,0x01E3B), `Abs (0x01E3B); + (0x01E3D,0x01E3D), `Abs (0x01E3D); + (0x01E3F,0x01E3F), `Abs (0x01E3F); + (0x01E41,0x01E41), `Abs (0x01E41); + (0x01E43,0x01E43), `Abs (0x01E43); + (0x01E45,0x01E45), `Abs (0x01E45); + (0x01E47,0x01E47), `Abs (0x01E47); + (0x01E49,0x01E49), `Abs (0x01E49); + (0x01E4B,0x01E4B), `Abs (0x01E4B); + (0x01E4D,0x01E4D), `Abs (0x01E4D); + (0x01E4F,0x01E4F), `Abs (0x01E4F); + (0x01E51,0x01E51), `Abs (0x01E51); + (0x01E53,0x01E53), `Abs (0x01E53); + (0x01E55,0x01E55), `Abs (0x01E55); + (0x01E57,0x01E57), `Abs (0x01E57); + (0x01E59,0x01E59), `Abs (0x01E59); + (0x01E5B,0x01E5B), `Abs (0x01E5B); + (0x01E5D,0x01E5D), `Abs (0x01E5D); + (0x01E5F,0x01E5F), `Abs (0x01E5F); + (0x01E61,0x01E61), `Abs (0x01E61); + (0x01E63,0x01E63), `Abs (0x01E63); + (0x01E65,0x01E65), `Abs (0x01E65); + (0x01E67,0x01E67), `Abs (0x01E67); + (0x01E69,0x01E69), `Abs (0x01E69); + (0x01E6B,0x01E6B), `Abs (0x01E6B); + (0x01E6D,0x01E6D), `Abs (0x01E6D); + (0x01E6F,0x01E6F), `Abs (0x01E6F); + (0x01E71,0x01E71), `Abs (0x01E71); + (0x01E73,0x01E73), `Abs (0x01E73); + (0x01E75,0x01E75), `Abs (0x01E75); + (0x01E77,0x01E77), `Abs (0x01E77); + (0x01E79,0x01E79), `Abs (0x01E79); + (0x01E7B,0x01E7B), `Abs (0x01E7B); + (0x01E7D,0x01E7D), `Abs (0x01E7D); + (0x01E7F,0x01E7F), `Abs (0x01E7F); + (0x01E81,0x01E81), `Abs (0x01E81); + (0x01E83,0x01E83), `Abs (0x01E83); + (0x01E85,0x01E85), `Abs (0x01E85); + (0x01E87,0x01E87), `Abs (0x01E87); + (0x01E89,0x01E89), `Abs (0x01E89); + (0x01E8B,0x01E8B), `Abs (0x01E8B); + (0x01E8D,0x01E8D), `Abs (0x01E8D); + (0x01E8F,0x01E8F), `Abs (0x01E8F); + (0x01E91,0x01E91), `Abs (0x01E91); + (0x01E93,0x01E93), `Abs (0x01E93); + (0x01E95,0x01E9D), `Delta (0); + (0x01E9F,0x01E9F), `Abs (0x01E9F); + (0x01EA1,0x01EA1), `Abs (0x01EA1); + (0x01EA3,0x01EA3), `Abs (0x01EA3); + (0x01EA5,0x01EA5), `Abs (0x01EA5); + (0x01EA7,0x01EA7), `Abs (0x01EA7); + (0x01EA9,0x01EA9), `Abs (0x01EA9); + (0x01EAB,0x01EAB), `Abs (0x01EAB); + (0x01EAD,0x01EAD), `Abs (0x01EAD); + (0x01EAF,0x01EAF), `Abs (0x01EAF); + (0x01EB1,0x01EB1), `Abs (0x01EB1); + (0x01EB3,0x01EB3), `Abs (0x01EB3); + (0x01EB5,0x01EB5), `Abs (0x01EB5); + (0x01EB7,0x01EB7), `Abs (0x01EB7); + (0x01EB9,0x01EB9), `Abs (0x01EB9); + (0x01EBB,0x01EBB), `Abs (0x01EBB); + (0x01EBD,0x01EBD), `Abs (0x01EBD); + (0x01EBF,0x01EBF), `Abs (0x01EBF); + (0x01EC1,0x01EC1), `Abs (0x01EC1); + (0x01EC3,0x01EC3), `Abs (0x01EC3); + (0x01EC5,0x01EC5), `Abs (0x01EC5); + (0x01EC7,0x01EC7), `Abs (0x01EC7); + (0x01EC9,0x01EC9), `Abs (0x01EC9); + (0x01ECB,0x01ECB), `Abs (0x01ECB); + (0x01ECD,0x01ECD), `Abs (0x01ECD); + (0x01ECF,0x01ECF), `Abs (0x01ECF); + (0x01ED1,0x01ED1), `Abs (0x01ED1); + (0x01ED3,0x01ED3), `Abs (0x01ED3); + (0x01ED5,0x01ED5), `Abs (0x01ED5); + (0x01ED7,0x01ED7), `Abs (0x01ED7); + (0x01ED9,0x01ED9), `Abs (0x01ED9); + (0x01EDB,0x01EDB), `Abs (0x01EDB); + (0x01EDD,0x01EDD), `Abs (0x01EDD); + (0x01EDF,0x01EDF), `Abs (0x01EDF); + (0x01EE1,0x01EE1), `Abs (0x01EE1); + (0x01EE3,0x01EE3), `Abs (0x01EE3); + (0x01EE5,0x01EE5), `Abs (0x01EE5); + (0x01EE7,0x01EE7), `Abs (0x01EE7); + (0x01EE9,0x01EE9), `Abs (0x01EE9); + (0x01EEB,0x01EEB), `Abs (0x01EEB); + (0x01EED,0x01EED), `Abs (0x01EED); + (0x01EEF,0x01EEF), `Abs (0x01EEF); + (0x01EF1,0x01EF1), `Abs (0x01EF1); + (0x01EF3,0x01EF3), `Abs (0x01EF3); + (0x01EF5,0x01EF5), `Abs (0x01EF5); + (0x01EF7,0x01EF7), `Abs (0x01EF7); + (0x01EF9,0x01EF9), `Abs (0x01EF9); + (0x01EFB,0x01EFB), `Abs (0x01EFB); + (0x01EFD,0x01EFD), `Abs (0x01EFD); + (0x01EFF,0x01F07), `Delta (0); + (0x01F10,0x01F15), `Delta (0); + (0x01F20,0x01F27), `Delta (0); + (0x01F30,0x01F37), `Delta (0); + (0x01F40,0x01F45), `Delta (0); + (0x01F50,0x01F57), `Delta (0); + (0x01F60,0x01F67), `Delta (0); + (0x01F70,0x01F7D), `Delta (0); + (0x01F80,0x01F87), `Delta (0); + (0x01F90,0x01F97), `Delta (0); + (0x01FA0,0x01FA7), `Delta (0); + (0x01FB0,0x01FB4), `Delta (0); + (0x01FB6,0x01FB7), `Delta (0); + (0x01FBE,0x01FBE), `Abs (0x01FBE); + (0x01FC2,0x01FC4), `Delta (0); + (0x01FC6,0x01FC7), `Delta (0); + (0x01FD0,0x01FD3), `Delta (0); + (0x01FD6,0x01FD7), `Delta (0); + (0x01FE0,0x01FE7), `Delta (0); + (0x01FF2,0x01FF4), `Delta (0); + (0x01FF6,0x01FF7), `Delta (0); + (0x0210A,0x0210A), `Abs (0x0210A); + (0x0210E,0x0210F), `Delta (0); + (0x02113,0x02113), `Abs (0x02113); + (0x0212F,0x0212F), `Abs (0x0212F); + (0x02134,0x02134), `Abs (0x02134); + (0x02139,0x02139), `Abs (0x02139); + (0x0213C,0x0213D), `Delta (0); + (0x02146,0x02149), `Delta (0); + (0x0214E,0x0214E), `Abs (0x0214E); + (0x02184,0x02184), `Abs (0x02184); + (0x02C30,0x02C5E), `Delta (0); + (0x02C61,0x02C61), `Abs (0x02C61); + (0x02C65,0x02C66), `Delta (0); + (0x02C68,0x02C68), `Abs (0x02C68); + (0x02C6A,0x02C6A), `Abs (0x02C6A); + (0x02C6C,0x02C6C), `Abs (0x02C6C); + (0x02C71,0x02C71), `Abs (0x02C71); + (0x02C73,0x02C74), `Delta (0); + (0x02C76,0x02C7B), `Delta (0); + (0x02C81,0x02C81), `Abs (0x02C81); + (0x02C83,0x02C83), `Abs (0x02C83); + (0x02C85,0x02C85), `Abs (0x02C85); + (0x02C87,0x02C87), `Abs (0x02C87); + (0x02C89,0x02C89), `Abs (0x02C89); + (0x02C8B,0x02C8B), `Abs (0x02C8B); + (0x02C8D,0x02C8D), `Abs (0x02C8D); + (0x02C8F,0x02C8F), `Abs (0x02C8F); + (0x02C91,0x02C91), `Abs (0x02C91); + (0x02C93,0x02C93), `Abs (0x02C93); + (0x02C95,0x02C95), `Abs (0x02C95); + (0x02C97,0x02C97), `Abs (0x02C97); + (0x02C99,0x02C99), `Abs (0x02C99); + (0x02C9B,0x02C9B), `Abs (0x02C9B); + (0x02C9D,0x02C9D), `Abs (0x02C9D); + (0x02C9F,0x02C9F), `Abs (0x02C9F); + (0x02CA1,0x02CA1), `Abs (0x02CA1); + (0x02CA3,0x02CA3), `Abs (0x02CA3); + (0x02CA5,0x02CA5), `Abs (0x02CA5); + (0x02CA7,0x02CA7), `Abs (0x02CA7); + (0x02CA9,0x02CA9), `Abs (0x02CA9); + (0x02CAB,0x02CAB), `Abs (0x02CAB); + (0x02CAD,0x02CAD), `Abs (0x02CAD); + (0x02CAF,0x02CAF), `Abs (0x02CAF); + (0x02CB1,0x02CB1), `Abs (0x02CB1); + (0x02CB3,0x02CB3), `Abs (0x02CB3); + (0x02CB5,0x02CB5), `Abs (0x02CB5); + (0x02CB7,0x02CB7), `Abs (0x02CB7); + (0x02CB9,0x02CB9), `Abs (0x02CB9); + (0x02CBB,0x02CBB), `Abs (0x02CBB); + (0x02CBD,0x02CBD), `Abs (0x02CBD); + (0x02CBF,0x02CBF), `Abs (0x02CBF); + (0x02CC1,0x02CC1), `Abs (0x02CC1); + (0x02CC3,0x02CC3), `Abs (0x02CC3); + (0x02CC5,0x02CC5), `Abs (0x02CC5); + (0x02CC7,0x02CC7), `Abs (0x02CC7); + (0x02CC9,0x02CC9), `Abs (0x02CC9); + (0x02CCB,0x02CCB), `Abs (0x02CCB); + (0x02CCD,0x02CCD), `Abs (0x02CCD); + (0x02CCF,0x02CCF), `Abs (0x02CCF); + (0x02CD1,0x02CD1), `Abs (0x02CD1); + (0x02CD3,0x02CD3), `Abs (0x02CD3); + (0x02CD5,0x02CD5), `Abs (0x02CD5); + (0x02CD7,0x02CD7), `Abs (0x02CD7); + (0x02CD9,0x02CD9), `Abs (0x02CD9); + (0x02CDB,0x02CDB), `Abs (0x02CDB); + (0x02CDD,0x02CDD), `Abs (0x02CDD); + (0x02CDF,0x02CDF), `Abs (0x02CDF); + (0x02CE1,0x02CE1), `Abs (0x02CE1); + (0x02CE3,0x02CE4), `Delta (0); + (0x02CEC,0x02CEC), `Abs (0x02CEC); + (0x02CEE,0x02CEE), `Abs (0x02CEE); + (0x02CF3,0x02CF3), `Abs (0x02CF3); + (0x02D00,0x02D25), `Delta (0); + (0x02D27,0x02D27), `Abs (0x02D27); + (0x02D2D,0x02D2D), `Abs (0x02D2D); + (0x0A641,0x0A641), `Abs (0x0A641); + (0x0A643,0x0A643), `Abs (0x0A643); + (0x0A645,0x0A645), `Abs (0x0A645); + (0x0A647,0x0A647), `Abs (0x0A647); + (0x0A649,0x0A649), `Abs (0x0A649); + (0x0A64B,0x0A64B), `Abs (0x0A64B); + (0x0A64D,0x0A64D), `Abs (0x0A64D); + (0x0A64F,0x0A64F), `Abs (0x0A64F); + (0x0A651,0x0A651), `Abs (0x0A651); + (0x0A653,0x0A653), `Abs (0x0A653); + (0x0A655,0x0A655), `Abs (0x0A655); + (0x0A657,0x0A657), `Abs (0x0A657); + (0x0A659,0x0A659), `Abs (0x0A659); + (0x0A65B,0x0A65B), `Abs (0x0A65B); + (0x0A65D,0x0A65D), `Abs (0x0A65D); + (0x0A65F,0x0A65F), `Abs (0x0A65F); + (0x0A661,0x0A661), `Abs (0x0A661); + (0x0A663,0x0A663), `Abs (0x0A663); + (0x0A665,0x0A665), `Abs (0x0A665); + (0x0A667,0x0A667), `Abs (0x0A667); + (0x0A669,0x0A669), `Abs (0x0A669); + (0x0A66B,0x0A66B), `Abs (0x0A66B); + (0x0A66D,0x0A66D), `Abs (0x0A66D); + (0x0A681,0x0A681), `Abs (0x0A681); + (0x0A683,0x0A683), `Abs (0x0A683); + (0x0A685,0x0A685), `Abs (0x0A685); + (0x0A687,0x0A687), `Abs (0x0A687); + (0x0A689,0x0A689), `Abs (0x0A689); + (0x0A68B,0x0A68B), `Abs (0x0A68B); + (0x0A68D,0x0A68D), `Abs (0x0A68D); + (0x0A68F,0x0A68F), `Abs (0x0A68F); + (0x0A691,0x0A691), `Abs (0x0A691); + (0x0A693,0x0A693), `Abs (0x0A693); + (0x0A695,0x0A695), `Abs (0x0A695); + (0x0A697,0x0A697), `Abs (0x0A697); + (0x0A699,0x0A699), `Abs (0x0A699); + (0x0A69B,0x0A69B), `Abs (0x0A69B); + (0x0A723,0x0A723), `Abs (0x0A723); + (0x0A725,0x0A725), `Abs (0x0A725); + (0x0A727,0x0A727), `Abs (0x0A727); + (0x0A729,0x0A729), `Abs (0x0A729); + (0x0A72B,0x0A72B), `Abs (0x0A72B); + (0x0A72D,0x0A72D), `Abs (0x0A72D); + (0x0A72F,0x0A731), `Delta (0); + (0x0A733,0x0A733), `Abs (0x0A733); + (0x0A735,0x0A735), `Abs (0x0A735); + (0x0A737,0x0A737), `Abs (0x0A737); + (0x0A739,0x0A739), `Abs (0x0A739); + (0x0A73B,0x0A73B), `Abs (0x0A73B); + (0x0A73D,0x0A73D), `Abs (0x0A73D); + (0x0A73F,0x0A73F), `Abs (0x0A73F); + (0x0A741,0x0A741), `Abs (0x0A741); + (0x0A743,0x0A743), `Abs (0x0A743); + (0x0A745,0x0A745), `Abs (0x0A745); + (0x0A747,0x0A747), `Abs (0x0A747); + (0x0A749,0x0A749), `Abs (0x0A749); + (0x0A74B,0x0A74B), `Abs (0x0A74B); + (0x0A74D,0x0A74D), `Abs (0x0A74D); + (0x0A74F,0x0A74F), `Abs (0x0A74F); + (0x0A751,0x0A751), `Abs (0x0A751); + (0x0A753,0x0A753), `Abs (0x0A753); + (0x0A755,0x0A755), `Abs (0x0A755); + (0x0A757,0x0A757), `Abs (0x0A757); + (0x0A759,0x0A759), `Abs (0x0A759); + (0x0A75B,0x0A75B), `Abs (0x0A75B); + (0x0A75D,0x0A75D), `Abs (0x0A75D); + (0x0A75F,0x0A75F), `Abs (0x0A75F); + (0x0A761,0x0A761), `Abs (0x0A761); + (0x0A763,0x0A763), `Abs (0x0A763); + (0x0A765,0x0A765), `Abs (0x0A765); + (0x0A767,0x0A767), `Abs (0x0A767); + (0x0A769,0x0A769), `Abs (0x0A769); + (0x0A76B,0x0A76B), `Abs (0x0A76B); + (0x0A76D,0x0A76D), `Abs (0x0A76D); + (0x0A76F,0x0A76F), `Abs (0x0A76F); + (0x0A771,0x0A778), `Delta (0); + (0x0A77A,0x0A77A), `Abs (0x0A77A); + (0x0A77C,0x0A77C), `Abs (0x0A77C); + (0x0A77F,0x0A77F), `Abs (0x0A77F); + (0x0A781,0x0A781), `Abs (0x0A781); + (0x0A783,0x0A783), `Abs (0x0A783); + (0x0A785,0x0A785), `Abs (0x0A785); + (0x0A787,0x0A787), `Abs (0x0A787); + (0x0A78C,0x0A78C), `Abs (0x0A78C); + (0x0A78E,0x0A78E), `Abs (0x0A78E); + (0x0A791,0x0A791), `Abs (0x0A791); + (0x0A793,0x0A795), `Delta (0); + (0x0A797,0x0A797), `Abs (0x0A797); + (0x0A799,0x0A799), `Abs (0x0A799); + (0x0A79B,0x0A79B), `Abs (0x0A79B); + (0x0A79D,0x0A79D), `Abs (0x0A79D); + (0x0A79F,0x0A79F), `Abs (0x0A79F); + (0x0A7A1,0x0A7A1), `Abs (0x0A7A1); + (0x0A7A3,0x0A7A3), `Abs (0x0A7A3); + (0x0A7A5,0x0A7A5), `Abs (0x0A7A5); + (0x0A7A7,0x0A7A7), `Abs (0x0A7A7); + (0x0A7A9,0x0A7A9), `Abs (0x0A7A9); + (0x0A7B5,0x0A7B5), `Abs (0x0A7B5); + (0x0A7B7,0x0A7B7), `Abs (0x0A7B7); + (0x0A7FA,0x0A7FA), `Abs (0x0A7FA); + (0x0AB30,0x0AB5A), `Delta (0); + (0x0AB60,0x0AB65), `Delta (0); + (0x0AB70,0x0ABBF), `Delta (0); + (0x0FB00,0x0FB06), `Delta (0); + (0x0FB13,0x0FB17), `Delta (0); + (0x0FF41,0x0FF5A), `Delta (0); + (0x10428,0x1044F), `Delta (0); + (0x104D8,0x104FB), `Delta (0); + (0x10CC0,0x10CF2), `Delta (0); + (0x118C0,0x118DF), `Delta (0); + (0x1D41A,0x1D433), `Delta (0); + (0x1D44E,0x1D454), `Delta (0); + (0x1D456,0x1D467), `Delta (0); + (0x1D482,0x1D49B), `Delta (0); + (0x1D4B6,0x1D4B9), `Delta (0); + (0x1D4BB,0x1D4BB), `Abs (0x1D4BB); + (0x1D4BD,0x1D4C3), `Delta (0); + (0x1D4C5,0x1D4CF), `Delta (0); + (0x1D4EA,0x1D503), `Delta (0); + (0x1D51E,0x1D537), `Delta (0); + (0x1D552,0x1D56B), `Delta (0); + (0x1D586,0x1D59F), `Delta (0); + (0x1D5BA,0x1D5D3), `Delta (0); + (0x1D5EE,0x1D607), `Delta (0); + (0x1D622,0x1D63B), `Delta (0); + (0x1D656,0x1D66F), `Delta (0); + (0x1D68A,0x1D6A5), `Delta (0); + (0x1D6C2,0x1D6DA), `Delta (0); + (0x1D6DC,0x1D6E1), `Delta (0); + (0x1D6FC,0x1D714), `Delta (0); + (0x1D716,0x1D71B), `Delta (0); + (0x1D736,0x1D74E), `Delta (0); + (0x1D750,0x1D755), `Delta (0); + (0x1D770,0x1D788), `Delta (0); + (0x1D78A,0x1D78F), `Delta (0); + (0x1D7AA,0x1D7C2), `Delta (0); + (0x1D7C4,0x1D7C9), `Delta (0); + (0x1D7CB,0x1D7CB), `Abs (0x1D7CB); + (0x1E922,0x1E943), `Delta (0); (0x001C5,0x001C5), `Abs (0x001C6); (0x001C8,0x001C8), `Abs (0x001C9); (0x001CB,0x001CB), `Abs (0x001CC); @@ -2614,6 +5040,2388 @@ let to_lower = [ (0x01FBC,0x01FBC), `Abs (0x01FB3); (0x01FCC,0x01FCC), `Abs (0x01FC3); (0x01FFC,0x01FFC), `Abs (0x01FF3); - (0x02160,0x0216F), `Delta (16) -] - + (0x00300,0x0036F), `Delta (0); + (0x00483,0x00487), `Delta (0); + (0x00591,0x005BD), `Delta (0); + (0x005BF,0x005BF), `Abs (0x005BF); + (0x005C1,0x005C2), `Delta (0); + (0x005C4,0x005C5), `Delta (0); + (0x005C7,0x005C7), `Abs (0x005C7); + (0x00610,0x0061A), `Delta (0); + (0x0064B,0x0065F), `Delta (0); + (0x00670,0x00670), `Abs (0x00670); + (0x006D6,0x006DC), `Delta (0); + (0x006DF,0x006E4), `Delta (0); + (0x006E7,0x006E8), `Delta (0); + (0x006EA,0x006ED), `Delta (0); + (0x00711,0x00711), `Abs (0x00711); + (0x00730,0x0074A), `Delta (0); + (0x007A6,0x007B0), `Delta (0); + (0x007EB,0x007F3), `Delta (0); + (0x00816,0x00819), `Delta (0); + (0x0081B,0x00823), `Delta (0); + (0x00825,0x00827), `Delta (0); + (0x00829,0x0082D), `Delta (0); + (0x00859,0x0085B), `Delta (0); + (0x008D4,0x008E1), `Delta (0); + (0x008E3,0x00902), `Delta (0); + (0x0093A,0x0093A), `Abs (0x0093A); + (0x0093C,0x0093C), `Abs (0x0093C); + (0x00941,0x00948), `Delta (0); + (0x0094D,0x0094D), `Abs (0x0094D); + (0x00951,0x00957), `Delta (0); + (0x00962,0x00963), `Delta (0); + (0x00981,0x00981), `Abs (0x00981); + (0x009BC,0x009BC), `Abs (0x009BC); + (0x009C1,0x009C4), `Delta (0); + (0x009CD,0x009CD), `Abs (0x009CD); + (0x009E2,0x009E3), `Delta (0); + (0x00A01,0x00A02), `Delta (0); + (0x00A3C,0x00A3C), `Abs (0x00A3C); + (0x00A41,0x00A42), `Delta (0); + (0x00A47,0x00A48), `Delta (0); + (0x00A4B,0x00A4D), `Delta (0); + (0x00A51,0x00A51), `Abs (0x00A51); + (0x00A70,0x00A71), `Delta (0); + (0x00A75,0x00A75), `Abs (0x00A75); + (0x00A81,0x00A82), `Delta (0); + (0x00ABC,0x00ABC), `Abs (0x00ABC); + (0x00AC1,0x00AC5), `Delta (0); + (0x00AC7,0x00AC8), `Delta (0); + (0x00ACD,0x00ACD), `Abs (0x00ACD); + (0x00AE2,0x00AE3), `Delta (0); + (0x00B01,0x00B01), `Abs (0x00B01); + (0x00B3C,0x00B3C), `Abs (0x00B3C); + (0x00B3F,0x00B3F), `Abs (0x00B3F); + (0x00B41,0x00B44), `Delta (0); + (0x00B4D,0x00B4D), `Abs (0x00B4D); + (0x00B56,0x00B56), `Abs (0x00B56); + (0x00B62,0x00B63), `Delta (0); + (0x00B82,0x00B82), `Abs (0x00B82); + (0x00BC0,0x00BC0), `Abs (0x00BC0); + (0x00BCD,0x00BCD), `Abs (0x00BCD); + (0x00C00,0x00C00), `Abs (0x00C00); + (0x00C3E,0x00C40), `Delta (0); + (0x00C46,0x00C48), `Delta (0); + (0x00C4A,0x00C4D), `Delta (0); + (0x00C55,0x00C56), `Delta (0); + (0x00C62,0x00C63), `Delta (0); + (0x00C81,0x00C81), `Abs (0x00C81); + (0x00CBC,0x00CBC), `Abs (0x00CBC); + (0x00CBF,0x00CBF), `Abs (0x00CBF); + (0x00CC6,0x00CC6), `Abs (0x00CC6); + (0x00CCC,0x00CCD), `Delta (0); + (0x00CE2,0x00CE3), `Delta (0); + (0x00D01,0x00D01), `Abs (0x00D01); + (0x00D41,0x00D44), `Delta (0); + (0x00D4D,0x00D4D), `Abs (0x00D4D); + (0x00D62,0x00D63), `Delta (0); + (0x00DCA,0x00DCA), `Abs (0x00DCA); + (0x00DD2,0x00DD4), `Delta (0); + (0x00DD6,0x00DD6), `Abs (0x00DD6); + (0x00E31,0x00E31), `Abs (0x00E31); + (0x00E34,0x00E3A), `Delta (0); + (0x00E47,0x00E4E), `Delta (0); + (0x00EB1,0x00EB1), `Abs (0x00EB1); + (0x00EB4,0x00EB9), `Delta (0); + (0x00EBB,0x00EBC), `Delta (0); + (0x00EC8,0x00ECD), `Delta (0); + (0x00F18,0x00F19), `Delta (0); + (0x00F35,0x00F35), `Abs (0x00F35); + (0x00F37,0x00F37), `Abs (0x00F37); + (0x00F39,0x00F39), `Abs (0x00F39); + (0x00F71,0x00F7E), `Delta (0); + (0x00F80,0x00F84), `Delta (0); + (0x00F86,0x00F87), `Delta (0); + (0x00F8D,0x00F97), `Delta (0); + (0x00F99,0x00FBC), `Delta (0); + (0x00FC6,0x00FC6), `Abs (0x00FC6); + (0x0102D,0x01030), `Delta (0); + (0x01032,0x01037), `Delta (0); + (0x01039,0x0103A), `Delta (0); + (0x0103D,0x0103E), `Delta (0); + (0x01058,0x01059), `Delta (0); + (0x0105E,0x01060), `Delta (0); + (0x01071,0x01074), `Delta (0); + (0x01082,0x01082), `Abs (0x01082); + (0x01085,0x01086), `Delta (0); + (0x0108D,0x0108D), `Abs (0x0108D); + (0x0109D,0x0109D), `Abs (0x0109D); + (0x0135D,0x0135F), `Delta (0); + (0x01712,0x01714), `Delta (0); + (0x01732,0x01734), `Delta (0); + (0x01752,0x01753), `Delta (0); + (0x01772,0x01773), `Delta (0); + (0x017B4,0x017B5), `Delta (0); + (0x017B7,0x017BD), `Delta (0); + (0x017C6,0x017C6), `Abs (0x017C6); + (0x017C9,0x017D3), `Delta (0); + (0x017DD,0x017DD), `Abs (0x017DD); + (0x0180B,0x0180D), `Delta (0); + (0x01885,0x01886), `Delta (0); + (0x018A9,0x018A9), `Abs (0x018A9); + (0x01920,0x01922), `Delta (0); + (0x01927,0x01928), `Delta (0); + (0x01932,0x01932), `Abs (0x01932); + (0x01939,0x0193B), `Delta (0); + (0x01A17,0x01A18), `Delta (0); + (0x01A1B,0x01A1B), `Abs (0x01A1B); + (0x01A56,0x01A56), `Abs (0x01A56); + (0x01A58,0x01A5E), `Delta (0); + (0x01A60,0x01A60), `Abs (0x01A60); + (0x01A62,0x01A62), `Abs (0x01A62); + (0x01A65,0x01A6C), `Delta (0); + (0x01A73,0x01A7C), `Delta (0); + (0x01A7F,0x01A7F), `Abs (0x01A7F); + (0x01AB0,0x01ABD), `Delta (0); + (0x01B00,0x01B03), `Delta (0); + (0x01B34,0x01B34), `Abs (0x01B34); + (0x01B36,0x01B3A), `Delta (0); + (0x01B3C,0x01B3C), `Abs (0x01B3C); + (0x01B42,0x01B42), `Abs (0x01B42); + (0x01B6B,0x01B73), `Delta (0); + (0x01B80,0x01B81), `Delta (0); + (0x01BA2,0x01BA5), `Delta (0); + (0x01BA8,0x01BA9), `Delta (0); + (0x01BAB,0x01BAD), `Delta (0); + (0x01BE6,0x01BE6), `Abs (0x01BE6); + (0x01BE8,0x01BE9), `Delta (0); + (0x01BED,0x01BED), `Abs (0x01BED); + (0x01BEF,0x01BF1), `Delta (0); + (0x01C2C,0x01C33), `Delta (0); + (0x01C36,0x01C37), `Delta (0); + (0x01CD0,0x01CD2), `Delta (0); + (0x01CD4,0x01CE0), `Delta (0); + (0x01CE2,0x01CE8), `Delta (0); + (0x01CED,0x01CED), `Abs (0x01CED); + (0x01CF4,0x01CF4), `Abs (0x01CF4); + (0x01CF8,0x01CF9), `Delta (0); + (0x01DC0,0x01DF5), `Delta (0); + (0x01DFB,0x01DFF), `Delta (0); + (0x020D0,0x020DC), `Delta (0); + (0x020E1,0x020E1), `Abs (0x020E1); + (0x020E5,0x020F0), `Delta (0); + (0x02CEF,0x02CF1), `Delta (0); + (0x02D7F,0x02D7F), `Abs (0x02D7F); + (0x02DE0,0x02DFF), `Delta (0); + (0x0302A,0x0302D), `Delta (0); + (0x03099,0x0309A), `Delta (0); + (0x0A66F,0x0A66F), `Abs (0x0A66F); + (0x0A674,0x0A67D), `Delta (0); + (0x0A69E,0x0A69F), `Delta (0); + (0x0A6F0,0x0A6F1), `Delta (0); + (0x0A802,0x0A802), `Abs (0x0A802); + (0x0A806,0x0A806), `Abs (0x0A806); + (0x0A80B,0x0A80B), `Abs (0x0A80B); + (0x0A825,0x0A826), `Delta (0); + (0x0A8C4,0x0A8C5), `Delta (0); + (0x0A8E0,0x0A8F1), `Delta (0); + (0x0A926,0x0A92D), `Delta (0); + (0x0A947,0x0A951), `Delta (0); + (0x0A980,0x0A982), `Delta (0); + (0x0A9B3,0x0A9B3), `Abs (0x0A9B3); + (0x0A9B6,0x0A9B9), `Delta (0); + (0x0A9BC,0x0A9BC), `Abs (0x0A9BC); + (0x0A9E5,0x0A9E5), `Abs (0x0A9E5); + (0x0AA29,0x0AA2E), `Delta (0); + (0x0AA31,0x0AA32), `Delta (0); + (0x0AA35,0x0AA36), `Delta (0); + (0x0AA43,0x0AA43), `Abs (0x0AA43); + (0x0AA4C,0x0AA4C), `Abs (0x0AA4C); + (0x0AA7C,0x0AA7C), `Abs (0x0AA7C); + (0x0AAB0,0x0AAB0), `Abs (0x0AAB0); + (0x0AAB2,0x0AAB4), `Delta (0); + (0x0AAB7,0x0AAB8), `Delta (0); + (0x0AABE,0x0AABF), `Delta (0); + (0x0AAC1,0x0AAC1), `Abs (0x0AAC1); + (0x0AAEC,0x0AAED), `Delta (0); + (0x0AAF6,0x0AAF6), `Abs (0x0AAF6); + (0x0ABE5,0x0ABE5), `Abs (0x0ABE5); + (0x0ABE8,0x0ABE8), `Abs (0x0ABE8); + (0x0ABED,0x0ABED), `Abs (0x0ABED); + (0x0FB1E,0x0FB1E), `Abs (0x0FB1E); + (0x0FE00,0x0FE0F), `Delta (0); + (0x0FE20,0x0FE2F), `Delta (0); + (0x101FD,0x101FD), `Abs (0x101FD); + (0x102E0,0x102E0), `Abs (0x102E0); + (0x10376,0x1037A), `Delta (0); + (0x10A01,0x10A03), `Delta (0); + (0x10A05,0x10A06), `Delta (0); + (0x10A0C,0x10A0F), `Delta (0); + (0x10A38,0x10A3A), `Delta (0); + (0x10A3F,0x10A3F), `Abs (0x10A3F); + (0x10AE5,0x10AE6), `Delta (0); + (0x11001,0x11001), `Abs (0x11001); + (0x11038,0x11046), `Delta (0); + (0x1107F,0x11081), `Delta (0); + (0x110B3,0x110B6), `Delta (0); + (0x110B9,0x110BA), `Delta (0); + (0x11100,0x11102), `Delta (0); + (0x11127,0x1112B), `Delta (0); + (0x1112D,0x11134), `Delta (0); + (0x11173,0x11173), `Abs (0x11173); + (0x11180,0x11181), `Delta (0); + (0x111B6,0x111BE), `Delta (0); + (0x111CA,0x111CC), `Delta (0); + (0x1122F,0x11231), `Delta (0); + (0x11234,0x11234), `Abs (0x11234); + (0x11236,0x11237), `Delta (0); + (0x1123E,0x1123E), `Abs (0x1123E); + (0x112DF,0x112DF), `Abs (0x112DF); + (0x112E3,0x112EA), `Delta (0); + (0x11300,0x11301), `Delta (0); + (0x1133C,0x1133C), `Abs (0x1133C); + (0x11340,0x11340), `Abs (0x11340); + (0x11366,0x1136C), `Delta (0); + (0x11370,0x11374), `Delta (0); + (0x11438,0x1143F), `Delta (0); + (0x11442,0x11444), `Delta (0); + (0x11446,0x11446), `Abs (0x11446); + (0x114B3,0x114B8), `Delta (0); + (0x114BA,0x114BA), `Abs (0x114BA); + (0x114BF,0x114C0), `Delta (0); + (0x114C2,0x114C3), `Delta (0); + (0x115B2,0x115B5), `Delta (0); + (0x115BC,0x115BD), `Delta (0); + (0x115BF,0x115C0), `Delta (0); + (0x115DC,0x115DD), `Delta (0); + (0x11633,0x1163A), `Delta (0); + (0x1163D,0x1163D), `Abs (0x1163D); + (0x1163F,0x11640), `Delta (0); + (0x116AB,0x116AB), `Abs (0x116AB); + (0x116AD,0x116AD), `Abs (0x116AD); + (0x116B0,0x116B5), `Delta (0); + (0x116B7,0x116B7), `Abs (0x116B7); + (0x1171D,0x1171F), `Delta (0); + (0x11722,0x11725), `Delta (0); + (0x11727,0x1172B), `Delta (0); + (0x11C30,0x11C36), `Delta (0); + (0x11C38,0x11C3D), `Delta (0); + (0x11C3F,0x11C3F), `Abs (0x11C3F); + (0x11C92,0x11CA7), `Delta (0); + (0x11CAA,0x11CB0), `Delta (0); + (0x11CB2,0x11CB3), `Delta (0); + (0x11CB5,0x11CB6), `Delta (0); + (0x16AF0,0x16AF4), `Delta (0); + (0x16B30,0x16B36), `Delta (0); + (0x16F8F,0x16F92), `Delta (0); + (0x1BC9D,0x1BC9E), `Delta (0); + (0x1D167,0x1D169), `Delta (0); + (0x1D17B,0x1D182), `Delta (0); + (0x1D185,0x1D18B), `Delta (0); + (0x1D1AA,0x1D1AD), `Delta (0); + (0x1D242,0x1D244), `Delta (0); + (0x1DA00,0x1DA36), `Delta (0); + (0x1DA3B,0x1DA6C), `Delta (0); + (0x1DA75,0x1DA75), `Abs (0x1DA75); + (0x1DA84,0x1DA84), `Abs (0x1DA84); + (0x1DA9B,0x1DA9F), `Delta (0); + (0x1DAA1,0x1DAAF), `Delta (0); + (0x1E000,0x1E006), `Delta (0); + (0x1E008,0x1E018), `Delta (0); + (0x1E01B,0x1E021), `Delta (0); + (0x1E023,0x1E024), `Delta (0); + (0x1E026,0x1E02A), `Delta (0); + (0x1E8D0,0x1E8D6), `Delta (0); + (0x1E944,0x1E94A), `Delta (0); + (0xE0100,0xE01EF), `Delta (0); + (0x00903,0x00903), `Abs (0x00903); + (0x0093B,0x0093B), `Abs (0x0093B); + (0x0093E,0x00940), `Delta (0); + (0x00949,0x0094C), `Delta (0); + (0x0094E,0x0094F), `Delta (0); + (0x00982,0x00983), `Delta (0); + (0x009BE,0x009C0), `Delta (0); + (0x009C7,0x009C8), `Delta (0); + (0x009CB,0x009CC), `Delta (0); + (0x009D7,0x009D7), `Abs (0x009D7); + (0x00A03,0x00A03), `Abs (0x00A03); + (0x00A3E,0x00A40), `Delta (0); + (0x00A83,0x00A83), `Abs (0x00A83); + (0x00ABE,0x00AC0), `Delta (0); + (0x00AC9,0x00AC9), `Abs (0x00AC9); + (0x00ACB,0x00ACC), `Delta (0); + (0x00B02,0x00B03), `Delta (0); + (0x00B3E,0x00B3E), `Abs (0x00B3E); + (0x00B40,0x00B40), `Abs (0x00B40); + (0x00B47,0x00B48), `Delta (0); + (0x00B4B,0x00B4C), `Delta (0); + (0x00B57,0x00B57), `Abs (0x00B57); + (0x00BBE,0x00BBF), `Delta (0); + (0x00BC1,0x00BC2), `Delta (0); + (0x00BC6,0x00BC8), `Delta (0); + (0x00BCA,0x00BCC), `Delta (0); + (0x00BD7,0x00BD7), `Abs (0x00BD7); + (0x00C01,0x00C03), `Delta (0); + (0x00C41,0x00C44), `Delta (0); + (0x00C82,0x00C83), `Delta (0); + (0x00CBE,0x00CBE), `Abs (0x00CBE); + (0x00CC0,0x00CC4), `Delta (0); + (0x00CC7,0x00CC8), `Delta (0); + (0x00CCA,0x00CCB), `Delta (0); + (0x00CD5,0x00CD6), `Delta (0); + (0x00D02,0x00D03), `Delta (0); + (0x00D3E,0x00D40), `Delta (0); + (0x00D46,0x00D48), `Delta (0); + (0x00D4A,0x00D4C), `Delta (0); + (0x00D57,0x00D57), `Abs (0x00D57); + (0x00D82,0x00D83), `Delta (0); + (0x00DCF,0x00DD1), `Delta (0); + (0x00DD8,0x00DDF), `Delta (0); + (0x00DF2,0x00DF3), `Delta (0); + (0x00F3E,0x00F3F), `Delta (0); + (0x00F7F,0x00F7F), `Abs (0x00F7F); + (0x0102B,0x0102C), `Delta (0); + (0x01031,0x01031), `Abs (0x01031); + (0x01038,0x01038), `Abs (0x01038); + (0x0103B,0x0103C), `Delta (0); + (0x01056,0x01057), `Delta (0); + (0x01062,0x01064), `Delta (0); + (0x01067,0x0106D), `Delta (0); + (0x01083,0x01084), `Delta (0); + (0x01087,0x0108C), `Delta (0); + (0x0108F,0x0108F), `Abs (0x0108F); + (0x0109A,0x0109C), `Delta (0); + (0x017B6,0x017B6), `Abs (0x017B6); + (0x017BE,0x017C5), `Delta (0); + (0x017C7,0x017C8), `Delta (0); + (0x01923,0x01926), `Delta (0); + (0x01929,0x0192B), `Delta (0); + (0x01930,0x01931), `Delta (0); + (0x01933,0x01938), `Delta (0); + (0x01A19,0x01A1A), `Delta (0); + (0x01A55,0x01A55), `Abs (0x01A55); + (0x01A57,0x01A57), `Abs (0x01A57); + (0x01A61,0x01A61), `Abs (0x01A61); + (0x01A63,0x01A64), `Delta (0); + (0x01A6D,0x01A72), `Delta (0); + (0x01B04,0x01B04), `Abs (0x01B04); + (0x01B35,0x01B35), `Abs (0x01B35); + (0x01B3B,0x01B3B), `Abs (0x01B3B); + (0x01B3D,0x01B41), `Delta (0); + (0x01B43,0x01B44), `Delta (0); + (0x01B82,0x01B82), `Abs (0x01B82); + (0x01BA1,0x01BA1), `Abs (0x01BA1); + (0x01BA6,0x01BA7), `Delta (0); + (0x01BAA,0x01BAA), `Abs (0x01BAA); + (0x01BE7,0x01BE7), `Abs (0x01BE7); + (0x01BEA,0x01BEC), `Delta (0); + (0x01BEE,0x01BEE), `Abs (0x01BEE); + (0x01BF2,0x01BF3), `Delta (0); + (0x01C24,0x01C2B), `Delta (0); + (0x01C34,0x01C35), `Delta (0); + (0x01CE1,0x01CE1), `Abs (0x01CE1); + (0x01CF2,0x01CF3), `Delta (0); + (0x0302E,0x0302F), `Delta (0); + (0x0A823,0x0A824), `Delta (0); + (0x0A827,0x0A827), `Abs (0x0A827); + (0x0A880,0x0A881), `Delta (0); + (0x0A8B4,0x0A8C3), `Delta (0); + (0x0A952,0x0A953), `Delta (0); + (0x0A983,0x0A983), `Abs (0x0A983); + (0x0A9B4,0x0A9B5), `Delta (0); + (0x0A9BA,0x0A9BB), `Delta (0); + (0x0A9BD,0x0A9C0), `Delta (0); + (0x0AA2F,0x0AA30), `Delta (0); + (0x0AA33,0x0AA34), `Delta (0); + (0x0AA4D,0x0AA4D), `Abs (0x0AA4D); + (0x0AA7B,0x0AA7B), `Abs (0x0AA7B); + (0x0AA7D,0x0AA7D), `Abs (0x0AA7D); + (0x0AAEB,0x0AAEB), `Abs (0x0AAEB); + (0x0AAEE,0x0AAEF), `Delta (0); + (0x0AAF5,0x0AAF5), `Abs (0x0AAF5); + (0x0ABE3,0x0ABE4), `Delta (0); + (0x0ABE6,0x0ABE7), `Delta (0); + (0x0ABE9,0x0ABEA), `Delta (0); + (0x0ABEC,0x0ABEC), `Abs (0x0ABEC); + (0x11000,0x11000), `Abs (0x11000); + (0x11002,0x11002), `Abs (0x11002); + (0x11082,0x11082), `Abs (0x11082); + (0x110B0,0x110B2), `Delta (0); + (0x110B7,0x110B8), `Delta (0); + (0x1112C,0x1112C), `Abs (0x1112C); + (0x11182,0x11182), `Abs (0x11182); + (0x111B3,0x111B5), `Delta (0); + (0x111BF,0x111C0), `Delta (0); + (0x1122C,0x1122E), `Delta (0); + (0x11232,0x11233), `Delta (0); + (0x11235,0x11235), `Abs (0x11235); + (0x112E0,0x112E2), `Delta (0); + (0x11302,0x11303), `Delta (0); + (0x1133E,0x1133F), `Delta (0); + (0x11341,0x11344), `Delta (0); + (0x11347,0x11348), `Delta (0); + (0x1134B,0x1134D), `Delta (0); + (0x11357,0x11357), `Abs (0x11357); + (0x11362,0x11363), `Delta (0); + (0x11435,0x11437), `Delta (0); + (0x11440,0x11441), `Delta (0); + (0x11445,0x11445), `Abs (0x11445); + (0x114B0,0x114B2), `Delta (0); + (0x114B9,0x114B9), `Abs (0x114B9); + (0x114BB,0x114BE), `Delta (0); + (0x114C1,0x114C1), `Abs (0x114C1); + (0x115AF,0x115B1), `Delta (0); + (0x115B8,0x115BB), `Delta (0); + (0x115BE,0x115BE), `Abs (0x115BE); + (0x11630,0x11632), `Delta (0); + (0x1163B,0x1163C), `Delta (0); + (0x1163E,0x1163E), `Abs (0x1163E); + (0x116AC,0x116AC), `Abs (0x116AC); + (0x116AE,0x116AF), `Delta (0); + (0x116B6,0x116B6), `Abs (0x116B6); + (0x11720,0x11721), `Delta (0); + (0x11726,0x11726), `Abs (0x11726); + (0x11C2F,0x11C2F), `Abs (0x11C2F); + (0x11C3E,0x11C3E), `Abs (0x11C3E); + (0x11CA9,0x11CA9), `Abs (0x11CA9); + (0x11CB1,0x11CB1), `Abs (0x11CB1); + (0x11CB4,0x11CB4), `Abs (0x11CB4); + (0x16F51,0x16F7E), `Delta (0); + (0x1D165,0x1D166), `Delta (0); + (0x1D16D,0x1D172), `Delta (0); + (0x00488,0x00489), `Delta (0); + (0x01ABE,0x01ABE), `Abs (0x01ABE); + (0x020DD,0x020E0), `Delta (0); + (0x020E2,0x020E4), `Delta (0); + (0x0A670,0x0A672), `Delta (0); + (0x00030,0x00039), `Delta (0); + (0x00660,0x00669), `Delta (0); + (0x006F0,0x006F9), `Delta (0); + (0x007C0,0x007C9), `Delta (0); + (0x00966,0x0096F), `Delta (0); + (0x009E6,0x009EF), `Delta (0); + (0x00A66,0x00A6F), `Delta (0); + (0x00AE6,0x00AEF), `Delta (0); + (0x00B66,0x00B6F), `Delta (0); + (0x00BE6,0x00BEF), `Delta (0); + (0x00C66,0x00C6F), `Delta (0); + (0x00CE6,0x00CEF), `Delta (0); + (0x00D66,0x00D6F), `Delta (0); + (0x00DE6,0x00DEF), `Delta (0); + (0x00E50,0x00E59), `Delta (0); + (0x00ED0,0x00ED9), `Delta (0); + (0x00F20,0x00F29), `Delta (0); + (0x01040,0x01049), `Delta (0); + (0x01090,0x01099), `Delta (0); + (0x017E0,0x017E9), `Delta (0); + (0x01810,0x01819), `Delta (0); + (0x01946,0x0194F), `Delta (0); + (0x019D0,0x019D9), `Delta (0); + (0x01A80,0x01A89), `Delta (0); + (0x01A90,0x01A99), `Delta (0); + (0x01B50,0x01B59), `Delta (0); + (0x01BB0,0x01BB9), `Delta (0); + (0x01C40,0x01C49), `Delta (0); + (0x01C50,0x01C59), `Delta (0); + (0x0A620,0x0A629), `Delta (0); + (0x0A8D0,0x0A8D9), `Delta (0); + (0x0A900,0x0A909), `Delta (0); + (0x0A9D0,0x0A9D9), `Delta (0); + (0x0A9F0,0x0A9F9), `Delta (0); + (0x0AA50,0x0AA59), `Delta (0); + (0x0ABF0,0x0ABF9), `Delta (0); + (0x0FF10,0x0FF19), `Delta (0); + (0x104A0,0x104A9), `Delta (0); + (0x11066,0x1106F), `Delta (0); + (0x110F0,0x110F9), `Delta (0); + (0x11136,0x1113F), `Delta (0); + (0x111D0,0x111D9), `Delta (0); + (0x112F0,0x112F9), `Delta (0); + (0x11450,0x11459), `Delta (0); + (0x114D0,0x114D9), `Delta (0); + (0x11650,0x11659), `Delta (0); + (0x116C0,0x116C9), `Delta (0); + (0x11730,0x11739), `Delta (0); + (0x118E0,0x118E9), `Delta (0); + (0x11C50,0x11C59), `Delta (0); + (0x16A60,0x16A69), `Delta (0); + (0x16B50,0x16B59), `Delta (0); + (0x1D7CE,0x1D7FF), `Delta (0); + (0x1E950,0x1E959), `Delta (0); + (0x016EE,0x016F0), `Delta (0); + (0x02160,0x0216F), `Delta (16); + (0x02170,0x02182), `Delta (0); + (0x02185,0x02188), `Delta (0); + (0x03007,0x03007), `Abs (0x03007); + (0x03021,0x03029), `Delta (0); + (0x03038,0x0303A), `Delta (0); + (0x0A6E6,0x0A6EF), `Delta (0); + (0x10140,0x10174), `Delta (0); + (0x10341,0x10341), `Abs (0x10341); + (0x1034A,0x1034A), `Abs (0x1034A); + (0x103D1,0x103D5), `Delta (0); + (0x12400,0x1246E), `Delta (0); + (0x000B2,0x000B3), `Delta (0); + (0x000B9,0x000B9), `Abs (0x000B9); + (0x000BC,0x000BE), `Delta (0); + (0x009F4,0x009F9), `Delta (0); + (0x00B72,0x00B77), `Delta (0); + (0x00BF0,0x00BF2), `Delta (0); + (0x00C78,0x00C7E), `Delta (0); + (0x00D58,0x00D5E), `Delta (0); + (0x00D70,0x00D78), `Delta (0); + (0x00F2A,0x00F33), `Delta (0); + (0x01369,0x0137C), `Delta (0); + (0x017F0,0x017F9), `Delta (0); + (0x019DA,0x019DA), `Abs (0x019DA); + (0x02070,0x02070), `Abs (0x02070); + (0x02074,0x02079), `Delta (0); + (0x02080,0x02089), `Delta (0); + (0x02150,0x0215F), `Delta (0); + (0x02189,0x02189), `Abs (0x02189); + (0x02460,0x0249B), `Delta (0); + (0x024EA,0x024FF), `Delta (0); + (0x02776,0x02793), `Delta (0); + (0x02CFD,0x02CFD), `Abs (0x02CFD); + (0x03192,0x03195), `Delta (0); + (0x03220,0x03229), `Delta (0); + (0x03248,0x0324F), `Delta (0); + (0x03251,0x0325F), `Delta (0); + (0x03280,0x03289), `Delta (0); + (0x032B1,0x032BF), `Delta (0); + (0x0A830,0x0A835), `Delta (0); + (0x10107,0x10133), `Delta (0); + (0x10175,0x10178), `Delta (0); + (0x1018A,0x1018B), `Delta (0); + (0x102E1,0x102FB), `Delta (0); + (0x10320,0x10323), `Delta (0); + (0x10858,0x1085F), `Delta (0); + (0x10879,0x1087F), `Delta (0); + (0x108A7,0x108AF), `Delta (0); + (0x108FB,0x108FF), `Delta (0); + (0x10916,0x1091B), `Delta (0); + (0x109BC,0x109BD), `Delta (0); + (0x109C0,0x109CF), `Delta (0); + (0x109D2,0x109FF), `Delta (0); + (0x10A40,0x10A47), `Delta (0); + (0x10A7D,0x10A7E), `Delta (0); + (0x10A9D,0x10A9F), `Delta (0); + (0x10AEB,0x10AEF), `Delta (0); + (0x10B58,0x10B5F), `Delta (0); + (0x10B78,0x10B7F), `Delta (0); + (0x10BA9,0x10BAF), `Delta (0); + (0x10CFA,0x10CFF), `Delta (0); + (0x10E60,0x10E7E), `Delta (0); + (0x11052,0x11065), `Delta (0); + (0x111E1,0x111F4), `Delta (0); + (0x1173A,0x1173B), `Delta (0); + (0x118EA,0x118F2), `Delta (0); + (0x11C5A,0x11C6C), `Delta (0); + (0x16B5B,0x16B61), `Delta (0); + (0x1D360,0x1D371), `Delta (0); + (0x1E8C7,0x1E8CF), `Delta (0); + (0x1F100,0x1F10C), `Delta (0); + (0x00020,0x00020), `Abs (0x00020); + (0x000A0,0x000A0), `Abs (0x000A0); + (0x01680,0x01680), `Abs (0x01680); + (0x02000,0x0200A), `Delta (0); + (0x0202F,0x0202F), `Abs (0x0202F); + (0x0205F,0x0205F), `Abs (0x0205F); + (0x03000,0x03000), `Abs (0x03000); + (0x02028,0x02029), `Delta (0); + (0x00001,0x0001F), `Delta (0); + (0x0007F,0x0009F), `Delta (0); + (0x000AD,0x000AD), `Abs (0x000AD); + (0x00600,0x00605), `Delta (0); + (0x0061C,0x0061C), `Abs (0x0061C); + (0x006DD,0x006DD), `Abs (0x006DD); + (0x0070F,0x0070F), `Abs (0x0070F); + (0x008E2,0x008E2), `Abs (0x008E2); + (0x0180E,0x0180E), `Abs (0x0180E); + (0x0200B,0x0200F), `Delta (0); + (0x0202A,0x0202E), `Delta (0); + (0x02060,0x02064), `Delta (0); + (0x02066,0x0206F), `Delta (0); + (0x0FEFF,0x0FEFF), `Abs (0x0FEFF); + (0x0FFF9,0x0FFFB), `Delta (0); + (0x110BD,0x110BD), `Abs (0x110BD); + (0x1BCA0,0x1BCA3), `Delta (0); + (0x1D173,0x1D17A), `Delta (0); + (0xE0001,0xE0001), `Abs (0xE0001); + (0xE0020,0xE007F), `Delta (0); + (0x0D800,0x0F8FF), `Delta (0); + (0xF0000,0xFFFFD), `Delta (0); + (0x100000,0x10FFFD), `Delta (0); + (0x00378,0x00379), `Delta (0); + (0x00380,0x00383), `Delta (0); + (0x0038B,0x0038B), `Abs (0x0038B); + (0x0038D,0x0038D), `Abs (0x0038D); + (0x003A2,0x003A2), `Abs (0x003A2); + (0x00530,0x00530), `Abs (0x00530); + (0x00557,0x00558), `Delta (0); + (0x00560,0x00560), `Abs (0x00560); + (0x00588,0x00588), `Abs (0x00588); + (0x0058B,0x0058C), `Delta (0); + (0x00590,0x00590), `Abs (0x00590); + (0x005C8,0x005CF), `Delta (0); + (0x005EB,0x005EF), `Delta (0); + (0x005F5,0x005FF), `Delta (0); + (0x0061D,0x0061D), `Abs (0x0061D); + (0x0070E,0x0070E), `Abs (0x0070E); + (0x0074B,0x0074C), `Delta (0); + (0x007B2,0x007BF), `Delta (0); + (0x007FB,0x007FF), `Delta (0); + (0x0082E,0x0082F), `Delta (0); + (0x0083F,0x0083F), `Abs (0x0083F); + (0x0085C,0x0085D), `Delta (0); + (0x0085F,0x0089F), `Delta (0); + (0x008B5,0x008B5), `Abs (0x008B5); + (0x008BE,0x008D3), `Delta (0); + (0x00984,0x00984), `Abs (0x00984); + (0x0098D,0x0098E), `Delta (0); + (0x00991,0x00992), `Delta (0); + (0x009A9,0x009A9), `Abs (0x009A9); + (0x009B1,0x009B1), `Abs (0x009B1); + (0x009B3,0x009B5), `Delta (0); + (0x009BA,0x009BB), `Delta (0); + (0x009C5,0x009C6), `Delta (0); + (0x009C9,0x009CA), `Delta (0); + (0x009CF,0x009D6), `Delta (0); + (0x009D8,0x009DB), `Delta (0); + (0x009DE,0x009DE), `Abs (0x009DE); + (0x009E4,0x009E5), `Delta (0); + (0x009FC,0x00A00), `Delta (0); + (0x00A04,0x00A04), `Abs (0x00A04); + (0x00A0B,0x00A0E), `Delta (0); + (0x00A11,0x00A12), `Delta (0); + (0x00A29,0x00A29), `Abs (0x00A29); + (0x00A31,0x00A31), `Abs (0x00A31); + (0x00A34,0x00A34), `Abs (0x00A34); + (0x00A37,0x00A37), `Abs (0x00A37); + (0x00A3A,0x00A3B), `Delta (0); + (0x00A3D,0x00A3D), `Abs (0x00A3D); + (0x00A43,0x00A46), `Delta (0); + (0x00A49,0x00A4A), `Delta (0); + (0x00A4E,0x00A50), `Delta (0); + (0x00A52,0x00A58), `Delta (0); + (0x00A5D,0x00A5D), `Abs (0x00A5D); + (0x00A5F,0x00A65), `Delta (0); + (0x00A76,0x00A80), `Delta (0); + (0x00A84,0x00A84), `Abs (0x00A84); + (0x00A8E,0x00A8E), `Abs (0x00A8E); + (0x00A92,0x00A92), `Abs (0x00A92); + (0x00AA9,0x00AA9), `Abs (0x00AA9); + (0x00AB1,0x00AB1), `Abs (0x00AB1); + (0x00AB4,0x00AB4), `Abs (0x00AB4); + (0x00ABA,0x00ABB), `Delta (0); + (0x00AC6,0x00AC6), `Abs (0x00AC6); + (0x00ACA,0x00ACA), `Abs (0x00ACA); + (0x00ACE,0x00ACF), `Delta (0); + (0x00AD1,0x00ADF), `Delta (0); + (0x00AE4,0x00AE5), `Delta (0); + (0x00AF2,0x00AF8), `Delta (0); + (0x00AFA,0x00B00), `Delta (0); + (0x00B04,0x00B04), `Abs (0x00B04); + (0x00B0D,0x00B0E), `Delta (0); + (0x00B11,0x00B12), `Delta (0); + (0x00B29,0x00B29), `Abs (0x00B29); + (0x00B31,0x00B31), `Abs (0x00B31); + (0x00B34,0x00B34), `Abs (0x00B34); + (0x00B3A,0x00B3B), `Delta (0); + (0x00B45,0x00B46), `Delta (0); + (0x00B49,0x00B4A), `Delta (0); + (0x00B4E,0x00B55), `Delta (0); + (0x00B58,0x00B5B), `Delta (0); + (0x00B5E,0x00B5E), `Abs (0x00B5E); + (0x00B64,0x00B65), `Delta (0); + (0x00B78,0x00B81), `Delta (0); + (0x00B84,0x00B84), `Abs (0x00B84); + (0x00B8B,0x00B8D), `Delta (0); + (0x00B91,0x00B91), `Abs (0x00B91); + (0x00B96,0x00B98), `Delta (0); + (0x00B9B,0x00B9B), `Abs (0x00B9B); + (0x00B9D,0x00B9D), `Abs (0x00B9D); + (0x00BA0,0x00BA2), `Delta (0); + (0x00BA5,0x00BA7), `Delta (0); + (0x00BAB,0x00BAD), `Delta (0); + (0x00BBA,0x00BBD), `Delta (0); + (0x00BC3,0x00BC5), `Delta (0); + (0x00BC9,0x00BC9), `Abs (0x00BC9); + (0x00BCE,0x00BCF), `Delta (0); + (0x00BD1,0x00BD6), `Delta (0); + (0x00BD8,0x00BE5), `Delta (0); + (0x00BFB,0x00BFF), `Delta (0); + (0x00C04,0x00C04), `Abs (0x00C04); + (0x00C0D,0x00C0D), `Abs (0x00C0D); + (0x00C11,0x00C11), `Abs (0x00C11); + (0x00C29,0x00C29), `Abs (0x00C29); + (0x00C3A,0x00C3C), `Delta (0); + (0x00C45,0x00C45), `Abs (0x00C45); + (0x00C49,0x00C49), `Abs (0x00C49); + (0x00C4E,0x00C54), `Delta (0); + (0x00C57,0x00C57), `Abs (0x00C57); + (0x00C5B,0x00C5F), `Delta (0); + (0x00C64,0x00C65), `Delta (0); + (0x00C70,0x00C77), `Delta (0); + (0x00C84,0x00C84), `Abs (0x00C84); + (0x00C8D,0x00C8D), `Abs (0x00C8D); + (0x00C91,0x00C91), `Abs (0x00C91); + (0x00CA9,0x00CA9), `Abs (0x00CA9); + (0x00CB4,0x00CB4), `Abs (0x00CB4); + (0x00CBA,0x00CBB), `Delta (0); + (0x00CC5,0x00CC5), `Abs (0x00CC5); + (0x00CC9,0x00CC9), `Abs (0x00CC9); + (0x00CCE,0x00CD4), `Delta (0); + (0x00CD7,0x00CDD), `Delta (0); + (0x00CDF,0x00CDF), `Abs (0x00CDF); + (0x00CE4,0x00CE5), `Delta (0); + (0x00CF0,0x00CF0), `Abs (0x00CF0); + (0x00CF3,0x00D00), `Delta (0); + (0x00D04,0x00D04), `Abs (0x00D04); + (0x00D0D,0x00D0D), `Abs (0x00D0D); + (0x00D11,0x00D11), `Abs (0x00D11); + (0x00D3B,0x00D3C), `Delta (0); + (0x00D45,0x00D45), `Abs (0x00D45); + (0x00D49,0x00D49), `Abs (0x00D49); + (0x00D50,0x00D53), `Delta (0); + (0x00D64,0x00D65), `Delta (0); + (0x00D80,0x00D81), `Delta (0); + (0x00D84,0x00D84), `Abs (0x00D84); + (0x00D97,0x00D99), `Delta (0); + (0x00DB2,0x00DB2), `Abs (0x00DB2); + (0x00DBC,0x00DBC), `Abs (0x00DBC); + (0x00DBE,0x00DBF), `Delta (0); + (0x00DC7,0x00DC9), `Delta (0); + (0x00DCB,0x00DCE), `Delta (0); + (0x00DD5,0x00DD5), `Abs (0x00DD5); + (0x00DD7,0x00DD7), `Abs (0x00DD7); + (0x00DE0,0x00DE5), `Delta (0); + (0x00DF0,0x00DF1), `Delta (0); + (0x00DF5,0x00E00), `Delta (0); + (0x00E3B,0x00E3E), `Delta (0); + (0x00E5C,0x00E80), `Delta (0); + (0x00E83,0x00E83), `Abs (0x00E83); + (0x00E85,0x00E86), `Delta (0); + (0x00E89,0x00E89), `Abs (0x00E89); + (0x00E8B,0x00E8C), `Delta (0); + (0x00E8E,0x00E93), `Delta (0); + (0x00E98,0x00E98), `Abs (0x00E98); + (0x00EA0,0x00EA0), `Abs (0x00EA0); + (0x00EA4,0x00EA4), `Abs (0x00EA4); + (0x00EA6,0x00EA6), `Abs (0x00EA6); + (0x00EA8,0x00EA9), `Delta (0); + (0x00EAC,0x00EAC), `Abs (0x00EAC); + (0x00EBA,0x00EBA), `Abs (0x00EBA); + (0x00EBE,0x00EBF), `Delta (0); + (0x00EC5,0x00EC5), `Abs (0x00EC5); + (0x00EC7,0x00EC7), `Abs (0x00EC7); + (0x00ECE,0x00ECF), `Delta (0); + (0x00EDA,0x00EDB), `Delta (0); + (0x00EE0,0x00EFF), `Delta (0); + (0x00F48,0x00F48), `Abs (0x00F48); + (0x00F6D,0x00F70), `Delta (0); + (0x00F98,0x00F98), `Abs (0x00F98); + (0x00FBD,0x00FBD), `Abs (0x00FBD); + (0x00FCD,0x00FCD), `Abs (0x00FCD); + (0x00FDB,0x00FFF), `Delta (0); + (0x010C6,0x010C6), `Abs (0x010C6); + (0x010C8,0x010CC), `Delta (0); + (0x010CE,0x010CF), `Delta (0); + (0x01249,0x01249), `Abs (0x01249); + (0x0124E,0x0124F), `Delta (0); + (0x01257,0x01257), `Abs (0x01257); + (0x01259,0x01259), `Abs (0x01259); + (0x0125E,0x0125F), `Delta (0); + (0x01289,0x01289), `Abs (0x01289); + (0x0128E,0x0128F), `Delta (0); + (0x012B1,0x012B1), `Abs (0x012B1); + (0x012B6,0x012B7), `Delta (0); + (0x012BF,0x012BF), `Abs (0x012BF); + (0x012C1,0x012C1), `Abs (0x012C1); + (0x012C6,0x012C7), `Delta (0); + (0x012D7,0x012D7), `Abs (0x012D7); + (0x01311,0x01311), `Abs (0x01311); + (0x01316,0x01317), `Delta (0); + (0x0135B,0x0135C), `Delta (0); + (0x0137D,0x0137F), `Delta (0); + (0x0139A,0x0139F), `Delta (0); + (0x013F6,0x013F7), `Delta (0); + (0x013FE,0x013FF), `Delta (0); + (0x0169D,0x0169F), `Delta (0); + (0x016F9,0x016FF), `Delta (0); + (0x0170D,0x0170D), `Abs (0x0170D); + (0x01715,0x0171F), `Delta (0); + (0x01737,0x0173F), `Delta (0); + (0x01754,0x0175F), `Delta (0); + (0x0176D,0x0176D), `Abs (0x0176D); + (0x01771,0x01771), `Abs (0x01771); + (0x01774,0x0177F), `Delta (0); + (0x017DE,0x017DF), `Delta (0); + (0x017EA,0x017EF), `Delta (0); + (0x017FA,0x017FF), `Delta (0); + (0x0180F,0x0180F), `Abs (0x0180F); + (0x0181A,0x0181F), `Delta (0); + (0x01878,0x0187F), `Delta (0); + (0x018AB,0x018AF), `Delta (0); + (0x018F6,0x018FF), `Delta (0); + (0x0191F,0x0191F), `Abs (0x0191F); + (0x0192C,0x0192F), `Delta (0); + (0x0193C,0x0193F), `Delta (0); + (0x01941,0x01943), `Delta (0); + (0x0196E,0x0196F), `Delta (0); + (0x01975,0x0197F), `Delta (0); + (0x019AC,0x019AF), `Delta (0); + (0x019CA,0x019CF), `Delta (0); + (0x019DB,0x019DD), `Delta (0); + (0x01A1C,0x01A1D), `Delta (0); + (0x01A5F,0x01A5F), `Abs (0x01A5F); + (0x01A7D,0x01A7E), `Delta (0); + (0x01A8A,0x01A8F), `Delta (0); + (0x01A9A,0x01A9F), `Delta (0); + (0x01AAE,0x01AAF), `Delta (0); + (0x01ABF,0x01AFF), `Delta (0); + (0x01B4C,0x01B4F), `Delta (0); + (0x01B7D,0x01B7F), `Delta (0); + (0x01BF4,0x01BFB), `Delta (0); + (0x01C38,0x01C3A), `Delta (0); + (0x01C4A,0x01C4C), `Delta (0); + (0x01C89,0x01CBF), `Delta (0); + (0x01CC8,0x01CCF), `Delta (0); + (0x01CF7,0x01CF7), `Abs (0x01CF7); + (0x01CFA,0x01CFF), `Delta (0); + (0x01DF6,0x01DFA), `Delta (0); + (0x01F16,0x01F17), `Delta (0); + (0x01F1E,0x01F1F), `Delta (0); + (0x01F46,0x01F47), `Delta (0); + (0x01F4E,0x01F4F), `Delta (0); + (0x01F58,0x01F58), `Abs (0x01F58); + (0x01F5A,0x01F5A), `Abs (0x01F5A); + (0x01F5C,0x01F5C), `Abs (0x01F5C); + (0x01F5E,0x01F5E), `Abs (0x01F5E); + (0x01F7E,0x01F7F), `Delta (0); + (0x01FB5,0x01FB5), `Abs (0x01FB5); + (0x01FC5,0x01FC5), `Abs (0x01FC5); + (0x01FD4,0x01FD5), `Delta (0); + (0x01FDC,0x01FDC), `Abs (0x01FDC); + (0x01FF0,0x01FF1), `Delta (0); + (0x01FF5,0x01FF5), `Abs (0x01FF5); + (0x01FFF,0x01FFF), `Abs (0x01FFF); + (0x02065,0x02065), `Abs (0x02065); + (0x02072,0x02073), `Delta (0); + (0x0208F,0x0208F), `Abs (0x0208F); + (0x0209D,0x0209F), `Delta (0); + (0x020BF,0x020CF), `Delta (0); + (0x020F1,0x020FF), `Delta (0); + (0x0218C,0x0218F), `Delta (0); + (0x023FF,0x023FF), `Abs (0x023FF); + (0x02427,0x0243F), `Delta (0); + (0x0244B,0x0245F), `Delta (0); + (0x02B74,0x02B75), `Delta (0); + (0x02B96,0x02B97), `Delta (0); + (0x02BBA,0x02BBC), `Delta (0); + (0x02BC9,0x02BC9), `Abs (0x02BC9); + (0x02BD2,0x02BEB), `Delta (0); + (0x02BF0,0x02BFF), `Delta (0); + (0x02C2F,0x02C2F), `Abs (0x02C2F); + (0x02C5F,0x02C5F), `Abs (0x02C5F); + (0x02CF4,0x02CF8), `Delta (0); + (0x02D26,0x02D26), `Abs (0x02D26); + (0x02D28,0x02D2C), `Delta (0); + (0x02D2E,0x02D2F), `Delta (0); + (0x02D68,0x02D6E), `Delta (0); + (0x02D71,0x02D7E), `Delta (0); + (0x02D97,0x02D9F), `Delta (0); + (0x02DA7,0x02DA7), `Abs (0x02DA7); + (0x02DAF,0x02DAF), `Abs (0x02DAF); + (0x02DB7,0x02DB7), `Abs (0x02DB7); + (0x02DBF,0x02DBF), `Abs (0x02DBF); + (0x02DC7,0x02DC7), `Abs (0x02DC7); + (0x02DCF,0x02DCF), `Abs (0x02DCF); + (0x02DD7,0x02DD7), `Abs (0x02DD7); + (0x02DDF,0x02DDF), `Abs (0x02DDF); + (0x02E45,0x02E7F), `Delta (0); + (0x02E9A,0x02E9A), `Abs (0x02E9A); + (0x02EF4,0x02EFF), `Delta (0); + (0x02FD6,0x02FEF), `Delta (0); + (0x02FFC,0x02FFF), `Delta (0); + (0x03040,0x03040), `Abs (0x03040); + (0x03097,0x03098), `Delta (0); + (0x03100,0x03104), `Delta (0); + (0x0312E,0x03130), `Delta (0); + (0x0318F,0x0318F), `Abs (0x0318F); + (0x031BB,0x031BF), `Delta (0); + (0x031E4,0x031EF), `Delta (0); + (0x0321F,0x0321F), `Abs (0x0321F); + (0x032FF,0x032FF), `Abs (0x032FF); + (0x04DB6,0x04DBF), `Delta (0); + (0x09FD6,0x09FFF), `Delta (0); + (0x0A48D,0x0A48F), `Delta (0); + (0x0A4C7,0x0A4CF), `Delta (0); + (0x0A62C,0x0A63F), `Delta (0); + (0x0A6F8,0x0A6FF), `Delta (0); + (0x0A7AF,0x0A7AF), `Abs (0x0A7AF); + (0x0A7B8,0x0A7F6), `Delta (0); + (0x0A82C,0x0A82F), `Delta (0); + (0x0A83A,0x0A83F), `Delta (0); + (0x0A878,0x0A87F), `Delta (0); + (0x0A8C6,0x0A8CD), `Delta (0); + (0x0A8DA,0x0A8DF), `Delta (0); + (0x0A8FE,0x0A8FF), `Delta (0); + (0x0A954,0x0A95E), `Delta (0); + (0x0A97D,0x0A97F), `Delta (0); + (0x0A9CE,0x0A9CE), `Abs (0x0A9CE); + (0x0A9DA,0x0A9DD), `Delta (0); + (0x0A9FF,0x0A9FF), `Abs (0x0A9FF); + (0x0AA37,0x0AA3F), `Delta (0); + (0x0AA4E,0x0AA4F), `Delta (0); + (0x0AA5A,0x0AA5B), `Delta (0); + (0x0AAC3,0x0AADA), `Delta (0); + (0x0AAF7,0x0AB00), `Delta (0); + (0x0AB07,0x0AB08), `Delta (0); + (0x0AB0F,0x0AB10), `Delta (0); + (0x0AB17,0x0AB1F), `Delta (0); + (0x0AB27,0x0AB27), `Abs (0x0AB27); + (0x0AB2F,0x0AB2F), `Abs (0x0AB2F); + (0x0AB66,0x0AB6F), `Delta (0); + (0x0ABEE,0x0ABEF), `Delta (0); + (0x0ABFA,0x0ABFF), `Delta (0); + (0x0D7A4,0x0D7AF), `Delta (0); + (0x0D7C7,0x0D7CA), `Delta (0); + (0x0D7FC,0x0D7FF), `Delta (0); + (0x0FA6E,0x0FA6F), `Delta (0); + (0x0FADA,0x0FAFF), `Delta (0); + (0x0FB07,0x0FB12), `Delta (0); + (0x0FB18,0x0FB1C), `Delta (0); + (0x0FB37,0x0FB37), `Abs (0x0FB37); + (0x0FB3D,0x0FB3D), `Abs (0x0FB3D); + (0x0FB3F,0x0FB3F), `Abs (0x0FB3F); + (0x0FB42,0x0FB42), `Abs (0x0FB42); + (0x0FB45,0x0FB45), `Abs (0x0FB45); + (0x0FBC2,0x0FBD2), `Delta (0); + (0x0FD40,0x0FD4F), `Delta (0); + (0x0FD90,0x0FD91), `Delta (0); + (0x0FDC8,0x0FDEF), `Delta (0); + (0x0FDFE,0x0FDFF), `Delta (0); + (0x0FE1A,0x0FE1F), `Delta (0); + (0x0FE53,0x0FE53), `Abs (0x0FE53); + (0x0FE67,0x0FE67), `Abs (0x0FE67); + (0x0FE6C,0x0FE6F), `Delta (0); + (0x0FE75,0x0FE75), `Abs (0x0FE75); + (0x0FEFD,0x0FEFE), `Delta (0); + (0x0FF00,0x0FF00), `Abs (0x0FF00); + (0x0FFBF,0x0FFC1), `Delta (0); + (0x0FFC8,0x0FFC9), `Delta (0); + (0x0FFD0,0x0FFD1), `Delta (0); + (0x0FFD8,0x0FFD9), `Delta (0); + (0x0FFDD,0x0FFDF), `Delta (0); + (0x0FFE7,0x0FFE7), `Abs (0x0FFE7); + (0x0FFEF,0x0FFF8), `Delta (0); + (0x0FFFE,0x0FFFF), `Delta (0); + (0x1000C,0x1000C), `Abs (0x1000C); + (0x10027,0x10027), `Abs (0x10027); + (0x1003B,0x1003B), `Abs (0x1003B); + (0x1003E,0x1003E), `Abs (0x1003E); + (0x1004E,0x1004F), `Delta (0); + (0x1005E,0x1007F), `Delta (0); + (0x100FB,0x100FF), `Delta (0); + (0x10103,0x10106), `Delta (0); + (0x10134,0x10136), `Delta (0); + (0x1018F,0x1018F), `Abs (0x1018F); + (0x1019C,0x1019F), `Delta (0); + (0x101A1,0x101CF), `Delta (0); + (0x101FE,0x1027F), `Delta (0); + (0x1029D,0x1029F), `Delta (0); + (0x102D1,0x102DF), `Delta (0); + (0x102FC,0x102FF), `Delta (0); + (0x10324,0x1032F), `Delta (0); + (0x1034B,0x1034F), `Delta (0); + (0x1037B,0x1037F), `Delta (0); + (0x1039E,0x1039E), `Abs (0x1039E); + (0x103C4,0x103C7), `Delta (0); + (0x103D6,0x103FF), `Delta (0); + (0x1049E,0x1049F), `Delta (0); + (0x104AA,0x104AF), `Delta (0); + (0x104D4,0x104D7), `Delta (0); + (0x104FC,0x104FF), `Delta (0); + (0x10528,0x1052F), `Delta (0); + (0x10564,0x1056E), `Delta (0); + (0x10570,0x105FF), `Delta (0); + (0x10737,0x1073F), `Delta (0); + (0x10756,0x1075F), `Delta (0); + (0x10768,0x107FF), `Delta (0); + (0x10806,0x10807), `Delta (0); + (0x10809,0x10809), `Abs (0x10809); + (0x10836,0x10836), `Abs (0x10836); + (0x10839,0x1083B), `Delta (0); + (0x1083D,0x1083E), `Delta (0); + (0x10856,0x10856), `Abs (0x10856); + (0x1089F,0x108A6), `Delta (0); + (0x108B0,0x108DF), `Delta (0); + (0x108F3,0x108F3), `Abs (0x108F3); + (0x108F6,0x108FA), `Delta (0); + (0x1091C,0x1091E), `Delta (0); + (0x1093A,0x1093E), `Delta (0); + (0x10940,0x1097F), `Delta (0); + (0x109B8,0x109BB), `Delta (0); + (0x109D0,0x109D1), `Delta (0); + (0x10A04,0x10A04), `Abs (0x10A04); + (0x10A07,0x10A0B), `Delta (0); + (0x10A14,0x10A14), `Abs (0x10A14); + (0x10A18,0x10A18), `Abs (0x10A18); + (0x10A34,0x10A37), `Delta (0); + (0x10A3B,0x10A3E), `Delta (0); + (0x10A48,0x10A4F), `Delta (0); + (0x10A59,0x10A5F), `Delta (0); + (0x10AA0,0x10ABF), `Delta (0); + (0x10AE7,0x10AEA), `Delta (0); + (0x10AF7,0x10AFF), `Delta (0); + (0x10B36,0x10B38), `Delta (0); + (0x10B56,0x10B57), `Delta (0); + (0x10B73,0x10B77), `Delta (0); + (0x10B92,0x10B98), `Delta (0); + (0x10B9D,0x10BA8), `Delta (0); + (0x10BB0,0x10BFF), `Delta (0); + (0x10C49,0x10C7F), `Delta (0); + (0x10CB3,0x10CBF), `Delta (0); + (0x10CF3,0x10CF9), `Delta (0); + (0x10D00,0x10E5F), `Delta (0); + (0x10E7F,0x10FFF), `Delta (0); + (0x1104E,0x11051), `Delta (0); + (0x11070,0x1107E), `Delta (0); + (0x110C2,0x110CF), `Delta (0); + (0x110E9,0x110EF), `Delta (0); + (0x110FA,0x110FF), `Delta (0); + (0x11135,0x11135), `Abs (0x11135); + (0x11144,0x1114F), `Delta (0); + (0x11177,0x1117F), `Delta (0); + (0x111CE,0x111CF), `Delta (0); + (0x111E0,0x111E0), `Abs (0x111E0); + (0x111F5,0x111FF), `Delta (0); + (0x11212,0x11212), `Abs (0x11212); + (0x1123F,0x1127F), `Delta (0); + (0x11287,0x11287), `Abs (0x11287); + (0x11289,0x11289), `Abs (0x11289); + (0x1128E,0x1128E), `Abs (0x1128E); + (0x1129E,0x1129E), `Abs (0x1129E); + (0x112AA,0x112AF), `Delta (0); + (0x112EB,0x112EF), `Delta (0); + (0x112FA,0x112FF), `Delta (0); + (0x11304,0x11304), `Abs (0x11304); + (0x1130D,0x1130E), `Delta (0); + (0x11311,0x11312), `Delta (0); + (0x11329,0x11329), `Abs (0x11329); + (0x11331,0x11331), `Abs (0x11331); + (0x11334,0x11334), `Abs (0x11334); + (0x1133A,0x1133B), `Delta (0); + (0x11345,0x11346), `Delta (0); + (0x11349,0x1134A), `Delta (0); + (0x1134E,0x1134F), `Delta (0); + (0x11351,0x11356), `Delta (0); + (0x11358,0x1135C), `Delta (0); + (0x11364,0x11365), `Delta (0); + (0x1136D,0x1136F), `Delta (0); + (0x11375,0x113FF), `Delta (0); + (0x1145A,0x1145A), `Abs (0x1145A); + (0x1145C,0x1145C), `Abs (0x1145C); + (0x1145E,0x1147F), `Delta (0); + (0x114C8,0x114CF), `Delta (0); + (0x114DA,0x1157F), `Delta (0); + (0x115B6,0x115B7), `Delta (0); + (0x115DE,0x115FF), `Delta (0); + (0x11645,0x1164F), `Delta (0); + (0x1165A,0x1165F), `Delta (0); + (0x1166D,0x1167F), `Delta (0); + (0x116B8,0x116BF), `Delta (0); + (0x116CA,0x116FF), `Delta (0); + (0x1171A,0x1171C), `Delta (0); + (0x1172C,0x1172F), `Delta (0); + (0x11740,0x1189F), `Delta (0); + (0x118F3,0x118FE), `Delta (0); + (0x11900,0x11ABF), `Delta (0); + (0x11AF9,0x11BFF), `Delta (0); + (0x11C09,0x11C09), `Abs (0x11C09); + (0x11C37,0x11C37), `Abs (0x11C37); + (0x11C46,0x11C4F), `Delta (0); + (0x11C6D,0x11C6F), `Delta (0); + (0x11C90,0x11C91), `Delta (0); + (0x11CA8,0x11CA8), `Abs (0x11CA8); + (0x11CB7,0x11FFF), `Delta (0); + (0x1239A,0x123FF), `Delta (0); + (0x1246F,0x1246F), `Abs (0x1246F); + (0x12475,0x1247F), `Delta (0); + (0x12544,0x12FFF), `Delta (0); + (0x1342F,0x143FF), `Delta (0); + (0x14647,0x167FF), `Delta (0); + (0x16A39,0x16A3F), `Delta (0); + (0x16A5F,0x16A5F), `Abs (0x16A5F); + (0x16A6A,0x16A6D), `Delta (0); + (0x16A70,0x16ACF), `Delta (0); + (0x16AEE,0x16AEF), `Delta (0); + (0x16AF6,0x16AFF), `Delta (0); + (0x16B46,0x16B4F), `Delta (0); + (0x16B5A,0x16B5A), `Abs (0x16B5A); + (0x16B62,0x16B62), `Abs (0x16B62); + (0x16B78,0x16B7C), `Delta (0); + (0x16B90,0x16EFF), `Delta (0); + (0x16F45,0x16F4F), `Delta (0); + (0x16F7F,0x16F8E), `Delta (0); + (0x16FA0,0x16FDF), `Delta (0); + (0x16FE1,0x16FFF), `Delta (0); + (0x187ED,0x187FF), `Delta (0); + (0x18AF3,0x1AFFF), `Delta (0); + (0x1B002,0x1BBFF), `Delta (0); + (0x1BC6B,0x1BC6F), `Delta (0); + (0x1BC7D,0x1BC7F), `Delta (0); + (0x1BC89,0x1BC8F), `Delta (0); + (0x1BC9A,0x1BC9B), `Delta (0); + (0x1BCA4,0x1CFFF), `Delta (0); + (0x1D0F6,0x1D0FF), `Delta (0); + (0x1D127,0x1D128), `Delta (0); + (0x1D1E9,0x1D1FF), `Delta (0); + (0x1D246,0x1D2FF), `Delta (0); + (0x1D357,0x1D35F), `Delta (0); + (0x1D372,0x1D3FF), `Delta (0); + (0x1D455,0x1D455), `Abs (0x1D455); + (0x1D49D,0x1D49D), `Abs (0x1D49D); + (0x1D4A0,0x1D4A1), `Delta (0); + (0x1D4A3,0x1D4A4), `Delta (0); + (0x1D4A7,0x1D4A8), `Delta (0); + (0x1D4AD,0x1D4AD), `Abs (0x1D4AD); + (0x1D4BA,0x1D4BA), `Abs (0x1D4BA); + (0x1D4BC,0x1D4BC), `Abs (0x1D4BC); + (0x1D4C4,0x1D4C4), `Abs (0x1D4C4); + (0x1D506,0x1D506), `Abs (0x1D506); + (0x1D50B,0x1D50C), `Delta (0); + (0x1D515,0x1D515), `Abs (0x1D515); + (0x1D51D,0x1D51D), `Abs (0x1D51D); + (0x1D53A,0x1D53A), `Abs (0x1D53A); + (0x1D53F,0x1D53F), `Abs (0x1D53F); + (0x1D545,0x1D545), `Abs (0x1D545); + (0x1D547,0x1D549), `Delta (0); + (0x1D551,0x1D551), `Abs (0x1D551); + (0x1D6A6,0x1D6A7), `Delta (0); + (0x1D7CC,0x1D7CD), `Delta (0); + (0x1DA8C,0x1DA9A), `Delta (0); + (0x1DAA0,0x1DAA0), `Abs (0x1DAA0); + (0x1DAB0,0x1DFFF), `Delta (0); + (0x1E007,0x1E007), `Abs (0x1E007); + (0x1E019,0x1E01A), `Delta (0); + (0x1E022,0x1E022), `Abs (0x1E022); + (0x1E025,0x1E025), `Abs (0x1E025); + (0x1E02B,0x1E7FF), `Delta (0); + (0x1E8C5,0x1E8C6), `Delta (0); + (0x1E8D7,0x1E8FF), `Delta (0); + (0x1E94B,0x1E94F), `Delta (0); + (0x1E95A,0x1E95D), `Delta (0); + (0x1E960,0x1EDFF), `Delta (0); + (0x1EE04,0x1EE04), `Abs (0x1EE04); + (0x1EE20,0x1EE20), `Abs (0x1EE20); + (0x1EE23,0x1EE23), `Abs (0x1EE23); + (0x1EE25,0x1EE26), `Delta (0); + (0x1EE28,0x1EE28), `Abs (0x1EE28); + (0x1EE33,0x1EE33), `Abs (0x1EE33); + (0x1EE38,0x1EE38), `Abs (0x1EE38); + (0x1EE3A,0x1EE3A), `Abs (0x1EE3A); + (0x1EE3C,0x1EE41), `Delta (0); + (0x1EE43,0x1EE46), `Delta (0); + (0x1EE48,0x1EE48), `Abs (0x1EE48); + (0x1EE4A,0x1EE4A), `Abs (0x1EE4A); + (0x1EE4C,0x1EE4C), `Abs (0x1EE4C); + (0x1EE50,0x1EE50), `Abs (0x1EE50); + (0x1EE53,0x1EE53), `Abs (0x1EE53); + (0x1EE55,0x1EE56), `Delta (0); + (0x1EE58,0x1EE58), `Abs (0x1EE58); + (0x1EE5A,0x1EE5A), `Abs (0x1EE5A); + (0x1EE5C,0x1EE5C), `Abs (0x1EE5C); + (0x1EE5E,0x1EE5E), `Abs (0x1EE5E); + (0x1EE60,0x1EE60), `Abs (0x1EE60); + (0x1EE63,0x1EE63), `Abs (0x1EE63); + (0x1EE65,0x1EE66), `Delta (0); + (0x1EE6B,0x1EE6B), `Abs (0x1EE6B); + (0x1EE73,0x1EE73), `Abs (0x1EE73); + (0x1EE78,0x1EE78), `Abs (0x1EE78); + (0x1EE7D,0x1EE7D), `Abs (0x1EE7D); + (0x1EE7F,0x1EE7F), `Abs (0x1EE7F); + (0x1EE8A,0x1EE8A), `Abs (0x1EE8A); + (0x1EE9C,0x1EEA0), `Delta (0); + (0x1EEA4,0x1EEA4), `Abs (0x1EEA4); + (0x1EEAA,0x1EEAA), `Abs (0x1EEAA); + (0x1EEBC,0x1EEEF), `Delta (0); + (0x1EEF2,0x1EFFF), `Delta (0); + (0x1F02C,0x1F02F), `Delta (0); + (0x1F094,0x1F09F), `Delta (0); + (0x1F0AF,0x1F0B0), `Delta (0); + (0x1F0C0,0x1F0C0), `Abs (0x1F0C0); + (0x1F0D0,0x1F0D0), `Abs (0x1F0D0); + (0x1F0F6,0x1F0FF), `Delta (0); + (0x1F10D,0x1F10F), `Delta (0); + (0x1F12F,0x1F12F), `Abs (0x1F12F); + (0x1F16C,0x1F16F), `Delta (0); + (0x1F1AD,0x1F1E5), `Delta (0); + (0x1F203,0x1F20F), `Delta (0); + (0x1F23C,0x1F23F), `Delta (0); + (0x1F249,0x1F24F), `Delta (0); + (0x1F252,0x1F2FF), `Delta (0); + (0x1F6D3,0x1F6DF), `Delta (0); + (0x1F6ED,0x1F6EF), `Delta (0); + (0x1F6F7,0x1F6FF), `Delta (0); + (0x1F774,0x1F77F), `Delta (0); + (0x1F7D5,0x1F7FF), `Delta (0); + (0x1F80C,0x1F80F), `Delta (0); + (0x1F848,0x1F84F), `Delta (0); + (0x1F85A,0x1F85F), `Delta (0); + (0x1F888,0x1F88F), `Delta (0); + (0x1F8AE,0x1F90F), `Delta (0); + (0x1F91F,0x1F91F), `Abs (0x1F91F); + (0x1F928,0x1F92F), `Delta (0); + (0x1F931,0x1F932), `Delta (0); + (0x1F93F,0x1F93F), `Abs (0x1F93F); + (0x1F94C,0x1F94F), `Delta (0); + (0x1F95F,0x1F97F), `Delta (0); + (0x1F992,0x1F9BF), `Delta (0); + (0x1F9C1,0x1FFFF), `Delta (0); + (0x2A6D7,0x2A6FF), `Delta (0); + (0x2B735,0x2B73F), `Delta (0); + (0x2B81E,0x2B81F), `Delta (0); + (0x2CEA2,0x2F7FF), `Delta (0); + (0x2FA1E,0xE0000), `Delta (0); + (0xE0002,0xE001F), `Delta (0); + (0xE0080,0xE00FF), `Delta (0); + (0xE01F0,0xEFFFF), `Delta (0); + (0xFFFFE,0xFFFFF), `Delta (0); + (0x10FFFE,0x10FFFF), `Delta (0); + (0x002B0,0x002C1), `Delta (0); + (0x002C6,0x002D1), `Delta (0); + (0x002E0,0x002E4), `Delta (0); + (0x002EC,0x002EC), `Abs (0x002EC); + (0x002EE,0x002EE), `Abs (0x002EE); + (0x00374,0x00374), `Abs (0x00374); + (0x0037A,0x0037A), `Abs (0x0037A); + (0x00559,0x00559), `Abs (0x00559); + (0x00640,0x00640), `Abs (0x00640); + (0x006E5,0x006E6), `Delta (0); + (0x007F4,0x007F5), `Delta (0); + (0x007FA,0x007FA), `Abs (0x007FA); + (0x0081A,0x0081A), `Abs (0x0081A); + (0x00824,0x00824), `Abs (0x00824); + (0x00828,0x00828), `Abs (0x00828); + (0x00971,0x00971), `Abs (0x00971); + (0x00E46,0x00E46), `Abs (0x00E46); + (0x00EC6,0x00EC6), `Abs (0x00EC6); + (0x010FC,0x010FC), `Abs (0x010FC); + (0x017D7,0x017D7), `Abs (0x017D7); + (0x01843,0x01843), `Abs (0x01843); + (0x01AA7,0x01AA7), `Abs (0x01AA7); + (0x01C78,0x01C7D), `Delta (0); + (0x01D2C,0x01D6A), `Delta (0); + (0x01D78,0x01D78), `Abs (0x01D78); + (0x01D9B,0x01DBF), `Delta (0); + (0x02071,0x02071), `Abs (0x02071); + (0x0207F,0x0207F), `Abs (0x0207F); + (0x02090,0x0209C), `Delta (0); + (0x02C7C,0x02C7D), `Delta (0); + (0x02D6F,0x02D6F), `Abs (0x02D6F); + (0x02E2F,0x02E2F), `Abs (0x02E2F); + (0x03005,0x03005), `Abs (0x03005); + (0x03031,0x03035), `Delta (0); + (0x0303B,0x0303B), `Abs (0x0303B); + (0x0309D,0x0309E), `Delta (0); + (0x030FC,0x030FE), `Delta (0); + (0x0A015,0x0A015), `Abs (0x0A015); + (0x0A4F8,0x0A4FD), `Delta (0); + (0x0A60C,0x0A60C), `Abs (0x0A60C); + (0x0A67F,0x0A67F), `Abs (0x0A67F); + (0x0A69C,0x0A69D), `Delta (0); + (0x0A717,0x0A71F), `Delta (0); + (0x0A770,0x0A770), `Abs (0x0A770); + (0x0A788,0x0A788), `Abs (0x0A788); + (0x0A7F8,0x0A7F9), `Delta (0); + (0x0A9CF,0x0A9CF), `Abs (0x0A9CF); + (0x0A9E6,0x0A9E6), `Abs (0x0A9E6); + (0x0AA70,0x0AA70), `Abs (0x0AA70); + (0x0AADD,0x0AADD), `Abs (0x0AADD); + (0x0AAF3,0x0AAF4), `Delta (0); + (0x0AB5C,0x0AB5F), `Delta (0); + (0x0FF70,0x0FF70), `Abs (0x0FF70); + (0x0FF9E,0x0FF9F), `Delta (0); + (0x16B40,0x16B43), `Delta (0); + (0x16F93,0x16F9F), `Delta (0); + (0x16FE0,0x16FE0), `Abs (0x16FE0); + (0x000AA,0x000AA), `Abs (0x000AA); + (0x000BA,0x000BA), `Abs (0x000BA); + (0x001BB,0x001BB), `Abs (0x001BB); + (0x001C0,0x001C3), `Delta (0); + (0x00294,0x00294), `Abs (0x00294); + (0x005D0,0x005EA), `Delta (0); + (0x005F0,0x005F2), `Delta (0); + (0x00620,0x0063F), `Delta (0); + (0x00641,0x0064A), `Delta (0); + (0x0066E,0x0066F), `Delta (0); + (0x00671,0x006D3), `Delta (0); + (0x006D5,0x006D5), `Abs (0x006D5); + (0x006EE,0x006EF), `Delta (0); + (0x006FA,0x006FC), `Delta (0); + (0x006FF,0x006FF), `Abs (0x006FF); + (0x00710,0x00710), `Abs (0x00710); + (0x00712,0x0072F), `Delta (0); + (0x0074D,0x007A5), `Delta (0); + (0x007B1,0x007B1), `Abs (0x007B1); + (0x007CA,0x007EA), `Delta (0); + (0x00800,0x00815), `Delta (0); + (0x00840,0x00858), `Delta (0); + (0x008A0,0x008B4), `Delta (0); + (0x008B6,0x008BD), `Delta (0); + (0x00904,0x00939), `Delta (0); + (0x0093D,0x0093D), `Abs (0x0093D); + (0x00950,0x00950), `Abs (0x00950); + (0x00958,0x00961), `Delta (0); + (0x00972,0x00980), `Delta (0); + (0x00985,0x0098C), `Delta (0); + (0x0098F,0x00990), `Delta (0); + (0x00993,0x009A8), `Delta (0); + (0x009AA,0x009B0), `Delta (0); + (0x009B2,0x009B2), `Abs (0x009B2); + (0x009B6,0x009B9), `Delta (0); + (0x009BD,0x009BD), `Abs (0x009BD); + (0x009CE,0x009CE), `Abs (0x009CE); + (0x009DC,0x009DD), `Delta (0); + (0x009DF,0x009E1), `Delta (0); + (0x009F0,0x009F1), `Delta (0); + (0x00A05,0x00A0A), `Delta (0); + (0x00A0F,0x00A10), `Delta (0); + (0x00A13,0x00A28), `Delta (0); + (0x00A2A,0x00A30), `Delta (0); + (0x00A32,0x00A33), `Delta (0); + (0x00A35,0x00A36), `Delta (0); + (0x00A38,0x00A39), `Delta (0); + (0x00A59,0x00A5C), `Delta (0); + (0x00A5E,0x00A5E), `Abs (0x00A5E); + (0x00A72,0x00A74), `Delta (0); + (0x00A85,0x00A8D), `Delta (0); + (0x00A8F,0x00A91), `Delta (0); + (0x00A93,0x00AA8), `Delta (0); + (0x00AAA,0x00AB0), `Delta (0); + (0x00AB2,0x00AB3), `Delta (0); + (0x00AB5,0x00AB9), `Delta (0); + (0x00ABD,0x00ABD), `Abs (0x00ABD); + (0x00AD0,0x00AD0), `Abs (0x00AD0); + (0x00AE0,0x00AE1), `Delta (0); + (0x00AF9,0x00AF9), `Abs (0x00AF9); + (0x00B05,0x00B0C), `Delta (0); + (0x00B0F,0x00B10), `Delta (0); + (0x00B13,0x00B28), `Delta (0); + (0x00B2A,0x00B30), `Delta (0); + (0x00B32,0x00B33), `Delta (0); + (0x00B35,0x00B39), `Delta (0); + (0x00B3D,0x00B3D), `Abs (0x00B3D); + (0x00B5C,0x00B5D), `Delta (0); + (0x00B5F,0x00B61), `Delta (0); + (0x00B71,0x00B71), `Abs (0x00B71); + (0x00B83,0x00B83), `Abs (0x00B83); + (0x00B85,0x00B8A), `Delta (0); + (0x00B8E,0x00B90), `Delta (0); + (0x00B92,0x00B95), `Delta (0); + (0x00B99,0x00B9A), `Delta (0); + (0x00B9C,0x00B9C), `Abs (0x00B9C); + (0x00B9E,0x00B9F), `Delta (0); + (0x00BA3,0x00BA4), `Delta (0); + (0x00BA8,0x00BAA), `Delta (0); + (0x00BAE,0x00BB9), `Delta (0); + (0x00BD0,0x00BD0), `Abs (0x00BD0); + (0x00C05,0x00C0C), `Delta (0); + (0x00C0E,0x00C10), `Delta (0); + (0x00C12,0x00C28), `Delta (0); + (0x00C2A,0x00C39), `Delta (0); + (0x00C3D,0x00C3D), `Abs (0x00C3D); + (0x00C58,0x00C5A), `Delta (0); + (0x00C60,0x00C61), `Delta (0); + (0x00C80,0x00C80), `Abs (0x00C80); + (0x00C85,0x00C8C), `Delta (0); + (0x00C8E,0x00C90), `Delta (0); + (0x00C92,0x00CA8), `Delta (0); + (0x00CAA,0x00CB3), `Delta (0); + (0x00CB5,0x00CB9), `Delta (0); + (0x00CBD,0x00CBD), `Abs (0x00CBD); + (0x00CDE,0x00CDE), `Abs (0x00CDE); + (0x00CE0,0x00CE1), `Delta (0); + (0x00CF1,0x00CF2), `Delta (0); + (0x00D05,0x00D0C), `Delta (0); + (0x00D0E,0x00D10), `Delta (0); + (0x00D12,0x00D3A), `Delta (0); + (0x00D3D,0x00D3D), `Abs (0x00D3D); + (0x00D4E,0x00D4E), `Abs (0x00D4E); + (0x00D54,0x00D56), `Delta (0); + (0x00D5F,0x00D61), `Delta (0); + (0x00D7A,0x00D7F), `Delta (0); + (0x00D85,0x00D96), `Delta (0); + (0x00D9A,0x00DB1), `Delta (0); + (0x00DB3,0x00DBB), `Delta (0); + (0x00DBD,0x00DBD), `Abs (0x00DBD); + (0x00DC0,0x00DC6), `Delta (0); + (0x00E01,0x00E30), `Delta (0); + (0x00E32,0x00E33), `Delta (0); + (0x00E40,0x00E45), `Delta (0); + (0x00E81,0x00E82), `Delta (0); + (0x00E84,0x00E84), `Abs (0x00E84); + (0x00E87,0x00E88), `Delta (0); + (0x00E8A,0x00E8A), `Abs (0x00E8A); + (0x00E8D,0x00E8D), `Abs (0x00E8D); + (0x00E94,0x00E97), `Delta (0); + (0x00E99,0x00E9F), `Delta (0); + (0x00EA1,0x00EA3), `Delta (0); + (0x00EA5,0x00EA5), `Abs (0x00EA5); + (0x00EA7,0x00EA7), `Abs (0x00EA7); + (0x00EAA,0x00EAB), `Delta (0); + (0x00EAD,0x00EB0), `Delta (0); + (0x00EB2,0x00EB3), `Delta (0); + (0x00EBD,0x00EBD), `Abs (0x00EBD); + (0x00EC0,0x00EC4), `Delta (0); + (0x00EDC,0x00EDF), `Delta (0); + (0x00F00,0x00F00), `Abs (0x00F00); + (0x00F40,0x00F47), `Delta (0); + (0x00F49,0x00F6C), `Delta (0); + (0x00F88,0x00F8C), `Delta (0); + (0x01000,0x0102A), `Delta (0); + (0x0103F,0x0103F), `Abs (0x0103F); + (0x01050,0x01055), `Delta (0); + (0x0105A,0x0105D), `Delta (0); + (0x01061,0x01061), `Abs (0x01061); + (0x01065,0x01066), `Delta (0); + (0x0106E,0x01070), `Delta (0); + (0x01075,0x01081), `Delta (0); + (0x0108E,0x0108E), `Abs (0x0108E); + (0x010D0,0x010FA), `Delta (0); + (0x010FD,0x01248), `Delta (0); + (0x0124A,0x0124D), `Delta (0); + (0x01250,0x01256), `Delta (0); + (0x01258,0x01258), `Abs (0x01258); + (0x0125A,0x0125D), `Delta (0); + (0x01260,0x01288), `Delta (0); + (0x0128A,0x0128D), `Delta (0); + (0x01290,0x012B0), `Delta (0); + (0x012B2,0x012B5), `Delta (0); + (0x012B8,0x012BE), `Delta (0); + (0x012C0,0x012C0), `Abs (0x012C0); + (0x012C2,0x012C5), `Delta (0); + (0x012C8,0x012D6), `Delta (0); + (0x012D8,0x01310), `Delta (0); + (0x01312,0x01315), `Delta (0); + (0x01318,0x0135A), `Delta (0); + (0x01380,0x0138F), `Delta (0); + (0x01401,0x0166C), `Delta (0); + (0x0166F,0x0167F), `Delta (0); + (0x01681,0x0169A), `Delta (0); + (0x016A0,0x016EA), `Delta (0); + (0x016F1,0x016F8), `Delta (0); + (0x01700,0x0170C), `Delta (0); + (0x0170E,0x01711), `Delta (0); + (0x01720,0x01731), `Delta (0); + (0x01740,0x01751), `Delta (0); + (0x01760,0x0176C), `Delta (0); + (0x0176E,0x01770), `Delta (0); + (0x01780,0x017B3), `Delta (0); + (0x017DC,0x017DC), `Abs (0x017DC); + (0x01820,0x01842), `Delta (0); + (0x01844,0x01877), `Delta (0); + (0x01880,0x01884), `Delta (0); + (0x01887,0x018A8), `Delta (0); + (0x018AA,0x018AA), `Abs (0x018AA); + (0x018B0,0x018F5), `Delta (0); + (0x01900,0x0191E), `Delta (0); + (0x01950,0x0196D), `Delta (0); + (0x01970,0x01974), `Delta (0); + (0x01980,0x019AB), `Delta (0); + (0x019B0,0x019C9), `Delta (0); + (0x01A00,0x01A16), `Delta (0); + (0x01A20,0x01A54), `Delta (0); + (0x01B05,0x01B33), `Delta (0); + (0x01B45,0x01B4B), `Delta (0); + (0x01B83,0x01BA0), `Delta (0); + (0x01BAE,0x01BAF), `Delta (0); + (0x01BBA,0x01BE5), `Delta (0); + (0x01C00,0x01C23), `Delta (0); + (0x01C4D,0x01C4F), `Delta (0); + (0x01C5A,0x01C77), `Delta (0); + (0x01CE9,0x01CEC), `Delta (0); + (0x01CEE,0x01CF1), `Delta (0); + (0x01CF5,0x01CF6), `Delta (0); + (0x02135,0x02138), `Delta (0); + (0x02D30,0x02D67), `Delta (0); + (0x02D80,0x02D96), `Delta (0); + (0x02DA0,0x02DA6), `Delta (0); + (0x02DA8,0x02DAE), `Delta (0); + (0x02DB0,0x02DB6), `Delta (0); + (0x02DB8,0x02DBE), `Delta (0); + (0x02DC0,0x02DC6), `Delta (0); + (0x02DC8,0x02DCE), `Delta (0); + (0x02DD0,0x02DD6), `Delta (0); + (0x02DD8,0x02DDE), `Delta (0); + (0x03006,0x03006), `Abs (0x03006); + (0x0303C,0x0303C), `Abs (0x0303C); + (0x03041,0x03096), `Delta (0); + (0x0309F,0x0309F), `Abs (0x0309F); + (0x030A1,0x030FA), `Delta (0); + (0x030FF,0x030FF), `Abs (0x030FF); + (0x03105,0x0312D), `Delta (0); + (0x03131,0x0318E), `Delta (0); + (0x031A0,0x031BA), `Delta (0); + (0x031F0,0x031FF), `Delta (0); + (0x03400,0x04DB5), `Delta (0); + (0x04E00,0x09FD5), `Delta (0); + (0x0A000,0x0A014), `Delta (0); + (0x0A016,0x0A48C), `Delta (0); + (0x0A4D0,0x0A4F7), `Delta (0); + (0x0A500,0x0A60B), `Delta (0); + (0x0A610,0x0A61F), `Delta (0); + (0x0A62A,0x0A62B), `Delta (0); + (0x0A66E,0x0A66E), `Abs (0x0A66E); + (0x0A6A0,0x0A6E5), `Delta (0); + (0x0A78F,0x0A78F), `Abs (0x0A78F); + (0x0A7F7,0x0A7F7), `Abs (0x0A7F7); + (0x0A7FB,0x0A801), `Delta (0); + (0x0A803,0x0A805), `Delta (0); + (0x0A807,0x0A80A), `Delta (0); + (0x0A80C,0x0A822), `Delta (0); + (0x0A840,0x0A873), `Delta (0); + (0x0A882,0x0A8B3), `Delta (0); + (0x0A8F2,0x0A8F7), `Delta (0); + (0x0A8FB,0x0A8FB), `Abs (0x0A8FB); + (0x0A8FD,0x0A8FD), `Abs (0x0A8FD); + (0x0A90A,0x0A925), `Delta (0); + (0x0A930,0x0A946), `Delta (0); + (0x0A960,0x0A97C), `Delta (0); + (0x0A984,0x0A9B2), `Delta (0); + (0x0A9E0,0x0A9E4), `Delta (0); + (0x0A9E7,0x0A9EF), `Delta (0); + (0x0A9FA,0x0A9FE), `Delta (0); + (0x0AA00,0x0AA28), `Delta (0); + (0x0AA40,0x0AA42), `Delta (0); + (0x0AA44,0x0AA4B), `Delta (0); + (0x0AA60,0x0AA6F), `Delta (0); + (0x0AA71,0x0AA76), `Delta (0); + (0x0AA7A,0x0AA7A), `Abs (0x0AA7A); + (0x0AA7E,0x0AAAF), `Delta (0); + (0x0AAB1,0x0AAB1), `Abs (0x0AAB1); + (0x0AAB5,0x0AAB6), `Delta (0); + (0x0AAB9,0x0AABD), `Delta (0); + (0x0AAC0,0x0AAC0), `Abs (0x0AAC0); + (0x0AAC2,0x0AAC2), `Abs (0x0AAC2); + (0x0AADB,0x0AADC), `Delta (0); + (0x0AAE0,0x0AAEA), `Delta (0); + (0x0AAF2,0x0AAF2), `Abs (0x0AAF2); + (0x0AB01,0x0AB06), `Delta (0); + (0x0AB09,0x0AB0E), `Delta (0); + (0x0AB11,0x0AB16), `Delta (0); + (0x0AB20,0x0AB26), `Delta (0); + (0x0AB28,0x0AB2E), `Delta (0); + (0x0ABC0,0x0ABE2), `Delta (0); + (0x0AC00,0x0D7A3), `Delta (0); + (0x0D7B0,0x0D7C6), `Delta (0); + (0x0D7CB,0x0D7FB), `Delta (0); + (0x0F900,0x0FA6D), `Delta (0); + (0x0FA70,0x0FAD9), `Delta (0); + (0x0FB1D,0x0FB1D), `Abs (0x0FB1D); + (0x0FB1F,0x0FB28), `Delta (0); + (0x0FB2A,0x0FB36), `Delta (0); + (0x0FB38,0x0FB3C), `Delta (0); + (0x0FB3E,0x0FB3E), `Abs (0x0FB3E); + (0x0FB40,0x0FB41), `Delta (0); + (0x0FB43,0x0FB44), `Delta (0); + (0x0FB46,0x0FBB1), `Delta (0); + (0x0FBD3,0x0FD3D), `Delta (0); + (0x0FD50,0x0FD8F), `Delta (0); + (0x0FD92,0x0FDC7), `Delta (0); + (0x0FDF0,0x0FDFB), `Delta (0); + (0x0FE70,0x0FE74), `Delta (0); + (0x0FE76,0x0FEFC), `Delta (0); + (0x0FF66,0x0FF6F), `Delta (0); + (0x0FF71,0x0FF9D), `Delta (0); + (0x0FFA0,0x0FFBE), `Delta (0); + (0x0FFC2,0x0FFC7), `Delta (0); + (0x0FFCA,0x0FFCF), `Delta (0); + (0x0FFD2,0x0FFD7), `Delta (0); + (0x0FFDA,0x0FFDC), `Delta (0); + (0x10000,0x1000B), `Delta (0); + (0x1000D,0x10026), `Delta (0); + (0x10028,0x1003A), `Delta (0); + (0x1003C,0x1003D), `Delta (0); + (0x1003F,0x1004D), `Delta (0); + (0x10050,0x1005D), `Delta (0); + (0x10080,0x100FA), `Delta (0); + (0x10280,0x1029C), `Delta (0); + (0x102A0,0x102D0), `Delta (0); + (0x10300,0x1031F), `Delta (0); + (0x10330,0x10340), `Delta (0); + (0x10342,0x10349), `Delta (0); + (0x10350,0x10375), `Delta (0); + (0x10380,0x1039D), `Delta (0); + (0x103A0,0x103C3), `Delta (0); + (0x103C8,0x103CF), `Delta (0); + (0x10450,0x1049D), `Delta (0); + (0x10500,0x10527), `Delta (0); + (0x10530,0x10563), `Delta (0); + (0x10600,0x10736), `Delta (0); + (0x10740,0x10755), `Delta (0); + (0x10760,0x10767), `Delta (0); + (0x10800,0x10805), `Delta (0); + (0x10808,0x10808), `Abs (0x10808); + (0x1080A,0x10835), `Delta (0); + (0x10837,0x10838), `Delta (0); + (0x1083C,0x1083C), `Abs (0x1083C); + (0x1083F,0x10855), `Delta (0); + (0x10860,0x10876), `Delta (0); + (0x10880,0x1089E), `Delta (0); + (0x108E0,0x108F2), `Delta (0); + (0x108F4,0x108F5), `Delta (0); + (0x10900,0x10915), `Delta (0); + (0x10920,0x10939), `Delta (0); + (0x10980,0x109B7), `Delta (0); + (0x109BE,0x109BF), `Delta (0); + (0x10A00,0x10A00), `Abs (0x10A00); + (0x10A10,0x10A13), `Delta (0); + (0x10A15,0x10A17), `Delta (0); + (0x10A19,0x10A33), `Delta (0); + (0x10A60,0x10A7C), `Delta (0); + (0x10A80,0x10A9C), `Delta (0); + (0x10AC0,0x10AC7), `Delta (0); + (0x10AC9,0x10AE4), `Delta (0); + (0x10B00,0x10B35), `Delta (0); + (0x10B40,0x10B55), `Delta (0); + (0x10B60,0x10B72), `Delta (0); + (0x10B80,0x10B91), `Delta (0); + (0x10C00,0x10C48), `Delta (0); + (0x11003,0x11037), `Delta (0); + (0x11083,0x110AF), `Delta (0); + (0x110D0,0x110E8), `Delta (0); + (0x11103,0x11126), `Delta (0); + (0x11150,0x11172), `Delta (0); + (0x11176,0x11176), `Abs (0x11176); + (0x11183,0x111B2), `Delta (0); + (0x111C1,0x111C4), `Delta (0); + (0x111DA,0x111DA), `Abs (0x111DA); + (0x111DC,0x111DC), `Abs (0x111DC); + (0x11200,0x11211), `Delta (0); + (0x11213,0x1122B), `Delta (0); + (0x11280,0x11286), `Delta (0); + (0x11288,0x11288), `Abs (0x11288); + (0x1128A,0x1128D), `Delta (0); + (0x1128F,0x1129D), `Delta (0); + (0x1129F,0x112A8), `Delta (0); + (0x112B0,0x112DE), `Delta (0); + (0x11305,0x1130C), `Delta (0); + (0x1130F,0x11310), `Delta (0); + (0x11313,0x11328), `Delta (0); + (0x1132A,0x11330), `Delta (0); + (0x11332,0x11333), `Delta (0); + (0x11335,0x11339), `Delta (0); + (0x1133D,0x1133D), `Abs (0x1133D); + (0x11350,0x11350), `Abs (0x11350); + (0x1135D,0x11361), `Delta (0); + (0x11400,0x11434), `Delta (0); + (0x11447,0x1144A), `Delta (0); + (0x11480,0x114AF), `Delta (0); + (0x114C4,0x114C5), `Delta (0); + (0x114C7,0x114C7), `Abs (0x114C7); + (0x11580,0x115AE), `Delta (0); + (0x115D8,0x115DB), `Delta (0); + (0x11600,0x1162F), `Delta (0); + (0x11644,0x11644), `Abs (0x11644); + (0x11680,0x116AA), `Delta (0); + (0x11700,0x11719), `Delta (0); + (0x118FF,0x118FF), `Abs (0x118FF); + (0x11AC0,0x11AF8), `Delta (0); + (0x11C00,0x11C08), `Delta (0); + (0x11C0A,0x11C2E), `Delta (0); + (0x11C40,0x11C40), `Abs (0x11C40); + (0x11C72,0x11C8F), `Delta (0); + (0x12000,0x12399), `Delta (0); + (0x12480,0x12543), `Delta (0); + (0x13000,0x1342E), `Delta (0); + (0x14400,0x14646), `Delta (0); + (0x16800,0x16A38), `Delta (0); + (0x16A40,0x16A5E), `Delta (0); + (0x16AD0,0x16AED), `Delta (0); + (0x16B00,0x16B2F), `Delta (0); + (0x16B63,0x16B77), `Delta (0); + (0x16B7D,0x16B8F), `Delta (0); + (0x16F00,0x16F44), `Delta (0); + (0x16F50,0x16F50), `Abs (0x16F50); + (0x17000,0x187EC), `Delta (0); + (0x18800,0x18AF2), `Delta (0); + (0x1B000,0x1B001), `Delta (0); + (0x1BC00,0x1BC6A), `Delta (0); + (0x1BC70,0x1BC7C), `Delta (0); + (0x1BC80,0x1BC88), `Delta (0); + (0x1BC90,0x1BC99), `Delta (0); + (0x1E800,0x1E8C4), `Delta (0); + (0x1EE00,0x1EE03), `Delta (0); + (0x1EE05,0x1EE1F), `Delta (0); + (0x1EE21,0x1EE22), `Delta (0); + (0x1EE24,0x1EE24), `Abs (0x1EE24); + (0x1EE27,0x1EE27), `Abs (0x1EE27); + (0x1EE29,0x1EE32), `Delta (0); + (0x1EE34,0x1EE37), `Delta (0); + (0x1EE39,0x1EE39), `Abs (0x1EE39); + (0x1EE3B,0x1EE3B), `Abs (0x1EE3B); + (0x1EE42,0x1EE42), `Abs (0x1EE42); + (0x1EE47,0x1EE47), `Abs (0x1EE47); + (0x1EE49,0x1EE49), `Abs (0x1EE49); + (0x1EE4B,0x1EE4B), `Abs (0x1EE4B); + (0x1EE4D,0x1EE4F), `Delta (0); + (0x1EE51,0x1EE52), `Delta (0); + (0x1EE54,0x1EE54), `Abs (0x1EE54); + (0x1EE57,0x1EE57), `Abs (0x1EE57); + (0x1EE59,0x1EE59), `Abs (0x1EE59); + (0x1EE5B,0x1EE5B), `Abs (0x1EE5B); + (0x1EE5D,0x1EE5D), `Abs (0x1EE5D); + (0x1EE5F,0x1EE5F), `Abs (0x1EE5F); + (0x1EE61,0x1EE62), `Delta (0); + (0x1EE64,0x1EE64), `Abs (0x1EE64); + (0x1EE67,0x1EE6A), `Delta (0); + (0x1EE6C,0x1EE72), `Delta (0); + (0x1EE74,0x1EE77), `Delta (0); + (0x1EE79,0x1EE7C), `Delta (0); + (0x1EE7E,0x1EE7E), `Abs (0x1EE7E); + (0x1EE80,0x1EE89), `Delta (0); + (0x1EE8B,0x1EE9B), `Delta (0); + (0x1EEA1,0x1EEA3), `Delta (0); + (0x1EEA5,0x1EEA9), `Delta (0); + (0x1EEAB,0x1EEBB), `Delta (0); + (0x20000,0x2A6D6), `Delta (0); + (0x2A700,0x2B734), `Delta (0); + (0x2B740,0x2B81D), `Delta (0); + (0x2B820,0x2CEA1), `Delta (0); + (0x2F800,0x2FA1D), `Delta (0); + (0x0005F,0x0005F), `Abs (0x0005F); + (0x0203F,0x02040), `Delta (0); + (0x02054,0x02054), `Abs (0x02054); + (0x0FE33,0x0FE34), `Delta (0); + (0x0FE4D,0x0FE4F), `Delta (0); + (0x0FF3F,0x0FF3F), `Abs (0x0FF3F); + (0x0002D,0x0002D), `Abs (0x0002D); + (0x0058A,0x0058A), `Abs (0x0058A); + (0x005BE,0x005BE), `Abs (0x005BE); + (0x01400,0x01400), `Abs (0x01400); + (0x01806,0x01806), `Abs (0x01806); + (0x02010,0x02015), `Delta (0); + (0x02E17,0x02E17), `Abs (0x02E17); + (0x02E1A,0x02E1A), `Abs (0x02E1A); + (0x02E3A,0x02E3B), `Delta (0); + (0x02E40,0x02E40), `Abs (0x02E40); + (0x0301C,0x0301C), `Abs (0x0301C); + (0x03030,0x03030), `Abs (0x03030); + (0x030A0,0x030A0), `Abs (0x030A0); + (0x0FE31,0x0FE32), `Delta (0); + (0x0FE58,0x0FE58), `Abs (0x0FE58); + (0x0FE63,0x0FE63), `Abs (0x0FE63); + (0x0FF0D,0x0FF0D), `Abs (0x0FF0D); + (0x00028,0x00028), `Abs (0x00028); + (0x0005B,0x0005B), `Abs (0x0005B); + (0x0007B,0x0007B), `Abs (0x0007B); + (0x00F3A,0x00F3A), `Abs (0x00F3A); + (0x00F3C,0x00F3C), `Abs (0x00F3C); + (0x0169B,0x0169B), `Abs (0x0169B); + (0x0201A,0x0201A), `Abs (0x0201A); + (0x0201E,0x0201E), `Abs (0x0201E); + (0x02045,0x02045), `Abs (0x02045); + (0x0207D,0x0207D), `Abs (0x0207D); + (0x0208D,0x0208D), `Abs (0x0208D); + (0x02308,0x02308), `Abs (0x02308); + (0x0230A,0x0230A), `Abs (0x0230A); + (0x02329,0x02329), `Abs (0x02329); + (0x02768,0x02768), `Abs (0x02768); + (0x0276A,0x0276A), `Abs (0x0276A); + (0x0276C,0x0276C), `Abs (0x0276C); + (0x0276E,0x0276E), `Abs (0x0276E); + (0x02770,0x02770), `Abs (0x02770); + (0x02772,0x02772), `Abs (0x02772); + (0x02774,0x02774), `Abs (0x02774); + (0x027C5,0x027C5), `Abs (0x027C5); + (0x027E6,0x027E6), `Abs (0x027E6); + (0x027E8,0x027E8), `Abs (0x027E8); + (0x027EA,0x027EA), `Abs (0x027EA); + (0x027EC,0x027EC), `Abs (0x027EC); + (0x027EE,0x027EE), `Abs (0x027EE); + (0x02983,0x02983), `Abs (0x02983); + (0x02985,0x02985), `Abs (0x02985); + (0x02987,0x02987), `Abs (0x02987); + (0x02989,0x02989), `Abs (0x02989); + (0x0298B,0x0298B), `Abs (0x0298B); + (0x0298D,0x0298D), `Abs (0x0298D); + (0x0298F,0x0298F), `Abs (0x0298F); + (0x02991,0x02991), `Abs (0x02991); + (0x02993,0x02993), `Abs (0x02993); + (0x02995,0x02995), `Abs (0x02995); + (0x02997,0x02997), `Abs (0x02997); + (0x029D8,0x029D8), `Abs (0x029D8); + (0x029DA,0x029DA), `Abs (0x029DA); + (0x029FC,0x029FC), `Abs (0x029FC); + (0x02E22,0x02E22), `Abs (0x02E22); + (0x02E24,0x02E24), `Abs (0x02E24); + (0x02E26,0x02E26), `Abs (0x02E26); + (0x02E28,0x02E28), `Abs (0x02E28); + (0x02E42,0x02E42), `Abs (0x02E42); + (0x03008,0x03008), `Abs (0x03008); + (0x0300A,0x0300A), `Abs (0x0300A); + (0x0300C,0x0300C), `Abs (0x0300C); + (0x0300E,0x0300E), `Abs (0x0300E); + (0x03010,0x03010), `Abs (0x03010); + (0x03014,0x03014), `Abs (0x03014); + (0x03016,0x03016), `Abs (0x03016); + (0x03018,0x03018), `Abs (0x03018); + (0x0301A,0x0301A), `Abs (0x0301A); + (0x0301D,0x0301D), `Abs (0x0301D); + (0x0FD3F,0x0FD3F), `Abs (0x0FD3F); + (0x0FE17,0x0FE17), `Abs (0x0FE17); + (0x0FE35,0x0FE35), `Abs (0x0FE35); + (0x0FE37,0x0FE37), `Abs (0x0FE37); + (0x0FE39,0x0FE39), `Abs (0x0FE39); + (0x0FE3B,0x0FE3B), `Abs (0x0FE3B); + (0x0FE3D,0x0FE3D), `Abs (0x0FE3D); + (0x0FE3F,0x0FE3F), `Abs (0x0FE3F); + (0x0FE41,0x0FE41), `Abs (0x0FE41); + (0x0FE43,0x0FE43), `Abs (0x0FE43); + (0x0FE47,0x0FE47), `Abs (0x0FE47); + (0x0FE59,0x0FE59), `Abs (0x0FE59); + (0x0FE5B,0x0FE5B), `Abs (0x0FE5B); + (0x0FE5D,0x0FE5D), `Abs (0x0FE5D); + (0x0FF08,0x0FF08), `Abs (0x0FF08); + (0x0FF3B,0x0FF3B), `Abs (0x0FF3B); + (0x0FF5B,0x0FF5B), `Abs (0x0FF5B); + (0x0FF5F,0x0FF5F), `Abs (0x0FF5F); + (0x0FF62,0x0FF62), `Abs (0x0FF62); + (0x00029,0x00029), `Abs (0x00029); + (0x0005D,0x0005D), `Abs (0x0005D); + (0x0007D,0x0007D), `Abs (0x0007D); + (0x00F3B,0x00F3B), `Abs (0x00F3B); + (0x00F3D,0x00F3D), `Abs (0x00F3D); + (0x0169C,0x0169C), `Abs (0x0169C); + (0x02046,0x02046), `Abs (0x02046); + (0x0207E,0x0207E), `Abs (0x0207E); + (0x0208E,0x0208E), `Abs (0x0208E); + (0x02309,0x02309), `Abs (0x02309); + (0x0230B,0x0230B), `Abs (0x0230B); + (0x0232A,0x0232A), `Abs (0x0232A); + (0x02769,0x02769), `Abs (0x02769); + (0x0276B,0x0276B), `Abs (0x0276B); + (0x0276D,0x0276D), `Abs (0x0276D); + (0x0276F,0x0276F), `Abs (0x0276F); + (0x02771,0x02771), `Abs (0x02771); + (0x02773,0x02773), `Abs (0x02773); + (0x02775,0x02775), `Abs (0x02775); + (0x027C6,0x027C6), `Abs (0x027C6); + (0x027E7,0x027E7), `Abs (0x027E7); + (0x027E9,0x027E9), `Abs (0x027E9); + (0x027EB,0x027EB), `Abs (0x027EB); + (0x027ED,0x027ED), `Abs (0x027ED); + (0x027EF,0x027EF), `Abs (0x027EF); + (0x02984,0x02984), `Abs (0x02984); + (0x02986,0x02986), `Abs (0x02986); + (0x02988,0x02988), `Abs (0x02988); + (0x0298A,0x0298A), `Abs (0x0298A); + (0x0298C,0x0298C), `Abs (0x0298C); + (0x0298E,0x0298E), `Abs (0x0298E); + (0x02990,0x02990), `Abs (0x02990); + (0x02992,0x02992), `Abs (0x02992); + (0x02994,0x02994), `Abs (0x02994); + (0x02996,0x02996), `Abs (0x02996); + (0x02998,0x02998), `Abs (0x02998); + (0x029D9,0x029D9), `Abs (0x029D9); + (0x029DB,0x029DB), `Abs (0x029DB); + (0x029FD,0x029FD), `Abs (0x029FD); + (0x02E23,0x02E23), `Abs (0x02E23); + (0x02E25,0x02E25), `Abs (0x02E25); + (0x02E27,0x02E27), `Abs (0x02E27); + (0x02E29,0x02E29), `Abs (0x02E29); + (0x03009,0x03009), `Abs (0x03009); + (0x0300B,0x0300B), `Abs (0x0300B); + (0x0300D,0x0300D), `Abs (0x0300D); + (0x0300F,0x0300F), `Abs (0x0300F); + (0x03011,0x03011), `Abs (0x03011); + (0x03015,0x03015), `Abs (0x03015); + (0x03017,0x03017), `Abs (0x03017); + (0x03019,0x03019), `Abs (0x03019); + (0x0301B,0x0301B), `Abs (0x0301B); + (0x0301E,0x0301F), `Delta (0); + (0x0FD3E,0x0FD3E), `Abs (0x0FD3E); + (0x0FE18,0x0FE18), `Abs (0x0FE18); + (0x0FE36,0x0FE36), `Abs (0x0FE36); + (0x0FE38,0x0FE38), `Abs (0x0FE38); + (0x0FE3A,0x0FE3A), `Abs (0x0FE3A); + (0x0FE3C,0x0FE3C), `Abs (0x0FE3C); + (0x0FE3E,0x0FE3E), `Abs (0x0FE3E); + (0x0FE40,0x0FE40), `Abs (0x0FE40); + (0x0FE42,0x0FE42), `Abs (0x0FE42); + (0x0FE44,0x0FE44), `Abs (0x0FE44); + (0x0FE48,0x0FE48), `Abs (0x0FE48); + (0x0FE5A,0x0FE5A), `Abs (0x0FE5A); + (0x0FE5C,0x0FE5C), `Abs (0x0FE5C); + (0x0FE5E,0x0FE5E), `Abs (0x0FE5E); + (0x0FF09,0x0FF09), `Abs (0x0FF09); + (0x0FF3D,0x0FF3D), `Abs (0x0FF3D); + (0x0FF5D,0x0FF5D), `Abs (0x0FF5D); + (0x0FF60,0x0FF60), `Abs (0x0FF60); + (0x0FF63,0x0FF63), `Abs (0x0FF63); + (0x000AB,0x000AB), `Abs (0x000AB); + (0x02018,0x02018), `Abs (0x02018); + (0x0201B,0x0201C), `Delta (0); + (0x0201F,0x0201F), `Abs (0x0201F); + (0x02039,0x02039), `Abs (0x02039); + (0x02E02,0x02E02), `Abs (0x02E02); + (0x02E04,0x02E04), `Abs (0x02E04); + (0x02E09,0x02E09), `Abs (0x02E09); + (0x02E0C,0x02E0C), `Abs (0x02E0C); + (0x02E1C,0x02E1C), `Abs (0x02E1C); + (0x02E20,0x02E20), `Abs (0x02E20); + (0x000BB,0x000BB), `Abs (0x000BB); + (0x02019,0x02019), `Abs (0x02019); + (0x0201D,0x0201D), `Abs (0x0201D); + (0x0203A,0x0203A), `Abs (0x0203A); + (0x02E03,0x02E03), `Abs (0x02E03); + (0x02E05,0x02E05), `Abs (0x02E05); + (0x02E0A,0x02E0A), `Abs (0x02E0A); + (0x02E0D,0x02E0D), `Abs (0x02E0D); + (0x02E1D,0x02E1D), `Abs (0x02E1D); + (0x02E21,0x02E21), `Abs (0x02E21); + (0x00021,0x00023), `Delta (0); + (0x00025,0x00027), `Delta (0); + (0x0002A,0x0002A), `Abs (0x0002A); + (0x0002C,0x0002C), `Abs (0x0002C); + (0x0002E,0x0002F), `Delta (0); + (0x0003A,0x0003B), `Delta (0); + (0x0003F,0x00040), `Delta (0); + (0x0005C,0x0005C), `Abs (0x0005C); + (0x000A1,0x000A1), `Abs (0x000A1); + (0x000A7,0x000A7), `Abs (0x000A7); + (0x000B6,0x000B7), `Delta (0); + (0x000BF,0x000BF), `Abs (0x000BF); + (0x0037E,0x0037E), `Abs (0x0037E); + (0x00387,0x00387), `Abs (0x00387); + (0x0055A,0x0055F), `Delta (0); + (0x00589,0x00589), `Abs (0x00589); + (0x005C0,0x005C0), `Abs (0x005C0); + (0x005C3,0x005C3), `Abs (0x005C3); + (0x005C6,0x005C6), `Abs (0x005C6); + (0x005F3,0x005F4), `Delta (0); + (0x00609,0x0060A), `Delta (0); + (0x0060C,0x0060D), `Delta (0); + (0x0061B,0x0061B), `Abs (0x0061B); + (0x0061E,0x0061F), `Delta (0); + (0x0066A,0x0066D), `Delta (0); + (0x006D4,0x006D4), `Abs (0x006D4); + (0x00700,0x0070D), `Delta (0); + (0x007F7,0x007F9), `Delta (0); + (0x00830,0x0083E), `Delta (0); + (0x0085E,0x0085E), `Abs (0x0085E); + (0x00964,0x00965), `Delta (0); + (0x00970,0x00970), `Abs (0x00970); + (0x00AF0,0x00AF0), `Abs (0x00AF0); + (0x00DF4,0x00DF4), `Abs (0x00DF4); + (0x00E4F,0x00E4F), `Abs (0x00E4F); + (0x00E5A,0x00E5B), `Delta (0); + (0x00F04,0x00F12), `Delta (0); + (0x00F14,0x00F14), `Abs (0x00F14); + (0x00F85,0x00F85), `Abs (0x00F85); + (0x00FD0,0x00FD4), `Delta (0); + (0x00FD9,0x00FDA), `Delta (0); + (0x0104A,0x0104F), `Delta (0); + (0x010FB,0x010FB), `Abs (0x010FB); + (0x01360,0x01368), `Delta (0); + (0x0166D,0x0166E), `Delta (0); + (0x016EB,0x016ED), `Delta (0); + (0x01735,0x01736), `Delta (0); + (0x017D4,0x017D6), `Delta (0); + (0x017D8,0x017DA), `Delta (0); + (0x01800,0x01805), `Delta (0); + (0x01807,0x0180A), `Delta (0); + (0x01944,0x01945), `Delta (0); + (0x01A1E,0x01A1F), `Delta (0); + (0x01AA0,0x01AA6), `Delta (0); + (0x01AA8,0x01AAD), `Delta (0); + (0x01B5A,0x01B60), `Delta (0); + (0x01BFC,0x01BFF), `Delta (0); + (0x01C3B,0x01C3F), `Delta (0); + (0x01C7E,0x01C7F), `Delta (0); + (0x01CC0,0x01CC7), `Delta (0); + (0x01CD3,0x01CD3), `Abs (0x01CD3); + (0x02016,0x02017), `Delta (0); + (0x02020,0x02027), `Delta (0); + (0x02030,0x02038), `Delta (0); + (0x0203B,0x0203E), `Delta (0); + (0x02041,0x02043), `Delta (0); + (0x02047,0x02051), `Delta (0); + (0x02053,0x02053), `Abs (0x02053); + (0x02055,0x0205E), `Delta (0); + (0x02CF9,0x02CFC), `Delta (0); + (0x02CFE,0x02CFF), `Delta (0); + (0x02D70,0x02D70), `Abs (0x02D70); + (0x02E00,0x02E01), `Delta (0); + (0x02E06,0x02E08), `Delta (0); + (0x02E0B,0x02E0B), `Abs (0x02E0B); + (0x02E0E,0x02E16), `Delta (0); + (0x02E18,0x02E19), `Delta (0); + (0x02E1B,0x02E1B), `Abs (0x02E1B); + (0x02E1E,0x02E1F), `Delta (0); + (0x02E2A,0x02E2E), `Delta (0); + (0x02E30,0x02E39), `Delta (0); + (0x02E3C,0x02E3F), `Delta (0); + (0x02E41,0x02E41), `Abs (0x02E41); + (0x02E43,0x02E44), `Delta (0); + (0x03001,0x03003), `Delta (0); + (0x0303D,0x0303D), `Abs (0x0303D); + (0x030FB,0x030FB), `Abs (0x030FB); + (0x0A4FE,0x0A4FF), `Delta (0); + (0x0A60D,0x0A60F), `Delta (0); + (0x0A673,0x0A673), `Abs (0x0A673); + (0x0A67E,0x0A67E), `Abs (0x0A67E); + (0x0A6F2,0x0A6F7), `Delta (0); + (0x0A874,0x0A877), `Delta (0); + (0x0A8CE,0x0A8CF), `Delta (0); + (0x0A8F8,0x0A8FA), `Delta (0); + (0x0A8FC,0x0A8FC), `Abs (0x0A8FC); + (0x0A92E,0x0A92F), `Delta (0); + (0x0A95F,0x0A95F), `Abs (0x0A95F); + (0x0A9C1,0x0A9CD), `Delta (0); + (0x0A9DE,0x0A9DF), `Delta (0); + (0x0AA5C,0x0AA5F), `Delta (0); + (0x0AADE,0x0AADF), `Delta (0); + (0x0AAF0,0x0AAF1), `Delta (0); + (0x0ABEB,0x0ABEB), `Abs (0x0ABEB); + (0x0FE10,0x0FE16), `Delta (0); + (0x0FE19,0x0FE19), `Abs (0x0FE19); + (0x0FE30,0x0FE30), `Abs (0x0FE30); + (0x0FE45,0x0FE46), `Delta (0); + (0x0FE49,0x0FE4C), `Delta (0); + (0x0FE50,0x0FE52), `Delta (0); + (0x0FE54,0x0FE57), `Delta (0); + (0x0FE5F,0x0FE61), `Delta (0); + (0x0FE68,0x0FE68), `Abs (0x0FE68); + (0x0FE6A,0x0FE6B), `Delta (0); + (0x0FF01,0x0FF03), `Delta (0); + (0x0FF05,0x0FF07), `Delta (0); + (0x0FF0A,0x0FF0A), `Abs (0x0FF0A); + (0x0FF0C,0x0FF0C), `Abs (0x0FF0C); + (0x0FF0E,0x0FF0F), `Delta (0); + (0x0FF1A,0x0FF1B), `Delta (0); + (0x0FF1F,0x0FF20), `Delta (0); + (0x0FF3C,0x0FF3C), `Abs (0x0FF3C); + (0x0FF61,0x0FF61), `Abs (0x0FF61); + (0x0FF64,0x0FF65), `Delta (0); + (0x10100,0x10102), `Delta (0); + (0x1039F,0x1039F), `Abs (0x1039F); + (0x103D0,0x103D0), `Abs (0x103D0); + (0x1056F,0x1056F), `Abs (0x1056F); + (0x10857,0x10857), `Abs (0x10857); + (0x1091F,0x1091F), `Abs (0x1091F); + (0x1093F,0x1093F), `Abs (0x1093F); + (0x10A50,0x10A58), `Delta (0); + (0x10A7F,0x10A7F), `Abs (0x10A7F); + (0x10AF0,0x10AF6), `Delta (0); + (0x10B39,0x10B3F), `Delta (0); + (0x10B99,0x10B9C), `Delta (0); + (0x11047,0x1104D), `Delta (0); + (0x110BB,0x110BC), `Delta (0); + (0x110BE,0x110C1), `Delta (0); + (0x11140,0x11143), `Delta (0); + (0x11174,0x11175), `Delta (0); + (0x111C5,0x111C9), `Delta (0); + (0x111CD,0x111CD), `Abs (0x111CD); + (0x111DB,0x111DB), `Abs (0x111DB); + (0x111DD,0x111DF), `Delta (0); + (0x11238,0x1123D), `Delta (0); + (0x112A9,0x112A9), `Abs (0x112A9); + (0x1144B,0x1144F), `Delta (0); + (0x1145B,0x1145B), `Abs (0x1145B); + (0x1145D,0x1145D), `Abs (0x1145D); + (0x114C6,0x114C6), `Abs (0x114C6); + (0x115C1,0x115D7), `Delta (0); + (0x11641,0x11643), `Delta (0); + (0x11660,0x1166C), `Delta (0); + (0x1173C,0x1173E), `Delta (0); + (0x11C41,0x11C45), `Delta (0); + (0x11C70,0x11C71), `Delta (0); + (0x12470,0x12474), `Delta (0); + (0x16A6E,0x16A6F), `Delta (0); + (0x16AF5,0x16AF5), `Abs (0x16AF5); + (0x16B37,0x16B3B), `Delta (0); + (0x16B44,0x16B44), `Abs (0x16B44); + (0x1BC9F,0x1BC9F), `Abs (0x1BC9F); + (0x1DA87,0x1DA8B), `Delta (0); + (0x1E95E,0x1E95F), `Delta (0); + (0x0002B,0x0002B), `Abs (0x0002B); + (0x0003C,0x0003E), `Delta (0); + (0x0007C,0x0007C), `Abs (0x0007C); + (0x0007E,0x0007E), `Abs (0x0007E); + (0x000AC,0x000AC), `Abs (0x000AC); + (0x000B1,0x000B1), `Abs (0x000B1); + (0x000D7,0x000D7), `Abs (0x000D7); + (0x000F7,0x000F7), `Abs (0x000F7); + (0x003F6,0x003F6), `Abs (0x003F6); + (0x00606,0x00608), `Delta (0); + (0x02044,0x02044), `Abs (0x02044); + (0x02052,0x02052), `Abs (0x02052); + (0x0207A,0x0207C), `Delta (0); + (0x0208A,0x0208C), `Delta (0); + (0x02118,0x02118), `Abs (0x02118); + (0x02140,0x02144), `Delta (0); + (0x0214B,0x0214B), `Abs (0x0214B); + (0x02190,0x02194), `Delta (0); + (0x0219A,0x0219B), `Delta (0); + (0x021A0,0x021A0), `Abs (0x021A0); + (0x021A3,0x021A3), `Abs (0x021A3); + (0x021A6,0x021A6), `Abs (0x021A6); + (0x021AE,0x021AE), `Abs (0x021AE); + (0x021CE,0x021CF), `Delta (0); + (0x021D2,0x021D2), `Abs (0x021D2); + (0x021D4,0x021D4), `Abs (0x021D4); + (0x021F4,0x022FF), `Delta (0); + (0x02320,0x02321), `Delta (0); + (0x0237C,0x0237C), `Abs (0x0237C); + (0x0239B,0x023B3), `Delta (0); + (0x023DC,0x023E1), `Delta (0); + (0x025B7,0x025B7), `Abs (0x025B7); + (0x025C1,0x025C1), `Abs (0x025C1); + (0x025F8,0x025FF), `Delta (0); + (0x0266F,0x0266F), `Abs (0x0266F); + (0x027C0,0x027C4), `Delta (0); + (0x027C7,0x027E5), `Delta (0); + (0x027F0,0x027FF), `Delta (0); + (0x02900,0x02982), `Delta (0); + (0x02999,0x029D7), `Delta (0); + (0x029DC,0x029FB), `Delta (0); + (0x029FE,0x02AFF), `Delta (0); + (0x02B30,0x02B44), `Delta (0); + (0x02B47,0x02B4C), `Delta (0); + (0x0FB29,0x0FB29), `Abs (0x0FB29); + (0x0FE62,0x0FE62), `Abs (0x0FE62); + (0x0FE64,0x0FE66), `Delta (0); + (0x0FF0B,0x0FF0B), `Abs (0x0FF0B); + (0x0FF1C,0x0FF1E), `Delta (0); + (0x0FF5C,0x0FF5C), `Abs (0x0FF5C); + (0x0FF5E,0x0FF5E), `Abs (0x0FF5E); + (0x0FFE2,0x0FFE2), `Abs (0x0FFE2); + (0x0FFE9,0x0FFEC), `Delta (0); + (0x1D6C1,0x1D6C1), `Abs (0x1D6C1); + (0x1D6DB,0x1D6DB), `Abs (0x1D6DB); + (0x1D6FB,0x1D6FB), `Abs (0x1D6FB); + (0x1D715,0x1D715), `Abs (0x1D715); + (0x1D735,0x1D735), `Abs (0x1D735); + (0x1D74F,0x1D74F), `Abs (0x1D74F); + (0x1D76F,0x1D76F), `Abs (0x1D76F); + (0x1D789,0x1D789), `Abs (0x1D789); + (0x1D7A9,0x1D7A9), `Abs (0x1D7A9); + (0x1D7C3,0x1D7C3), `Abs (0x1D7C3); + (0x1EEF0,0x1EEF1), `Delta (0); + (0x00024,0x00024), `Abs (0x00024); + (0x000A2,0x000A5), `Delta (0); + (0x0058F,0x0058F), `Abs (0x0058F); + (0x0060B,0x0060B), `Abs (0x0060B); + (0x009F2,0x009F3), `Delta (0); + (0x009FB,0x009FB), `Abs (0x009FB); + (0x00AF1,0x00AF1), `Abs (0x00AF1); + (0x00BF9,0x00BF9), `Abs (0x00BF9); + (0x00E3F,0x00E3F), `Abs (0x00E3F); + (0x017DB,0x017DB), `Abs (0x017DB); + (0x020A0,0x020BE), `Delta (0); + (0x0A838,0x0A838), `Abs (0x0A838); + (0x0FDFC,0x0FDFC), `Abs (0x0FDFC); + (0x0FE69,0x0FE69), `Abs (0x0FE69); + (0x0FF04,0x0FF04), `Abs (0x0FF04); + (0x0FFE0,0x0FFE1), `Delta (0); + (0x0FFE5,0x0FFE6), `Delta (0); + (0x0005E,0x0005E), `Abs (0x0005E); + (0x00060,0x00060), `Abs (0x00060); + (0x000A8,0x000A8), `Abs (0x000A8); + (0x000AF,0x000AF), `Abs (0x000AF); + (0x000B4,0x000B4), `Abs (0x000B4); + (0x000B8,0x000B8), `Abs (0x000B8); + (0x002C2,0x002C5), `Delta (0); + (0x002D2,0x002DF), `Delta (0); + (0x002E5,0x002EB), `Delta (0); + (0x002ED,0x002ED), `Abs (0x002ED); + (0x002EF,0x002FF), `Delta (0); + (0x00375,0x00375), `Abs (0x00375); + (0x00384,0x00385), `Delta (0); + (0x01FBD,0x01FBD), `Abs (0x01FBD); + (0x01FBF,0x01FC1), `Delta (0); + (0x01FCD,0x01FCF), `Delta (0); + (0x01FDD,0x01FDF), `Delta (0); + (0x01FED,0x01FEF), `Delta (0); + (0x01FFD,0x01FFE), `Delta (0); + (0x0309B,0x0309C), `Delta (0); + (0x0A700,0x0A716), `Delta (0); + (0x0A720,0x0A721), `Delta (0); + (0x0A789,0x0A78A), `Delta (0); + (0x0AB5B,0x0AB5B), `Abs (0x0AB5B); + (0x0FBB2,0x0FBC1), `Delta (0); + (0x0FF3E,0x0FF3E), `Abs (0x0FF3E); + (0x0FF40,0x0FF40), `Abs (0x0FF40); + (0x0FFE3,0x0FFE3), `Abs (0x0FFE3); + (0x1F3FB,0x1F3FF), `Delta (0); + (0x000A6,0x000A6), `Abs (0x000A6); + (0x000A9,0x000A9), `Abs (0x000A9); + (0x000AE,0x000AE), `Abs (0x000AE); + (0x000B0,0x000B0), `Abs (0x000B0); + (0x00482,0x00482), `Abs (0x00482); + (0x0058D,0x0058E), `Delta (0); + (0x0060E,0x0060F), `Delta (0); + (0x006DE,0x006DE), `Abs (0x006DE); + (0x006E9,0x006E9), `Abs (0x006E9); + (0x006FD,0x006FE), `Delta (0); + (0x007F6,0x007F6), `Abs (0x007F6); + (0x009FA,0x009FA), `Abs (0x009FA); + (0x00B70,0x00B70), `Abs (0x00B70); + (0x00BF3,0x00BF8), `Delta (0); + (0x00BFA,0x00BFA), `Abs (0x00BFA); + (0x00C7F,0x00C7F), `Abs (0x00C7F); + (0x00D4F,0x00D4F), `Abs (0x00D4F); + (0x00D79,0x00D79), `Abs (0x00D79); + (0x00F01,0x00F03), `Delta (0); + (0x00F13,0x00F13), `Abs (0x00F13); + (0x00F15,0x00F17), `Delta (0); + (0x00F1A,0x00F1F), `Delta (0); + (0x00F34,0x00F34), `Abs (0x00F34); + (0x00F36,0x00F36), `Abs (0x00F36); + (0x00F38,0x00F38), `Abs (0x00F38); + (0x00FBE,0x00FC5), `Delta (0); + (0x00FC7,0x00FCC), `Delta (0); + (0x00FCE,0x00FCF), `Delta (0); + (0x00FD5,0x00FD8), `Delta (0); + (0x0109E,0x0109F), `Delta (0); + (0x01390,0x01399), `Delta (0); + (0x01940,0x01940), `Abs (0x01940); + (0x019DE,0x019FF), `Delta (0); + (0x01B61,0x01B6A), `Delta (0); + (0x01B74,0x01B7C), `Delta (0); + (0x02100,0x02101), `Delta (0); + (0x02103,0x02106), `Delta (0); + (0x02108,0x02109), `Delta (0); + (0x02114,0x02114), `Abs (0x02114); + (0x02116,0x02117), `Delta (0); + (0x0211E,0x02123), `Delta (0); + (0x02125,0x02125), `Abs (0x02125); + (0x02127,0x02127), `Abs (0x02127); + (0x02129,0x02129), `Abs (0x02129); + (0x0212E,0x0212E), `Abs (0x0212E); + (0x0213A,0x0213B), `Delta (0); + (0x0214A,0x0214A), `Abs (0x0214A); + (0x0214C,0x0214D), `Delta (0); + (0x0214F,0x0214F), `Abs (0x0214F); + (0x0218A,0x0218B), `Delta (0); + (0x02195,0x02199), `Delta (0); + (0x0219C,0x0219F), `Delta (0); + (0x021A1,0x021A2), `Delta (0); + (0x021A4,0x021A5), `Delta (0); + (0x021A7,0x021AD), `Delta (0); + (0x021AF,0x021CD), `Delta (0); + (0x021D0,0x021D1), `Delta (0); + (0x021D3,0x021D3), `Abs (0x021D3); + (0x021D5,0x021F3), `Delta (0); + (0x02300,0x02307), `Delta (0); + (0x0230C,0x0231F), `Delta (0); + (0x02322,0x02328), `Delta (0); + (0x0232B,0x0237B), `Delta (0); + (0x0237D,0x0239A), `Delta (0); + (0x023B4,0x023DB), `Delta (0); + (0x023E2,0x023FE), `Delta (0); + (0x02400,0x02426), `Delta (0); + (0x02440,0x0244A), `Delta (0); + (0x0249C,0x024B5), `Delta (0); + (0x024B6,0x024CF), `Delta (26); + (0x024D0,0x024E9), `Delta (0); + (0x02500,0x025B6), `Delta (0); + (0x025B8,0x025C0), `Delta (0); + (0x025C2,0x025F7), `Delta (0); + (0x02600,0x0266E), `Delta (0); + (0x02670,0x02767), `Delta (0); + (0x02794,0x027BF), `Delta (0); + (0x02800,0x028FF), `Delta (0); + (0x02B00,0x02B2F), `Delta (0); + (0x02B45,0x02B46), `Delta (0); + (0x02B4D,0x02B73), `Delta (0); + (0x02B76,0x02B95), `Delta (0); + (0x02B98,0x02BB9), `Delta (0); + (0x02BBD,0x02BC8), `Delta (0); + (0x02BCA,0x02BD1), `Delta (0); + (0x02BEC,0x02BEF), `Delta (0); + (0x02CE5,0x02CEA), `Delta (0); + (0x02E80,0x02E99), `Delta (0); + (0x02E9B,0x02EF3), `Delta (0); + (0x02F00,0x02FD5), `Delta (0); + (0x02FF0,0x02FFB), `Delta (0); + (0x03004,0x03004), `Abs (0x03004); + (0x03012,0x03013), `Delta (0); + (0x03020,0x03020), `Abs (0x03020); + (0x03036,0x03037), `Delta (0); + (0x0303E,0x0303F), `Delta (0); + (0x03190,0x03191), `Delta (0); + (0x03196,0x0319F), `Delta (0); + (0x031C0,0x031E3), `Delta (0); + (0x03200,0x0321E), `Delta (0); + (0x0322A,0x03247), `Delta (0); + (0x03250,0x03250), `Abs (0x03250); + (0x03260,0x0327F), `Delta (0); + (0x0328A,0x032B0), `Delta (0); + (0x032C0,0x032FE), `Delta (0); + (0x03300,0x033FF), `Delta (0); + (0x04DC0,0x04DFF), `Delta (0); + (0x0A490,0x0A4C6), `Delta (0); + (0x0A828,0x0A82B), `Delta (0); + (0x0A836,0x0A837), `Delta (0); + (0x0A839,0x0A839), `Abs (0x0A839); + (0x0AA77,0x0AA79), `Delta (0); + (0x0FDFD,0x0FDFD), `Abs (0x0FDFD); + (0x0FFE4,0x0FFE4), `Abs (0x0FFE4); + (0x0FFE8,0x0FFE8), `Abs (0x0FFE8); + (0x0FFED,0x0FFEE), `Delta (0); + (0x0FFFC,0x0FFFD), `Delta (0); + (0x10137,0x1013F), `Delta (0); + (0x10179,0x10189), `Delta (0); + (0x1018C,0x1018E), `Delta (0); + (0x10190,0x1019B), `Delta (0); + (0x101A0,0x101A0), `Abs (0x101A0); + (0x101D0,0x101FC), `Delta (0); + (0x10877,0x10878), `Delta (0); + (0x10AC8,0x10AC8), `Abs (0x10AC8); + (0x1173F,0x1173F), `Abs (0x1173F); + (0x16B3C,0x16B3F), `Delta (0); + (0x16B45,0x16B45), `Abs (0x16B45); + (0x1BC9C,0x1BC9C), `Abs (0x1BC9C); + (0x1D000,0x1D0F5), `Delta (0); + (0x1D100,0x1D126), `Delta (0); + (0x1D129,0x1D164), `Delta (0); + (0x1D16A,0x1D16C), `Delta (0); + (0x1D183,0x1D184), `Delta (0); + (0x1D18C,0x1D1A9), `Delta (0); + (0x1D1AE,0x1D1E8), `Delta (0); + (0x1D200,0x1D241), `Delta (0); + (0x1D245,0x1D245), `Abs (0x1D245); + (0x1D300,0x1D356), `Delta (0); + (0x1D800,0x1D9FF), `Delta (0); + (0x1DA37,0x1DA3A), `Delta (0); + (0x1DA6D,0x1DA74), `Delta (0); + (0x1DA76,0x1DA83), `Delta (0); + (0x1DA85,0x1DA86), `Delta (0); + (0x1F000,0x1F02B), `Delta (0); + (0x1F030,0x1F093), `Delta (0); + (0x1F0A0,0x1F0AE), `Delta (0); + (0x1F0B1,0x1F0BF), `Delta (0); + (0x1F0C1,0x1F0CF), `Delta (0); + (0x1F0D1,0x1F0F5), `Delta (0); + (0x1F110,0x1F12E), `Delta (0); + (0x1F130,0x1F16B), `Delta (0); + (0x1F170,0x1F1AC), `Delta (0); + (0x1F1E6,0x1F202), `Delta (0); + (0x1F210,0x1F23B), `Delta (0); + (0x1F240,0x1F248), `Delta (0); + (0x1F250,0x1F251), `Delta (0); + (0x1F300,0x1F3FA), `Delta (0); + (0x1F400,0x1F6D2), `Delta (0); + (0x1F6E0,0x1F6EC), `Delta (0); + (0x1F6F0,0x1F6F6), `Delta (0); + (0x1F700,0x1F773), `Delta (0); + (0x1F780,0x1F7D4), `Delta (0); + (0x1F800,0x1F80B), `Delta (0); + (0x1F810,0x1F847), `Delta (0); + (0x1F850,0x1F859), `Delta (0); + (0x1F860,0x1F887), `Delta (0); + (0x1F890,0x1F8AD), `Delta (0); + (0x1F910,0x1F91E), `Delta (0); + (0x1F920,0x1F927), `Delta (0); + (0x1F930,0x1F930), `Abs (0x1F930); + (0x1F933,0x1F93E), `Delta (0); + (0x1F940,0x1F94B), `Delta (0); + (0x1F950,0x1F95E), `Delta (0); + (0x1F980,0x1F991), `Delta (0) +];; -- cgit v1.2.3 From 09fd1e8b5e810bae0e50ecd4901cd7c8f1464f4a Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Wed, 16 Nov 2016 10:45:25 +0100 Subject: Revert more of a477dc for good measure We stop failing automatically on non-declared-class nested or toplevel subgoals as in 8.5, instead of the previous a477dc behavior of shelving those goals and failing if shelved goals remained at the end of resolution. It means typeclass resolution during refinement is closer to all:typeclasses eauto. Hints in typeclass_instances for non-declared classes can be used during resolution of _nested_ subgoals when it is fired from type-inference, toplevel goals considered in this case are still only classes (as in 8.5 and before). The code that triggers the restriction to only declared class subgoals is commented. Revert changes to test-suite, adding test for #5203, #5198 is fixed too. Add corresponding tests in the test-suite (that will break if we, e.g. disallow non-class subgoals) and update the refman accordingly. --- doc/refman/Classes.tex | 16 +++++++------- tactics/class_tactics.ml | 7 +++--- test-suite/bugs/closed/5198.v | 39 ++++++++++++++++++++++++++++++++++ test-suite/bugs/closed/5203.v | 5 +++++ test-suite/success/Typeclasses.v | 46 ++++++++++++++++++++++++++++++++++------ test-suite/success/bteauto.v | 6 +++--- 6 files changed, 99 insertions(+), 20 deletions(-) create mode 100644 test-suite/bugs/closed/5198.v create mode 100644 test-suite/bugs/closed/5203.v diff --git a/doc/refman/Classes.tex b/doc/refman/Classes.tex index 7c4bd4d201..bd8ee450ef 100644 --- a/doc/refman/Classes.tex +++ b/doc/refman/Classes.tex @@ -391,19 +391,19 @@ than {\tt eauto} and {\tt auto}. The main differences are the following: It analyses the dependencies between subgoals to avoid backtracking on subgoals that are entirely independent. \item When called with no arguments, {\tt typeclasses eauto} uses the - {\tt typeclass\_instances} database by default (instead of {\tt core}) - and will try to solve \emph{only} typeclass goals, shelving the other - goals. If some subgoal of a hint/instance is non-dependent and not of - class type, the hint application will fail when faced with that - subgoal. Dependent subgoals are automatically shelved, and shelved + {\tt typeclass\_instances} database by default (instead of {\tt + core}). + Dependent subgoals are automatically shelved, and shelved goals can remain after resolution ends (following the behavior of \Coq{} 8.5). \emph{Note: } As of Coq 8.6, {\tt all:once (typeclasses eauto)} faithfully mimicks what happens during typeclass resolution when it is - called during refinement/type-inference. It might move to {\tt - all:typeclasses eauto} in future versions when the refinement engine - will be able to backtrack. + called during refinement/type-inference, except that \emph{only} + declared class subgoals are considered at the start of resolution + during type inference, while ``all'' can select non-class subgoals as + well. It might move to {\tt all:typeclasses eauto} in future versions + when the refinement engine will be able to backtrack. \item When called with specific databases (e.g. {\tt with}), {\tt typeclasses eauto} allows shelved goals to remain at any point during search and treat typeclasses goals like any other. diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 99a1a98993..4138562c64 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -1167,7 +1167,8 @@ module Search = struct if path_matches derivs [] then aux e tl else let filter = - if info.search_only_classes then fail_if_nonclass info + if false (* in 8.6, still allow non-class subgoals + info.search_only_classes *) then fail_if_nonclass info else Proofview.tclUNIT () in ortac @@ -1238,8 +1239,8 @@ module Search = struct unit Proofview.tactic = let open Proofview in let open Proofview.Notations in - if only_classes && not (is_class_type sigma (Goal.concl gl)) then - Proofview.shelve + if false (* In 8.6, still allow non-class goals only_classes && not (is_class_type sigma (Goal.concl gl)) *) then + Tacticals.New.tclZEROMSG (str"Not a subgoal for a class") else let dep = dep || Proofview.unifiable sigma (Goal.goal gl) gls in let info = make_autogoal ?st only_classes dep (cut_of_hints hints) i gl in diff --git a/test-suite/bugs/closed/5198.v b/test-suite/bugs/closed/5198.v new file mode 100644 index 0000000000..7254afb429 --- /dev/null +++ b/test-suite/bugs/closed/5198.v @@ -0,0 +1,39 @@ +(* -*- mode: coq; coq-prog-args: ("-emacs" "-boot" "-nois") -*- *) +(* File reduced by coq-bug-finder from original input, then from 286 lines to +27 lines, then from 224 lines to 53 lines, then from 218 lines to 56 lines, +then from 269 lines to 180 lines, then from 132 lines to 48 lines, then from +253 lines to 65 lines, then from 79 lines to 65 lines *) +(* coqc version 8.6.0 (November 2016) compiled on Nov 12 2016 14:43:52 with +OCaml 4.02.3 + coqtop version jgross-Leopard-WS:/home/jgross/Downloads/coq/coq-v8.6,v8.6 +(7e992fa784ee6fa48af8a2e461385c094985587d) *) +Axiom admit : forall {T}, T. +Set Printing Implicit. +Inductive nat := O | S (_ : nat). +Axiom f : forall (_ _ : nat), nat. +Class ZLikeOps (e : nat) + := { LargeT : Type ; SmallT : Type ; CarryAdd : forall (_ _ : LargeT), LargeT +}. +Class BarrettParameters := + { b : nat ; k : nat ; ops : ZLikeOps (f b k) }. +Axiom barrett_reduce_function_bundled : forall {params : BarrettParameters} + (_ : @LargeT _ (@ops params)), + @SmallT _ (@ops params). + +Global Instance ZZLikeOps e : ZLikeOps (f (S O) e) + := { LargeT := nat ; SmallT := nat ; CarryAdd x y := y }. +Definition SRep := nat. +Local Instance x86_25519_Barrett : BarrettParameters + := { b := S O ; k := O ; ops := ZZLikeOps O }. +Definition SRepAdd : forall (_ _ : SRep), SRep + := let v := (fun x y => barrett_reduce_function_bundled (CarryAdd x y)) in + v. +Definition SRepAdd' : forall (_ _ : SRep), SRep + := (fun x y => barrett_reduce_function_bundled (CarryAdd x y)). +(* Error: +In environment +x : SRep +y : SRep +The term "x" has type "SRep" while it is expected to have type + "@LargeT ?e ?ZLikeOps". + *) diff --git a/test-suite/bugs/closed/5203.v b/test-suite/bugs/closed/5203.v new file mode 100644 index 0000000000..ed137395fc --- /dev/null +++ b/test-suite/bugs/closed/5203.v @@ -0,0 +1,5 @@ +Goal True. + Typeclasses eauto := debug. + Fail solve [ typeclasses eauto ]. + Fail typeclasses eauto. + \ No newline at end of file diff --git a/test-suite/success/Typeclasses.v b/test-suite/success/Typeclasses.v index 5557ba8379..f62427ef47 100644 --- a/test-suite/success/Typeclasses.v +++ b/test-suite/success/Typeclasses.v @@ -1,15 +1,28 @@ Module onlyclasses. +(* In 8.6 we still allow non-class subgoals *) Variable Foo : Type. Variable foo : Foo. Hint Extern 0 Foo => exact foo : typeclass_instances. Goal Foo * Foo. split. shelve. Set Typeclasses Debug. - Fail (unshelve typeclasses eauto); fail. - typeclasses eauto with typeclass_instances. - Unshelve. typeclasses eauto with typeclass_instances. + typeclasses eauto. + Unshelve. typeclasses eauto. Qed. + + Module RJung. + Class Foo (x : nat). + + Instance foo x : x = 2 -> Foo x. + Hint Extern 0 (_ = _) => reflexivity : typeclass_instances. + Typeclasses eauto := debug. + Check (_ : Foo 2). + + + Fail Definition foo := (_ : 0 = 0). + + End RJung. End onlyclasses. Module shelve_non_class_subgoals. @@ -17,16 +30,36 @@ Module shelve_non_class_subgoals. Variable foo : Foo. Hint Extern 0 Foo => exact foo : typeclass_instances. Class Bar := {}. - Instance bar1 (f:Foo) : Bar. + Instance bar1 (f:Foo) : Bar := {}. Typeclasses eauto := debug. Set Typeclasses Debug Verbosity 2. Goal Bar. (* Solution has shelved subgoals (of non typeclass type) *) - Fail typeclasses eauto. + typeclasses eauto. Abort. End shelve_non_class_subgoals. +Module RefineVsNoTceauto. + + Class Foo (A : Type) := foo : A. + Instance: Foo nat := { foo := 0 }. + Instance: Foo nat := { foo := 42 }. + Hint Extern 0 (_ = _) => refine eq_refl : typeclass_instances. + Goal exists (f : Foo nat), @foo _ f = 0. + Proof. + unshelve (notypeclasses refine (ex_intro _ _ _)). + Set Typeclasses Debug. Set Printing All. + all:once (typeclasses eauto). + Fail idtac. (* Check no subgoals are left *) + Undo 3. + (** In this case, the (_ = _) subgoal is not considered + by typeclass resolution *) + refine (ex_intro _ _ _). Fail reflexivity. + Abort. + +End RefineVsNoTceauto. + Module Leivantex2PR339. (** Was a bug preventing to find hints associated with no pattern *) Class Bar := {}. @@ -34,8 +67,9 @@ Module Leivantex2PR339. Hint Extern 0 => exact True : typeclass_instances. Typeclasses eauto := debug. Goal Bar. - Fail typeclasses eauto. Set Typeclasses Debug Verbosity 2. + typeclasses eauto. (* Relies on resolution of a non-class subgoal *) + Undo 1. typeclasses eauto with typeclass_instances. Qed. End Leivantex2PR339. diff --git a/test-suite/success/bteauto.v b/test-suite/success/bteauto.v index 0af367781a..3178c6fc15 100644 --- a/test-suite/success/bteauto.v +++ b/test-suite/success/bteauto.v @@ -24,9 +24,9 @@ Module Backtracking. Fail all:((once (typeclasses eauto with typeclass_instances)) + apply eq_refl). (* Does backtrack if other goals fail *) - all:[> (unshelve typeclasses eauto; fail) + reflexivity .. ]. + all:[> typeclasses eauto + reflexivity .. ]. Undo 1. - all:((unshelve typeclasses eauto; fail) + reflexivity). (* Note "+" is a focussing combinator *) + all:(typeclasses eauto + reflexivity). (* Note "+" is a focussing combinator *) Show Proof. Qed. @@ -66,7 +66,7 @@ Module Backtracking. unshelve evar (t : A). all:cycle 1. refine (@ex_intro _ _ t _). all:cycle 1. - all:((unshelve typeclasses eauto; fail) + reflexivity). + all:(typeclasses eauto + reflexivity). Qed. End Leivant. End Backtracking. -- cgit v1.2.3 From 37e0ce25f88a77c48c480e37ccca444a8f5fe4e8 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Wed, 16 Nov 2016 16:22:53 +0100 Subject: Minor debug printing bug, Hit by OCaml's "if then else" with no "end" once more --- tactics/class_tactics.ml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index 4138562c64..e44ace4257 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -1318,10 +1318,9 @@ module Search = struct Feedback.msg_debug (str"Starting resolution with " ++ int i ++ str" goal(s) under focus and " ++ int (List.length initshelf) ++ str " shelved goal(s)" ++ - if only_classes then str " in only_classes mode" else - str " in regular mode" ++ - match depth with None -> str ", unbounded" - | Some i -> str ", with depth limit " ++ int i)); + (if only_classes then str " in only_classes mode" else str " in regular mode") ++ + match depth with None -> str ", unbounded" + | Some i -> str ", with depth limit " ++ int i)); tac let run_on_evars p evm tac = -- cgit v1.2.3 From 26d180fa0b27edc773fd07c73906e4ed56475200 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Wed, 16 Nov 2016 10:51:39 +0100 Subject: [stm] Remove STM-related vernaculars I think these commands never make a lot of sense on scripts other than debugging and we have better methods now. The last remaining command, used for the tty emulation has been renamed to VtBack, but it should go away at some point too once the legacy interfaces are removed. --- ide/texmacspp.ml | 3 --- intf/vernacexpr.mli | 23 +-------------------- parsing/g_vernac.ml4 | 10 ---------- printing/ppvernac.ml | 16 --------------- stm/stm.ml | 51 +++++++++++++---------------------------------- stm/vernac_classifier.ml | 22 ++++---------------- toplevel/vernac.ml | 3 +-- toplevel/vernacentries.ml | 4 ---- 8 files changed, 20 insertions(+), 112 deletions(-) diff --git a/ide/texmacspp.ml b/ide/texmacspp.ml index 680da7f54b..dbcd8630b1 100644 --- a/ide/texmacspp.ml +++ b/ide/texmacspp.ml @@ -724,9 +724,6 @@ let rec tmpp v loc = | VernacComments (cl) -> xmlComment loc (List.flatten (List.map pp_comment cl)) - (* Stm backdoor *) - | VernacStm _ as x -> xmlTODO loc x - (* Proof management *) | VernacGoal _ as x -> xmlTODO loc x | VernacAbort _ as x -> xmlTODO loc x diff --git a/intf/vernacexpr.mli b/intf/vernacexpr.mli index 92e4dd618e..f77a940a7e 100644 --- a/intf/vernacexpr.mli +++ b/intf/vernacexpr.mli @@ -283,16 +283,6 @@ type bullet = | Star of int | Plus of int -(** {6 Types concerning Stm} *) -type 'a stm_vernac = - | JoinDocument - | Finish - | Wait - | PrintDag - | Observe of Stateid.t - | Command of 'a (* An out of flow command not to be recorded by Stm *) - | PGLast of 'a (* To ease the life of PG *) - (** {6 Types concerning the module layer} *) (** Rigid / flexible module signature *) @@ -451,9 +441,6 @@ type vernac_expr = | VernacRegister of lident * register_kind | VernacComments of comment list - (* Stm backdoor *) - | VernacStm of vernac_expr stm_vernac - (* Proof management *) | VernacGoal of constr_expr | VernacAbort of lident option @@ -508,7 +495,7 @@ type vernac_type = | VtProofStep of proof_step | VtProofMode of string | VtQuery of vernac_part_of_script * report_with - | VtStm of vernac_control * vernac_part_of_script + | VtBack of Stateid.t * vernac_part_of_script | VtUnknown and report_with = Stateid.t * Feedback.route_id (* feedback on id/route *) and vernac_qed_type = VtKeep | VtKeepAsAxiom | VtDrop (* Qed/Admitted, Abort *) @@ -516,14 +503,6 @@ and vernac_start = string * opacity_guarantee * Id.t list and vernac_sideff_type = Id.t list and vernac_is_alias = bool and vernac_part_of_script = bool -and vernac_control = - | VtFinish - | VtWait - | VtJoinDocument - | VtPrintDag - | VtObserve of Stateid.t - | VtBack of Stateid.t - | VtPG and opacity_guarantee = | GuaranteesOpacity (** Only generates opaque terms at [Qed] *) | Doesn'tGuaranteeOpacity (** May generate transparent terms even with [Qed].*) diff --git a/parsing/g_vernac.ml4 b/parsing/g_vernac.ml4 index 9b52d1bf31..4ba9eeefa9 100644 --- a/parsing/g_vernac.ml4 +++ b/parsing/g_vernac.ml4 @@ -64,16 +64,6 @@ GEXTEND Gram | IDENT "Local"; v = vernac_poly -> VernacLocal (true, v) | IDENT "Global"; v = vernac_poly -> VernacLocal (false, v) - (* Stm backdoor *) - | IDENT "Stm"; IDENT "JoinDocument"; "." -> VernacStm JoinDocument - | IDENT "Stm"; IDENT "Finish"; "." -> VernacStm Finish - | IDENT "Stm"; IDENT "Wait"; "." -> VernacStm Wait - | IDENT "Stm"; IDENT "PrintDag"; "." -> VernacStm PrintDag - | IDENT "Stm"; IDENT "Observe"; id = INT; "." -> - VernacStm (Observe (Stateid.of_int (int_of_string id))) - | IDENT "Stm"; IDENT "Command"; v = vernac_aux -> VernacStm (Command v) - | IDENT "Stm"; IDENT "PGLast"; v = vernac_aux -> VernacStm (PGLast v) - | v = vernac_poly -> v ] ] ; diff --git a/printing/ppvernac.ml b/printing/ppvernac.ml index 3494ad006f..a6b1c97f5c 100644 --- a/printing/ppvernac.ml +++ b/printing/ppvernac.ml @@ -538,22 +538,6 @@ module Make | VernacLocal (local, v) -> return (pr_locality local ++ spc() ++ pr_vernac_body v) - (* Stm *) - | VernacStm JoinDocument -> - return (keyword "Stm JoinDocument") - | VernacStm PrintDag -> - return (keyword "Stm PrintDag") - | VernacStm Finish -> - return (keyword "Stm Finish") - | VernacStm Wait -> - return (keyword "Stm Wait") - | VernacStm (Observe id) -> - return (keyword "Stm Observe " ++ str(Stateid.to_string id)) - | VernacStm (Command v) -> - return (keyword "Stm Command " ++ pr_vernac_body v) - | VernacStm (PGLast v) -> - return (keyword "Stm PGLast " ++ pr_vernac_body v) - (* Proof management *) | VernacAbortAll -> return (keyword "Abort All") diff --git a/stm/stm.ml b/stm/stm.ml index e387e6322f..0ddaf604ad 100644 --- a/stm/stm.ml +++ b/stm/stm.ml @@ -989,7 +989,7 @@ end = struct (* {{{ *) try match v with | VernacResetInitial -> - VtStm (VtBack Stateid.initial, true), VtNow + VtBack (Stateid.initial, true), VtNow | VernacResetName (_,name) -> let id = VCS.get_branch_pos (VCS.current_branch ()) in (try @@ -997,20 +997,20 @@ end = struct (* {{{ *) fold_until (fun b (id,_,label,_,_) -> if b then `Stop id else `Cont (List.mem name label)) false id in - VtStm (VtBack oid, true), VtNow + VtBack (oid, true), VtNow with Not_found -> - VtStm (VtBack id, true), VtNow) + VtBack (id, true), VtNow) | VernacBack n -> let id = VCS.get_branch_pos (VCS.current_branch ()) in let oid = fold_until (fun n (id,_,_,_,_) -> if Int.equal n 0 then `Stop id else `Cont (n-1)) n id in - VtStm (VtBack oid, true), VtNow + VtBack (oid, true), VtNow | VernacUndo n -> let id = VCS.get_branch_pos (VCS.current_branch ()) in let oid = fold_until (fun n (id,_,_,tactic,undo) -> let value = (if tactic then 1 else 0) - undo in if Int.equal n 0 then `Stop id else `Cont (n-value)) n id in - VtStm (VtBack oid, true), VtLater + VtBack (oid, true), VtLater | VernacUndoTo _ | VernacRestart as e -> let m = match e with VernacUndoTo m -> m | _ -> 0 in @@ -1027,16 +1027,16 @@ end = struct (* {{{ *) 0 id in let oid = fold_until (fun n (id,_,_,_,_) -> if Int.equal n 0 then `Stop id else `Cont (n-1)) (n-m-1) id in - VtStm (VtBack oid, true), VtLater + VtBack (oid, true), VtLater | VernacAbortAll -> let id = VCS.get_branch_pos (VCS.current_branch ()) in let oid = fold_until (fun () (id,vcs,_,_,_) -> match Vcs_.branches vcs with [_] -> `Stop id | _ -> `Cont ()) () id in - VtStm (VtBack oid, true), VtLater + VtBack (oid, true), VtLater | VernacBacktrack (id,_,_) | VernacBackTo id -> - VtStm (VtBack (Stateid.of_int id), not !Flags.print_emacs), VtNow + VtBack (Stateid.of_int id, not !Flags.print_emacs), VtNow | _ -> VtUnknown, VtNow with | Not_found -> @@ -2428,22 +2428,8 @@ let process_transaction ?(newtip=Stateid.fresh ()) ~tty prerr_endline (fun () -> " classified as: " ^ string_of_vernac_classification c); match c with - (* PG stuff *) - | VtStm(VtPG,false), VtNow -> vernac_interp Stateid.dummy x; `Ok - | VtStm(VtPG,_), _ -> anomaly(str "PG command in script or VtLater") - (* Joining various parts of the document *) - | VtStm (VtJoinDocument, b), VtNow -> join (); `Ok - | VtStm (VtFinish, b), VtNow -> finish (); `Ok - | VtStm (VtWait, b), VtNow -> finish (); wait (); `Ok - | VtStm (VtPrintDag, b), VtNow -> - VCS.print ~now:true (); `Ok - | VtStm (VtObserve id, b), VtNow -> observe id; `Ok - | VtStm ((VtObserve _ | VtFinish | VtJoinDocument - |VtPrintDag |VtWait),_), VtLater -> - anomaly(str"classifier: join actions cannot be classified as VtLater") - (* Back *) - | VtStm (VtBack oid, true), w -> + | VtBack(oid, true), w -> let id = VCS.new_node ~id:newtip () in let { mine; others } = Backtrack.branches_of oid in let valid = VCS.get_branch_pos head in @@ -2462,12 +2448,12 @@ let process_transaction ?(newtip=Stateid.fresh ()) ~tty VCS.checkout_shallowest_proof_branch (); VCS.commit id (Alias (oid,x)); Backtrack.record (); if w == VtNow then finish (); `Ok - | VtStm (VtBack id, false), VtNow -> + | VtBack (id, false), VtNow -> prerr_endline (fun () -> "undo to state " ^ Stateid.to_string id); Backtrack.backto id; VCS.checkout_shallowest_proof_branch (); Reach.known_state ~cache:(interactive ()) id; `Ok - | VtStm (VtBack id, false), VtLater -> + | VtBack (id, false), VtLater -> anomaly(str"classifier: VtBack + VtLater must imply part_of_script") (* Query *) @@ -2604,15 +2590,6 @@ let process_transaction ?(newtip=Stateid.fresh ()) ~tty | VtUnknown, VtLater -> anomaly(str"classifier: VtUnknown must imply VtNow") end in - (* Proof General *) - begin match expr with - | VernacStm (PGLast _) -> - if not (VCS.Branch.equal head VCS.Branch.master) then - vernac_interp Stateid.dummy - { verbose = true; loc = Loc.ghost; indentation = 0; strlen = 0; - expr = VernacShow (ShowGoal OpenSubgoals) } - | _ -> () - end; prerr_endline (fun () -> "processed }}}"); VCS.print (); rc @@ -2674,8 +2651,8 @@ let query ~at ?(report_with=(Stateid.dummy,default_route)) s = let clas = classify_vernac ast in let aast = { verbose = true; indentation; strlen; loc; expr = ast } in match clas with - | VtStm (w,_), _ -> - ignore(process_transaction ~tty:false aast (VtStm (w,false), VtNow)) + | VtBack (w,_), _ -> + ignore(process_transaction ~tty:false aast (VtBack (w,false), VtNow)) | _ -> ignore(process_transaction ~tty:false aast (VtQuery (false,report_with), VtNow))) @@ -2822,7 +2799,7 @@ let interp verb (loc,e) = let print_goals = verb && match clas with | VtQuery _, _ -> false - | (VtProofStep _ | VtStm (VtBack _, _) | VtStartProof _), _ -> true + | (VtProofStep _ | VtBack (_, _) | VtStartProof _), _ -> true | _ -> not !Flags.coqtop_ui in try finish ~print_goals () with e -> diff --git a/stm/vernac_classifier.ml b/stm/vernac_classifier.ml index dc5be08a37..f9bf9653fd 100644 --- a/stm/vernac_classifier.ml +++ b/stm/vernac_classifier.ml @@ -33,10 +33,7 @@ let string_of_vernac_type = function | VtQuery (b,(id,route)) -> "Query " ^ string_of_in_script b ^ " report " ^ Stateid.to_string id ^ " route " ^ string_of_int route - | VtStm ((VtFinish|VtJoinDocument|VtObserve _|VtPrintDag|VtWait), b) -> - "Stm " ^ string_of_in_script b - | VtStm (VtPG, b) -> "Stm PG " ^ string_of_in_script b - | VtStm (VtBack _, b) -> "Stm Back " ^ string_of_in_script b + | VtBack(_, b) -> "Stm Back " ^ string_of_in_script b let string_of_vernac_when = function | VtLater -> "Later" @@ -55,7 +52,7 @@ let declare_vernac_classifier let elide_part_of_script_and_now (a, _) = match a with | VtQuery (_,id) -> VtQuery (false,id), VtNow - | VtStm (x, _) -> VtStm (x, false), VtNow + | VtBack (x, _) -> VtBack (x, false), VtNow | x -> x, VtNow let make_polymorphic (a, b as x) = @@ -69,23 +66,12 @@ let set_undo_classifier f = undo_classifier := f let rec classify_vernac e = let static_classifier e = match e with - (* PG compatibility *) - | VernacUnsetOption (["Silent"]|["Undo"]|["Printing";"Depth"]) - | VernacSetOption ((["Silent"]|["Undo"]|["Printing";"Depth"]),_) - when !Flags.print_emacs -> VtStm(VtPG,false), VtNow (* Univ poly compatibility: we run it now, so that we can just * look at Flags in stm.ml. Would be nicer to have the stm * look at the entire dag to detect this option. *) | VernacSetOption (["Universe"; "Polymorphism"],_) | VernacUnsetOption (["Universe"; "Polymorphism"]) -> VtSideff [], VtNow - (* Stm *) - | VernacStm Finish -> VtStm (VtFinish, true), VtNow - | VernacStm Wait -> VtStm (VtWait, true), VtNow - | VernacStm JoinDocument -> VtStm (VtJoinDocument, true), VtNow - | VernacStm PrintDag -> VtStm (VtPrintDag, true), VtNow - | VernacStm (Observe id) -> VtStm (VtObserve id, true), VtNow - | VernacStm (Command x) -> elide_part_of_script_and_now (classify_vernac x) - | VernacStm (PGLast x) -> fst (classify_vernac x), VtNow + (* Nested vernac exprs *) | VernacProgram e -> classify_vernac e | VernacLocal (_,e) -> classify_vernac e @@ -98,7 +84,7 @@ let rec classify_vernac e = | VernacFail e -> (* Fail Qed or Fail Lemma must not join/fork the DAG *) (match classify_vernac e with | ( VtQuery _ | VtProofStep _ | VtSideff _ - | VtStm _ | VtProofMode _ ), _ as x -> x + | VtBack _ | VtProofMode _ ), _ as x -> x | VtQed _, _ -> VtProofStep { parallel = `No; proof_block_detection = None }, VtNow diff --git a/toplevel/vernac.ml b/toplevel/vernac.ml index bfdae85d50..ba5bc55069 100644 --- a/toplevel/vernac.ml +++ b/toplevel/vernac.ml @@ -27,8 +27,7 @@ let rec is_navigation_vernac = function | VernacResetName _ | VernacBacktrack _ | VernacBackTo _ - | VernacBack _ - | VernacStm _ -> true + | VernacBack _ -> true | VernacRedirect (_, (_,c)) | VernacTime (_,c) -> is_navigation_vernac c (* Time Back* is harmless *) diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index 230e62607a..f0e63aa7c5 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -1941,7 +1941,6 @@ let interp ?proof ~loc locality poly c = | VernacTime _ -> assert false | VernacRedirect _ -> assert false | VernacTimeout _ -> assert false - | VernacStm _ -> assert false | VernacError e -> raise e @@ -2209,9 +2208,6 @@ let interp ?(verbosely=true) ?proof (loc,c) = aux ?locality ~polymorphism:b isprogcmd c | VernacPolymorphic (b, c) -> CErrors.error "Polymorphism specified twice" | VernacLocal _ -> CErrors.error "Locality specified twice" - | VernacStm (Command c) -> aux ?locality ?polymorphism isprogcmd c - | VernacStm (PGLast c) -> aux ?locality ?polymorphism isprogcmd c - | VernacStm _ -> assert false (* Done by Stm *) | VernacFail v -> with_fail true (fun () -> aux ?locality ?polymorphism isprogcmd v) | VernacTimeout (n,v) -> -- cgit v1.2.3 From 633ed9c528c64dc2daa0b3e83749bc392aab7fd2 Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Mon, 6 Jun 2016 14:54:23 -0400 Subject: Add test suite files for 4700-4785 I didn't add any test-cases for timing-based bugs (4707, 4768, 4776, 4777, 4779, 4783), nor CoqIDE bugs (4700, 4751, 4752, 4756), nor bugs about printing (4709, 4711, 4720, 4723, 4734, 4736, 4738, 4741, 4743, 4748, 4749, 4750, 4757, 4758, 4765, 4784). I'm not sure what to do with 4712, 4714, 4732, 4740. --- test-suite/bugs/closed/4708.v | 8 ++++ test-suite/bugs/closed/4718.v | 15 +++++++ test-suite/bugs/closed/4722.v | 1 + test-suite/bugs/closed/4722/tata | 1 + test-suite/bugs/closed/4727.v | 10 +++++ test-suite/bugs/closed/4745.v | 35 +++++++++++++++ test-suite/bugs/closed/4772.v | 6 +++ test-suite/bugs/opened/4701.v | 23 ++++++++++ test-suite/bugs/opened/4717.v | 19 ++++++++ test-suite/bugs/opened/4721.v | 13 ++++++ test-suite/bugs/opened/4728.v | 72 ++++++++++++++++++++++++++++++ test-suite/bugs/opened/4755.v | 34 +++++++++++++++ test-suite/bugs/opened/4771.v | 22 ++++++++++ test-suite/bugs/opened/4778.v | 35 +++++++++++++++ test-suite/bugs/opened/4781.v | 94 ++++++++++++++++++++++++++++++++++++++++ 15 files changed, 388 insertions(+) create mode 100644 test-suite/bugs/closed/4708.v create mode 100644 test-suite/bugs/closed/4718.v create mode 100644 test-suite/bugs/closed/4722.v create mode 120000 test-suite/bugs/closed/4722/tata create mode 100644 test-suite/bugs/closed/4727.v create mode 100644 test-suite/bugs/closed/4745.v create mode 100644 test-suite/bugs/closed/4772.v create mode 100644 test-suite/bugs/opened/4701.v create mode 100644 test-suite/bugs/opened/4717.v create mode 100644 test-suite/bugs/opened/4721.v create mode 100644 test-suite/bugs/opened/4728.v create mode 100644 test-suite/bugs/opened/4755.v create mode 100644 test-suite/bugs/opened/4771.v create mode 100644 test-suite/bugs/opened/4778.v create mode 100644 test-suite/bugs/opened/4781.v diff --git a/test-suite/bugs/closed/4708.v b/test-suite/bugs/closed/4708.v new file mode 100644 index 0000000000..ad2e581004 --- /dev/null +++ b/test-suite/bugs/closed/4708.v @@ -0,0 +1,8 @@ +(*Doc, it hurts when I poke myself.*) + +Notation "'" := 1. (* was: +Setting notation at level 0. +Toplevel input, characters 0-18: +> Notation "'" := 1. +> ^^^^^^^^^^^^^^^^^^ +Anomaly: Uncaught exception Invalid_argument("index out of bounds"). Please report. *) diff --git a/test-suite/bugs/closed/4718.v b/test-suite/bugs/closed/4718.v new file mode 100644 index 0000000000..12a4e8fc1a --- /dev/null +++ b/test-suite/bugs/closed/4718.v @@ -0,0 +1,15 @@ +(*Congruence is weaker than reflexivity when it comes to higher level than necessary equalities:*) + +Goal @eq Set nat nat. +congruence. +Qed. + +Goal @eq Type nat nat. +congruence. (*bug*) +Qed. + +Variable T : Type. + +Goal @eq Type T T. +congruence. +Qed. diff --git a/test-suite/bugs/closed/4722.v b/test-suite/bugs/closed/4722.v new file mode 100644 index 0000000000..f047624c84 --- /dev/null +++ b/test-suite/bugs/closed/4722.v @@ -0,0 +1 @@ +(* -*- coq-prog-args: ("-emacs" "-R" "4722" "Foo") -*- *) diff --git a/test-suite/bugs/closed/4722/tata b/test-suite/bugs/closed/4722/tata new file mode 120000 index 0000000000..b38e66e75f --- /dev/null +++ b/test-suite/bugs/closed/4722/tata @@ -0,0 +1 @@ +toto \ No newline at end of file diff --git a/test-suite/bugs/closed/4727.v b/test-suite/bugs/closed/4727.v new file mode 100644 index 0000000000..3854bbffdd --- /dev/null +++ b/test-suite/bugs/closed/4727.v @@ -0,0 +1,10 @@ +(* -*- coq-prog-args: ("-emacs" "-compat" "8.4") -*- *) +Goal forall (P : Set) (l : P) (P0 : Set) (w w0 : P0) (T : Type) (a : P * T) (o : P -> option P0), + (forall (l1 l2 : P) (w1 : P0), o l1 = Some w1 -> o l2 = Some w1 -> l1 = l2) -> + o l = Some w -> o (fst a) = Some w0 -> {w = w0} + {w <> w0} -> False. +Proof. + clear; intros ???????? inj H0 H1 H2. + destruct H2; intuition subst. + eapply inj in H1; [ | eauto ]. + progress subst. (* should succeed, used to not succeed *) +Abort. diff --git a/test-suite/bugs/closed/4745.v b/test-suite/bugs/closed/4745.v new file mode 100644 index 0000000000..c090125e64 --- /dev/null +++ b/test-suite/bugs/closed/4745.v @@ -0,0 +1,35 @@ +(*I get an Anomaly in the following code. + +```*) +Require Vector. + +Module M. + Lemma Vector_map_map : + forall A B C (f : A -> B) (g : B -> C) n (v : Vector.t A n), + Vector.map g (Vector.map f v) = Vector.map (fun a => g (f a)) v. + Proof. + induction v; simpl; auto using f_equal. + Qed. + + Lemma Vector_map_map_transparent : + forall A B C (f : A -> B) (g : B -> C) n (v : Vector.t A n), + Vector.map g (Vector.map f v) = Vector.map (fun a => g (f a)) v. + Proof. + induction v; simpl; auto using f_equal. + Defined. + (* Anomaly: constant not found in kind_of_head: Coq.Vectors.Vector.t_ind. Please report. *) + + (* strangely, explicitly passing the principle to induction works *) + Lemma Vector_map_map_transparent' : + forall A B C (f : A -> B) (g : B -> C) n (v : Vector.t A n), + Vector.map g (Vector.map f v) = Vector.map (fun a => g (f a)) v. + Proof. + induction v using Vector.t_ind; simpl; auto using f_equal. + Defined. +End M. +(*``` + +Changing any of the following things eliminates the Anomaly + * moving the lemma out of the module M to the top level + * proving the lemma as a Fixpoint instead of using induction + * proving the analogous lemma on lists instead of vectors*) diff --git a/test-suite/bugs/closed/4772.v b/test-suite/bugs/closed/4772.v new file mode 100644 index 0000000000..c3109fa31c --- /dev/null +++ b/test-suite/bugs/closed/4772.v @@ -0,0 +1,6 @@ + +Record TruncType := BuildTruncType { + trunctype_type : Type +}. + +Fail Arguments BuildTruncType _ _ {_}. (* This should fail *) diff --git a/test-suite/bugs/opened/4701.v b/test-suite/bugs/opened/4701.v new file mode 100644 index 0000000000..9286f0f1f0 --- /dev/null +++ b/test-suite/bugs/opened/4701.v @@ -0,0 +1,23 @@ +(*Suppose we have*) + + Inductive my_if {A B} : bool -> Type := + | then_case (_ : A) : my_if true + | else_case (_ : B) : my_if false. + Notation "'If' b 'Then' A 'Else' B" := (@my_if A B b) (at level 10). + +(*then here are three inductive type declarations that work:*) + + Inductive I1 := + | i1 (x : I1). + Inductive I2 := + | i2 (x : nat). + Inductive I3 := + | i3 (b : bool) (x : If b Then I3 Else nat). + +(*and here is one that does not, despite being equivalent to [I3]:*) + + Fail Inductive I4 := + | i4 (b : bool) (x : if b then I4 else nat). (* Error: Non strictly positive occurrence of "I4" in + "forall b : bool, (if b then I4 else nat) -> I4". *) + +(*I think this one should work. I believe this is a conservative extension over CIC: Since [match] statements returning types can always be re-encoded as inductive type families, the analysis should be independent of whether the constructor uses an inductive or a [match] statement.*) diff --git a/test-suite/bugs/opened/4717.v b/test-suite/bugs/opened/4717.v new file mode 100644 index 0000000000..9ad4746723 --- /dev/null +++ b/test-suite/bugs/opened/4717.v @@ -0,0 +1,19 @@ +(*See below. They sometimes work, and sometimes do not. Is this a bug?*) + +Require Import Omega Psatz. + +Definition foo := nat. + +Goal forall (n : foo), 0 = n - n. +Proof. intros. omega. (* works *) Qed. + +Goal forall (x n : foo), x = x + n - n. +Proof. + intros. + Fail omega. (* Omega can't solve this system *) + Fail lia. (* Cannot find witness. *) + unfold foo in *. + omega. (* works *) +Qed. + +(* Guillaume Melquiond: What matters is the equality. In the first case, it is @eq nat. In the second case, it is @eq foo. The same issue exists for ring and field. So it is not a bug, but it is worth fixing.*) diff --git a/test-suite/bugs/opened/4721.v b/test-suite/bugs/opened/4721.v new file mode 100644 index 0000000000..1f184b3930 --- /dev/null +++ b/test-suite/bugs/opened/4721.v @@ -0,0 +1,13 @@ +Variables S1 S2 : Set. + +Goal @eq Type S1 S2 -> @eq Type S1 S2. +intro H. +Fail tauto. +assumption. +Qed. + +(*This is in 8.5pl1, and Matthieq Sozeau says: "That's a regression in tauto indeed, which now requires exact equality of the universes, through a non linear goal pattern matching: +match goal with ?X1 |- ?X1 forces both instances of X1 to be convertible, +with no additional universe constraints currently, but the two types are +initially different. This can be fixed easily to allow the same flexibility +as in 8.4 (or assumption) to unify the universes as well."*) diff --git a/test-suite/bugs/opened/4728.v b/test-suite/bugs/opened/4728.v new file mode 100644 index 0000000000..230b4beb6c --- /dev/null +++ b/test-suite/bugs/opened/4728.v @@ -0,0 +1,72 @@ +(*I'd like the final [Check] in the following to work:*) + +Ltac fin_eta_expand := + [ > lazymatch goal with + | [ H : _ |- _ ] => clear H + end.. + | lazymatch goal with + | [ H : ?T |- ?T ] + => exact H + | [ |- ?G ] + => fail 0 "No hypothesis matching" G + end ]; + let n := numgoals in + tryif constr_eq numgoals 0 + then idtac + else fin_eta_expand. + +Ltac pre_eta_expand x := + let T := type of x in + let G := match goal with |- ?G => G end in + unify T G; + unshelve econstructor; + destruct x; + fin_eta_expand. + +Ltac eta_expand x := + let v := constr:(ltac:(pre_eta_expand x)) in + idtac v; + let v := (eval cbv beta iota zeta in v) in + exact v. + +Notation eta_expand x := (ltac:(eta_expand x)) (only parsing). + +Ltac partial_unify eqn := + lazymatch eqn with + | ?x = ?x => idtac + | ?f ?x = ?g ?y + => partial_unify (f = g); + (tryif unify x y then + idtac + else tryif has_evar x then + unify x y + else tryif has_evar y then + unify x y + else + idtac) + | ?x = ?y + => idtac; + (tryif unify x y then + idtac + else tryif has_evar x then + unify x y + else tryif has_evar y then + unify x y + else + idtac) + end. + +Tactic Notation "{" open_constr(old_record) "with" open_constr(new_record) "}" := + let old_record' := eta_expand old_record in + partial_unify (old_record = new_record); + eexact new_record. + +Set Implicit Arguments. +Record prod A B := pair { fst : A ; snd : B }. +Infix "*" := prod : type_scope. +Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : core_scope. + +Notation "{ old 'with' new }" := (ltac:({ old with new })) (only parsing). + +Check ltac:({ (1, 1) with {| snd := 2 |} }). +Fail Check { (1, 1) with {| snd := 2 |} }. (* Error: Cannot infer this placeholder of type "Type"; should succeed *) diff --git a/test-suite/bugs/opened/4755.v b/test-suite/bugs/opened/4755.v new file mode 100644 index 0000000000..9cc0d361ea --- /dev/null +++ b/test-suite/bugs/opened/4755.v @@ -0,0 +1,34 @@ +(*I'm not sure which behavior is better. But if the change is intentional, it should be documented (I don't think it is), and it'd be nice if there were a flag for this, or if -compat 8.4 restored the old behavior.*) + +Require Import Coq.Setoids.Setoid Coq.Classes.Morphisms. +Definition f (v : option nat) := match v with + | Some k => Some k + | None => None + end. + +Axioms F G : (option nat -> option nat) -> Prop. +Axiom FG : forall f, f None = None -> F f = G f. + +Axiom admit : forall {T}, T. + +Existing Instance eq_Reflexive. + +Global Instance foo (A := nat) + : Proper ((pointwise_relation _ eq) + ==> eq ==> forall_relation (fun _ => Basics.flip Basics.impl)) + (@option_rect A (fun _ => Prop)) | 0. +exact admit. +Qed. + +Global Instance bar (A := nat) + : Proper ((pointwise_relation _ eq) + ==> eq ==> eq ==> Basics.flip Basics.impl) + (@option_rect A (fun _ => Prop)) | 0. +exact admit. +Qed. + +Goal forall k, option_rect (fun _ => Prop) (fun v : nat => v = v /\ F f) True k. +Proof. + intro. + pose proof (_ : (Proper (_ ==> eq ==> _) and)). + Fail setoid_rewrite (FG _ _); []. (* In 8.5: Error: Tactic failure: Incorrect number of goals (expected 2 tactics); works in 8.4 *) diff --git a/test-suite/bugs/opened/4771.v b/test-suite/bugs/opened/4771.v new file mode 100644 index 0000000000..396d74bdbf --- /dev/null +++ b/test-suite/bugs/opened/4771.v @@ -0,0 +1,22 @@ +Module Type Foo. + +Parameter Inline t : nat. + +End Foo. + +Module F(X : Foo). + +Tactic Notation "foo" ref(x) := idtac. + +Ltac g := foo X.t. + +End F. + +Module N. +Definition t := 0 + 0. +End N. + +Module K := F(N). + +(* Was +Anomaly: Uncaught exception Not_found. Please report. *) diff --git a/test-suite/bugs/opened/4778.v b/test-suite/bugs/opened/4778.v new file mode 100644 index 0000000000..633d158e96 --- /dev/null +++ b/test-suite/bugs/opened/4778.v @@ -0,0 +1,35 @@ +Require Import Coq.Setoids.Setoid Coq.Classes.Morphisms. +Definition f (v : option nat) := match v with + | Some k => Some k + | None => None + end. + +Axioms F G : (option nat -> option nat) -> Prop. +Axiom FG : forall f, f None = None -> F f = G f. + +Axiom admit : forall {T}, T. + +Existing Instance eq_Reflexive. + +(* This instance is needed in 8.4, but is useless in 8.5 *) +Global Instance foo (A := nat) + : Proper ((pointwise_relation _ eq) + ==> eq ==> forall_relation (fun _ => Basics.flip Basics.impl)) + (@option_rect A (fun _ => Prop)) | 0. +exact admit. +Qed. + +(* +(* This is required in 8.5, but useless in 8.4 *) +Global Instance bar (A := nat) + : Proper ((pointwise_relation _ eq) + ==> eq ==> eq ==> Basics.flip Basics.impl) + (@option_rect A (fun _ => Prop)) | 0. +exact admit. +Qed. +*) + +Goal forall k, option_rect (fun _ => Prop) (fun v : nat => v = v /\ F f) True k. Proof. + intro. + pose proof (_ : (Proper (_ ==> eq ==> _) and)). + Fail setoid_rewrite (FG _ _); [ | reflexivity.. ]. (* this should succeed without [Fail], as it does in 8.4 *) diff --git a/test-suite/bugs/opened/4781.v b/test-suite/bugs/opened/4781.v new file mode 100644 index 0000000000..8b651ac22e --- /dev/null +++ b/test-suite/bugs/opened/4781.v @@ -0,0 +1,94 @@ +Ltac force_clear := + clear; + repeat match goal with + | [ H : _ |- _ ] => clear H + | [ H := _ |- _ ] => clearbody H + end. + +Class abstract_term {T} (x : T) := by_abstract_term : T. +Hint Extern 0 (@abstract_term ?T ?x) => force_clear; change T; abstract (exact x) : typeclass_instances. + +Goal True. +(* These work: *) + let term := constr:(I) in + let T := type of term in + let x := constr:((_ : abstract_term term) : T) in + pose x. + let term := constr:(I) in + let T := type of term in + let x := constr:((_ : abstract_term term) : T) in + let x := (eval cbv iota in (let v : T := x in v)) in + pose x. + let term := constr:(I) in + let T := type of term in + let x := constr:((_ : abstract_term term) : T) in + let x := match constr:(Set) with ?y => constr:(y) end in + pose x. +(* This fails with an error: *) + Fail let term := constr:(I) in + let T := type of term in + let x := constr:((_ : abstract_term term) : T) in + let x := match constr:(x) with ?y => constr:(y) end in + pose x. (* The command has indeed failed with message: +Error: Variable y should be bound to a term. *) +(* And the rest fail with Anomaly: Uncaught exception Not_found. Please report. *) + Fail let term := constr:(I) in + let T := type of term in + let x := constr:((_ : abstract_term term) : T) in + let x := match constr:(x) with ?y => y end in + pose x. + Fail let term := constr:(I) in + let T := type of term in + let x := constr:((_ : abstract_term term) : T) in + let x := (eval cbv iota in x) in + pose x. + Fail let term := constr:(I) in + let T := type of term in + let x := constr:((_ : abstract_term term) : T) in + let x := type of x in + pose x. (* should succeed *) + Fail let term := constr:(I) in + let T := type of term in + let x := constr:(_ : abstract_term term) in + let x := type of x in + pose x. (* should succeed *) + +(*Apparently what [cbv iota] doesn't see can't hurt it, and [pose] is perfectly happy with abstracted lemmas only some of the time. + +Even stranger, consider:*) + let term := constr:(I) in + let T := type of term in + let x := constr:((_ : abstract_term term) : T) in + let y := (eval cbv iota in (let v : T := x in v)) in + pose y; + let x' := fresh "x'" in + pose x as x'. + let x := (eval cbv delta [x'] in x') in + pose x; + let z := (eval cbv iota in x) in + pose z. + +(*This works fine. But if I change the period to a semicolon, I get:*) + + Fail let term := constr:(I) in + let T := type of term in + let x := constr:((_ : abstract_term term) : T) in + let y := (eval cbv iota in (let v : T := x in v)) in + pose y; + let x' := fresh "x'" in + pose x as x'; + let x := (eval cbv delta [x'] in x') in + pose x. (* Anomaly: Uncaught exception Not_found. Please report. *) + (* should succeed *) +(*and if I use the second one instead of [pose x] (note that using [idtac] works fine), I get:*) + + Fail let term := constr:(I) in + let T := type of term in + let x := constr:((_ : abstract_term term) : T) in + let y := (eval cbv iota in (let v : T := x in v)) in + pose y; + let x' := fresh "x'" in + pose x as x'; + let x := (eval cbv delta [x'] in x') in + let z := (eval cbv iota in x) in (* Error: Variable x should be bound to a term. *) + idtac. (* should succeed *) -- cgit v1.2.3 From 81c9fa0de99400b51c029cdbd1519b4f724e320a Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Thu, 17 Nov 2016 13:06:07 +0100 Subject: fake_ide: use the now available Status XML message --- tools/fake_ide.ml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/fake_ide.ml b/tools/fake_ide.ml index 8fcca535d1..214dfb4703 100644 --- a/tools/fake_ide.ml +++ b/tools/fake_ide.ml @@ -266,11 +266,9 @@ let eval_print l coq = let to_id, _ = get_id id in eval_call (query (phrase, to_id)) coq | [ Tok(_,"WAIT") ] -> - let phrase = "Stm Wait." in - eval_call (query (phrase,tip_id())) coq + eval_call (status false) coq | [ Tok(_,"JOIN") ] -> - let phrase = "Stm JoinDocument." in - eval_call (query (phrase,tip_id())) coq + eval_call (status true) coq | [ Tok(_,"ASSERT"); Tok(_,"TIP"); Tok(_,id) ] -> let to_id, _ = get_id id in if not(Stateid.equal (Document.tip doc) to_id) then error "Wrong tip" -- cgit v1.2.3 From 253493355a71c0673b0c10b06e7eb9f0fd0242a9 Mon Sep 17 00:00:00 2001 From: Théo Zimmermann Date: Thu, 17 Nov 2016 16:01:29 +0100 Subject: Add missing label. Fixes broken ref. --- doc/refman/Classes.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/refman/Classes.tex b/doc/refman/Classes.tex index bd8ee450ef..acfc4bea93 100644 --- a/doc/refman/Classes.tex +++ b/doc/refman/Classes.tex @@ -380,6 +380,7 @@ use implicit generalization (see \ref{SectionContext}). \asubsection{\tt typeclasses eauto} \tacindex{typeclasses eauto} +\label{typeclasseseauto} The {\tt typeclasses eauto} tactic uses a different resolution engine than {\tt eauto} and {\tt auto}. The main differences are the following: -- cgit v1.2.3 From 954f1697fb750eecf4612bbb191a91c3a4bafb7c Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Fri, 18 Nov 2016 08:38:12 +0100 Subject: Revert "fake_ide: use the now available Status XML message" This reverts commit 81c9fa0de99400b51c029cdbd1519b4f724e320a. --- tools/fake_ide.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/fake_ide.ml b/tools/fake_ide.ml index 214dfb4703..8fcca535d1 100644 --- a/tools/fake_ide.ml +++ b/tools/fake_ide.ml @@ -266,9 +266,11 @@ let eval_print l coq = let to_id, _ = get_id id in eval_call (query (phrase, to_id)) coq | [ Tok(_,"WAIT") ] -> - eval_call (status false) coq + let phrase = "Stm Wait." in + eval_call (query (phrase,tip_id())) coq | [ Tok(_,"JOIN") ] -> - eval_call (status true) coq + let phrase = "Stm JoinDocument." in + eval_call (query (phrase,tip_id())) coq | [ Tok(_,"ASSERT"); Tok(_,"TIP"); Tok(_,id) ] -> let to_id, _ = get_id id in if not(Stateid.equal (Document.tip doc) to_id) then error "Wrong tip" -- cgit v1.2.3 From bdcf5b040b975a179fe9b2889fea0d38ae4689df Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Fri, 18 Nov 2016 08:38:30 +0100 Subject: Revert "Merge remote-tracking branch 'github/pr/360' into v8.6" This reverts commit b00e039b957b8428c21faec5c76f3a3484cde2cf, reversing changes made to ca9e00ff9b2a8ee17430398a5e0bef2345c39341. It turns out that calling from fake_ide the STM commands that were removed by this PR requires an extension of the XML protocol. So postponing the integration. --- ide/texmacspp.ml | 3 +++ intf/vernacexpr.mli | 23 ++++++++++++++++++++- parsing/g_vernac.ml4 | 10 ++++++++++ printing/ppvernac.ml | 16 +++++++++++++++ stm/stm.ml | 51 ++++++++++++++++++++++++++++++++++------------- stm/vernac_classifier.ml | 22 ++++++++++++++++---- toplevel/vernac.ml | 3 ++- toplevel/vernacentries.ml | 4 ++++ 8 files changed, 112 insertions(+), 20 deletions(-) diff --git a/ide/texmacspp.ml b/ide/texmacspp.ml index dbcd8630b1..680da7f54b 100644 --- a/ide/texmacspp.ml +++ b/ide/texmacspp.ml @@ -724,6 +724,9 @@ let rec tmpp v loc = | VernacComments (cl) -> xmlComment loc (List.flatten (List.map pp_comment cl)) + (* Stm backdoor *) + | VernacStm _ as x -> xmlTODO loc x + (* Proof management *) | VernacGoal _ as x -> xmlTODO loc x | VernacAbort _ as x -> xmlTODO loc x diff --git a/intf/vernacexpr.mli b/intf/vernacexpr.mli index f77a940a7e..92e4dd618e 100644 --- a/intf/vernacexpr.mli +++ b/intf/vernacexpr.mli @@ -283,6 +283,16 @@ type bullet = | Star of int | Plus of int +(** {6 Types concerning Stm} *) +type 'a stm_vernac = + | JoinDocument + | Finish + | Wait + | PrintDag + | Observe of Stateid.t + | Command of 'a (* An out of flow command not to be recorded by Stm *) + | PGLast of 'a (* To ease the life of PG *) + (** {6 Types concerning the module layer} *) (** Rigid / flexible module signature *) @@ -441,6 +451,9 @@ type vernac_expr = | VernacRegister of lident * register_kind | VernacComments of comment list + (* Stm backdoor *) + | VernacStm of vernac_expr stm_vernac + (* Proof management *) | VernacGoal of constr_expr | VernacAbort of lident option @@ -495,7 +508,7 @@ type vernac_type = | VtProofStep of proof_step | VtProofMode of string | VtQuery of vernac_part_of_script * report_with - | VtBack of Stateid.t * vernac_part_of_script + | VtStm of vernac_control * vernac_part_of_script | VtUnknown and report_with = Stateid.t * Feedback.route_id (* feedback on id/route *) and vernac_qed_type = VtKeep | VtKeepAsAxiom | VtDrop (* Qed/Admitted, Abort *) @@ -503,6 +516,14 @@ and vernac_start = string * opacity_guarantee * Id.t list and vernac_sideff_type = Id.t list and vernac_is_alias = bool and vernac_part_of_script = bool +and vernac_control = + | VtFinish + | VtWait + | VtJoinDocument + | VtPrintDag + | VtObserve of Stateid.t + | VtBack of Stateid.t + | VtPG and opacity_guarantee = | GuaranteesOpacity (** Only generates opaque terms at [Qed] *) | Doesn'tGuaranteeOpacity (** May generate transparent terms even with [Qed].*) diff --git a/parsing/g_vernac.ml4 b/parsing/g_vernac.ml4 index 4ba9eeefa9..9b52d1bf31 100644 --- a/parsing/g_vernac.ml4 +++ b/parsing/g_vernac.ml4 @@ -64,6 +64,16 @@ GEXTEND Gram | IDENT "Local"; v = vernac_poly -> VernacLocal (true, v) | IDENT "Global"; v = vernac_poly -> VernacLocal (false, v) + (* Stm backdoor *) + | IDENT "Stm"; IDENT "JoinDocument"; "." -> VernacStm JoinDocument + | IDENT "Stm"; IDENT "Finish"; "." -> VernacStm Finish + | IDENT "Stm"; IDENT "Wait"; "." -> VernacStm Wait + | IDENT "Stm"; IDENT "PrintDag"; "." -> VernacStm PrintDag + | IDENT "Stm"; IDENT "Observe"; id = INT; "." -> + VernacStm (Observe (Stateid.of_int (int_of_string id))) + | IDENT "Stm"; IDENT "Command"; v = vernac_aux -> VernacStm (Command v) + | IDENT "Stm"; IDENT "PGLast"; v = vernac_aux -> VernacStm (PGLast v) + | v = vernac_poly -> v ] ] ; diff --git a/printing/ppvernac.ml b/printing/ppvernac.ml index a6b1c97f5c..3494ad006f 100644 --- a/printing/ppvernac.ml +++ b/printing/ppvernac.ml @@ -538,6 +538,22 @@ module Make | VernacLocal (local, v) -> return (pr_locality local ++ spc() ++ pr_vernac_body v) + (* Stm *) + | VernacStm JoinDocument -> + return (keyword "Stm JoinDocument") + | VernacStm PrintDag -> + return (keyword "Stm PrintDag") + | VernacStm Finish -> + return (keyword "Stm Finish") + | VernacStm Wait -> + return (keyword "Stm Wait") + | VernacStm (Observe id) -> + return (keyword "Stm Observe " ++ str(Stateid.to_string id)) + | VernacStm (Command v) -> + return (keyword "Stm Command " ++ pr_vernac_body v) + | VernacStm (PGLast v) -> + return (keyword "Stm PGLast " ++ pr_vernac_body v) + (* Proof management *) | VernacAbortAll -> return (keyword "Abort All") diff --git a/stm/stm.ml b/stm/stm.ml index 0ddaf604ad..e387e6322f 100644 --- a/stm/stm.ml +++ b/stm/stm.ml @@ -989,7 +989,7 @@ end = struct (* {{{ *) try match v with | VernacResetInitial -> - VtBack (Stateid.initial, true), VtNow + VtStm (VtBack Stateid.initial, true), VtNow | VernacResetName (_,name) -> let id = VCS.get_branch_pos (VCS.current_branch ()) in (try @@ -997,20 +997,20 @@ end = struct (* {{{ *) fold_until (fun b (id,_,label,_,_) -> if b then `Stop id else `Cont (List.mem name label)) false id in - VtBack (oid, true), VtNow + VtStm (VtBack oid, true), VtNow with Not_found -> - VtBack (id, true), VtNow) + VtStm (VtBack id, true), VtNow) | VernacBack n -> let id = VCS.get_branch_pos (VCS.current_branch ()) in let oid = fold_until (fun n (id,_,_,_,_) -> if Int.equal n 0 then `Stop id else `Cont (n-1)) n id in - VtBack (oid, true), VtNow + VtStm (VtBack oid, true), VtNow | VernacUndo n -> let id = VCS.get_branch_pos (VCS.current_branch ()) in let oid = fold_until (fun n (id,_,_,tactic,undo) -> let value = (if tactic then 1 else 0) - undo in if Int.equal n 0 then `Stop id else `Cont (n-value)) n id in - VtBack (oid, true), VtLater + VtStm (VtBack oid, true), VtLater | VernacUndoTo _ | VernacRestart as e -> let m = match e with VernacUndoTo m -> m | _ -> 0 in @@ -1027,16 +1027,16 @@ end = struct (* {{{ *) 0 id in let oid = fold_until (fun n (id,_,_,_,_) -> if Int.equal n 0 then `Stop id else `Cont (n-1)) (n-m-1) id in - VtBack (oid, true), VtLater + VtStm (VtBack oid, true), VtLater | VernacAbortAll -> let id = VCS.get_branch_pos (VCS.current_branch ()) in let oid = fold_until (fun () (id,vcs,_,_,_) -> match Vcs_.branches vcs with [_] -> `Stop id | _ -> `Cont ()) () id in - VtBack (oid, true), VtLater + VtStm (VtBack oid, true), VtLater | VernacBacktrack (id,_,_) | VernacBackTo id -> - VtBack (Stateid.of_int id, not !Flags.print_emacs), VtNow + VtStm (VtBack (Stateid.of_int id), not !Flags.print_emacs), VtNow | _ -> VtUnknown, VtNow with | Not_found -> @@ -2428,8 +2428,22 @@ let process_transaction ?(newtip=Stateid.fresh ()) ~tty prerr_endline (fun () -> " classified as: " ^ string_of_vernac_classification c); match c with + (* PG stuff *) + | VtStm(VtPG,false), VtNow -> vernac_interp Stateid.dummy x; `Ok + | VtStm(VtPG,_), _ -> anomaly(str "PG command in script or VtLater") + (* Joining various parts of the document *) + | VtStm (VtJoinDocument, b), VtNow -> join (); `Ok + | VtStm (VtFinish, b), VtNow -> finish (); `Ok + | VtStm (VtWait, b), VtNow -> finish (); wait (); `Ok + | VtStm (VtPrintDag, b), VtNow -> + VCS.print ~now:true (); `Ok + | VtStm (VtObserve id, b), VtNow -> observe id; `Ok + | VtStm ((VtObserve _ | VtFinish | VtJoinDocument + |VtPrintDag |VtWait),_), VtLater -> + anomaly(str"classifier: join actions cannot be classified as VtLater") + (* Back *) - | VtBack(oid, true), w -> + | VtStm (VtBack oid, true), w -> let id = VCS.new_node ~id:newtip () in let { mine; others } = Backtrack.branches_of oid in let valid = VCS.get_branch_pos head in @@ -2448,12 +2462,12 @@ let process_transaction ?(newtip=Stateid.fresh ()) ~tty VCS.checkout_shallowest_proof_branch (); VCS.commit id (Alias (oid,x)); Backtrack.record (); if w == VtNow then finish (); `Ok - | VtBack (id, false), VtNow -> + | VtStm (VtBack id, false), VtNow -> prerr_endline (fun () -> "undo to state " ^ Stateid.to_string id); Backtrack.backto id; VCS.checkout_shallowest_proof_branch (); Reach.known_state ~cache:(interactive ()) id; `Ok - | VtBack (id, false), VtLater -> + | VtStm (VtBack id, false), VtLater -> anomaly(str"classifier: VtBack + VtLater must imply part_of_script") (* Query *) @@ -2590,6 +2604,15 @@ let process_transaction ?(newtip=Stateid.fresh ()) ~tty | VtUnknown, VtLater -> anomaly(str"classifier: VtUnknown must imply VtNow") end in + (* Proof General *) + begin match expr with + | VernacStm (PGLast _) -> + if not (VCS.Branch.equal head VCS.Branch.master) then + vernac_interp Stateid.dummy + { verbose = true; loc = Loc.ghost; indentation = 0; strlen = 0; + expr = VernacShow (ShowGoal OpenSubgoals) } + | _ -> () + end; prerr_endline (fun () -> "processed }}}"); VCS.print (); rc @@ -2651,8 +2674,8 @@ let query ~at ?(report_with=(Stateid.dummy,default_route)) s = let clas = classify_vernac ast in let aast = { verbose = true; indentation; strlen; loc; expr = ast } in match clas with - | VtBack (w,_), _ -> - ignore(process_transaction ~tty:false aast (VtBack (w,false), VtNow)) + | VtStm (w,_), _ -> + ignore(process_transaction ~tty:false aast (VtStm (w,false), VtNow)) | _ -> ignore(process_transaction ~tty:false aast (VtQuery (false,report_with), VtNow))) @@ -2799,7 +2822,7 @@ let interp verb (loc,e) = let print_goals = verb && match clas with | VtQuery _, _ -> false - | (VtProofStep _ | VtBack (_, _) | VtStartProof _), _ -> true + | (VtProofStep _ | VtStm (VtBack _, _) | VtStartProof _), _ -> true | _ -> not !Flags.coqtop_ui in try finish ~print_goals () with e -> diff --git a/stm/vernac_classifier.ml b/stm/vernac_classifier.ml index f9bf9653fd..dc5be08a37 100644 --- a/stm/vernac_classifier.ml +++ b/stm/vernac_classifier.ml @@ -33,7 +33,10 @@ let string_of_vernac_type = function | VtQuery (b,(id,route)) -> "Query " ^ string_of_in_script b ^ " report " ^ Stateid.to_string id ^ " route " ^ string_of_int route - | VtBack(_, b) -> "Stm Back " ^ string_of_in_script b + | VtStm ((VtFinish|VtJoinDocument|VtObserve _|VtPrintDag|VtWait), b) -> + "Stm " ^ string_of_in_script b + | VtStm (VtPG, b) -> "Stm PG " ^ string_of_in_script b + | VtStm (VtBack _, b) -> "Stm Back " ^ string_of_in_script b let string_of_vernac_when = function | VtLater -> "Later" @@ -52,7 +55,7 @@ let declare_vernac_classifier let elide_part_of_script_and_now (a, _) = match a with | VtQuery (_,id) -> VtQuery (false,id), VtNow - | VtBack (x, _) -> VtBack (x, false), VtNow + | VtStm (x, _) -> VtStm (x, false), VtNow | x -> x, VtNow let make_polymorphic (a, b as x) = @@ -66,12 +69,23 @@ let set_undo_classifier f = undo_classifier := f let rec classify_vernac e = let static_classifier e = match e with + (* PG compatibility *) + | VernacUnsetOption (["Silent"]|["Undo"]|["Printing";"Depth"]) + | VernacSetOption ((["Silent"]|["Undo"]|["Printing";"Depth"]),_) + when !Flags.print_emacs -> VtStm(VtPG,false), VtNow (* Univ poly compatibility: we run it now, so that we can just * look at Flags in stm.ml. Would be nicer to have the stm * look at the entire dag to detect this option. *) | VernacSetOption (["Universe"; "Polymorphism"],_) | VernacUnsetOption (["Universe"; "Polymorphism"]) -> VtSideff [], VtNow - + (* Stm *) + | VernacStm Finish -> VtStm (VtFinish, true), VtNow + | VernacStm Wait -> VtStm (VtWait, true), VtNow + | VernacStm JoinDocument -> VtStm (VtJoinDocument, true), VtNow + | VernacStm PrintDag -> VtStm (VtPrintDag, true), VtNow + | VernacStm (Observe id) -> VtStm (VtObserve id, true), VtNow + | VernacStm (Command x) -> elide_part_of_script_and_now (classify_vernac x) + | VernacStm (PGLast x) -> fst (classify_vernac x), VtNow (* Nested vernac exprs *) | VernacProgram e -> classify_vernac e | VernacLocal (_,e) -> classify_vernac e @@ -84,7 +98,7 @@ let rec classify_vernac e = | VernacFail e -> (* Fail Qed or Fail Lemma must not join/fork the DAG *) (match classify_vernac e with | ( VtQuery _ | VtProofStep _ | VtSideff _ - | VtBack _ | VtProofMode _ ), _ as x -> x + | VtStm _ | VtProofMode _ ), _ as x -> x | VtQed _, _ -> VtProofStep { parallel = `No; proof_block_detection = None }, VtNow diff --git a/toplevel/vernac.ml b/toplevel/vernac.ml index ba5bc55069..bfdae85d50 100644 --- a/toplevel/vernac.ml +++ b/toplevel/vernac.ml @@ -27,7 +27,8 @@ let rec is_navigation_vernac = function | VernacResetName _ | VernacBacktrack _ | VernacBackTo _ - | VernacBack _ -> true + | VernacBack _ + | VernacStm _ -> true | VernacRedirect (_, (_,c)) | VernacTime (_,c) -> is_navigation_vernac c (* Time Back* is harmless *) diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index f0e63aa7c5..230e62607a 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -1941,6 +1941,7 @@ let interp ?proof ~loc locality poly c = | VernacTime _ -> assert false | VernacRedirect _ -> assert false | VernacTimeout _ -> assert false + | VernacStm _ -> assert false | VernacError e -> raise e @@ -2208,6 +2209,9 @@ let interp ?(verbosely=true) ?proof (loc,c) = aux ?locality ~polymorphism:b isprogcmd c | VernacPolymorphic (b, c) -> CErrors.error "Polymorphism specified twice" | VernacLocal _ -> CErrors.error "Locality specified twice" + | VernacStm (Command c) -> aux ?locality ?polymorphism isprogcmd c + | VernacStm (PGLast c) -> aux ?locality ?polymorphism isprogcmd c + | VernacStm _ -> assert false (* Done by Stm *) | VernacFail v -> with_fail true (fun () -> aux ?locality ?polymorphism isprogcmd v) | VernacTimeout (n,v) -> -- cgit v1.2.3 From 1559f734060e49fe09d7221f63dd66e8e7d565a4 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Fri, 14 Oct 2016 20:17:48 +0200 Subject: Tests for info/debug auto/eauto. This is while waiting for a deeper uniformization of auto, eauto, and typeclasses eauto. Incidentally includes a little fix in harmonizing auto/eauto printing. --- tactics/auto.ml | 2 +- test-suite/output/auto.out | 20 ++++++++++++++++++++ test-suite/output/auto.v | 11 +++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 test-suite/output/auto.out create mode 100644 test-suite/output/auto.v diff --git a/tactics/auto.ml b/tactics/auto.ml index d4251555d8..7558a707ec 100644 --- a/tactics/auto.ml +++ b/tactics/auto.ml @@ -259,7 +259,7 @@ and erase_subtree depth = function | (d,_) :: l -> if Int.equal d depth then l else erase_subtree depth l let pr_info_atom (d,pp) = - str (String.make d ' ') ++ pp () ++ str "." + str (String.make (d-1) ' ') ++ pp () ++ str "." let pr_info_trace = function | (Info,_,{contents=(d,Some pp)::l}) -> diff --git a/test-suite/output/auto.out b/test-suite/output/auto.out new file mode 100644 index 0000000000..a5b55a9993 --- /dev/null +++ b/test-suite/output/auto.out @@ -0,0 +1,20 @@ +(* info auto: *) +simple apply or_intror (in core). + intro. + assumption. +Debug: (* debug auto: *) +Debug: * assumption. (*fail*) +Debug: * intro. (*fail*) +Debug: * simple apply or_intror (in core). (*success*) +Debug: ** assumption. (*fail*) +Debug: ** intro. (*success*) +Debug: ** assumption. (*success*) +(* info eauto: *) +simple apply or_intror. + intro. + exact H. +Debug: (* debug eauto: *) +Debug: 1 depth=5 +Debug: 1.1 depth=4 simple apply or_intror +Debug: 1.1.1 depth=4 intro +Debug: 1.1.1.1 depth=4 exact H diff --git a/test-suite/output/auto.v b/test-suite/output/auto.v new file mode 100644 index 0000000000..a77b7b82e6 --- /dev/null +++ b/test-suite/output/auto.v @@ -0,0 +1,11 @@ +(* testing info/debug auto/eauto *) + +Goal False \/ (True -> True). +info_auto. +Undo. +debug auto. +Undo. +info_eauto. +Undo. +debug eauto. +Qed. -- cgit v1.2.3 From 102d2db3ea7a7354de5e019224e2778fe7603b8e Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Mon, 21 Nov 2016 07:25:30 +0100 Subject: Stop parsing -compat-notations options, which are no longer supported (bug #3339). --- tools/coqc.ml | 1 - toplevel/usage.ml | 2 -- 2 files changed, 3 deletions(-) diff --git a/tools/coqc.ml b/tools/coqc.ml index b59bbdb1e0..b12d48710f 100644 --- a/tools/coqc.ml +++ b/tools/coqc.ml @@ -94,7 +94,6 @@ let parse_args () = |"-silent"|"-m"|"-xml"|"-v7"|"-v8"|"-beautify"|"-strict-implicit" |"-dont-load-proofs"|"-load-proofs"|"-force-load-proofs" |"-impredicative-set"|"-vm"|"-native-compiler" - |"-verbose-compat-notations"|"-no-compat-notations" |"-indices-matter"|"-quick"|"-type-in-type" |"-async-proofs-always-delegate"|"-async-proofs-never-reopen-branch" as o) :: rem -> diff --git a/toplevel/usage.ml b/toplevel/usage.ml index 956a402617..38ceacf5ec 100644 --- a/toplevel/usage.ml +++ b/toplevel/usage.ml @@ -36,8 +36,6 @@ let print_usage_channel co command = \n -noinit start without loading the Init library\ \n -nois (idem)\ \n -compat X.Y provides compatibility support for Coq version X.Y\ -\n -verbose-compat-notations be warned when using compatibility notations\ -\n -no-compat-notations get an error when using compatibility notations\ \n\ \n -load-ml-object f load ML object file f\ \n -load-ml-source f load ML file f\ -- cgit v1.2.3 From aa86963464045d61fa0eaf3a7fe67ced7a6a73f4 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Mon, 21 Nov 2016 12:49:17 +0100 Subject: Remove spurious spaces in merlin file generated by coq_makefile (bug #5213). --- tools/coq_makefile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/coq_makefile.ml b/tools/coq_makefile.ml index ac69a69a4a..eab909f5b1 100644 --- a/tools/coq_makefile.ml +++ b/tools/coq_makefile.ml @@ -887,7 +887,7 @@ let merlin targets (ml_inc,_,_) = print ".merlin:\n"; print "\t@echo 'FLG -rectypes' > .merlin\n" ; List.iter (fun c -> - printf "\t@echo \"B $(COQLIB) %s\" >> .merlin\n" c) + printf "\t@echo \"B $(COQLIB)%s\" >> .merlin\n" c) lib_dirs ; List.iter (fun (_,c) -> printf "\t@echo \"B %s\" >> .merlin\n" c; -- cgit v1.2.3 From 27190db7f119bc9b50150be6dff889986c747e38 Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Mon, 21 Nov 2016 15:05:26 -0500 Subject: (v8.6) Add example in dev/doc/changes involving Tacmach.project --- dev/doc/changes.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev/doc/changes.txt b/dev/doc/changes.txt index d052468f99..e926674696 100644 --- a/dev/doc/changes.txt +++ b/dev/doc/changes.txt @@ -244,6 +244,10 @@ define_evar_* mostly used internally in the unification engine. ... let Sigma (xn, sigma, pn) = ... in Sigma (ans, sigma, p1 +> ... +> pn) + + Examples of `Sigma.Unsafe.of_evar_map` include: + + Evarutil.new_evar env (Tacmach.project goal) ty ----> Evarutil.new_evar env (Sigma.Unsafe.of_evar_map (Tacmach.project goal)) ty - The Proofview.Goal.*enter family of functions now takes a polymorphic continuation given as a record as an argument. -- cgit v1.2.3 From 8572140c30629cfcc6b7e68d450487c64922a6b9 Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Mon, 21 Nov 2016 16:01:34 -0500 Subject: (v8.6) Make a note about wit_constr and Constrarg in dev/doc/changes --- dev/doc/changes.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/doc/changes.txt b/dev/doc/changes.txt index d052468f99..12c0163b95 100644 --- a/dev/doc/changes.txt +++ b/dev/doc/changes.txt @@ -218,6 +218,8 @@ val get_id_for_feedback : unit -> edit_or_state_id * route_id for constructing compound entries still works over this scheme. Note that in the case of (VERNAC) ARGUMENT EXTEND, the name of the argument entry is bound in the parsing rules, so beware of recursive calls. + + For example, to get "wit_constr" you must "open Constrarg" at the top of the file. - Evarutil was split in two parts. The new Evardefine file exposes functions define_evar_* mostly used internally in the unification engine. -- cgit v1.2.3 From 59dee24e5dfe3dfe20c2a4a2843192d797c89155 Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Mon, 21 Nov 2016 17:03:22 -0500 Subject: (v8.6) Update dev/doc/changes with things about mem_named_context --- dev/doc/changes.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/doc/changes.txt b/dev/doc/changes.txt index d052468f99..156f38c455 100644 --- a/dev/doc/changes.txt +++ b/dev/doc/changes.txt @@ -256,7 +256,10 @@ define_evar_* mostly used internally in the unification engine. Proofview.Goal.enter { enter = begin fun gl -> ... end } -- `Tacexpr.TacDynamic(Loc.dummy_loc, Pretyping.constr_in c)` --> `Tacinterp.Value.of_constr c` +- `Tacexpr.TacDynamic(Loc.dummy_loc, Pretyping.constr_in c)` ---> `Tacinterp.Value.of_constr c` +- `Pretyping.Termops.mem_named_context` ---> `Engine.Termops.mem_named_context_val` + (`Global.named_context` ---> `Global.named_context_val`) + (`Context.Named.lookup` ---> `Environ.lookup_named_val`) ** Search API ** -- cgit v1.2.3 From bfa2ac5fc5578d9bcf2ea1183deeaa6329c29b9b Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Mon, 21 Nov 2016 17:11:45 -0500 Subject: (v8.6) Update dev/doc/changes.txt with HintsResolveEntry changes --- dev/doc/changes.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/doc/changes.txt b/dev/doc/changes.txt index d052468f99..134a6a25e8 100644 --- a/dev/doc/changes.txt +++ b/dev/doc/changes.txt @@ -256,7 +256,8 @@ define_evar_* mostly used internally in the unification engine. Proofview.Goal.enter { enter = begin fun gl -> ... end } -- `Tacexpr.TacDynamic(Loc.dummy_loc, Pretyping.constr_in c)` --> `Tacinterp.Value.of_constr c` +- `Tacexpr.TacDynamic(Loc.dummy_loc, Pretyping.constr_in c)` ---> `Tacinterp.Value.of_constr c` +- `Vernacexpr.HintsResolveEntry(priority, poly, hnf, path, atom)` ---> `Vernacexpr.HintsResolveEntry(Vernacexpr.({hint_priority = priority; hint_pattern = None}), poly, hnf, path, atom)` ** Search API ** -- cgit v1.2.3 From a277da239514ad3bcabc7933a14cfcdc46f272e5 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 22 Nov 2016 10:54:20 +0100 Subject: Properly parenthesize "ltac:" arguments (bug #5169). --- printing/pptactic.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printing/pptactic.ml b/printing/pptactic.ml index 1e618b59eb..6e40e03f5b 100644 --- a/printing/pptactic.ml +++ b/printing/pptactic.ml @@ -1216,7 +1216,7 @@ module Make | TacNumgoals -> keyword "numgoals" | (TacCall _|Tacexp _ | TacGeneric _) as a -> - keyword "ltac:" ++ pr_tac (latom,E) (TacArg (Loc.ghost,a)) + str "ltac:(" ++ pr_tac (1,Any) (TacArg (Loc.ghost,a)) ++ str ")" in pr_tac -- cgit v1.2.3 From 88b2eb9279bf5f83f27057094de5b696ee9916e3 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 22 Nov 2016 16:35:15 +0100 Subject: Fix locality of "Hint Resolve <->" (bug #5189). "Hint Resolve <->" now behaves the same as "Hint Resolve", in that it uses the same default locality and it accepts locality prefixes. --- ltac/extratactics.ml4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ltac/extratactics.ml4 b/ltac/extratactics.ml4 index 2225650204..1223f6eb4b 100644 --- a/ltac/extratactics.ml4 +++ b/ltac/extratactics.ml4 @@ -319,7 +319,8 @@ let project_hint pri l2r r = (info,false,true,Hints.PathAny, Hints.IsGlobRef (Globnames.ConstRef c)) let add_hints_iff l2r lc n bl = - Hints.add_hints true bl + let l = Locality.LocalityFixme.consume () in + Hints.add_hints (Locality.make_module_locality l) bl (Hints.HintsResolveEntry (List.map (project_hint n l2r) lc)) VERNAC COMMAND EXTEND HintResolveIffLR CLASSIFIED AS SIDEFF -- cgit v1.2.3 From 989553966c7ba1a2cc23fd10fc2633dcb0f98648 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Thu, 24 Nov 2016 10:03:17 +0100 Subject: Fix incorrect long multiplication in the VM. If the result had its 30th bit set, then all the high part of the result on a 64-bit architecture would end up being set, thus breaking subsequent computations. This patch also fixes the incorrectly parenthesized definition of uint32_of_value, which by luck was never misused. --- kernel/byterun/coq_interp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/byterun/coq_interp.c b/kernel/byterun/coq_interp.c index 792a311fcf..47df22807f 100644 --- a/kernel/byterun/coq_interp.c +++ b/kernel/byterun/coq_interp.c @@ -23,7 +23,7 @@ #include "coq_values.h" /* spiwack: I append here a few macros for value/number manipulation */ -#define uint32_of_value(val) (((uint32_t)val >> 1)) +#define uint32_of_value(val) ((uint32_t)(val) >> 1) #define value_of_uint32(i) ((value)(((uint32_t)(i) << 1) | 1)) #define UI64_of_uint32(lo) ((uint64_t)(lo)) #define UI64_of_value(val) (UI64_of_uint32(uint32_of_value(val))) @@ -1206,7 +1206,7 @@ value coq_interprete Alloc_small(accu, 2, 1); /* ( _ , arity, tag ) */ /*unsigned shift*/ Field(accu, 0) = (value)((p >> 31)|1) ; /*higher part*/ - Field(accu, 1) = (value)((int32_t)p|1); /*lower part*/ + Field(accu, 1) = (value)((uint32_t)p|1); /*lower part*/ } Next; } -- cgit v1.2.3 From 9ddae1778aef70c55a1347c4d0b28694cf34a5af Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Thu, 24 Nov 2016 13:39:06 +0100 Subject: Fix some documentation typos. --- ide/utils/configwin_keys.ml | 2 +- parsing/pcoq.mli | 8 ++++---- theories/Numbers/BigNumPrelude.v | 4 ++-- theories/Strings/Ascii.v | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ide/utils/configwin_keys.ml b/ide/utils/configwin_keys.ml index 9f44e5c6be..e9b19da621 100644 --- a/ide/utils/configwin_keys.ml +++ b/ide/utils/configwin_keys.ml @@ -154,7 +154,7 @@ let xk_KP_9 = 0xFFB9 (* - * Auxilliary Functions; note the duplicate definitions for left and right + * Auxiliary Functions; note the duplicate definitions for left and right * function keys; Sun keyboards and a few other manufactures have such * function key groups on the left and/or right sides of the keyboard. * We've not found a keyboard with more than 35 function keys total. diff --git a/parsing/pcoq.mli b/parsing/pcoq.mli index ec8dac8210..37165f6ceb 100644 --- a/parsing/pcoq.mli +++ b/parsing/pcoq.mli @@ -39,7 +39,7 @@ module Gram : module type of Compat.GrammarMake(CLexer) | (together with a constr entry level, e.g. 50, and indications of) | (subentries, e.g. x in constr next level and y constr same level) | - | spliting into tokens by Metasyntax.split_notation_string + | splitting into tokens by Metasyntax.split_notation_string V [String "x"; String "+"; String "y"] : symbol_token list | @@ -96,7 +96,7 @@ module Gram : module type of Compat.GrammarMake(CLexer) *) -(** Temporary activate camlp4 verbosity *) +(** Temporarily activate camlp4 verbosity *) val camlp4_verbosity : bool -> ('a -> unit) -> 'a -> unit @@ -232,14 +232,14 @@ type gram_reinit = gram_assoc * gram_position val grammar_extend : 'a Gram.entry -> gram_reinit option -> 'a Extend.extend_statment -> unit -(** Extend the grammar of Coq, without synchronizing it with the bactracking +(** Extend the grammar of Coq, without synchronizing it with the backtracking mechanism. This means that grammar extensions defined this way will survive an undo. *) (** {5 Extending the parser with summary-synchronized commands} *) module GramState : Store.S -(** Auxilliary state of the grammar. Any added data must be marshallable. *) +(** Auxiliary state of the grammar. Any added data must be marshallable. *) type 'a grammar_command (** Type of synchronized parsing extensions. The ['a] type should be diff --git a/theories/Numbers/BigNumPrelude.v b/theories/Numbers/BigNumPrelude.v index 45a7527c97..bd8930872c 100644 --- a/theories/Numbers/BigNumPrelude.v +++ b/theories/Numbers/BigNumPrelude.v @@ -10,7 +10,7 @@ (** * BigNumPrelude *) -(** Auxillary functions & theorems used for arbitrary precision efficient +(** Auxiliary functions & theorems used for arbitrary precision efficient numbers. *) @@ -22,7 +22,7 @@ Require Export Zpow_facts. Declare ML Module "numbers_syntax_plugin". (* *** Nota Bene *** - All results that were general enough has been moved in ZArith. + All results that were general enough have been moved in ZArith. Only remain here specialized lemmas and compatibility elements. (P.L. 5/11/2007). *) diff --git a/theories/Strings/Ascii.v b/theories/Strings/Ascii.v index 97cb746f37..55a533c55a 100644 --- a/theories/Strings/Ascii.v +++ b/theories/Strings/Ascii.v @@ -40,7 +40,7 @@ Defined. (** * Conversion between natural numbers modulo 256 and ascii characters *) -(** Auxillary function that turns a positive into an ascii by +(** Auxiliary function that turns a positive into an ascii by looking at the last 8 bits, ie z mod 2^8 *) Definition ascii_of_pos : positive -> ascii := -- cgit v1.2.3 From b16de62d20790930589795c3d10fbb07185ec22c Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Thu, 24 Nov 2016 14:02:41 +0100 Subject: Lazily load constants in micromega (bug #5134). --- plugins/micromega/coq_micromega.ml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/micromega/coq_micromega.ml b/plugins/micromega/coq_micromega.ml index a063cbbfe3..e4b58a56f9 100644 --- a/plugins/micromega/coq_micromega.ml +++ b/plugins/micromega/coq_micromega.ml @@ -1517,27 +1517,27 @@ let rec apply_ids t ids = | [] -> t | i::ids -> apply_ids (Term.mkApp(t,[| Term.mkVar i |])) ids -let coq_Node = +let coq_Node = lazy (Coqlib.gen_constant_in_modules "VarMap" [["Coq" ; "micromega" ; "VarMap"];["VarMap"]] "Node") -let coq_Leaf = +let coq_Leaf = lazy (Coqlib.gen_constant_in_modules "VarMap" [["Coq" ; "micromega" ; "VarMap"];["VarMap"]] "Leaf") -let coq_Empty = +let coq_Empty = lazy (Coqlib.gen_constant_in_modules "VarMap" [["Coq" ; "micromega" ;"VarMap"];["VarMap"]] "Empty") -let coq_VarMap = +let coq_VarMap = lazy (Coqlib.gen_constant_in_modules "VarMap" [["Coq" ; "micromega" ; "VarMap"] ; ["VarMap"]] "t") let rec dump_varmap typ m = match m with - | Mc.Empty -> Term.mkApp(coq_Empty,[| typ |]) - | Mc.Leaf v -> Term.mkApp(coq_Leaf,[| typ; v|]) - | Mc.Node(l,o,r) -> - Term.mkApp (coq_Node, [| typ; dump_varmap typ l; o ; dump_varmap typ r |]) + | Mc.Empty -> Term.mkApp(Lazy.force coq_Empty,[| typ |]) + | Mc.Leaf v -> Term.mkApp(Lazy.force coq_Leaf,[| typ; v|]) + | Mc.Node(l,o,r) -> + Term.mkApp (Lazy.force coq_Node, [| typ; dump_varmap typ l; o ; dump_varmap typ r |]) let vm_of_list env = @@ -1709,7 +1709,7 @@ let micromega_order_change spec cert cert_typ env ff (*: unit Proofview.tactic* (set [ ("__ff", ff, Term.mkApp(Lazy.force coq_Formula, [|formula_typ |])); - ("__varmap", vm, Term.mkApp( coq_VarMap, [|spec.typ|])); + ("__varmap", vm, Term.mkApp(Lazy.force coq_VarMap, [|spec.typ|])); ("__wit", cert, cert_typ) ] (Tacmach.pf_concl gl)) -- cgit v1.2.3 From a27ac0315dcbb99c64a260bac3988199a26b39cf Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Thu, 24 Nov 2016 15:14:19 +0100 Subject: Fix some documentation typos. Note: "dependant" does exist, but it is a noun and it means a person that is somehow financially dependent on someone else. --- CHANGES | 4 ++-- config/coq_config.mli | 4 ++-- dev/doc/notes-on-conversion | 2 +- doc/faq/FAQ.tex | 4 ++-- lib/profile.ml | 6 +++--- proofs/proof_global.ml | 2 +- theories/FSets/FMapList.v | 2 +- theories/FSets/FMapWeakList.v | 2 +- theories/FSets/FSetList.v | 2 +- theories/FSets/FSetWeakList.v | 2 +- theories/MSets/MSetList.v | 2 +- theories/MSets/MSetWeakList.v | 2 +- toplevel/vernacentries.ml | 4 ++-- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGES b/CHANGES index 984e91946b..ecbf82e69d 100644 --- a/CHANGES +++ b/CHANGES @@ -1130,7 +1130,7 @@ Extraction instead of accessing their body, they are now considered as axioms. The previous behaviour can be reactivated via the option "Set Extraction AccessOpaque". -- The pretty-printer for Haskell now produces layout-independant code +- The pretty-printer for Haskell now produces layout-independent code - A new command "Separate Extraction cst1 cst2 ..." that mixes a minimal extracted environment a la "Recursive Extraction" and the production of several files (one per coq source) a la "Extraction Library" @@ -1815,7 +1815,7 @@ Tactics Moreover, romega now has a variant "romega with *" that can be also used on non-Z goals (nat, N, positive) via a call to a translation tactic named zify (its purpose is to Z-ify your goal...). This zify may also be used - independantly of romega. + independently of romega. - Tactic "remember" now supports an "in" clause to remember only selected occurrences of a term. - Tactic "pose proof" supports name overwriting in case of specialization of an diff --git a/config/coq_config.mli b/config/coq_config.mli index 6087c01169..c171bd3553 100644 --- a/config/coq_config.mli +++ b/config/coq_config.mli @@ -32,7 +32,7 @@ val cflags : string (* arguments passed to gcc *) val best : string (* byte/opt *) val arch : string (* architecture *) val arch_is_win32 : bool -val osdeplibs : string (* OS dependant link options for ocamlc *) +val osdeplibs : string (* OS dependent link options for ocamlc *) val vmbyteflags : string list (* -custom/-dllib -lcoqrun *) @@ -51,7 +51,7 @@ val exec_extension : string (* "" under Unix, ".exe" under MS-windows *) val with_geoproof : bool ref (* to (de)activate functions specific to Geoproof with Coqide *) val browser : string -(** default web browser to use, may be overriden by environment +(** default web browser to use, may be overridden by environment variable COQREMOTEBROWSER *) val has_coqide : string diff --git a/dev/doc/notes-on-conversion b/dev/doc/notes-on-conversion index 6274275c9d..a81f170c63 100644 --- a/dev/doc/notes-on-conversion +++ b/dev/doc/notes-on-conversion @@ -21,7 +21,7 @@ Notation OMEGA := (ack 4 4). Definition f (x:nat) := x. -(* Evaluation in tactics can somehow be controled *) +(* Evaluation in tactics can somehow be controlled *) Lemma l1 : OMEGA = OMEGA. reflexivity. (* succeed: identity *) Qed. (* succeed: identity *) diff --git a/doc/faq/FAQ.tex b/doc/faq/FAQ.tex index 48b61827d1..213fb03137 100644 --- a/doc/faq/FAQ.tex +++ b/doc/faq/FAQ.tex @@ -2587,8 +2587,8 @@ It is the language of commands of Gallina i.e. definitions, lemmas, {\ldots} \Question{What is a dependent type?} -A dependant type is a type which depends on some term. For instance -``vector of size n'' is a dependant type representing all the vectors +A dependent type is a type which depends on some term. For instance +``vector of size n'' is a dependent type representing all the vectors of size $n$. Its type depends on $n$ \Question{What is a proof by reflection?} diff --git a/lib/profile.ml b/lib/profile.ml index 0910db3fe2..d620fe69c4 100644 --- a/lib/profile.ml +++ b/lib/profile.ml @@ -146,9 +146,9 @@ let merge_profile filename (curr_table, curr_outside, curr_total as new_data) = number of allocated bytes may exceed the maximum integer capacity (2^31 on 32-bits architectures); therefore, allocation is measured by small steps, total allocations are computed by adding elementary - measures and carries are controled from step to step *) + measures and carries are controlled from step to step *) -(* Unix measure of time is approximative and shoitt delays are often +(* Unix measure of time is approximate and short delays are often unperceivable; therefore, total times are measured in one (big) step to avoid rounding errors and to get the best possible approximation. @@ -358,7 +358,7 @@ let declare_profile name = prof_table := (name,e)::!prof_table; e -(* Default initialisation, may be overriden *) +(* Default initialization, may be overridden *) let _ = init_profile () (******************************) diff --git a/proofs/proof_global.ml b/proofs/proof_global.ml index 7605f63872..e753e972da 100644 --- a/proofs/proof_global.ml +++ b/proofs/proof_global.ml @@ -617,7 +617,7 @@ module Bullet = struct let _ = register_behavior strict end - (* Current bullet behavior, controled by the option *) + (* Current bullet behavior, controlled by the option *) let current_behavior = ref Strict.strict let _ = diff --git a/theories/FSets/FMapList.v b/theories/FSets/FMapList.v index 13cb559b99..5acdb7eb7e 100644 --- a/theories/FSets/FMapList.v +++ b/theories/FSets/FMapList.v @@ -8,7 +8,7 @@ (** * Finite map library *) -(** This file proposes an implementation of the non-dependant interface +(** This file proposes an implementation of the non-dependent interface [FMapInterface.S] using lists of pairs ordered (increasing) with respect to left projection. *) diff --git a/theories/FSets/FMapWeakList.v b/theories/FSets/FMapWeakList.v index 0f11dd7a53..130cbee871 100644 --- a/theories/FSets/FMapWeakList.v +++ b/theories/FSets/FMapWeakList.v @@ -8,7 +8,7 @@ (** * Finite map library *) -(** This file proposes an implementation of the non-dependant interface +(** This file proposes an implementation of the non-dependent interface [FMapInterface.WS] using lists of pairs, unordered but without redundancy. *) Require Import FMapInterface. diff --git a/theories/FSets/FSetList.v b/theories/FSets/FSetList.v index 1f36306c34..9c3ec71ae3 100644 --- a/theories/FSets/FSetList.v +++ b/theories/FSets/FSetList.v @@ -8,7 +8,7 @@ (** * Finite sets library *) -(** This file proposes an implementation of the non-dependant +(** This file proposes an implementation of the non-dependent interface [FSetInterface.S] using strictly ordered list. *) Require Export FSetInterface. diff --git a/theories/FSets/FSetWeakList.v b/theories/FSets/FSetWeakList.v index 2ea32e97cb..9dbea88495 100644 --- a/theories/FSets/FSetWeakList.v +++ b/theories/FSets/FSetWeakList.v @@ -8,7 +8,7 @@ (** * Finite sets library *) -(** This file proposes an implementation of the non-dependant +(** This file proposes an implementation of the non-dependent interface [FSetInterface.WS] using lists without redundancy. *) Require Import FSetInterface. diff --git a/theories/MSets/MSetList.v b/theories/MSets/MSetList.v index fb0d1ad9df..05c20eb8fa 100644 --- a/theories/MSets/MSetList.v +++ b/theories/MSets/MSetList.v @@ -8,7 +8,7 @@ (** * Finite sets library *) -(** This file proposes an implementation of the non-dependant +(** This file proposes an implementation of the non-dependent interface [MSetInterface.S] using strictly ordered list. *) Require Export MSetInterface OrdersFacts OrdersLists. diff --git a/theories/MSets/MSetWeakList.v b/theories/MSets/MSetWeakList.v index 372acd56ad..2ac57a932b 100644 --- a/theories/MSets/MSetWeakList.v +++ b/theories/MSets/MSetWeakList.v @@ -8,7 +8,7 @@ (** * Finite sets library *) -(** This file proposes an implementation of the non-dependant +(** This file proposes an implementation of the non-dependent interface [MSetWeakInterface.S] using lists without redundancy. *) Require Import MSetInterface. diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index 230e62607a..41ee165ff8 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -1127,7 +1127,7 @@ let vernac_arguments locality reference args more_implicits nargs_for_red flags (* Parts of this code are overly complicated because the implicit arguments API is completely crazy: positions (ExplByPos) are elaborated to names. This is broken by design, since not all arguments have names. So - eventhough we eventually want to map only positions to implicit statuses, + even though we eventually want to map only positions to implicit statuses, we have to check whether the corresponding arguments have names, not to trigger an error in the impargs code. Even better, the names we have to check are not the current ones (after previous renamings), but the original @@ -2135,7 +2135,7 @@ let enforce_polymorphism = function | None -> Flags.is_universe_polymorphism () | Some b -> Flags.make_polymorphic_flag b; b -(** A global default timeout, controled by option "Set Default Timeout n". +(** A global default timeout, controlled by option "Set Default Timeout n". Use "Unset Default Timeout" to deactivate it (or set it to 0). *) let default_timeout = ref None -- cgit v1.2.3 From 3642314974b3aca6eb522c37e7e4efd226e6ebc8 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Tue, 29 Nov 2016 17:50:11 +0100 Subject: STM: cur_id must be invalid if an error occurs (fix #5191) Line erroneously removed in 17f3346c --- stm/stm.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/stm/stm.ml b/stm/stm.ml index e387e6322f..b4331dc460 100644 --- a/stm/stm.ml +++ b/stm/stm.ml @@ -896,6 +896,7 @@ end = struct (* {{{ *) with e -> let (e, info) = CErrors.push e in let good_id = !cur_id in + cur_id := Stateid.dummy; VCS.reached id; let ie = match Stateid.get info, safe_id with -- cgit v1.2.3 From 89fc7443d2e35f5020d272faecc4fe1f6e12eb11 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Tue, 29 Nov 2016 11:37:24 +0100 Subject: Fix #5174: Underinformative syntax error messages in the new arguments syntax We introduce a bit of compatibility parsing code to print deprecation warnings. --- parsing/g_vernac.ml4 | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/parsing/g_vernac.ml4 b/parsing/g_vernac.ml4 index 9b52d1bf31..e61be53a99 100644 --- a/parsing/g_vernac.ml4 +++ b/parsing/g_vernac.ml4 @@ -582,9 +582,9 @@ let warn_deprecated_implicit_arguments = let warn_deprecated_arguments_syntax = CWarnings.create ~name:"deprecated-arguments-syntax" ~category:"deprecated" - (fun () -> strbrk "The \"/\" modifier has an effect only in the first " - ++ strbrk "arguments list. The syntax allowing it to appear" - ++ strbrk " in other lists is deprecated.") + (fun () -> strbrk "The \"/\" and \"!\" modifiers have an effect only " + ++ strbrk "in the first arguments list. The syntax allowing" + ++ strbrk " them to appear in other lists is deprecated.") (* Extensions: implicits, coercions, etc. *) GEXTEND Gram @@ -664,8 +664,8 @@ GEXTEND Gram more_implicits = OPT [ ","; impl = LIST1 [ impl = LIST0 more_implicits_block -> - let warn_slash = List.exists fst impl in - if warn_slash then warn_deprecated_arguments_syntax ~loc:!@loc (); + let warn_deprecated = List.exists fst impl in + if warn_deprecated then warn_deprecated_arguments_syntax ~loc:!@loc (); List.flatten (List.map snd impl)] SEP "," -> impl ]; @@ -776,14 +776,19 @@ GEXTEND Gram implicit_status = MaximallyImplicit}) items ] ]; + name_or_bang: [ + [ b = OPT "!"; id = name -> + not (Option.is_empty b), id + ] + ]; (* Same as [argument_spec_block], but with only implicit status and names *) more_implicits_block: [ - [ name = name -> (false, [(snd name, Vernacexpr.NotImplicit)]) + [ (bang,name) = name_or_bang -> (bang, [(snd name, Vernacexpr.NotImplicit)]) | "/" -> (true (* Should warn about deprecated syntax *), []) - | "["; items = LIST1 name; "]" -> - (false, List.map (fun name -> (snd name, Vernacexpr.Implicit)) items) - | "{"; items = LIST1 name; "}" -> - (false, List.map (fun name -> (snd name, Vernacexpr.MaximallyImplicit)) items) + | "["; items = LIST1 name_or_bang; "]" -> + (List.exists fst items, List.map (fun (_,(_,name)) -> (name, Vernacexpr.Implicit)) items) + | "{"; items = LIST1 name_or_bang; "}" -> + (List.exists fst items, List.map (fun (_,(_,name)) -> (name, Vernacexpr.MaximallyImplicit)) items) ] ]; strategy_level: -- cgit v1.2.3 From b6a70501e7ba46d556288abc5c3c81399a280e26 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Tue, 29 Nov 2016 16:29:24 +0100 Subject: Update copyright on documentation cover. --- doc/common/styles/html/coqremote/cover.html | 1 + doc/common/styles/html/simple/cover.html | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/common/styles/html/coqremote/cover.html b/doc/common/styles/html/coqremote/cover.html index 6ec4dc1af0..1c415eca69 100644 --- a/doc/common/styles/html/coqremote/cover.html +++ b/doc/common/styles/html/coqremote/cover.html @@ -61,6 +61,7 @@
  • V8.3 © INRIA 2010-2011
  • V8.4 © INRIA 2012-2014
  • V8.5 © INRIA 2015-2016
  • +
  • V8.6 © INRIA 2016
  • This research was partly supported by IST diff --git a/doc/common/styles/html/simple/cover.html b/doc/common/styles/html/simple/cover.html index 328bd68daf..25fb56320b 100644 --- a/doc/common/styles/html/simple/cover.html +++ b/doc/common/styles/html/simple/cover.html @@ -39,6 +39,7 @@

  • V8.3 © INRIA 2010-2011
  • V8.4 © INRIA 2012-2014
  • V8.5 © INRIA 2015-2016
  • +
  • V8.6 © INRIA 2016
  • This research was partly supported by IST -- cgit v1.2.3 From 3e6fa1cbdc0ec145728089000595b6ea29f37a4c Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Tue, 29 Nov 2016 16:35:56 +0100 Subject: Fix #5183 - Two CoqIDE crash errors When opening a file without extension, an uncaught exception was occurring. Note that this fix is not complete, since the "Compile Buffer" command still fails. This is because of a limitation of coqc which appends the ".v" extension to its argument even if it already existed (and even if it doesn't exist with the extension!). --- lib/aux_file.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/aux_file.ml b/lib/aux_file.ml index c6c7b42429..0f0f09aa23 100644 --- a/lib/aux_file.ml +++ b/lib/aux_file.ml @@ -17,6 +17,10 @@ let version = 1 let oc = ref None +let chop_extension f = + if check_suffix f ".v" then chop_extension f + else f + let aux_file_name_for vfile = dirname vfile ^ "/." ^ chop_extension(basename vfile) ^ ".aux" -- cgit v1.2.3 From 17559d528cf7ff92a089d1b966c500424ba45099 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Fri, 18 Nov 2016 13:24:39 +0100 Subject: Slightly more efficient [Univ.super] implem --- kernel/univ.ml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/kernel/univ.ml b/kernel/univ.ml index 9224ec48d7..c863fac0eb 100644 --- a/kernel/univ.ml +++ b/kernel/univ.ml @@ -471,12 +471,17 @@ struct let super (u,n as x) (v,n' as y) = let cmp = Level.compare u v in - if Int.equal cmp 0 then - if n < n' then Inl true - else Inl false - else if is_prop x then Inl true - else if is_prop y then Inl false - else Inr cmp + if Int.equal cmp 0 then Inl (n < n') + else + match x, y with + | (l,0), (l',0) -> + let open RawLevel in + (match Level.data l, Level.data l' with + | Prop, Prop -> Inl false + | Prop, _ -> Inl true + | _, Prop -> Inl false + | _, _ -> Inr cmp) + | _, _ -> Inr cmp let to_string (v, n) = if Int.equal n 0 then Level.to_string v -- cgit v1.2.3 From 25c82d55497db43bf2cd131f10d2ef366758bbe1 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Fri, 18 Nov 2016 13:25:05 +0100 Subject: Fix UGraph.check_eq! Universes are kept in normal form w.r.t. equality but not the <= relation, so the previous check worked almost always but was actually too strict! In cases like (max(Set,u) = u) when u is declared >= Set it was failing to find an equality. Applying the KISS principle: u = v <-> u <= v /\ v <= u. Fix invariant breakage that triggered the discovery of the check_eq bug as well. No algebraic universes should appear in a term position (on the left of a colon in a typing judgment), this was not the case when an algebraic universe instantiated an evar that appeared in the term. We force their universe variable status to change in refresh_universes to avoid this. Fix ind sort inference: Use syntactic universe equality for inductive sort inference instead of check_leq (which now correctly takes constraints into account) and simplify code --- engine/evd.ml | 7 ++ engine/evd.mli | 3 +- kernel/uGraph.ml | 21 ++-- pretyping/cases.ml | 11 +- pretyping/cases.mli | 5 +- pretyping/evarsolve.ml | 41 ++++---- test-suite/bugs/closed/5208.v | 222 +++++++++++++++++++++++++++++++++++++++++ test-suite/success/Inductive.v | 21 ++++ toplevel/command.ml | 8 +- 9 files changed, 294 insertions(+), 45 deletions(-) create mode 100644 test-suite/bugs/closed/5208.v diff --git a/engine/evd.ml b/engine/evd.ml index aa91fc5222..a6b6f742b7 100644 --- a/engine/evd.ml +++ b/engine/evd.ml @@ -854,6 +854,13 @@ let is_eq_sort s1 s2 = if Univ.Universe.equal u1 u2 then None else Some (u1, u2) +(* Precondition: l is not defined in the substitution *) +let universe_rigidity evd l = + let uctx = evd.universes in + if Univ.LSet.mem l (Univ.ContextSet.levels (UState.context_set uctx)) then + UnivFlexible (Univ.LSet.mem l (UState.algebraics uctx)) + else UnivRigid + let normalize_universe evd = let vars = ref (UState.subst evd.universes) in let normalize = Universes.normalize_universe_opt_subst vars in diff --git a/engine/evd.mli b/engine/evd.mli index b47b389d1b..89dcd92cee 100644 --- a/engine/evd.mli +++ b/engine/evd.mli @@ -514,7 +514,8 @@ val new_univ_variable : ?loc:Loc.t -> ?name:string -> rigid -> evar_map -> evar_ val new_sort_variable : ?loc:Loc.t -> ?name:string -> rigid -> evar_map -> evar_map * sorts val add_global_univ : evar_map -> Univ.Level.t -> evar_map - + +val universe_rigidity : evar_map -> Univ.Level.t -> rigid val make_flexible_variable : evar_map -> bool -> Univ.universe_level -> evar_map val is_sort_variable : evar_map -> sorts -> Univ.universe_level option (** [is_sort_variable evm s] returns [Some u] or [None] if [s] is diff --git a/kernel/uGraph.ml b/kernel/uGraph.ml index e2712615be..4884d0deb1 100644 --- a/kernel/uGraph.ml +++ b/kernel/uGraph.ml @@ -638,19 +638,6 @@ let check_smaller g strict u v = type 'a check_function = universes -> 'a -> 'a -> bool -let check_equal_expr g x y = - x == y || (let (u, n) = x and (v, m) = y in - Int.equal n m && check_equal g u v) - -let check_eq_univs g l1 l2 = - let f x1 x2 = check_equal_expr g x1 x2 in - let exists x1 l = Universe.exists (fun x2 -> f x1 x2) l in - Universe.for_all (fun x1 -> exists x1 l2) l1 - && Universe.for_all (fun x2 -> exists x2 l1) l2 - -let check_eq g u v = - Universe.equal u v || check_eq_univs g u v - let check_smaller_expr g (u,n) (v,m) = let diff = n - m in match diff with @@ -669,7 +656,13 @@ let real_check_leq g u v = let check_leq g u v = Universe.equal u v || is_type0m_univ u || - check_eq_univs g u v || real_check_leq g u v + real_check_leq g u v + +let check_eq_univs g l1 l2 = + real_check_leq g l1 l2 && real_check_leq g l2 l1 + +let check_eq g u v = + Universe.equal u v || check_eq_univs g u v (* enforce_univ_eq g u v will force u=v if possible, will fail otherwise *) diff --git a/pretyping/cases.ml b/pretyping/cases.ml index aa24733d9f..27c1dd0316 100644 --- a/pretyping/cases.ml +++ b/pretyping/cases.ml @@ -1934,14 +1934,19 @@ let prepare_predicate_from_arsign_tycon env sigma loc tomatchs arsign c = *) let prepare_predicate loc typing_fun env sigma tomatchs arsign tycon pred = + let refresh_tycon sigma t = + refresh_universes ~status:Evd.univ_flexible ~onlyalg:true (Some true) + env sigma t + in let preds = match pred, tycon with (* No return clause *) | None, Some t when not (noccur_with_meta 0 max_int t) -> (* If the tycon is not closed w.r.t real variables, we try *) (* two different strategies *) - (* First strategy: we abstract the tycon wrt to the dependencies *) - let p1 = + (* First strategy: we abstract the tycon wrt to the dependencies *) + let sigma, t = refresh_tycon sigma t in + let p1 = prepare_predicate_from_arsign_tycon env sigma loc tomatchs arsign t in (* Second strategy: we build an "inversion" predicate *) let sigma2,pred2 = build_inversion_problem loc env sigma tomatchs t in @@ -1952,7 +1957,7 @@ let prepare_predicate loc typing_fun env sigma tomatchs arsign tycon pred = (* No dependent type constraint, or no constraints at all: *) (* we use two strategies *) let sigma,t = match tycon with - | Some t -> sigma,t + | Some t -> refresh_tycon sigma t | None -> let sigma = Sigma.Unsafe.of_evar_map sigma in let Sigma ((t, _), sigma, _) = diff --git a/pretyping/cases.mli b/pretyping/cases.mli index ba566f3744..ee4148de64 100644 --- a/pretyping/cases.mli +++ b/pretyping/cases.mli @@ -114,10 +114,11 @@ val compile : 'a pattern_matching_problem -> Environ.unsafe_judgment val prepare_predicate : Loc.t -> (Evarutil.type_constraint -> - Environ.env -> Evd.evar_map ref -> 'a -> Environ.unsafe_judgment) -> + Environ.env -> Evd.evar_map ref -> glob_constr -> Environ.unsafe_judgment) -> Environ.env -> Evd.evar_map -> (Term.types * tomatch_type) list -> Context.Rel.t list -> Constr.constr option -> - 'a option -> (Evd.evar_map * Names.name list * Term.constr) list + glob_constr option -> + (Evd.evar_map * Names.name list * Term.constr) list diff --git a/pretyping/evarsolve.ml b/pretyping/evarsolve.ml index f0aa9b564f..02e10d7fc1 100644 --- a/pretyping/evarsolve.ml +++ b/pretyping/evarsolve.ml @@ -42,33 +42,34 @@ let get_polymorphic_positions f = templ.template_param_levels) | _ -> assert false -let refresh_level evd s = - match Evd.is_sort_variable evd s with - | None -> true - | Some l -> not (Evd.is_flexible_level evd l) - let refresh_universes ?(status=univ_rigid) ?(onlyalg=false) ?(refreshset=false) pbty env evd t = let evdref = ref evd in let modified = ref false in - let rec refresh status dir t = - match kind_of_term t with - | Sort (Type u as s) when - (match Univ.universe_level u with - | None -> true - | Some l -> not onlyalg && refresh_level evd s) -> + let refresh_sort status dir s = let s' = evd_comb0 (new_sort_variable status) evdref in let evd = if dir then set_leq_sort env !evdref s' s else set_leq_sort env !evdref s s' in - modified := true; evdref := evd; mkSort s' + modified := true; evdref := evd; mkSort s' + in + let rec refresh onlyalg status dir t = + match kind_of_term t with + | Sort (Type u as s) -> + (match Univ.universe_level u with + | None -> refresh_sort status dir s + | Some l -> + (match Evd.universe_rigidity evd l with + | UnivRigid -> if not onlyalg then refresh_sort status dir s else t + | UnivFlexible alg -> + if onlyalg && alg then + (evdref := Evd.make_flexible_variable !evdref false l; t) + else t)) | Sort (Prop Pos as s) when refreshset && not dir -> - let s' = evd_comb0 (new_sort_variable status) evdref in - let evd = set_leq_sort env !evdref s s' in - modified := true; evdref := evd; mkSort s' + refresh_sort status dir s | Prod (na,u,v) -> - mkProd (na,u,refresh status dir v) + mkProd (na, u, refresh onlyalg status dir v) | _ -> t (** Refresh the types of evars under template polymorphic references *) and refresh_term_evars onevars top t = @@ -81,7 +82,7 @@ let refresh_universes ?(status=univ_rigid) ?(onlyalg=false) ?(refreshset=false) Array.iter (refresh_term_evars onevars false) args | Evar (ev, a) when onevars -> let evi = Evd.find !evdref ev in - let ty' = refresh univ_flexible true evi.evar_concl in + let ty' = refresh onlyalg univ_flexible true evi.evar_concl in if !modified then evdref := Evd.add !evdref ev {evi with evar_concl = ty'} else () @@ -101,9 +102,9 @@ let refresh_universes ?(status=univ_rigid) ?(onlyalg=false) ?(refreshset=false) in let t' = if isArity t then - (match pbty with - | None -> t - | Some dir -> refresh status dir t) + match pbty with + | None -> refresh true univ_flexible false t + | Some dir -> refresh onlyalg status dir t else (refresh_term_evars false true t; t) in if !modified then !evdref, t' else !evdref, t diff --git a/test-suite/bugs/closed/5208.v b/test-suite/bugs/closed/5208.v new file mode 100644 index 0000000000..b7a684a27c --- /dev/null +++ b/test-suite/bugs/closed/5208.v @@ -0,0 +1,222 @@ +Require Import Program. + +Require Import Coq.Strings.String. +Require Import Coq.Strings.Ascii. +Require Import Coq.Numbers.BinNums. + +Set Implicit Arguments. +Set Strict Implicit. +Set Universe Polymorphism. +Set Printing Universes. + +Local Open Scope positive. + +Definition field : Type := positive. + +Section poly. + Universe U. + + Inductive fields : Type := + | pm_Leaf : fields + | pm_Branch : fields -> option Type@{U} -> fields -> fields. + + Definition fields_left (f : fields) : fields := + match f with + | pm_Leaf => pm_Leaf + | pm_Branch l _ _ => l + end. + + Definition fields_right (f : fields) : fields := + match f with + | pm_Leaf => pm_Leaf + | pm_Branch _ _ r => r + end. + + Definition fields_here (f : fields) : option Type@{U} := + match f with + | pm_Leaf => None + | pm_Branch _ s _ => s + end. + + Fixpoint fields_get (p : field) (m : fields) {struct p} : option Type@{U} := + match p with + | xH => match m with + | pm_Leaf => None + | pm_Branch _ x _ => x + end + | xO p' => fields_get p' match m with + | pm_Leaf => pm_Leaf + | pm_Branch L _ _ => L + end + | xI p' => fields_get p' match m with + | pm_Leaf => pm_Leaf + | pm_Branch _ _ R => R + end + end. + + Definition fields_leaf : fields := pm_Leaf. + + Inductive member (val : Type@{U}) : fields -> Type := + | pmm_H : forall L R, member val (pm_Branch L (Some val) R) + | pmm_L : forall (V : option Type@{U}) L R, member val L -> member val (pm_Branch L V R) + | pmm_R : forall (V : option Type@{U}) L R, member val R -> member val (pm_Branch L V R). + Arguments pmm_H {_ _ _}. + Arguments pmm_L {_ _ _ _} _. + Arguments pmm_R {_ _ _ _} _. + + Fixpoint get_member (val : Type@{U}) p {struct p} + : forall m, fields_get p m = @Some Type@{U} val -> member val m := + match p as p return forall m, fields_get p m = @Some Type@{U} val -> member@{U} val m with + | xH => fun m => + match m as m return fields_get xH m = @Some Type@{U} val -> member@{U} val m with + | pm_Leaf => fun pf : None = @Some Type@{U} _ => + match pf in _ = Z return match Z with + | Some _ => _ + | None => unit + end + with + | eq_refl => tt + end + | pm_Branch _ None _ => fun pf : None = @Some Type@{U} _ => + match pf in _ = Z return match Z with + | Some _ => _ + | None => unit + end + with + | eq_refl => tt + end + | pm_Branch _ (Some x) _ => fun pf : @Some Type@{U} x = @Some Type@{U} val => + match eq_sym pf in _ = Z return member@{U} val (pm_Branch _ Z _) with + | eq_refl => pmm_H + end + end + | xO p' => fun m => + match m as m return fields_get (xO p') m = @Some Type@{U} val -> member@{U} val m with + | pm_Leaf => fun pf : fields_get p' pm_Leaf = @Some Type@{U} val => + @get_member _ p' pm_Leaf pf + | pm_Branch l _ _ => fun pf : fields_get p' l = @Some Type@{U} val => + @pmm_L _ _ _ _ (@get_member _ p' l pf) + end + | xI p' => fun m => + match m as m return fields_get (xI p') m = @Some Type@{U} val -> member@{U} val m with + | pm_Leaf => fun pf : fields_get p' pm_Leaf = @Some Type@{U} val => + @get_member _ p' pm_Leaf pf + | pm_Branch l _ r => fun pf : fields_get p' r = @Some Type@{U} val => + @pmm_R _ _ _ _ (@get_member _ p' r pf) + end + end. + + Inductive record : fields -> Type := + | pr_Leaf : record pm_Leaf + | pr_Branch : forall L R (V : option Type@{U}), + record L -> + match V return Type@{U} with + | None => unit + | Some t => t + end -> + record R -> + record (pm_Branch L V R). + + + Definition record_left {L} {V : option Type@{U}} {R} + (r : record (pm_Branch L V R)) : record L := + match r in record z + return match z with + | pm_Branch L _ _ => record L + | _ => unit + end + with + | pr_Branch _ l _ _ => l + | pr_Leaf => tt + end. +Set Printing All. + Definition record_at {L} {V : option Type@{U}} {R} (r : record (pm_Branch L V R)) + : match V return Type@{U} with + | None => unit + | Some t => t + end := + match r in record z + return match z (* return ?X *) with + | pm_Branch _ V _ => match V return Type@{U} with + | None => unit + | Some t => t + end + | _ => unit + end + with + | pr_Branch _ _ v _ => v + | pr_Leaf => tt + end. + + Definition record_here {L : fields} (v : Type@{U}) {R : fields} + (r : record (pm_Branch L (@Some Type@{U} v) R)) : v := + match r in record z + return match z return Type@{U} with + | pm_Branch _ (Some v) _ => v + | _ => unit + end + with + | pr_Branch _ _ v _ => v + | pr_Leaf => tt + end. + + Definition record_right {L V R} (r : record (pm_Branch L V R)) : record R := + match r in record z return match z with + | pm_Branch _ _ R => record R + | _ => unit + end + with + | pr_Branch _ _ _ r => r + | pr_Leaf => tt + end. + + Fixpoint record_get {val : Type@{U}} {pm : fields} (m : member val pm) : record pm -> val := + match m in member _ pm return record pm -> val with + | pmm_H => fun r => record_here r + | pmm_L m' => fun r => record_get m' (record_left r) + | pmm_R m' => fun r => record_get m' (record_right r) + end. + + Fixpoint record_set {val : Type@{U}} {pm : fields} (m : member val pm) (x : val) {struct m} + : record pm -> record pm := + match m in member _ pm return record pm -> record pm with + | pmm_H => fun r => + pr_Branch (Some _) + (record_left r) + x + (record_right r) + | pmm_L m' => fun r => + pr_Branch _ + (record_set m' x (record_left r)) + (record_at r) + (record_right r) + | pmm_R m' => fun r => + pr_Branch _ (record_left r) + (record_at r) + (record_set m' x (record_right r)) + end. +End poly. +Axiom cheat : forall {A}, A. +Lemma record_get_record_set_different: + forall (T: Type) (vars: fields) + (pmr pmw: member T vars) + (diff: pmr <> pmw) + (r: record vars) (val: T), + record_get pmr (record_set pmw val r) = record_get pmr r. +Proof. + intros. + revert pmr diff r val. + induction pmw; simpl; intros. + - dependent destruction pmr. + + congruence. + + auto. + + auto. + - dependent destruction pmr. + + auto. + + simpl. apply IHpmw. congruence. + + auto. + - dependent destruction pmr. + + auto. + + auto. + + simpl. apply IHpmw. congruence. +Qed. diff --git a/test-suite/success/Inductive.v b/test-suite/success/Inductive.v index 9661b3bfac..f746def5cb 100644 --- a/test-suite/success/Inductive.v +++ b/test-suite/success/Inductive.v @@ -162,3 +162,24 @@ Inductive L (A:Type) (T:=A) : Type := C : L nat -> L A. hit the Inductiveops.get_arity bug mentioned above (see #3491) *) Inductive IND6 (A:Type) (T:=A) := CONS6 : IND6 T -> IND6 A. + + +Module TemplateProp. + + (** Check lowering of a template universe polymorphic inductive to Prop *) + + Inductive Foo (A : Type) : Type := foo : A -> Foo A. + + Check Foo True : Prop. + +End TemplateProp. + +Module PolyNoLowerProp. + + (** Check lowering of a general universe polymorphic inductive to Prop is _failing_ *) + + Polymorphic Inductive Foo (A : Type) : Type := foo : A -> Foo A. + + Fail Check Foo True : Prop. + +End PolyNoLowerProp. diff --git a/toplevel/command.ml b/toplevel/command.ml index 7ffe680e5e..ed3eac51b6 100644 --- a/toplevel/command.ml +++ b/toplevel/command.ml @@ -537,11 +537,9 @@ let inductive_levels env evdref poly arities inds = in let duu = Sorts.univ_of_sort du in let evd = - if not (Univ.is_small_univ duu) && Evd.check_eq evd cu duu then - if is_flexible_sort evd duu then - if Evd.check_leq evd Univ.type0_univ duu then - evd - else Evd.set_eq_sort env evd (Prop Null) du + if not (Univ.is_small_univ duu) && Univ.Universe.equal cu duu then + if is_flexible_sort evd duu && not (Evd.check_leq evd Univ.type0_univ duu) then + Evd.set_eq_sort env evd (Prop Null) du else evd else Evd.set_eq_sort env evd (Type cu) du in -- cgit v1.2.3 From d06211803146dec998b414d215d4d93190e2001f Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Mon, 28 Nov 2016 18:36:10 +0100 Subject: Univs: fix bug #5180 In the kernel's generic conversion, backtrack on UniverseInconsistency for the unfolding heuristic (single backtracking point in reduction). This exception can be raised in the univ_compare structure to produce better error messages when the generic conversion function is called from higher level code in reductionops.ml, which itself is called during unification in evarconv.ml. Inside the kernel, the infer and check variants of conversion never raise UniverseInconsistency though, so this does not change the behavior of the kernel. --- kernel/reduction.ml | 2 +- kernel/reduction.mli | 8 +++++- pretyping/reductionops.ml | 2 +- test-suite/bugs/closed/5180.v | 64 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 test-suite/bugs/closed/5180.v diff --git a/kernel/reduction.ml b/kernel/reduction.ml index 6c664f7918..1ae89347ad 100644 --- a/kernel/reduction.ml +++ b/kernel/reduction.ml @@ -316,7 +316,7 @@ and eqappr cv_pb l2r infos (lft1,st1) (lft2,st2) cuniv = (try let cuniv = conv_table_key infos fl1 fl2 cuniv in convert_stacks l2r infos lft1 lft2 v1 v2 cuniv - with NotConvertible -> + with NotConvertible | Univ.UniverseInconsistency _ -> (* else the oracle tells which constant is to be expanded *) let oracle = CClosure.oracle_of_infos infos in let (app1,app2) = diff --git a/kernel/reduction.mli b/kernel/reduction.mli index 9812c45f7b..8a2b2469d6 100644 --- a/kernel/reduction.mli +++ b/kernel/reduction.mli @@ -36,7 +36,7 @@ type 'a extended_conversion_function = type conv_pb = CONV | CUMUL type 'a universe_compare = - { (* Might raise NotConvertible *) + { (* Might raise NotConvertible or UnivInconsistency *) compare : env -> conv_pb -> sorts -> sorts -> 'a -> 'a; compare_instances: flex:bool -> Univ.Instance.t -> Univ.Instance.t -> 'a -> 'a; @@ -56,9 +56,12 @@ constructors. *) val convert_instances : flex:bool -> Univ.Instance.t -> Univ.Instance.t -> 'a * 'a universe_compare -> 'a * 'a universe_compare +(** These two never raise UnivInconsistency, inferred_universes + just gathers the constraints. *) val checked_universes : UGraph.t universe_compare val inferred_universes : (UGraph.t * Univ.Constraint.t) universe_compare +(** These two functions can only raise NotConvertible *) val conv : constr extended_conversion_function val conv_leq : types extended_conversion_function @@ -70,6 +73,9 @@ val infer_conv : ?l2r:bool -> ?evars:(existential->constr option) -> val infer_conv_leq : ?l2r:bool -> ?evars:(existential->constr option) -> ?ts:Names.transparent_state -> types infer_conversion_function +(** Depending on the universe state functions, this might raise + [UniverseInconsistency] in addition to [NotConvertible] (for better error + messages). *) val generic_conv : conv_pb -> l2r:bool -> (existential->constr option) -> Names.transparent_state -> (constr,'a) generic_conversion_function diff --git a/pretyping/reductionops.ml b/pretyping/reductionops.ml index 332d4e0b26..297f0a1a8e 100644 --- a/pretyping/reductionops.ml +++ b/pretyping/reductionops.ml @@ -1262,7 +1262,7 @@ let sigma_compare_sorts env pb s0 s1 sigma = match pb with | Reduction.CONV -> Evd.set_eq_sort env sigma s0 s1 | Reduction.CUMUL -> Evd.set_leq_sort env sigma s0 s1 - + let sigma_compare_instances ~flex i0 i1 sigma = try Evd.set_eq_instances ~flex sigma i0 i1 with Evd.UniversesDiffer diff --git a/test-suite/bugs/closed/5180.v b/test-suite/bugs/closed/5180.v new file mode 100644 index 0000000000..261092ee6d --- /dev/null +++ b/test-suite/bugs/closed/5180.v @@ -0,0 +1,64 @@ +Universes a b c ω ω'. +Definition Typeω := Type@{ω}. +Definition Type2 : Typeω := Type@{c}. +Definition Type1 : Type2 := Type@{b}. +Definition Type0 : Type1 := Type@{a}. + +Set Universe Polymorphism. +Set Printing Universes. + +Definition Typei' (n : nat) + := match n return Type@{ω'} with + | 0 => Type0 + | 1 => Type1 + | 2 => Type2 + | _ => Typeω + end. +Definition TypeOfTypei' {n} (x : Typei' n) : Type@{ω'} + := match n return Typei' n -> Type@{ω'} with + | 0 | 1 | 2 | _ => fun x => x + end x. +Definition Typei (n : nat) : Typei' (S n) + := match n return Typei' (S n) with + | 0 => Type0 + | 1 => Type1 + | _ => Type2 + end. +Definition TypeOfTypei {n} (x : TypeOfTypei' (Typei n)) : Type@{ω'} + := match n return TypeOfTypei' (Typei n) -> Type@{ω'} with + | 0 | 1 | _ => fun x => x + end x. +Check Typei 0 : Typei 1. +Check Typei 1 : Typei 2. + +Definition lift' {n} : TypeOfTypei' (Typei n) -> TypeOfTypei' (Typei (S n)) + := match n return TypeOfTypei' (Typei n) -> TypeOfTypei' (Typei (S n)) with + | 0 | 1 | 2 | _ => fun x => (x : Type) + end. +Definition lift'' {n} : TypeOfTypei' (Typei n) -> TypeOfTypei' (Typei (S n)) + := match n return TypeOfTypei' (Typei n) -> TypeOfTypei' (Typei (S n)) with + | 0 | 1 | 2 | _ => fun x => x + end. (* The command has indeed failed with message: +In environment +n : nat +x : TypeOfTypei' (Typei 0) +The term "x" has type "TypeOfTypei' (Typei 0)" while it is expected to have type + "TypeOfTypei' (Typei 1)" (universe inconsistency: Cannot enforce b = a because a < b). + *) +Check (fun x : TypeOfTypei' (Typei 0) => TypeOfTypei' (Typei 1)). + +Definition lift''' {n} : TypeOfTypei' (Typei n) -> TypeOfTypei' (Typei (S n)). + refine match n return TypeOfTypei' (Typei n) -> TypeOfTypei' (Typei (S n)) with + | 0 | 1 | 2 | _ => fun x => _ + end. + exact x. + Undo. + (* The command has indeed failed with message: +In environment +n : nat +x : TypeOfTypei' (Typei 0) +The term "x" has type "TypeOfTypei' (Typei 0)" while it is expected to have type + "TypeOfTypei' (Typei 1)" (universe inconsistency: Cannot enforce b = a because a < b). + *) + all:compute in *. + all:exact x. \ No newline at end of file -- cgit v1.2.3 From 1099b748bb080d449037fbd06199c012fa3ce387 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Wed, 30 Nov 2016 16:23:38 +0100 Subject: Fix bug #5232: proper globalization of hints paths --- ltac/g_auto.ml4 | 24 ++++++++++++++++----- tactics/hints.ml | 62 +++++++++++++++++++++++++++++++++++++++---------------- tactics/hints.mli | 25 +++++++++++++++------- 3 files changed, 80 insertions(+), 31 deletions(-) diff --git a/ltac/g_auto.ml4 b/ltac/g_auto.ml4 index 22a2d7fc2f..c561ecf606 100644 --- a/ltac/g_auto.ml4 +++ b/ltac/g_auto.ml4 @@ -171,18 +171,32 @@ TACTIC EXTEND convert_concl_no_check | ["convert_concl_no_check" constr(x) ] -> [ Tactics.convert_concl_no_check x Term.DEFAULTcast ] END -let pr_hints_path_atom _ _ _ = Hints.pp_hints_path_atom +let pr_pre_hints_path_atom _ _ _ = Hints.pp_hints_path_atom Libnames.pr_reference +let pr_hints_path_atom _ _ _ = Hints.pp_hints_path_atom Printer.pr_global +let glob_hints_path_atom ist = Hints.glob_hints_path_atom ARGUMENT EXTEND hints_path_atom PRINTED BY pr_hints_path_atom -| [ ne_global_list(g) ] -> [ Hints.PathHints (List.map Nametab.global g) ] + + GLOBALIZED BY glob_hints_path_atom + + RAW_PRINTED BY pr_pre_hints_path_atom + GLOB_PRINTED BY pr_hints_path_atom +| [ ne_global_list(g) ] -> [ Hints.PathHints g ] | [ "_" ] -> [ Hints.PathAny ] END let pr_hints_path prc prx pry c = Hints.pp_hints_path c - +let pr_pre_hints_path prc prx pry c = Hints.pp_hints_path_gen Libnames.pr_reference c +let glob_hints_path ist = Hints.glob_hints_path + ARGUMENT EXTEND hints_path - PRINTED BY pr_hints_path +PRINTED BY pr_hints_path + +GLOBALIZED BY glob_hints_path +RAW_PRINTED BY pr_pre_hints_path +GLOB_PRINTED BY pr_hints_path + | [ "(" hints_path(p) ")" ] -> [ p ] | [ hints_path(p) "*" ] -> [ Hints.PathStar p ] | [ "emp" ] -> [ Hints.PathEmpty ] @@ -203,7 +217,7 @@ END VERNAC COMMAND EXTEND HintCut CLASSIFIED AS SIDEFF | [ "Hint" "Cut" "[" hints_path(p) "]" opthints(dbnames) ] -> [ - let entry = Hints.HintsCutEntry p in + let entry = Hints.HintsCutEntry (Hints.glob_hints_path p) in Hints.add_hints (Locality.make_section_locality (Locality.LocalityFixme.consume ())) (match dbnames with None -> ["core"] | Some l -> l) entry ] END diff --git a/tactics/hints.ml b/tactics/hints.ml index d91ea8079c..9a96b73898 100644 --- a/tactics/hints.ml +++ b/tactics/hints.ml @@ -100,18 +100,25 @@ type 'a hint_ast = | Unfold_nth of evaluable_global_reference (* Hint Unfold *) | Extern of Genarg.glob_generic_argument (* Hint Extern *) -type hints_path_atom = - | PathHints of global_reference list + +type 'a hints_path_atom_gen = + | PathHints of 'a list + (* For forward hints, their names is the list of projections *) | PathAny -type hints_path = - | PathAtom of hints_path_atom - | PathStar of hints_path - | PathSeq of hints_path * hints_path - | PathOr of hints_path * hints_path +type hints_path_atom = global_reference hints_path_atom_gen + +type 'a hints_path_gen = + | PathAtom of 'a hints_path_atom_gen + | PathStar of 'a hints_path_gen + | PathSeq of 'a hints_path_gen * 'a hints_path_gen + | PathOr of 'a hints_path_gen * 'a hints_path_gen | PathEmpty | PathEpsilon +type pre_hints_path = Libnames.reference hints_path_gen +type hints_path = global_reference hints_path_gen + type hint_term = | IsGlobRef of global_reference | IsConstr of constr * Univ.universe_context_set @@ -393,21 +400,40 @@ let rec normalize_path h = let path_derivate hp hint = normalize_path (path_derivate hp hint) -let pp_hints_path_atom a = +let pp_hints_path_atom prg a = match a with | PathAny -> str"_" - | PathHints grs -> pr_sequence pr_global grs - -let rec pp_hints_path = function - | PathAtom pa -> pp_hints_path_atom pa - | PathStar (PathAtom PathAny) -> str"_*" - | PathStar p -> str "(" ++ pp_hints_path p ++ str")*" - | PathSeq (p, p') -> pp_hints_path p ++ spc () ++ pp_hints_path p' - | PathOr (p, p') -> - str "(" ++ pp_hints_path p ++ spc () ++ str"|" ++ cut () ++ spc () ++ - pp_hints_path p' ++ str ")" + | PathHints grs -> pr_sequence prg grs + +let pp_hints_path_gen prg = + let rec aux = function + | PathAtom pa -> pp_hints_path_atom prg pa + | PathStar (PathAtom PathAny) -> str"_*" + | PathStar p -> str "(" ++ aux p ++ str")*" + | PathSeq (p, p') -> aux p ++ spc () ++ aux p' + | PathOr (p, p') -> + str "(" ++ aux p ++ spc () ++ str"|" ++ cut () ++ spc () ++ + aux p' ++ str ")" | PathEmpty -> str"emp" | PathEpsilon -> str"eps" + in aux + +let pp_hints_path = pp_hints_path_gen pr_global + +let glob_hints_path_atom p = + match p with + | PathHints g -> PathHints (List.map Nametab.global g) + | PathAny -> PathAny + +let glob_hints_path = + let rec aux = function + | PathAtom pa -> PathAtom (glob_hints_path_atom pa) + | PathStar p -> PathStar (aux p) + | PathSeq (p, p') -> PathSeq (aux p, aux p') + | PathOr (p, p') -> PathOr (aux p, aux p') + | PathEmpty -> PathEmpty + | PathEpsilon -> PathEpsilon + in aux let subst_path_atom subst p = match p with diff --git a/tactics/hints.mli b/tactics/hints.mli index 42a2896ed8..1be3e0c52f 100644 --- a/tactics/hints.mli +++ b/tactics/hints.mli @@ -42,11 +42,12 @@ type 'a hint_ast = type hint type raw_hint = constr * types * Univ.universe_context_set -type hints_path_atom = - | PathHints of global_reference list +type 'a hints_path_atom_gen = + | PathHints of 'a list (* For forward hints, their names is the list of projections *) | PathAny +type hints_path_atom = global_reference hints_path_atom_gen type hint_db_name = string type 'a with_metadata = private { @@ -67,20 +68,28 @@ type search_entry type hint_entry -type hints_path = - | PathAtom of hints_path_atom - | PathStar of hints_path - | PathSeq of hints_path * hints_path - | PathOr of hints_path * hints_path +type 'a hints_path_gen = + | PathAtom of 'a hints_path_atom_gen + | PathStar of 'a hints_path_gen + | PathSeq of 'a hints_path_gen * 'a hints_path_gen + | PathOr of 'a hints_path_gen * 'a hints_path_gen | PathEmpty | PathEpsilon +type pre_hints_path = Libnames.reference hints_path_gen +type hints_path = global_reference hints_path_gen + val normalize_path : hints_path -> hints_path val path_matches : hints_path -> hints_path_atom list -> bool val path_derivate : hints_path -> hints_path_atom -> hints_path -val pp_hints_path_atom : hints_path_atom -> Pp.std_ppcmds +val pp_hints_path_gen : ('a -> Pp.std_ppcmds) -> 'a hints_path_gen -> Pp.std_ppcmds +val pp_hints_path_atom : ('a -> Pp.std_ppcmds) -> 'a hints_path_atom_gen -> Pp.std_ppcmds val pp_hints_path : hints_path -> Pp.std_ppcmds val pp_hint_mode : hint_mode -> Pp.std_ppcmds +val glob_hints_path_atom : + Libnames.reference hints_path_atom_gen -> Globnames.global_reference hints_path_atom_gen +val glob_hints_path : + Libnames.reference hints_path_gen -> Globnames.global_reference hints_path_gen module Hint_db : sig -- cgit v1.2.3 From 823f0ab9c34f99d9171a5332a535c20d9f0f315c Mon Sep 17 00:00:00 2001 From: Théo Zimmermann Date: Wed, 30 Nov 2016 15:00:13 +0100 Subject: Fix typeclasses eauto shelving. A file in the test-suite had to be modified. It was supposed to reproduce a behavior in intuistionistic-nuprl but it did not really. This commit is not supposed to break intuistionistic-nuprl. --- tactics/class_tactics.ml | 4 ++-- test-suite/success/Typeclasses.v | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index e44ace4257..b47d8af56b 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -1129,7 +1129,7 @@ module Search = struct try let evi = Evd.find_undefined sigma ev in if info.search_only_classes then - Some (ev, is_class_type sigma (Evd.evar_concl evi)) + Some (ev, not (is_class_type sigma (Evd.evar_concl evi))) else Some (ev, true) with Not_found -> None in @@ -1147,7 +1147,7 @@ module Search = struct begin (* Some existentials produced by the original tactic were not solved in the subgoals, turn them into subgoals now. *) - let shelved, goals = List.split_when (fun (ev, s) -> s) remaining in + let shelved, goals = List.partition (fun (ev, s) -> s) remaining in let shelved = List.map fst shelved and goals = List.map fst goals in if !typeclasses_debug > 1 && not (List.is_empty goals) then Feedback.msg_debug diff --git a/test-suite/success/Typeclasses.v b/test-suite/success/Typeclasses.v index f62427ef47..6b1f0315bc 100644 --- a/test-suite/success/Typeclasses.v +++ b/test-suite/success/Typeclasses.v @@ -98,7 +98,7 @@ Goal exists R, @Refl nat R. solve [typeclasses eauto with foo]. Qed. -(* Set Typeclasses Compatibility "8.5". *) +Set Typeclasses Compatibility "8.5". Parameter f : nat -> Prop. Parameter g : nat -> nat -> Prop. Parameter h : nat -> nat -> nat -> Prop. @@ -108,8 +108,7 @@ Axiom c : forall x y z, h x y z -> f x -> f y. Hint Resolve a b c : mybase. Goal forall x y z, h x y z -> f x -> f y. intros. - Set Typeclasses Debug. - typeclasses eauto with mybase. + Fail Timeout 1 typeclasses eauto with mybase. (* Loops now *) Unshelve. Abort. End bt. @@ -138,7 +137,8 @@ Notation "'return' t" := (unit t). Class A `(e: T) := { a := True }. Class B `(e_: T) := { e := e_; sg_ass :> A e }. -Set Typeclasses Debug. +(* Set Typeclasses Debug. *) +(* Set Typeclasses Debug Verbosity 2. *) Goal forall `{B T}, Prop. intros. apply a. -- cgit v1.2.3 From 910a1aec499b304006f2a9291811087ca3c4c7a1 Mon Sep 17 00:00:00 2001 From: Théo Zimmermann Date: Mon, 28 Nov 2016 16:06:06 +0100 Subject: Fix shelving order in typeclasses eauto. Before this fix, unshelve typeclasses eauto would produce sub-goals in the reverse order compared to when they were first shelved. --- tactics/class_tactics.ml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml index b47d8af56b..b416bc657a 100644 --- a/tactics/class_tactics.ml +++ b/tactics/class_tactics.ml @@ -1124,7 +1124,7 @@ module Search = struct else tclDISPATCH (List.init j (fun j' -> (tac_of gls i (Option.default 0 k + j)))) in - let finish sigma = + let finish nestedshelf sigma = let filter ev = try let evi = Evd.find_undefined sigma ev in @@ -1148,8 +1148,8 @@ module Search = struct (* Some existentials produced by the original tactic were not solved in the subgoals, turn them into subgoals now. *) let shelved, goals = List.partition (fun (ev, s) -> s) remaining in - let shelved = List.map fst shelved and goals = List.map fst goals in - if !typeclasses_debug > 1 && not (List.is_empty goals) then + let shelved = List.map fst shelved @ nestedshelf and goals = List.map fst goals in + if !typeclasses_debug > 1 && not (List.is_empty shelved && List.is_empty goals) then Feedback.msg_debug (str"Adding shelved subgoals to the search: " ++ prlist_with_sep spc (pr_ev sigma) goals ++ @@ -1162,7 +1162,8 @@ module Search = struct with_shelf (Unsafe.tclEVARS sigma' <*> Unsafe.tclNEWGOALS goals) >>= fun s -> result s i (Some (Option.default 0 k + j))) end - in res <*> tclEVARMAP >>= finish + in with_shelf res >>= fun (sh, ()) -> + tclEVARMAP >>= finish sh in if path_matches derivs [] then aux e tl else -- cgit v1.2.3 From f35eb5737fcdc1430eb45372d5bb99109d0216a2 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Tue, 28 Jun 2016 16:51:59 +0200 Subject: [merlin] Adjust merlin for ide. --- .merlin | 2 ++ ide/.merlin | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.merlin b/.merlin index 7ae6422335..24226a9184 100644 --- a/.merlin +++ b/.merlin @@ -2,6 +2,8 @@ FLG -rectypes -thread S config B config +S ide +B ide S lib B lib S intf diff --git a/ide/.merlin b/ide/.merlin index 3f3d9d275d..953b5dce4c 100644 --- a/ide/.merlin +++ b/ide/.merlin @@ -1,4 +1,4 @@ -PKG lablgtk2.sourceview2 +PKG unix laglgtk2 lablgtk2.sourceview2 S utils B utils -- cgit v1.2.3 From 17c3f8e2d339e5b6f60c89ad17e578d786d2b9ca Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sun, 20 Nov 2016 15:14:23 +0100 Subject: More on fixing #5098 (preserving printing of "in hyp"). --- printing/pptactic.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/printing/pptactic.ml b/printing/pptactic.ml index 6e40e03f5b..4b86381b49 100644 --- a/printing/pptactic.ml +++ b/printing/pptactic.ml @@ -630,7 +630,8 @@ module Make | _ -> pr_with_occurrences (fun () -> str" |- *") (occs,()) in pr_in - (prlist_with_sep (fun () -> str", ") (pr_hyp_location pr_id) l ++ pr_occs) + (prlist_with_sep (fun () -> str",") + (fun id -> spc () ++ pr_hyp_location pr_id id) l ++ pr_occs) let pr_orient b = if b then mt () else str "<- " -- cgit v1.2.3 From 4e551415f20ad696c319b32b349e4499c2505388 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sun, 20 Nov 2016 17:58:07 +0100 Subject: Protect printing of ltac's "context [...]" from possible collision with user-level notations by inserting spaces. --- printing/pptactic.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/printing/pptactic.ml b/printing/pptactic.ml index 4b86381b49..fedc62f44f 100644 --- a/printing/pptactic.ml +++ b/printing/pptactic.ml @@ -219,7 +219,7 @@ module Make | ConstrContext ((_,id),c) -> hov 0 (keyword "context" ++ spc () ++ pr_id id ++ spc () ++ - str "[" ++ prlc c ++ str "]") + str "[ " ++ prlc c ++ str " ]") | ConstrTypeOf c -> hov 1 (keyword "type of" ++ spc() ++ prc c) | ConstrTerm c when test c -> @@ -676,9 +676,9 @@ module Make | Subterm (b,None,a) -> (** ppedrot: we don't make difference between [appcontext] and [context] anymore, and the interpretation is governed by a flag instead. *) - keyword "context" ++ str" [" ++ pr_pat a ++ str "]" + keyword "context" ++ str" [ " ++ pr_pat a ++ str " ]" | Subterm (b,Some id,a) -> - keyword "context" ++ spc () ++ pr_id id ++ str "[" ++ pr_pat a ++ str "]" + keyword "context" ++ spc () ++ pr_id id ++ str "[ " ++ pr_pat a ++ str " ]" let pr_match_hyps pr_pat = function | Hyp (nal,mp) -> -- cgit v1.2.3 From 1c5e311d6a92deb66ba412c56516a4b71a513e01 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sun, 20 Nov 2016 15:35:05 +0100 Subject: Fixing printing of "only parsing" in abbreviations. --- printing/ppvernac.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/printing/ppvernac.ml b/printing/ppvernac.ml index 3494ad006f..be15879184 100644 --- a/printing/ppvernac.ml +++ b/printing/ppvernac.ml @@ -1015,7 +1015,10 @@ module Make (keyword "Notation" ++ spc () ++ pr_lident id ++ spc () ++ prlist_with_sep spc pr_id ids ++ str":=" ++ pr_constrarg c ++ pr_syntax_modifiers - (match compat with None -> [] | Some v -> [SetCompatVersion v])) + (match compat with + | None -> [] + | Some Flags.Current -> [SetOnlyParsing] + | Some v -> [SetCompatVersion v])) ) | VernacDeclareImplicits (q,[]) -> return ( -- cgit v1.2.3 From 00f1839a2cee1cb1fa4dc207391c4a5bb588f71a Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sun, 20 Nov 2016 15:40:40 +0100 Subject: Fixing space in printing several list of implicit arguments. --- printing/ppvernac.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printing/ppvernac.ml b/printing/ppvernac.ml index be15879184..75271e21ea 100644 --- a/printing/ppvernac.ml +++ b/printing/ppvernac.ml @@ -1060,7 +1060,7 @@ module Make in print_arguments nargs args ++ if not (List.is_empty more_implicits) then - str ", " ++ prlist_with_sep (fun () -> str", ") print_implicits more_implicits + prlist (fun l -> str"," ++ print_implicits l) more_implicits else (mt ()) ++ (if not (List.is_empty mods) then str" : " else str"") ++ prlist_with_sep (fun () -> str", " ++ spc()) (function -- cgit v1.2.3 From a4db30e1cd6c21a466549835a86d61f95db36c82 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Tue, 12 Apr 2016 22:24:59 +0200 Subject: Fixing printers for pr_auto_using and pr_firstorder_using. --- ltac/g_auto.ml4 | 10 +++++++--- plugins/firstorder/g_ground.ml4 | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ltac/g_auto.ml4 b/ltac/g_auto.ml4 index c561ecf606..6a8fa8d698 100644 --- a/ltac/g_auto.ml4 +++ b/ltac/g_auto.ml4 @@ -50,11 +50,17 @@ let eval_uconstrs ist cs = } in List.map (fun c -> Pretyping.type_uconstr ~flags ist c) cs -let pr_auto_using _ _ _ = Pptactic.pr_auto_using (fun _ -> mt ()) +let pr_auto_using_raw _ _ _ = Pptactic.pr_auto_using Ppconstr.pr_constr_expr +let pr_auto_using_glob _ _ _ = Pptactic.pr_auto_using (fun (c,_) -> Printer.pr_glob_constr c) +let pr_auto_using _ _ _ = Pptactic.pr_auto_using Printer.pr_closed_glob ARGUMENT EXTEND auto_using TYPED AS uconstr_list PRINTED BY pr_auto_using + RAW_TYPED AS uconstr_list + RAW_PRINTED BY pr_auto_using_raw + GLOB_TYPED AS uconstr_list + GLOB_PRINTED BY pr_auto_using_glob | [ "using" ne_uconstr_list_sep(l, ",") ] -> [ l ] | [ ] -> [ [] ] END @@ -206,8 +212,6 @@ GLOB_PRINTED BY pr_hints_path | [ hints_path(p) hints_path(q) ] -> [ Hints.PathSeq (p, q) ] END -let pr_hintbases _prc _prlc _prt = Pptactic.pr_hintbases - ARGUMENT EXTEND opthints TYPED AS preident_list_opt PRINTED BY pr_hintbases diff --git a/plugins/firstorder/g_ground.ml4 b/plugins/firstorder/g_ground.ml4 index 95095b09cb..43fac8ad83 100644 --- a/plugins/firstorder/g_ground.ml4 +++ b/plugins/firstorder/g_ground.ml4 @@ -116,9 +116,9 @@ open Pp open Genarg open Ppconstr open Printer -let pr_firstorder_using_raw _ _ _ l = str "using " ++ prlist_with_sep pr_comma pr_reference l -let pr_firstorder_using_glob _ _ _ l = str "using " ++ prlist_with_sep pr_comma (pr_or_var (fun x -> (pr_global (snd x)))) l -let pr_firstorder_using_typed _ _ _ l = str "using " ++ prlist_with_sep pr_comma pr_global l +let pr_firstorder_using_raw _ _ _ = Pptactic.pr_auto_using pr_reference +let pr_firstorder_using_glob _ _ _ = Pptactic.pr_auto_using (pr_or_var (fun x -> pr_global (snd x))) +let pr_firstorder_using_typed _ _ _ = Pptactic.pr_auto_using pr_global let warn_deprecated_syntax = CWarnings.create ~name:"firstorder-deprecated-syntax" ~category:"deprecated" -- cgit v1.2.3 From edb7a97487cb5e38bb284472eacfd1b58fa97f84 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Mon, 21 Nov 2016 07:00:31 +0100 Subject: Fixing space in printing "Context". --- printing/ppvernac.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printing/ppvernac.ml b/printing/ppvernac.ml index 75271e21ea..9533833212 100644 --- a/printing/ppvernac.ml +++ b/printing/ppvernac.ml @@ -913,7 +913,7 @@ module Make | VernacContext l -> return ( hov 1 ( - keyword "Context" ++ spc () ++ pr_and_type_binders_arg l) + keyword "Context" ++ pr_and_type_binders_arg l) ) | VernacDeclareInstances insts -> -- cgit v1.2.3 From ab3b0de5902082f7e692901979aa8330394c2f26 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Mon, 21 Nov 2016 12:58:02 +0100 Subject: Fixing printing of "Set Warnings Append". --- printing/ppvernac.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printing/ppvernac.ml b/printing/ppvernac.ml index 9533833212..5d6d36d569 100644 --- a/printing/ppvernac.ml +++ b/printing/ppvernac.ml @@ -1131,7 +1131,7 @@ module Make | VernacSetAppendOption (na,v) -> return ( hov 2 (keyword "Set" ++ spc() ++ pr_printoption na None ++ - spc() ++ keyword "Append" ++ spc() ++ str v) + spc() ++ keyword "Append" ++ spc() ++ qs v) ) | VernacAddOption (na,l) -> return ( -- cgit v1.2.3 From 0ea7bdc2e315da9a0a8338e5099dfcaad0bac9ef Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Fri, 2 Dec 2016 15:48:30 +0100 Subject: Fix #5242 - Dubious unsilenceable warning on invalid identifier We make this warning configurable and disabled by default. --- kernel/names.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/names.ml b/kernel/names.ml index 9267a64d61..1eb9a31751 100644 --- a/kernel/names.ml +++ b/kernel/names.ml @@ -34,9 +34,15 @@ struct let hash = String.hash + let warn_invalid_identifier = + CWarnings.create ~name:"invalid-identifier" ~category:"parsing" + ~default:CWarnings.Disabled + (fun s -> str s) + let check_soft ?(warn = true) x = let iter (fatal, x) = - if fatal then CErrors.error x else if warn then Feedback.msg_warning (str x) + if fatal then CErrors.error x else + if warn then warn_invalid_identifier x in Option.iter iter (Unicode.ident_refutation x) -- cgit v1.2.3 From af58f731322527af1d81233beade4c98fbb2d7bd Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Mon, 28 Nov 2016 19:05:23 +0100 Subject: Univs: fix bug #5188 Parameter was implemented the wrong way trying to separate the universes of the telescope. --- test-suite/bugs/closed/5188.v | 5 +++++ toplevel/command.ml | 15 +++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 test-suite/bugs/closed/5188.v diff --git a/test-suite/bugs/closed/5188.v b/test-suite/bugs/closed/5188.v new file mode 100644 index 0000000000..e29ebfb4ec --- /dev/null +++ b/test-suite/bugs/closed/5188.v @@ -0,0 +1,5 @@ +Set Printing All. +Axiom relation : forall (T : Type), Set. +Axiom T : forall A (R : relation A), Set. +Set Printing Universes. +Parameter (A:_) (R:_) (e:@T A R). diff --git a/toplevel/command.ml b/toplevel/command.ml index 7ffe680e5e..f6172a4b85 100644 --- a/toplevel/command.ml +++ b/toplevel/command.ml @@ -261,10 +261,7 @@ match local with let interp_assumption evdref env impls bl c = let c = prod_constr_expr c bl in - let ty, impls = interp_type_evars_impls env evdref ~impls c in - let evd, nf = nf_evars_and_universes !evdref in - let ctx = Evd.universe_context_set evd in - ((nf ty, ctx), impls) + interp_type_evars_impls env evdref ~impls c let declare_assumptions idl is_coe k (c,ctx) pl imps impl_is_on nl = let refs, status, _ = @@ -290,25 +287,27 @@ let do_assumptions_unbound_univs (_, poly, _ as kind) nl l = else l in let _,l = List.fold_map (fun (env,ienv) (is_coe,(idl,c)) -> - let (t,ctx),imps = interp_assumption evdref env ienv [] c in + let t,imps = interp_assumption evdref env ienv [] c in let env = push_named_context (List.map (fun (_,id) -> LocalAssum (id,t)) idl) env in let ienv = List.fold_right (fun (_,id) ienv -> let impls = compute_internalization_data env Variable t imps in Id.Map.add id impls ienv) idl ienv in - ((env,ienv),((is_coe,idl),t,(ctx,imps)))) + ((env,ienv),((is_coe,idl),t,imps))) (env,empty_internalization_env) l in let evd = solve_remaining_evars all_and_fail_flags env !evdref (Evd.empty,!evdref) in + let evd = Evd.nf_constraints evd in + let ctx = Evd.universe_context_set evd in let l = List.map (on_pi2 (nf_evar evd)) l in - snd (List.fold_left (fun (subst,status) ((is_coe,idl),t,(ctx,imps)) -> + pi2 (List.fold_left (fun (subst,status,ctx) ((is_coe,idl),t,imps) -> let t = replace_vars subst t in let (refs,status') = declare_assumptions idl is_coe kind (t,ctx) [] imps false nl in let subst' = List.map2 (fun (_,id) (c,u) -> (id,Universes.constr_of_global_univ (c,u))) idl refs in - (subst'@subst, status' && status)) ([],true) l) + (subst'@subst, status' && status, Univ.ContextSet.empty)) ([],true,ctx) l) let do_assumptions_bound_univs coe kind nl id pl c = let env = Global.env () in -- cgit v1.2.3 From f492ddb3f9949993ad9072688e9e2cac7cfcbce0 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Fri, 2 Dec 2016 16:46:05 +0100 Subject: Comment on universe handling in Parameters --- toplevel/command.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toplevel/command.ml b/toplevel/command.ml index f6172a4b85..8b527ebd6f 100644 --- a/toplevel/command.ml +++ b/toplevel/command.ml @@ -286,6 +286,7 @@ let do_assumptions_unbound_univs (_, poly, _ as kind) nl l = l [] else l in + (* We intepret all declarations in the same evar_map, i.e. as a telescope. *) let _,l = List.fold_map (fun (env,ienv) (is_coe,(idl,c)) -> let t,imps = interp_assumption evdref env ienv [] c in let env = @@ -297,6 +298,7 @@ let do_assumptions_unbound_univs (_, poly, _ as kind) nl l = (env,empty_internalization_env) l in let evd = solve_remaining_evars all_and_fail_flags env !evdref (Evd.empty,!evdref) in + (* The universe constraints come from the whole telescope. *) let evd = Evd.nf_constraints evd in let ctx = Evd.universe_context_set evd in let l = List.map (on_pi2 (nf_evar evd)) l in @@ -307,7 +309,9 @@ let do_assumptions_unbound_univs (_, poly, _ as kind) nl l = (fun (_,id) (c,u) -> (id,Universes.constr_of_global_univ (c,u))) idl refs in - (subst'@subst, status' && status, Univ.ContextSet.empty)) ([],true,ctx) l) + (subst'@subst, status' && status, + (* The universe constraints are declared with the first declaration only. *) + Univ.ContextSet.empty)) ([],true,ctx) l) let do_assumptions_bound_univs coe kind nl id pl c = let env = Global.env () in -- cgit v1.2.3 From afab44873b7861d542cc0146d2bb8099d513f008 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sun, 20 Nov 2016 15:34:39 +0100 Subject: Fixing printing of "ltac:" in tactics after surrounding parentheses became mandatory. --- printing/pptactic.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printing/pptactic.ml b/printing/pptactic.ml index fedc62f44f..fcc30d702f 100644 --- a/printing/pptactic.ml +++ b/printing/pptactic.ml @@ -1217,7 +1217,7 @@ module Make | TacNumgoals -> keyword "numgoals" | (TacCall _|Tacexp _ | TacGeneric _) as a -> - str "ltac:(" ++ pr_tac (1,Any) (TacArg (Loc.ghost,a)) ++ str ")" + hov 0 (keyword "ltac:" ++ surround (pr_tac ltop (TacArg (Loc.ghost,a)))) in pr_tac -- cgit v1.2.3 From 7e8434765ca1289aeb3a5200e791c9ced0acfde4 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sun, 20 Nov 2016 15:54:55 +0100 Subject: Fixing lexing of strings in comments for beautifier. Was a bug introduced in 0ad6edc1. --- parsing/cLexer.ml4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parsing/cLexer.ml4 b/parsing/cLexer.ml4 index d570f015eb..aec6a32644 100644 --- a/parsing/cLexer.ml4 +++ b/parsing/cLexer.ml4 @@ -419,8 +419,8 @@ let rec comment loc bp = parser bp2 | [< '')' >] -> push_string "*)"; loc | [< s >] -> real_push_char '*'; comment loc bp s >] -> loc | [< ''"'; s >] -> - let loc = fst (string loc ~comm_level:(Some 0) bp2 0 s) - in + let loc, len = string loc ~comm_level:(Some 0) bp2 0 s in + push_string "\""; push_string (get_buff len); push_string "\""; comment loc bp s | [< _ = Stream.empty >] ep -> let loc = set_loc_pos loc bp ep in -- cgit v1.2.3 From b8c0f76e507dc0c5dbae3ea7a89d78f16b4a7acb Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Fri, 2 Dec 2016 18:00:18 +0100 Subject: Document changes --- engine/evd.mli | 12 ++++++++++- kernel/univ.ml | 54 +++++++++++++++++++++++++++++++------------------- pretyping/cases.ml | 3 +++ pretyping/evarsolve.ml | 29 +++++++++++++++++---------- 4 files changed, 66 insertions(+), 32 deletions(-) diff --git a/engine/evd.mli b/engine/evd.mli index 89dcd92cee..86887f3dcc 100644 --- a/engine/evd.mli +++ b/engine/evd.mli @@ -467,7 +467,17 @@ val retract_coercible_metas : evar_map -> metabinding list * evar_map (********************************************************* Sort/universe variables *) -(** Rigid or flexible universe variables *) +(** Rigid or flexible universe variables. + + [UnivRigid] variables are user-provided or come from an explicit + [Type] in the source, we do not minimize them or unify them eagerly. + + [UnivFlexible alg] variables are fresh universe variables of + polymorphic constants or generated during refinement, sometimes in + algebraic position (i.e. not appearing in the term at the moment of + creation). They are the candidates for minimization (if alg, to an + algebraic universe) and unified eagerly in the first-order + unification heurstic. *) type rigid = UState.rigid = | UnivRigid diff --git a/kernel/univ.ml b/kernel/univ.ml index c863fac0eb..09f884ecd0 100644 --- a/kernel/univ.ml +++ b/kernel/univ.ml @@ -468,20 +468,32 @@ struct else if Level.is_prop u then hcons (Level.set,n+k) else hcons (u,n+k) - + + type super_result = + SuperSame of bool + (* The level expressions are in cumulativity relation. boolean + indicates if left is smaller than right? *) + | SuperDiff of int + (* The level expressions are unrelated, the comparison result + is canonical *) + + (** [super u v] compares two level expressions, + returning [SuperSame] if they refer to the same level at potentially different + increments or [SuperDiff] if they are different. The booleans indicate if the + left expression is "smaller" than the right one in both cases. *) let super (u,n as x) (v,n' as y) = let cmp = Level.compare u v in - if Int.equal cmp 0 then Inl (n < n') + if Int.equal cmp 0 then SuperSame (n < n') else match x, y with | (l,0), (l',0) -> let open RawLevel in (match Level.data l, Level.data l' with - | Prop, Prop -> Inl false - | Prop, _ -> Inl true - | _, Prop -> Inl false - | _, _ -> Inr cmp) - | _, _ -> Inr cmp + | Prop, Prop -> SuperSame false + | Prop, _ -> SuperSame true + | _, Prop -> SuperSame false + | _, _ -> SuperDiff cmp) + | _, _ -> SuperDiff cmp let to_string (v, n) = if Int.equal n 0 then Level.to_string v @@ -603,24 +615,26 @@ struct | Nil, _ -> l2 | _, Nil -> l1 | Cons (h1, _, t1), Cons (h2, _, t2) -> - (match Expr.super h1 h2 with - | Inl true (* h1 < h2 *) -> merge_univs t1 l2 - | Inl false -> merge_univs l1 t2 - | Inr c -> - if c <= 0 (* h1 < h2 is name order *) - then cons h1 (merge_univs t1 l2) - else cons h2 (merge_univs l1 t2)) + let open Expr in + (match super h1 h2 with + | SuperSame true (* h1 < h2 *) -> merge_univs t1 l2 + | SuperSame false -> merge_univs l1 t2 + | SuperDiff c -> + if c <= 0 (* h1 < h2 is name order *) + then cons h1 (merge_univs t1 l2) + else cons h2 (merge_univs l1 t2)) let sort u = let rec aux a l = match l with | Cons (b, _, l') -> - (match Expr.super a b with - | Inl false -> aux a l' - | Inl true -> l - | Inr c -> - if c <= 0 then cons a l - else cons b (aux a l')) + let open Expr in + (match super a b with + | SuperSame false -> aux a l' + | SuperSame true -> l + | SuperDiff c -> + if c <= 0 then cons a l + else cons b (aux a l')) | Nil -> cons a l in fold (fun a acc -> aux a acc) u nil diff --git a/pretyping/cases.ml b/pretyping/cases.ml index 27c1dd0316..6e4d72705b 100644 --- a/pretyping/cases.ml +++ b/pretyping/cases.ml @@ -1935,6 +1935,9 @@ let prepare_predicate_from_arsign_tycon env sigma loc tomatchs arsign c = let prepare_predicate loc typing_fun env sigma tomatchs arsign tycon pred = let refresh_tycon sigma t = + (** If we put the typing constraint in the term, it has to be + refreshed to preserve the invariant that no algebraic universe + can appear in the term. *) refresh_universes ~status:Evd.univ_flexible ~onlyalg:true (Some true) env sigma t in diff --git a/pretyping/evarsolve.ml b/pretyping/evarsolve.ml index 02e10d7fc1..4fd030845d 100644 --- a/pretyping/evarsolve.ml +++ b/pretyping/evarsolve.ml @@ -46,30 +46,35 @@ let refresh_universes ?(status=univ_rigid) ?(onlyalg=false) ?(refreshset=false) pbty env evd t = let evdref = ref evd in let modified = ref false in - let refresh_sort status dir s = + (* direction: true for fresh universes lower than the existing ones *) + let refresh_sort status ~direction s = let s' = evd_comb0 (new_sort_variable status) evdref in let evd = - if dir then set_leq_sort env !evdref s' s + if direction then set_leq_sort env !evdref s' s else set_leq_sort env !evdref s s' in modified := true; evdref := evd; mkSort s' in - let rec refresh onlyalg status dir t = + let rec refresh ~onlyalg status ~direction t = match kind_of_term t with | Sort (Type u as s) -> (match Univ.universe_level u with - | None -> refresh_sort status dir s + | None -> refresh_sort status ~direction s | Some l -> (match Evd.universe_rigidity evd l with - | UnivRigid -> if not onlyalg then refresh_sort status dir s else t + | UnivRigid -> + if not onlyalg then refresh_sort status ~direction s + else t | UnivFlexible alg -> if onlyalg && alg then (evdref := Evd.make_flexible_variable !evdref false l; t) else t)) - | Sort (Prop Pos as s) when refreshset && not dir -> - refresh_sort status dir s + | Sort (Prop Pos as s) when refreshset && not direction -> + (* Cannot make a universe "lower" than "Set", + only refreshing when we want higher universes. *) + refresh_sort status ~direction s | Prod (na,u,v) -> - mkProd (na, u, refresh onlyalg status dir v) + mkProd (na, u, refresh ~onlyalg status ~direction v) | _ -> t (** Refresh the types of evars under template polymorphic references *) and refresh_term_evars onevars top t = @@ -82,7 +87,7 @@ let refresh_universes ?(status=univ_rigid) ?(onlyalg=false) ?(refreshset=false) Array.iter (refresh_term_evars onevars false) args | Evar (ev, a) when onevars -> let evi = Evd.find !evdref ev in - let ty' = refresh onlyalg univ_flexible true evi.evar_concl in + let ty' = refresh ~onlyalg univ_flexible ~direction:true evi.evar_concl in if !modified then evdref := Evd.add !evdref ev {evi with evar_concl = ty'} else () @@ -103,8 +108,10 @@ let refresh_universes ?(status=univ_rigid) ?(onlyalg=false) ?(refreshset=false) let t' = if isArity t then match pbty with - | None -> refresh true univ_flexible false t - | Some dir -> refresh onlyalg status dir t + | None -> + (* No cumulativity needed, but we still need to refresh the algebraics *) + refresh ~onlyalg:true univ_flexible ~direction:false t + | Some direction -> refresh ~onlyalg status ~direction t else (refresh_term_evars false true t; t) in if !modified then !evdref, t' else !evdref, t -- cgit v1.2.3 From f4818831f8661cab43ec0261d78140b0693d1381 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Fri, 2 Dec 2016 18:18:21 +0100 Subject: Fix test-suite after change in "context" printing. --- test-suite/output/Tactics.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-suite/output/Tactics.out b/test-suite/output/Tactics.out index 9949658c44..239edd1da3 100644 --- a/test-suite/output/Tactics.out +++ b/test-suite/output/Tactics.out @@ -1,4 +1,4 @@ Ltac f H := split; [ a H | e H ] Ltac g := match goal with - | |- context [if ?X then _ else _] => case X + | |- context [ if ?X then _ else _ ] => case X end -- cgit v1.2.3 From ac9f2b1a5789964b1d881d024912350a7506a0f9 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Sun, 4 Dec 2016 11:40:36 +0100 Subject: [pp] Set printing width for richpp formatter (bug #5244) Richpp output depends on printing width, thus its internal formatter should be seeded with the proper width value. While we are at it, we increase the default buffer size to a more sensible value. --- lib/richpp.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/richpp.ml b/lib/richpp.ml index a98273edb2..d1c6d158e4 100644 --- a/lib/richpp.ml +++ b/lib/richpp.ml @@ -55,7 +55,7 @@ let rich_pp annotate ppcmds = string_of_int index in - let pp_buffer = Buffer.create 13 in + let pp_buffer = Buffer.create 180 in let push_pcdata () = (** Push the optional PCData on the above node *) @@ -113,6 +113,13 @@ let rich_pp annotate ppcmds = pp_set_formatter_tag_functions ft tag_functions; pp_set_mark_tags ft true; + (* Set formatter width. This is currently a hack and duplicate code + with Pp_control. Hopefully it will be fixed better in Coq 8.7 *) + let w = pp_get_margin str_formatter () in + let m = max (64 * w / 100) (w-30) in + pp_set_margin ft w; + pp_set_max_indent ft m; + (** The whole output must be a valid document. To that end, we nest the document inside tags. *) pp_open_tag ft "pp"; -- cgit v1.2.3 From 7aa2c39387a9781bf406c763c538859f24b8b7f3 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Mon, 5 Dec 2016 10:58:04 +0100 Subject: Compute dependency of C files only in kernel/byterun. Some C files included in build scripts (in dev/build) were triggering errors or warnings on non-win32 platforms. Note that ide/ide_win32_stubs.c was already handled through an ad-hoc rule in Makefile. If you add a new C file outside of kernel/byterun, please extend the CFILES variable. --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6649542c88..1dd4efca2e 100644 --- a/Makefile +++ b/Makefile @@ -59,6 +59,10 @@ define find $(shell find . $(FIND_VCS_CLAUSE) '(' -name $(1) ')' -print | sed 's|^\./||') endef +define findindir + $(shell find $(1) $(FIND_VCS_CLAUSE) '(' -name $(2) ')' -print | sed 's|^\./||') +endef + define findx $(shell find . $(FIND_VCS_CLAUSE) '(' -name $(1) ')' -exec $(2) {} \; | sed 's|^\./||') endef @@ -68,7 +72,7 @@ endef LEXFILES := $(call find, '*.mll') export MLLIBFILES := $(call find, '*.mllib') $(call find, '*.mlpack') export ML4FILES := $(call find, '*.ml4') -export CFILES := $(call find, '*.c') +export CFILES := $(call findindir, 'kernel/byterun', '*.c') # NB: The lists of currently existing .ml and .mli files will change # before and after a build or a make clean. Hence we do not export -- cgit v1.2.3 From 436782a98f9f8d452f9b60cb27cd90a7bcf33253 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Mon, 5 Dec 2016 13:29:17 +0100 Subject: ssrmatching: handle primite projections (fix: #5247) --- plugins/ssrmatching/ssrmatching.ml4 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/ssrmatching/ssrmatching.ml4 b/plugins/ssrmatching/ssrmatching.ml4 index ef04bef8e6..11f45d5d86 100644 --- a/plugins/ssrmatching/ssrmatching.ml4 +++ b/plugins/ssrmatching/ssrmatching.ml4 @@ -434,7 +434,7 @@ let proj_nparams c = try 1 + Recordops.find_projection_nparams (ConstRef c) with _ -> 0 let isFixed c = match kind_of_term c with - | Var _ | Ind _ | Construct _ | Const _ -> true + | Var _ | Ind _ | Construct _ | Const _ | Proj _ -> true | _ -> false let isRigid c = match kind_of_term c with @@ -486,6 +486,7 @@ let mk_tpattern ?p_origin ?(hack=false) env sigma0 (ise, t) ok dir p = let np = proj_nparams p in if np = 0 || np > List.length a then KpatConst, f, a else let a1, a2 = List.chop np a in KpatProj p, applist(f, a1), a2 + | Proj (p,arg) -> KpatProj (Projection.constant p), f, a | Var _ | Ind _ | Construct _ -> KpatFixed, f, a | Evar (k, _) -> if Evd.mem sigma0 k then KpatEvar k, f, a else @@ -566,6 +567,10 @@ let filter_upat i0 f n u fpats = if np < na then fpats else let () = if !i0 < np then i0 := n in (u, np) :: fpats +let eq_prim_proj c t = match kind_of_term t with + | Proj(p,_) -> Constant.equal (Projection.constant p) c + | _ -> false + let filter_upat_FO i0 f n u fpats = let np = nb_args u.up_FO in if n < np then fpats else @@ -576,7 +581,7 @@ let filter_upat_FO i0 f n u fpats = | KpatLet -> isLetIn f | KpatLam -> isLambda f | KpatRigid -> isRigid f - | KpatProj pc -> Term.eq_constr f (mkConst pc) + | KpatProj pc -> Term.eq_constr f (mkConst pc) || eq_prim_proj pc f | KpatFlex -> i0 := n; true in if ok then begin if !i0 < np then i0 := np; (u, np) :: fpats end else fpats -- cgit v1.2.3 From 08c6e4c3dbe2ae851ef3097cc44618ea82717974 Mon Sep 17 00:00:00 2001 From: Paul Steckler Date: Mon, 5 Dec 2016 17:26:55 -0500 Subject: the -byte option is deprecated --- doc/refman/RefMan-com.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/refman/RefMan-com.tex b/doc/refman/RefMan-com.tex index c1e552a5da..784c9ccbbf 100644 --- a/doc/refman/RefMan-com.tex +++ b/doc/refman/RefMan-com.tex @@ -26,8 +26,8 @@ run by the command {\tt coqtop}. They are two different binary images of \Coq: the byte-code one and the native-code one (if {\ocaml} provides a native-code compiler for your platform, which is supposed in the following). By default, -\verb!coqc! executes the native-code version; this can be overridden -using the \verb!-byte! option. +\verb!coqtop! executes the native-code version; run \verb!coqtop.byte! to +get the byte-code version. The byte-code toplevel is based on an {\ocaml} toplevel (to allow the dynamic link of tactics). You can switch to -- cgit v1.2.3 From 2125949733b631426e955e722d6ca4e1b2eb5b60 Mon Sep 17 00:00:00 2001 From: Paul Steckler Date: Mon, 5 Dec 2016 17:55:15 -0500 Subject: Change module for Coq loop --- doc/refman/RefMan-com.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/refman/RefMan-com.tex b/doc/refman/RefMan-com.tex index 784c9ccbbf..bef0a1686f 100644 --- a/doc/refman/RefMan-com.tex +++ b/doc/refman/RefMan-com.tex @@ -32,7 +32,7 @@ get the byte-code version. The byte-code toplevel is based on an {\ocaml} toplevel (to allow the dynamic link of tactics). You can switch to the {\ocaml} toplevel with the command \verb!Drop.!, and come back to the -\Coq~toplevel with the command \verb!Toplevel.loop();;!. +\Coq~toplevel with the command \verb!Coqloop.loop();;!. \section{Batch compilation ({\tt coqc})} The {\tt coqc} command takes a name {\em file} as argument. Then it -- cgit v1.2.3 From 227ff6a46ad511ff2ab0ba1ffb9017bdb0291a58 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 6 Dec 2016 17:52:26 +0100 Subject: Update documentation (bugs #5246 and #5251). --- doc/refman/RefMan-gal.tex | 6 +++--- doc/refman/RefMan-tac.tex | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/refman/RefMan-gal.tex b/doc/refman/RefMan-gal.tex index 99eee44e03..3814e4403a 100644 --- a/doc/refman/RefMan-gal.tex +++ b/doc/refman/RefMan-gal.tex @@ -713,9 +713,9 @@ definition have a special syntax: ``{\tt let fix}~$f$~{\ldots}~{\tt {\tt Inductive} \nelist{\inductivebody}{with} {\tt .} \\ & $|$ & {\tt CoInductive} \nelist{\inductivebody}{with} {\tt .} \\ & & \\ -{\inductivebody} & ::= & - {\ident} \zeroone{\binders} {\tt :} {\term} {\tt :=} \\ - && ~~\zeroone{\zeroone{\tt |} \nelist{$\!${\ident}$\!$ \zeroone{\binders} {\typecstrwithoutblank}}{|}} \\ +{\inductivebody} & ::= & + {\ident} \zeroone{\binders} {\typecstr} {\tt :=} \\ + && ~~\zeroone{\zeroone{\tt |} \nelist{$\!${\ident}$\!$ \zeroone{\binders} {\typecstr}}{|}} \\ & & \\ %% TODO: where ... %% Fixpoints {\fixpoint} & ::= & {\tt Fixpoint} \nelist{\fixpointbody}{with} {\tt .} \\ diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex index 01dc1dec9b..4b06520314 100644 --- a/doc/refman/RefMan-tac.tex +++ b/doc/refman/RefMan-tac.tex @@ -302,7 +302,7 @@ Section~\ref{pattern} to transform the goal so that it gets the form {\tt (fun $x$ => $Q$)~$u_1$~\ldots~$u_n$}. \begin{ErrMsgs} -\item \errindex{Impossible to unify \dots\ with \dots} +\item \errindex{Unable to unify \dots\ with \dots} The {\tt apply} tactic failed to match the conclusion of {\term} and the current goal. @@ -4621,7 +4621,7 @@ It is equivalent to {\tt apply refl\_equal}. \begin{ErrMsgs} \item \errindex{The conclusion is not a substitutive equation} -\item \errindex{Impossible to unify \dots\ with \dots} +\item \errindex{Unable to unify \dots\ with \dots} \end{ErrMsgs} \subsection{\tt symmetry} -- cgit v1.2.3 From 7af1b3e08452c3bbced6ca7eece2c91c6bf29137 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 6 Dec 2016 18:53:22 +0100 Subject: Fix broken documentation in presence of \zeroone{... \tt ...}. The way \zeroone was defined, the \tt modifier was leaked outside the brackets, thus messing with the following text. There are a bunch of occurrences of this issue in the manual, so rather than turning all the \tt into \texttt, the definition of \zeroone is made more robust. Unfortunately, there is one single occurrence of \zeroone that does not support the more robust version. (Note that this specific usage of \zeroone is morally a bug, since it goes against all the LaTeX conventions.) So the commit also keeps the old leaky version of \zeroone around as \zeroonelax so that it can be used there. --- doc/common/macros.tex | 3 ++- doc/refman/RefMan-tac.tex | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/common/macros.tex b/doc/common/macros.tex index df5ee405f9..5abdecfc18 100644 --- a/doc/common/macros.tex +++ b/doc/common/macros.tex @@ -72,7 +72,8 @@ %\newcommand{\spec}[1]{\{\,#1\,\}} % Building regular expressions -\newcommand{\zeroone}[1]{\mbox{\sl [}#1\mbox{\sl ]}} +\newcommand{\zeroone}[1]{\mbox{\sl [}{#1}\mbox{\sl ]}} +\newcommand{\zeroonelax}[1]{\mbox{\sl [}#1\mbox{\sl ]}} %\newcommand{\zeroonemany}[1]{$\{$#1$\}$*} %\newcommand{\onemany}[1]{$\{$#1$\}$+} \newcommand{\nelistnosep}[1]{{#1} \mbox{\dots} {#1}} diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex index 4b06520314..3f12411863 100644 --- a/doc/refman/RefMan-tac.tex +++ b/doc/refman/RefMan-tac.tex @@ -114,7 +114,7 @@ following syntax: \begin{tabular}{lcl} {\occclause} & ::= & {\tt in} {\occgoalset} \\ {\occgoalset} & ::= & - \zeroone{{\ident$_1$} \zeroone{\atoccurrences} {\tt ,} \\ + \zeroonelax{{\ident$_1$} \zeroone{\atoccurrences} {\tt ,} \\ & & {\dots} {\tt ,}\\ & & {\ident$_m$} \zeroone{\atoccurrences}}\\ & & \zeroone{{\tt |-} \zeroone{{\tt *} \zeroone{\atoccurrences}}}\\ -- cgit v1.2.3 From 40cffd816b7adbf8f136f62f6f891fb5be9b96a6 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Tue, 6 Dec 2016 16:56:42 +0100 Subject: Fix #5248 - test-suite fails in 8.6beta1 This was yet another bug in the VM long multiplication, that I unfortunately introduced in ebc509ed2. It was impacting only 32-bit architectures. In the future, I'll try to make sure that 1) we provide unit tests for integer arithmetic (my int63 branch ships with such tests) 2) our continuous testing infrastructure runs the test suite on a 32-bit architecture. I tried to set up such an instance, but failed. Waiting for support reply. --- kernel/byterun/coq_interp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/byterun/coq_interp.c b/kernel/byterun/coq_interp.c index 47df22807f..5dec3b785c 100644 --- a/kernel/byterun/coq_interp.c +++ b/kernel/byterun/coq_interp.c @@ -23,9 +23,9 @@ #include "coq_values.h" /* spiwack: I append here a few macros for value/number manipulation */ -#define uint32_of_value(val) ((uint32_t)(val) >> 1) -#define value_of_uint32(i) ((value)(((uint32_t)(i) << 1) | 1)) -#define UI64_of_uint32(lo) ((uint64_t)(lo)) +#define uint32_of_value(val) (((uint32_t)(val)) >> 1) +#define value_of_uint32(i) ((value)((((uint32_t)(i)) << 1) | 1)) +#define UI64_of_uint32(lo) ((uint64_t)((uint32_t)(lo))) #define UI64_of_value(val) (UI64_of_uint32(uint32_of_value(val))) /* /spiwack */ -- cgit v1.2.3 From 80bd0e81305abfc76831ff1c8361e01c4aabb68e Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Wed, 7 Dec 2016 12:34:35 +0100 Subject: ssrmatching: fix iter_constr_LR iterator wrt Proj --- plugins/ssrmatching/ssrmatching.ml4 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/ssrmatching/ssrmatching.ml4 b/plugins/ssrmatching/ssrmatching.ml4 index 11f45d5d86..d21223d43d 100644 --- a/plugins/ssrmatching/ssrmatching.ml4 +++ b/plugins/ssrmatching/ssrmatching.ml4 @@ -390,7 +390,8 @@ let iter_constr_LR f c = match kind_of_term c with | Case (_, p, v, b) -> f v; f p; Array.iter f b | Fix (_, (_, t, b)) | CoFix (_, (_, t, b)) -> for i = 0 to Array.length t - 1 do f t.(i); f b.(i) done - | _ -> () + | Proj(_,a) -> f a + | (Rel _ | Meta _ | Var _ | Sort _ | Const _ | Ind _ | Construct _) -> () (* The comparison used to determine which subterms matches is KEYED *) (* CONVERSION. This looks for convertible terms that either have the same *) @@ -524,7 +525,13 @@ let nb_cs_proj_args pc f u = try match kind_of_term f with | Prod _ -> na Prod_cs | Sort s -> na (Sort_cs (family_of_sort s)) - | Const (c',_) when Constant.equal c' pc -> Array.length (snd (destApp u.up_f)) + | Const (c',_) when Constant.equal c' pc -> + begin match kind_of_term u.up_f with + | App(_,args) -> Array.length args + | Proj _ -> 0 (* if splay_app calls expand_projection, this has to be + the number of arguments including the projected *) + | _ -> assert false + end | Var _ | Ind _ | Construct _ | Const _ -> na (Const_cs (global_of_constr f)) | _ -> -1 with Not_found -> -1 -- cgit v1.2.3 From 04c3f08807e341273919556652525f8226e94b6d Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Wed, 7 Dec 2016 14:52:29 +0100 Subject: A few words in CHANGES. --- CHANGES | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index ecbf82e69d..3cb0eaa216 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,13 @@ +Changes from V8.6beta1 to V8.6 +============================== + +Kernel + +- Fixed critical bug #5248 in VM long multiplication on 32-bit + architectures. Was there only since 8.6beta1, so no stable release impacted. + +Other bug fixes in universes, type class shelving,... + Changes from V8.5 to V8.6beta1 ============================== -- cgit v1.2.3 From 7037e2972828f395962284848ce167545253d910 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Wed, 7 Dec 2016 14:59:14 +0100 Subject: Set version number to 8.6rc1. --- configure.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ml b/configure.ml index b97bf9a71b..f1397e676d 100644 --- a/configure.ml +++ b/configure.ml @@ -12,10 +12,10 @@ open Printf let coq_version = "8.6beta1" -let coq_macos_version = "8.5.90" (** "[...] should be a string comprised of +let coq_macos_version = "8.6.00" (** "[...] should be a string comprised of three non-negative, period-separated integers [...]" *) -let vo_magic = 8591 -let state_magic = 58591 +let vo_magic = 8600 +let state_magic = 58600 let distributed_exec = ["coqtop";"coqc";"coqchk";"coqdoc";"coqmktop";"coqworkmgr"; "coqdoc";"coq_makefile";"coq-tex";"gallina";"coqwc";"csdpcert";"coqdep"] -- cgit v1.2.3 From b802f1789b59a93bb84783125f61794c00d6c940 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Wed, 7 Dec 2016 15:18:03 +0100 Subject: Add bat files for 8.6beta1 build. --- dev/build/windows/MakeCoq_86beta1_abs_ocaml.bat | 10 ++++++++++ dev/build/windows/MakeCoq_86beta1_installer.bat | 8 ++++++++ dev/build/windows/MakeCoq_86beta1_installer_32.bat | 8 ++++++++ 3 files changed, 26 insertions(+) create mode 100644 dev/build/windows/MakeCoq_86beta1_abs_ocaml.bat create mode 100644 dev/build/windows/MakeCoq_86beta1_installer.bat create mode 100644 dev/build/windows/MakeCoq_86beta1_installer_32.bat diff --git a/dev/build/windows/MakeCoq_86beta1_abs_ocaml.bat b/dev/build/windows/MakeCoq_86beta1_abs_ocaml.bat new file mode 100644 index 0000000000..914c332f46 --- /dev/null +++ b/dev/build/windows/MakeCoq_86beta1_abs_ocaml.bat @@ -0,0 +1,10 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -mode=absolute ^ + -ocaml=Y ^ + -make=Y ^ + -coqver=8.6beta1 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_86beta1_abs ^ + -destcoq=%ROOTPATH%\coq64_86beta1_abs diff --git a/dev/build/windows/MakeCoq_86beta1_installer.bat b/dev/build/windows/MakeCoq_86beta1_installer.bat new file mode 100644 index 0000000000..76a5bb35ac --- /dev/null +++ b/dev/build/windows/MakeCoq_86beta1_installer.bat @@ -0,0 +1,8 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -installer=Y ^ + -coqver=8.6beta1 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_86beta1_inst ^ + -destcoq=%ROOTPATH%\coq64_86beta1_inst diff --git a/dev/build/windows/MakeCoq_86beta1_installer_32.bat b/dev/build/windows/MakeCoq_86beta1_installer_32.bat new file mode 100644 index 0000000000..ff83087e75 --- /dev/null +++ b/dev/build/windows/MakeCoq_86beta1_installer_32.bat @@ -0,0 +1,8 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=32 ^ + -installer=Y ^ + -coqver=8.6beta1 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_86beta1_inst ^ + -destcoq=%ROOTPATH%\coq64_86beta1_inst -- cgit v1.2.3 From fddf3ca8f2499c14018c13417346c567971c0a23 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Wed, 7 Dec 2016 15:22:34 +0100 Subject: Add bat files for 8.6rc1 build. --- dev/build/windows/MakeCoq_86rc1_abs_ocaml.bat | 10 ++++++++++ dev/build/windows/MakeCoq_86rc1_installer.bat | 8 ++++++++ dev/build/windows/MakeCoq_86rc1_installer_32.bat | 8 ++++++++ 3 files changed, 26 insertions(+) create mode 100644 dev/build/windows/MakeCoq_86rc1_abs_ocaml.bat create mode 100644 dev/build/windows/MakeCoq_86rc1_installer.bat create mode 100644 dev/build/windows/MakeCoq_86rc1_installer_32.bat diff --git a/dev/build/windows/MakeCoq_86rc1_abs_ocaml.bat b/dev/build/windows/MakeCoq_86rc1_abs_ocaml.bat new file mode 100644 index 0000000000..c0669f01d2 --- /dev/null +++ b/dev/build/windows/MakeCoq_86rc1_abs_ocaml.bat @@ -0,0 +1,10 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -mode=absolute ^ + -ocaml=Y ^ + -make=Y ^ + -coqver=8.6rc1 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_86rc1_abs ^ + -destcoq=%ROOTPATH%\coq64_86rc1_abs diff --git a/dev/build/windows/MakeCoq_86rc1_installer.bat b/dev/build/windows/MakeCoq_86rc1_installer.bat new file mode 100644 index 0000000000..66234ebbde --- /dev/null +++ b/dev/build/windows/MakeCoq_86rc1_installer.bat @@ -0,0 +1,8 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -installer=Y ^ + -coqver=8.6rc1 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_86rc1_inst ^ + -destcoq=%ROOTPATH%\coq64_86rc1_inst diff --git a/dev/build/windows/MakeCoq_86rc1_installer_32.bat b/dev/build/windows/MakeCoq_86rc1_installer_32.bat new file mode 100644 index 0000000000..50672a6b5d --- /dev/null +++ b/dev/build/windows/MakeCoq_86rc1_installer_32.bat @@ -0,0 +1,8 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=32 ^ + -installer=Y ^ + -coqver=8.6rc1 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_86rc1_inst ^ + -destcoq=%ROOTPATH%\coq64_86rc1_inst -- cgit v1.2.3 From d24aaa4d0e45dc3ec31c5f576516b01ded403dd8 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Wed, 7 Dec 2016 16:04:21 +0100 Subject: Commit bumping the version number was partial... The sad part of the story is that the script testing this version number is run after tagging by the coq-dev-tools Makefile... will fix that. --- configure.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ml b/configure.ml index f1397e676d..f4b18d9f70 100644 --- a/configure.ml +++ b/configure.ml @@ -11,7 +11,7 @@ #load "str.cma" open Printf -let coq_version = "8.6beta1" +let coq_version = "8.6rc1" let coq_macos_version = "8.6.00" (** "[...] should be a string comprised of three non-negative, period-separated integers [...]" *) let vo_magic = 8600 -- cgit v1.2.3 From fb637d483d3637f0cf81eed92467f1ff491add2a Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Thu, 8 Dec 2016 10:30:26 +0100 Subject: Fix paths in 32-bit windows build scripts. --- dev/build/windows/MakeCoq_86beta1_installer_32.bat | 4 ++-- dev/build/windows/MakeCoq_86rc1_installer_32.bat | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/build/windows/MakeCoq_86beta1_installer_32.bat b/dev/build/windows/MakeCoq_86beta1_installer_32.bat index ff83087e75..f53232b651 100644 --- a/dev/build/windows/MakeCoq_86beta1_installer_32.bat +++ b/dev/build/windows/MakeCoq_86beta1_installer_32.bat @@ -4,5 +4,5 @@ call MakeCoq_MinGW.bat ^ -arch=32 ^ -installer=Y ^ -coqver=8.6beta1 ^ - -destcyg=%ROOTPATH%\cygwin_coq64_86beta1_inst ^ - -destcoq=%ROOTPATH%\coq64_86beta1_inst + -destcyg=%ROOTPATH%\cygwin_coq32_86beta1_inst ^ + -destcoq=%ROOTPATH%\coq32_86beta1_inst diff --git a/dev/build/windows/MakeCoq_86rc1_installer_32.bat b/dev/build/windows/MakeCoq_86rc1_installer_32.bat index 50672a6b5d..96f43e16a5 100644 --- a/dev/build/windows/MakeCoq_86rc1_installer_32.bat +++ b/dev/build/windows/MakeCoq_86rc1_installer_32.bat @@ -4,5 +4,5 @@ call MakeCoq_MinGW.bat ^ -arch=32 ^ -installer=Y ^ -coqver=8.6rc1 ^ - -destcyg=%ROOTPATH%\cygwin_coq64_86rc1_inst ^ - -destcoq=%ROOTPATH%\coq64_86rc1_inst + -destcyg=%ROOTPATH%\cygwin_coq32_86rc1_inst ^ + -destcoq=%ROOTPATH%\coq32_86rc1_inst -- cgit v1.2.3 From fbde1bb856527cc152cd7daf99b85a8c76991a23 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Thu, 8 Dec 2016 16:03:33 +0100 Subject: Windows build scripts for 8.6 final. --- dev/build/windows/MakeCoq_86_abs_ocaml.bat | 10 ++++++++++ dev/build/windows/MakeCoq_86_installer.bat | 8 ++++++++ dev/build/windows/MakeCoq_86_installer_32.bat | 8 ++++++++ 3 files changed, 26 insertions(+) create mode 100644 dev/build/windows/MakeCoq_86_abs_ocaml.bat create mode 100644 dev/build/windows/MakeCoq_86_installer.bat create mode 100644 dev/build/windows/MakeCoq_86_installer_32.bat diff --git a/dev/build/windows/MakeCoq_86_abs_ocaml.bat b/dev/build/windows/MakeCoq_86_abs_ocaml.bat new file mode 100644 index 0000000000..50483c4d4a --- /dev/null +++ b/dev/build/windows/MakeCoq_86_abs_ocaml.bat @@ -0,0 +1,10 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -mode=absolute ^ + -ocaml=Y ^ + -make=Y ^ + -coqver=8.6 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_86_abs ^ + -destcoq=%ROOTPATH%\coq64_86_abs diff --git a/dev/build/windows/MakeCoq_86_installer.bat b/dev/build/windows/MakeCoq_86_installer.bat new file mode 100644 index 0000000000..263520ff14 --- /dev/null +++ b/dev/build/windows/MakeCoq_86_installer.bat @@ -0,0 +1,8 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=64 ^ + -installer=Y ^ + -coqver=8.6 ^ + -destcyg=%ROOTPATH%\cygwin_coq64_86_inst ^ + -destcoq=%ROOTPATH%\coq64_86_inst diff --git a/dev/build/windows/MakeCoq_86_installer_32.bat b/dev/build/windows/MakeCoq_86_installer_32.bat new file mode 100644 index 0000000000..14921dd7c3 --- /dev/null +++ b/dev/build/windows/MakeCoq_86_installer_32.bat @@ -0,0 +1,8 @@ +call MakeCoq_SetRootPath + +call MakeCoq_MinGW.bat ^ + -arch=32 ^ + -installer=Y ^ + -coqver=8.6 ^ + -destcyg=%ROOTPATH%\cygwin_coq32_86_inst ^ + -destcoq=%ROOTPATH%\coq32_86_inst -- cgit v1.2.3 From 0d1438851ba3a0b9f76847abc42f3bf8ad26c4cb Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Thu, 8 Dec 2016 15:58:33 +0100 Subject: Set version to 8.6 in configure. --- configure.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ml b/configure.ml index f4b18d9f70..99f5ae5424 100644 --- a/configure.ml +++ b/configure.ml @@ -11,7 +11,7 @@ #load "str.cma" open Printf -let coq_version = "8.6rc1" +let coq_version = "8.6" let coq_macos_version = "8.6.00" (** "[...] should be a string comprised of three non-negative, period-separated integers [...]" *) let vo_magic = 8600 -- cgit v1.2.3 From 90b61424761c5ba1ddbecf20c29d78b485584ae7 Mon Sep 17 00:00:00 2001 From: Gaetan Gilbert Date: Mon, 12 Dec 2016 14:18:48 +0100 Subject: Extend Fast_typeops to be a replacement for Typeops This brings the fix in cad44fc for #2996 to the copy of Fast_typeops.check_hyps_inclusion. Fast_typeops.constant_type checks the universe constraints instead of outputting them. Since everyone who used Typeops.constant_type just discarded the constraints they've been switched to constant_type_in which should be the same in Fast_typeops and Typeops. There are some small differences in the interfaces: - Typeops.type_of_projection <-> Fast_typeops.type_of_projection_constant to avoid collision with the internally used type_of_projection (which gives the type of [Proj(p,c)]). - check_hyps_inclusion takes [('a -> constr)] and ['a] instead of [constr] for reporting errors. --- kernel/fast_typeops.ml | 284 ++++++++++++++++++++++++++++----------- kernel/fast_typeops.mli | 106 ++++++++++++++- kernel/typeops.mli | 10 +- plugins/cc/ccalgo.ml | 2 +- plugins/extraction/extraction.ml | 2 +- plugins/funind/recdef.ml | 8 +- 6 files changed, 323 insertions(+), 89 deletions(-) diff --git a/kernel/fast_typeops.ml b/kernel/fast_typeops.ml index dce4e93076..7d9a2aac09 100644 --- a/kernel/fast_typeops.ml +++ b/kernel/fast_typeops.ml @@ -37,19 +37,14 @@ let check_constraints cst env = else error_unsatisfied_constraints env cst (* This should be a type (a priori without intention to be an assumption) *) -let type_judgment env c t = - match kind_of_term(whd_all env t) with - | Sort s -> {utj_val = c; utj_type = s } - | _ -> error_not_type env (make_judge c t) - let check_type env c t = match kind_of_term(whd_all env t) with | Sort s -> s | _ -> error_not_type env (make_judge c t) -(* This should be a type intended to be assumed. The error message is *) -(* not as useful as for [type_judgment]. *) -let assumption_of_judgment env t ty = +(* This should be a type intended to be assumed. The error message is + not as useful as for [type_judgment]. *) +let check_assumption env t ty = try let _ = check_type env t ty in t with TypeError _ -> error_assumption env (make_judge t ty) @@ -62,26 +57,24 @@ let assumption_of_judgment env t ty = (* Prop and Set *) -let judge_of_prop = mkSort type1_sort - -let judge_of_prop_contents _ = judge_of_prop +let type1 = mkSort type1_sort (* Type of Type(i). *) -let judge_of_type u = +let type_of_type u = let uu = Universe.super u in mkType uu (*s Type of a de Bruijn index. *) -let judge_of_relative env n = +let type_of_relative env n = try env |> lookup_rel n |> RelDecl.get_type |> lift n with Not_found -> error_unbound_rel env n (* Type of variables *) -let judge_of_variable env id = +let type_of_variable env id = try named_type id env with Not_found -> error_unbound_var env id @@ -89,17 +82,24 @@ let judge_of_variable env id = (* Management of context of variables. *) (* Checks if a context of variables can be instantiated by the - variables of the current env *) -(* TODO: check order? *) + variables of the current env. + Order does not have to be checked assuming that all names are distinct *) let check_hyps_inclusion env f c sign = Context.Named.fold_outside - (fun decl () -> - let id = NamedDecl.get_id decl in - let ty1 = NamedDecl.get_type decl in + (fun d1 () -> + let open Context.Named.Declaration in + let id = NamedDecl.get_id d1 in try - let ty2 = named_type id env in - if not (eq_constr ty2 ty1) then raise Exit - with Not_found | Exit -> + let d2 = lookup_named id env in + conv env (get_type d2) (get_type d1); + (match d2,d1 with + | LocalAssum _, LocalAssum _ -> () + | LocalAssum _, LocalDef _ -> + (* This is wrong, because we don't know if the body is + needed or not for typechecking: *) () + | LocalDef _, LocalAssum _ -> raise NotConvertible + | LocalDef (_,b2,_), LocalDef (_,b1,_) -> conv env b2 b1); + with Not_found | NotConvertible | Option.Heterogeneous -> error_reference_variables env id (f c)) sign ~init:() @@ -111,7 +111,7 @@ let check_hyps_inclusion env f c sign = (* Type of constants *) -let type_of_constant_knowing_parameters_arity env t paramtyps = +let type_of_constant_type_knowing_parameters env t paramtyps = match t with | RegularArity t -> t | TemplateArity (sign,ar) -> @@ -119,19 +119,28 @@ let type_of_constant_knowing_parameters_arity env t paramtyps = let ctx,s = instantiate_universes env ctx ar paramtyps in mkArity (List.rev ctx,s) -let type_of_constant_knowing_parameters env cst paramtyps = - let ty, cu = constant_type env cst in - type_of_constant_knowing_parameters_arity env ty paramtyps, cu - -let judge_of_constant_knowing_parameters env (kn,u as cst) args = +let type_of_constant_knowing_parameters env (kn,u as cst) args = let cb = lookup_constant kn env in let () = check_hyps_inclusion env mkConstU cst cb.const_hyps in - let ty, cu = type_of_constant_knowing_parameters env cst args in + let ty, cu = constant_type env cst in + let ty = type_of_constant_type_knowing_parameters env ty args in let () = check_constraints cu env in ty -let judge_of_constant env cst = - judge_of_constant_knowing_parameters env cst [||] +let type_of_constant_knowing_parameters_in env (kn,u as cst) args = + let cb = lookup_constant kn env in + let () = check_hyps_inclusion env mkConstU cst cb.const_hyps in + let ty = constant_type_in env cst in + type_of_constant_type_knowing_parameters env ty args + +let type_of_constant env cst = + type_of_constant_knowing_parameters env cst [||] + +let type_of_constant_in env cst = + type_of_constant_knowing_parameters_in env cst [||] + +let type_of_constant_type env t = + type_of_constant_type_knowing_parameters env t [||] (* Type of a lambda-abstraction. *) @@ -145,7 +154,7 @@ let judge_of_constant env cst = and no upper constraint exists on the sort $s$, we don't need to compute $s$ *) -let judge_of_abstraction env name var ty = +let type_of_abstraction env name var ty = mkProd (name, var, ty) (* Type of an application. *) @@ -153,7 +162,7 @@ let judge_of_abstraction env name var ty = let make_judgev c t = Array.map2 make_judge c t -let judge_of_apply env func funt argsv argstv = +let type_of_apply env func funt argsv argstv = let len = Array.length argsv in let rec apply_rec i typ = if Int.equal i len then typ @@ -207,7 +216,7 @@ let sort_of_product env domsort rangsort = where j.uj_type is convertible to a sort s2 *) -let judge_of_product env name s1 s2 = +let type_of_product env name s1 s2 = let s = sort_of_product env s1 s2 in mkSort s @@ -220,7 +229,7 @@ let judge_of_product env name s1 s2 = env |- c:typ2 *) -let judge_of_cast env c ct k expected_type = +let check_cast env c ct k expected_type = try match k with | VMcast -> @@ -249,33 +258,34 @@ let judge_of_cast env c ct k expected_type = the App case of execute; from this constraints, the expected dynamic constraints of the form u<=v are enforced *) -let judge_of_inductive_knowing_parameters env (ind,u as indu) args = +let type_of_inductive_knowing_parameters env (ind,u as indu) args = let (mib,mip) as spec = lookup_mind_specif env ind in check_hyps_inclusion env mkIndU indu mib.mind_hyps; let t,cst = Inductive.constrained_type_of_inductive_knowing_parameters env (spec,u) args in - check_constraints cst env; - t + check_constraints cst env; + t -let judge_of_inductive env (ind,u as indu) = +let type_of_inductive env (ind,u as indu) = let (mib,mip) = lookup_mind_specif env ind in check_hyps_inclusion env mkIndU indu mib.mind_hyps; let t,cst = Inductive.constrained_type_of_inductive env ((mib,mip),u) in - check_constraints cst env; - t + check_constraints cst env; + t (* Constructors. *) -let judge_of_constructor env (c,u as cu) = - let _ = +let type_of_constructor env (c,u as cu) = + let () = let ((kn,_),_) = c in let mib = lookup_mind kn env in - check_hyps_inclusion env mkConstructU cu mib.mind_hyps in + check_hyps_inclusion env mkConstructU cu mib.mind_hyps + in let specif = lookup_mind_specif env (inductive_of_constructor c) in let t,cst = constrained_type_of_constructor cu specif in let () = check_constraints cst env in - t + t (* Case. *) @@ -287,25 +297,25 @@ let check_branch_types env (ind,u) c ct lft explft = | Invalid_argument _ -> error_number_branches env (make_judge c ct) (Array.length explft) -let judge_of_case env ci p pt c ct lf lft = +let type_of_case env ci p pt c ct lf lft = let (pind, _ as indspec) = try find_rectype env ct with Not_found -> error_case_not_inductive env (make_judge c ct) in - let _ = check_case_info env pind ci in + let () = check_case_info env pind ci in let (bty,rslty) = type_case_branches env indspec (make_judge p pt) c in let () = check_branch_types env pind c ct lft bty in - rslty + rslty -let judge_of_projection env p c ct = +let type_of_projection env p c ct = let pb = lookup_projection p env in let (ind,u), args = try find_rectype env ct with Not_found -> error_case_not_inductive env (make_judge c ct) in - assert(eq_mind pb.proj_ind (fst ind)); - let ty = Vars.subst_instance_constr u pb.Declarations.proj_type in - substl (c :: List.rev args) ty + assert(eq_mind pb.proj_ind (fst ind)); + let ty = Vars.subst_instance_constr u pb.Declarations.proj_type in + substl (c :: List.rev args) ty (* Fixpoints. *) @@ -313,7 +323,7 @@ let judge_of_projection env p c ct = (* Checks the type of a general (co)fixpoint, i.e. without checking *) (* the specific guard condition. *) -let type_fixpoint env lna lar vdef vdeft = +let check_fixpoint env lna lar vdef vdeft = let lt = Array.length vdeft in assert (Int.equal (Array.length lar) lt); try @@ -333,23 +343,23 @@ let rec execute env cstr = match kind_of_term cstr with (* Atomic terms *) | Sort (Prop c) -> - judge_of_prop_contents c + type1 | Sort (Type u) -> - judge_of_type u + type_of_type u | Rel n -> - judge_of_relative env n + type_of_relative env n | Var id -> - judge_of_variable env id + type_of_variable env id | Const c -> - judge_of_constant env c + type_of_constant env c | Proj (p, c) -> let ct = execute env c in - judge_of_projection env p c ct + type_of_projection env p c ct (* Lambda calculus operators *) | App (f,args) -> @@ -359,56 +369,56 @@ let rec execute env cstr = | Ind ind when Environ.template_polymorphic_pind ind env -> (* Template sort-polymorphism of inductive types *) let args = Array.map (fun t -> lazy t) argst in - judge_of_inductive_knowing_parameters env ind args + type_of_inductive_knowing_parameters env ind args | Const cst when Environ.template_polymorphic_pconstant cst env -> (* Template sort-polymorphism of constants *) let args = Array.map (fun t -> lazy t) argst in - judge_of_constant_knowing_parameters env cst args + type_of_constant_knowing_parameters env cst args | _ -> (* Full or no sort-polymorphism *) execute env f in - judge_of_apply env f ft args argst + type_of_apply env f ft args argst | Lambda (name,c1,c2) -> let _ = execute_is_type env c1 in let env1 = push_rel (LocalAssum (name,c1)) env in let c2t = execute env1 c2 in - judge_of_abstraction env name c1 c2t + type_of_abstraction env name c1 c2t | Prod (name,c1,c2) -> let vars = execute_is_type env c1 in let env1 = push_rel (LocalAssum (name,c1)) env in let vars' = execute_is_type env1 c2 in - judge_of_product env name vars vars' + type_of_product env name vars vars' | LetIn (name,c1,c2,c3) -> let c1t = execute env c1 in let _c2s = execute_is_type env c2 in - let _ = judge_of_cast env c1 c1t DEFAULTcast c2 in + let () = check_cast env c1 c1t DEFAULTcast c2 in let env1 = push_rel (LocalDef (name,c1,c2)) env in let c3t = execute env1 c3 in subst1 c1 c3t | Cast (c,k,t) -> let ct = execute env c in - let _ts = execute_type env t in - let _ = judge_of_cast env c ct k t in + let _ts = (check_type env t (execute env t)) in + let () = check_cast env c ct k t in t (* Inductive types *) | Ind ind -> - judge_of_inductive env ind + type_of_inductive env ind | Construct c -> - judge_of_constructor env c + type_of_constructor env c | Case (ci,p,c,lf) -> let ct = execute env c in let pt = execute env p in let lft = execute_array env lf in - judge_of_case env ci p pt c ct lf lft + type_of_case env ci p pt c ct lf lft | Fix ((vn,i as vni),recdef) -> let (fix_ty,recdef') = execute_recdef env recdef i in @@ -431,16 +441,12 @@ and execute_is_type env constr = let t = execute env constr in check_type env constr t -and execute_type env constr = - let t = execute env constr in - type_judgment env constr t - and execute_recdef env (names,lar,vdef) i = let lart = execute_array env lar in - let lara = Array.map2 (assumption_of_judgment env) lar lart in + let lara = Array.map2 (check_assumption env) lar lart in let env1 = push_rec_types (names,lara,vdef) env in let vdeft = execute_array env1 vdef in - let () = type_fixpoint env1 names lara vdef vdeft in + let () = check_fixpoint env1 names lara vdef vdeft in (lara.(i),(names,lara,vdef)) and execute_array env = Array.map (execute env) @@ -456,9 +462,133 @@ let infer = Profile.profile2 infer_key (fun b c -> infer b c) else (fun b c -> infer b c) +let assumption_of_judgment env {uj_val=c; uj_type=t} = + check_assumption env c t + +let type_judgment env {uj_val=c; uj_type=t} = + let s = check_type env c t in + {utj_val = c; utj_type = s } + let infer_type env constr = - execute_type env constr + let t = execute env constr in + let s = check_type env constr t in + {utj_val = constr; utj_type = s} let infer_v env cv = let jv = execute_array env cv in make_judgev cv jv + +(* Typing of several terms. *) + +let infer_local_decl env id = function + | Entries.LocalDefEntry c -> + let t = execute env c in + RelDecl.LocalDef (Name id, c, t) + | Entries.LocalAssumEntry c -> + let t = execute env c in + RelDecl.LocalAssum (Name id, check_assumption env c t) + +let infer_local_decls env decls = + let rec inferec env = function + | (id, d) :: l -> + let (env, l) = inferec env l in + let d = infer_local_decl env id d in + (push_rel d env, Context.Rel.add d l) + | [] -> (env, Context.Rel.empty) + in + inferec env decls + +let judge_of_prop = make_judge mkProp type1 +let judge_of_set = make_judge mkSet type1 +let judge_of_type u = make_judge (mkType u) (type_of_type u) + +let judge_of_prop_contents = function + | Null -> judge_of_prop + | Pos -> judge_of_set + +let judge_of_relative env k = make_judge (mkRel k) (type_of_relative env k) + +let judge_of_variable env x = make_judge (mkVar x) (type_of_variable env x) + +let judge_of_constant env cst = make_judge (mkConstU cst) (type_of_constant env cst) +let judge_of_constant_knowing_parameters env cst args = + make_judge (mkConstU cst) (type_of_constant_knowing_parameters env cst args) + +let judge_of_projection env p cj = + make_judge (mkProj (p,cj.uj_val)) (type_of_projection env p cj.uj_val cj.uj_type) + +let dest_judgev v = + Array.map j_val v, Array.map j_type v + +let judge_of_apply env funj argjv = + let args, argtys = dest_judgev argjv in + make_judge (mkApp (funj.uj_val, args)) (type_of_apply env funj.uj_val funj.uj_type args argtys) + +let judge_of_abstraction env x varj bodyj = + make_judge (mkLambda (x, varj.utj_val, bodyj.uj_val)) + (type_of_abstraction env x varj.utj_val bodyj.uj_type) + +let judge_of_product env x varj outj = + make_judge (mkProd (x, varj.utj_val, outj.utj_val)) + (mkSort (sort_of_product env varj.utj_type outj.utj_type)) + +let judge_of_letin env name defj typj j = + make_judge (mkLetIn (name, defj.uj_val, typj.utj_val, j.uj_val)) + (subst1 defj.uj_val j.uj_type) + +let judge_of_cast env cj k tj = + let () = check_cast env cj.uj_val cj.uj_type k tj.utj_val in + let c = match k with | REVERTcast -> cj.uj_val | _ -> mkCast (cj.uj_val, k, tj.utj_val) in + make_judge c tj.utj_val + +let judge_of_inductive env indu = + make_judge (mkIndU indu) (type_of_inductive env indu) + +let judge_of_constructor env cu = + make_judge (mkConstructU cu) (type_of_constructor env cu) + +let judge_of_case env ci pj cj lfj = + let lf, lft = dest_judgev lfj in + make_judge (mkCase (ci, (*nf_betaiota*) pj.uj_val, cj.uj_val, lft)) + (type_of_case env ci pj.uj_val pj.uj_type cj.uj_val cj.uj_type lf lft) + +let type_of_projection_constant env (p,u) = + let cst = Projection.constant p in + let cb = lookup_constant cst env in + match cb.const_proj with + | Some pb -> + if cb.const_polymorphic then + Vars.subst_instance_constr u pb.proj_type + else pb.proj_type + | None -> raise (Invalid_argument "type_of_projection: not a projection") + +(* Instantiation of terms on real arguments. *) + +(* Make a type polymorphic if an arity *) + +let extract_level env p = + let _,c = dest_prod_assum env p in + match kind_of_term c with Sort (Type u) -> Univ.Universe.level u | _ -> None + +let extract_context_levels env l = + let fold l = function + | RelDecl.LocalAssum (_,p) -> extract_level env p :: l + | RelDecl.LocalDef _ -> l + in + List.fold_left fold [] l + +let make_polymorphic_if_constant_for_ind env {uj_val = c; uj_type = t} = + let params, ccl = dest_prod_assum env t in + match kind_of_term ccl with + | Sort (Type u) -> + let ind, l = decompose_app (whd_all env c) in + if isInd ind && List.is_empty l then + let mis = lookup_mind_specif env (fst (destInd ind)) in + let nparams = Inductive.inductive_params mis in + let paramsl = CList.lastn nparams params in + let param_ccls = extract_context_levels env paramsl in + let s = { template_param_levels = param_ccls; template_level = u} in + TemplateArity (params,s) + else RegularArity t + | _ -> + RegularArity t diff --git a/kernel/fast_typeops.mli b/kernel/fast_typeops.mli index 41cff607e7..73c63db681 100644 --- a/kernel/fast_typeops.mli +++ b/kernel/fast_typeops.mli @@ -6,13 +6,16 @@ (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) +open Names +open Univ open Term open Environ +open Entries open Declarations (** {6 Typing functions (not yet tagged as safe) } - - They return unsafe judgments that are "in context" of a set of + + They return unsafe judgments that are "in context" of a set of (local) universe variables (the ones that appear in the term) and associated constraints. In case of polymorphic definitions, these variables and constraints will be generalized. @@ -22,3 +25,102 @@ open Declarations val infer : env -> constr -> unsafe_judgment val infer_v : env -> constr array -> unsafe_judgment array val infer_type : env -> types -> unsafe_type_judgment + +val infer_local_decls : + env -> (Id.t * local_entry) list -> (env * Context.Rel.t) + +(** {6 Basic operations of the typing machine. } *) + +(** If [j] is the judgement {% $ %}c:t{% $ %}, then [assumption_of_judgement env j] + returns the type {% $ %}c{% $ %}, checking that {% $ %}t{% $ %} is a sort. *) + +val assumption_of_judgment : env -> unsafe_judgment -> types +val type_judgment : env -> unsafe_judgment -> unsafe_type_judgment + +(** {6 Type of sorts. } *) +val judge_of_prop : unsafe_judgment +val judge_of_set : unsafe_judgment +val judge_of_prop_contents : contents -> unsafe_judgment +val judge_of_type : universe -> unsafe_judgment + +(** {6 Type of a bound variable. } *) +val judge_of_relative : env -> int -> unsafe_judgment + +(** {6 Type of variables } *) +val judge_of_variable : env -> variable -> unsafe_judgment + +(** {6 type of a constant } *) + +val judge_of_constant : env -> pconstant -> unsafe_judgment + +val judge_of_constant_knowing_parameters : + env -> pconstant -> types Lazy.t array -> unsafe_judgment + +(** {6 type of an applied projection } *) + +val judge_of_projection : env -> Names.projection -> unsafe_judgment -> unsafe_judgment + +(** {6 Type of application. } *) +val judge_of_apply : + env -> unsafe_judgment -> unsafe_judgment array + -> unsafe_judgment + +(** {6 Type of an abstraction. } *) +val judge_of_abstraction : + env -> Name.t -> unsafe_type_judgment -> unsafe_judgment + -> unsafe_judgment + +val sort_of_product : env -> sorts -> sorts -> sorts + +(** {6 Type of a product. } *) +val judge_of_product : + env -> Name.t -> unsafe_type_judgment -> unsafe_type_judgment + -> unsafe_judgment + +(** s Type of a let in. *) +val judge_of_letin : + env -> Name.t -> unsafe_judgment -> unsafe_type_judgment -> unsafe_judgment + -> unsafe_judgment + +(** {6 Type of a cast. } *) +val judge_of_cast : + env -> unsafe_judgment -> cast_kind -> unsafe_type_judgment -> + unsafe_judgment + +(** {6 Inductive types. } *) + +val judge_of_inductive : env -> inductive puniverses -> unsafe_judgment + +(* val judge_of_inductive_knowing_parameters : *) +(* env -> inductive -> unsafe_judgment array -> unsafe_judgment *) + +val judge_of_constructor : env -> constructor puniverses -> unsafe_judgment + +(** {6 Type of Cases. } *) +val judge_of_case : env -> case_info + -> unsafe_judgment -> unsafe_judgment -> unsafe_judgment array + -> unsafe_judgment + +(* val type_of_constant : env -> pconstant -> types constrained *) + +val type_of_constant_type : env -> constant_type -> types + +val type_of_projection_constant : env -> Names.projection puniverses -> types + +val type_of_constant_in : env -> pconstant -> types + +val type_of_constant_type_knowing_parameters : + env -> constant_type -> types Lazy.t array -> types + +(* val type_of_constant_knowing_parameters : *) +(* env -> pconstant -> types Lazy.t array -> types constrained *) + +val type_of_constant_knowing_parameters_in : + env -> pconstant -> types Lazy.t array -> types + +(** Make a type polymorphic if an arity *) +val make_polymorphic_if_constant_for_ind : env -> unsafe_judgment -> + constant_type + +(** Check that hyps are included in env and fails with error otherwise *) +val check_hyps_inclusion : env -> ('a -> constr) -> 'a -> Context.Named.t -> unit diff --git a/kernel/typeops.mli b/kernel/typeops.mli index 81fd1427d0..cfc82c1589 100644 --- a/kernel/typeops.mli +++ b/kernel/typeops.mli @@ -102,10 +102,10 @@ val judge_of_case : env -> case_info -> unsafe_judgment (** Typecheck general fixpoint (not checking guard conditions) *) -val type_fixpoint : env -> Name.t array -> types array - -> unsafe_judgment array -> unit +(* val type_fixpoint : env -> Name.t array -> types array *) +(* -> unsafe_judgment array -> unit *) -val type_of_constant : env -> pconstant -> types constrained +(* val type_of_constant : env -> pconstant -> types constrained *) val type_of_constant_type : env -> constant_type -> types @@ -116,8 +116,8 @@ val type_of_constant_in : env -> pconstant -> types val type_of_constant_type_knowing_parameters : env -> constant_type -> types Lazy.t array -> types -val type_of_constant_knowing_parameters : - env -> pconstant -> types Lazy.t array -> types constrained +(* val type_of_constant_knowing_parameters : *) +(* env -> pconstant -> types Lazy.t array -> types constrained *) val type_of_constant_knowing_parameters_in : env -> pconstant -> types Lazy.t array -> types diff --git a/plugins/cc/ccalgo.ml b/plugins/cc/ccalgo.ml index bc53b113df..7347c3c2cd 100644 --- a/plugins/cc/ccalgo.ml +++ b/plugins/cc/ccalgo.ml @@ -444,7 +444,7 @@ and applist_projection c l = let p = Projection.make (fst c) false in (match l with | [] -> (* Expand the projection *) - let ty,_ = Typeops.type_of_constant (Global.env ()) c in + let ty = Typeops.type_of_constant_in (Global.env ()) c in (* FIXME constraints *) let pb = Environ.lookup_projection p (Global.env()) in let ctx,_ = Term.decompose_prod_n_assum (pb.Declarations.proj_npars + 1) ty in it_mkLambda_or_LetIn (mkProj(p,mkRel 1)) ctx diff --git a/plugins/extraction/extraction.ml b/plugins/extraction/extraction.ml index a980a43f53..33fab74e13 100644 --- a/plugins/extraction/extraction.ml +++ b/plugins/extraction/extraction.ml @@ -258,7 +258,7 @@ let rec extract_type env db j c args = | Const (kn,u as c) -> let r = ConstRef kn in let cb = lookup_constant kn env in - let typ,_ = Typeops.type_of_constant env c in + let typ = Typeops.type_of_constant_in env c in (* FIXME constraints *) (match flag_of_type env typ with | (Logic,_) -> assert false (* Cf. logical cases above *) | (Info, TypeScheme) -> diff --git a/plugins/funind/recdef.ml b/plugins/funind/recdef.ml index 54066edfb8..e00fa528ad 100644 --- a/plugins/funind/recdef.ml +++ b/plugins/funind/recdef.ml @@ -78,8 +78,10 @@ let def_of_const t = let type_of_const t = match (kind_of_term t) with - Const sp -> Typeops.type_of_constant (Global.env()) sp - |_ -> assert false + | Const sp -> + (* FIXME discarding universe constraints *) + Typeops.type_of_constant_in (Global.env()) sp + |_ -> assert false let constr_of_global x = fst (Universes.unsafe_constr_of_global x) @@ -1422,7 +1424,7 @@ let start_equation (f:global_reference) (term_f:global_reference) (cont_tactic:Id.t list -> tactic) g = let ids = pf_ids_of_hyps g in let terminate_constr = constr_of_global term_f in - let nargs = nb_prod (fst (type_of_const terminate_constr)) (*FIXME*) in + let nargs = nb_prod (type_of_const terminate_constr) in let x = n_x_id ids nargs in observe_tac (str "start_equation") (observe_tclTHENLIST (str "start_equation") [ h_intros x; -- cgit v1.2.3 From 421d846d80c19226ba0922ff3c3b0006c98c21b6 Mon Sep 17 00:00:00 2001 From: Gaetan Gilbert Date: Mon, 12 Dec 2016 14:49:01 +0100 Subject: Replace Typeops by Fast_typeops This is really [mv fast_typeops.ml{,i} typeops.ml{,i}] plus trivial changes in the other files, the real changes are in the parent commit. --- kernel/fast_typeops.ml | 594 ---------------------------------------------- kernel/fast_typeops.mli | 126 ---------- kernel/kernel.mllib | 1 - kernel/term_typing.ml | 1 - kernel/typeops.ml | 561 ++++++++++++++++++++++--------------------- kernel/typeops.mli | 10 +- pretyping/inductiveops.ml | 6 +- 7 files changed, 298 insertions(+), 1001 deletions(-) delete mode 100644 kernel/fast_typeops.ml delete mode 100644 kernel/fast_typeops.mli diff --git a/kernel/fast_typeops.ml b/kernel/fast_typeops.ml deleted file mode 100644 index 7d9a2aac09..0000000000 --- a/kernel/fast_typeops.ml +++ /dev/null @@ -1,594 +0,0 @@ -(************************************************************************) -(* v * The Coq Proof Assistant / The Coq Development Team *) -(* - try conv_leq false env t1 t2 - with NotConvertible -> raise (NotConvertibleVect i)) - () - v1 - v2 - -let check_constraints cst env = - if Environ.check_constraints cst env then () - else error_unsatisfied_constraints env cst - -(* This should be a type (a priori without intention to be an assumption) *) -let check_type env c t = - match kind_of_term(whd_all env t) with - | Sort s -> s - | _ -> error_not_type env (make_judge c t) - -(* This should be a type intended to be assumed. The error message is - not as useful as for [type_judgment]. *) -let check_assumption env t ty = - try let _ = check_type env t ty in t - with TypeError _ -> - error_assumption env (make_judge t ty) - -(************************************************) -(* Incremental typing rules: builds a typing judgment given the *) -(* judgments for the subterms. *) - -(*s Type of sorts *) - -(* Prop and Set *) - -let type1 = mkSort type1_sort - -(* Type of Type(i). *) - -let type_of_type u = - let uu = Universe.super u in - mkType uu - -(*s Type of a de Bruijn index. *) - -let type_of_relative env n = - try - env |> lookup_rel n |> RelDecl.get_type |> lift n - with Not_found -> - error_unbound_rel env n - -(* Type of variables *) -let type_of_variable env id = - try named_type id env - with Not_found -> - error_unbound_var env id - -(* Management of context of variables. *) - -(* Checks if a context of variables can be instantiated by the - variables of the current env. - Order does not have to be checked assuming that all names are distinct *) -let check_hyps_inclusion env f c sign = - Context.Named.fold_outside - (fun d1 () -> - let open Context.Named.Declaration in - let id = NamedDecl.get_id d1 in - try - let d2 = lookup_named id env in - conv env (get_type d2) (get_type d1); - (match d2,d1 with - | LocalAssum _, LocalAssum _ -> () - | LocalAssum _, LocalDef _ -> - (* This is wrong, because we don't know if the body is - needed or not for typechecking: *) () - | LocalDef _, LocalAssum _ -> raise NotConvertible - | LocalDef (_,b2,_), LocalDef (_,b1,_) -> conv env b2 b1); - with Not_found | NotConvertible | Option.Heterogeneous -> - error_reference_variables env id (f c)) - sign - ~init:() - -(* Instantiation of terms on real arguments. *) - -(* Make a type polymorphic if an arity *) - -(* Type of constants *) - - -let type_of_constant_type_knowing_parameters env t paramtyps = - match t with - | RegularArity t -> t - | TemplateArity (sign,ar) -> - let ctx = List.rev sign in - let ctx,s = instantiate_universes env ctx ar paramtyps in - mkArity (List.rev ctx,s) - -let type_of_constant_knowing_parameters env (kn,u as cst) args = - let cb = lookup_constant kn env in - let () = check_hyps_inclusion env mkConstU cst cb.const_hyps in - let ty, cu = constant_type env cst in - let ty = type_of_constant_type_knowing_parameters env ty args in - let () = check_constraints cu env in - ty - -let type_of_constant_knowing_parameters_in env (kn,u as cst) args = - let cb = lookup_constant kn env in - let () = check_hyps_inclusion env mkConstU cst cb.const_hyps in - let ty = constant_type_in env cst in - type_of_constant_type_knowing_parameters env ty args - -let type_of_constant env cst = - type_of_constant_knowing_parameters env cst [||] - -let type_of_constant_in env cst = - type_of_constant_knowing_parameters_in env cst [||] - -let type_of_constant_type env t = - type_of_constant_type_knowing_parameters env t [||] - -(* Type of a lambda-abstraction. *) - -(* [judge_of_abstraction env name var j] implements the rule - - env, name:typ |- j.uj_val:j.uj_type env, |- (name:typ)j.uj_type : s - ----------------------------------------------------------------------- - env |- [name:typ]j.uj_val : (name:typ)j.uj_type - - Since all products are defined in the Calculus of Inductive Constructions - and no upper constraint exists on the sort $s$, we don't need to compute $s$ -*) - -let type_of_abstraction env name var ty = - mkProd (name, var, ty) - -(* Type of an application. *) - -let make_judgev c t = - Array.map2 make_judge c t - -let type_of_apply env func funt argsv argstv = - let len = Array.length argsv in - let rec apply_rec i typ = - if Int.equal i len then typ - else - (match kind_of_term (whd_all env typ) with - | Prod (_,c1,c2) -> - let arg = argsv.(i) and argt = argstv.(i) in - (try - let () = conv_leq false env argt c1 in - apply_rec (i+1) (subst1 arg c2) - with NotConvertible -> - error_cant_apply_bad_type env - (i+1,c1,argt) - (make_judge func funt) - (make_judgev argsv argstv)) - - | _ -> - error_cant_apply_not_functional env - (make_judge func funt) - (make_judgev argsv argstv)) - in apply_rec 0 funt - -(* Type of product *) - -let sort_of_product env domsort rangsort = - match (domsort, rangsort) with - (* Product rule (s,Prop,Prop) *) - | (_, Prop Null) -> rangsort - (* Product rule (Prop/Set,Set,Set) *) - | (Prop _, Prop Pos) -> rangsort - (* Product rule (Type,Set,?) *) - | (Type u1, Prop Pos) -> - if is_impredicative_set env then - (* Rule is (Type,Set,Set) in the Set-impredicative calculus *) - rangsort - else - (* Rule is (Type_i,Set,Type_i) in the Set-predicative calculus *) - Type (Universe.sup Universe.type0 u1) - (* Product rule (Prop,Type_i,Type_i) *) - | (Prop Pos, Type u2) -> Type (Universe.sup Universe.type0 u2) - (* Product rule (Prop,Type_i,Type_i) *) - | (Prop Null, Type _) -> rangsort - (* Product rule (Type_i,Type_i,Type_i) *) - | (Type u1, Type u2) -> Type (Universe.sup u1 u2) - -(* [judge_of_product env name (typ1,s1) (typ2,s2)] implements the rule - - env |- typ1:s1 env, name:typ1 |- typ2 : s2 - ------------------------------------------------------------------------- - s' >= (s1,s2), env |- (name:typ)j.uj_val : s' - - where j.uj_type is convertible to a sort s2 -*) -let type_of_product env name s1 s2 = - let s = sort_of_product env s1 s2 in - mkSort s - -(* Type of a type cast *) - -(* [judge_of_cast env (c,typ1) (typ2,s)] implements the rule - - env |- c:typ1 env |- typ2:s env |- typ1 <= typ2 - --------------------------------------------------------------------- - env |- c:typ2 -*) - -let check_cast env c ct k expected_type = - try - match k with - | VMcast -> - vm_conv CUMUL env ct expected_type - | DEFAULTcast -> - default_conv ~l2r:false CUMUL env ct expected_type - | REVERTcast -> - default_conv ~l2r:true CUMUL env ct expected_type - | NATIVEcast -> - let sigma = Nativelambda.empty_evars in - Nativeconv.native_conv CUMUL sigma env ct expected_type - with NotConvertible -> - error_actual_type env (make_judge c ct) expected_type - -(* Inductive types. *) - -(* The type is parametric over the uniform parameters whose conclusion - is in Type; to enforce the internal constraints between the - parameters and the instances of Type occurring in the type of the - constructors, we use the level variables _statically_ assigned to - the conclusions of the parameters as mediators: e.g. if a parameter - has conclusion Type(alpha), static constraints of the form alpha<=v - exist between alpha and the Type's occurring in the constructor - types; when the parameters is finally instantiated by a term of - conclusion Type(u), then the constraints u<=alpha is computed in - the App case of execute; from this constraints, the expected - dynamic constraints of the form u<=v are enforced *) - -let type_of_inductive_knowing_parameters env (ind,u as indu) args = - let (mib,mip) as spec = lookup_mind_specif env ind in - check_hyps_inclusion env mkIndU indu mib.mind_hyps; - let t,cst = Inductive.constrained_type_of_inductive_knowing_parameters - env (spec,u) args - in - check_constraints cst env; - t - -let type_of_inductive env (ind,u as indu) = - let (mib,mip) = lookup_mind_specif env ind in - check_hyps_inclusion env mkIndU indu mib.mind_hyps; - let t,cst = Inductive.constrained_type_of_inductive env ((mib,mip),u) in - check_constraints cst env; - t - -(* Constructors. *) - -let type_of_constructor env (c,u as cu) = - let () = - let ((kn,_),_) = c in - let mib = lookup_mind kn env in - check_hyps_inclusion env mkConstructU cu mib.mind_hyps - in - let specif = lookup_mind_specif env (inductive_of_constructor c) in - let t,cst = constrained_type_of_constructor cu specif in - let () = check_constraints cst env in - t - -(* Case. *) - -let check_branch_types env (ind,u) c ct lft explft = - try conv_leq_vecti env lft explft - with - NotConvertibleVect i -> - error_ill_formed_branch env c ((ind,i+1),u) lft.(i) explft.(i) - | Invalid_argument _ -> - error_number_branches env (make_judge c ct) (Array.length explft) - -let type_of_case env ci p pt c ct lf lft = - let (pind, _ as indspec) = - try find_rectype env ct - with Not_found -> error_case_not_inductive env (make_judge c ct) in - let () = check_case_info env pind ci in - let (bty,rslty) = - type_case_branches env indspec (make_judge p pt) c in - let () = check_branch_types env pind c ct lft bty in - rslty - -let type_of_projection env p c ct = - let pb = lookup_projection p env in - let (ind,u), args = - try find_rectype env ct - with Not_found -> error_case_not_inductive env (make_judge c ct) - in - assert(eq_mind pb.proj_ind (fst ind)); - let ty = Vars.subst_instance_constr u pb.Declarations.proj_type in - substl (c :: List.rev args) ty - - -(* Fixpoints. *) - -(* Checks the type of a general (co)fixpoint, i.e. without checking *) -(* the specific guard condition. *) - -let check_fixpoint env lna lar vdef vdeft = - let lt = Array.length vdeft in - assert (Int.equal (Array.length lar) lt); - try - conv_leq_vecti env vdeft (Array.map (fun ty -> lift lt ty) lar) - with NotConvertibleVect i -> - error_ill_typed_rec_body env i lna (make_judgev vdef vdeft) lar - -(************************************************************************) -(************************************************************************) - -(* The typing machine. *) - (* ATTENTION : faudra faire le typage du contexte des Const, - Ind et Constructsi un jour cela devient des constructions - arbitraires et non plus des variables *) -let rec execute env cstr = - let open Context.Rel.Declaration in - match kind_of_term cstr with - (* Atomic terms *) - | Sort (Prop c) -> - type1 - - | Sort (Type u) -> - type_of_type u - - | Rel n -> - type_of_relative env n - - | Var id -> - type_of_variable env id - - | Const c -> - type_of_constant env c - - | Proj (p, c) -> - let ct = execute env c in - type_of_projection env p c ct - - (* Lambda calculus operators *) - | App (f,args) -> - let argst = execute_array env args in - let ft = - match kind_of_term f with - | Ind ind when Environ.template_polymorphic_pind ind env -> - (* Template sort-polymorphism of inductive types *) - let args = Array.map (fun t -> lazy t) argst in - type_of_inductive_knowing_parameters env ind args - | Const cst when Environ.template_polymorphic_pconstant cst env -> - (* Template sort-polymorphism of constants *) - let args = Array.map (fun t -> lazy t) argst in - type_of_constant_knowing_parameters env cst args - | _ -> - (* Full or no sort-polymorphism *) - execute env f - in - - type_of_apply env f ft args argst - - | Lambda (name,c1,c2) -> - let _ = execute_is_type env c1 in - let env1 = push_rel (LocalAssum (name,c1)) env in - let c2t = execute env1 c2 in - type_of_abstraction env name c1 c2t - - | Prod (name,c1,c2) -> - let vars = execute_is_type env c1 in - let env1 = push_rel (LocalAssum (name,c1)) env in - let vars' = execute_is_type env1 c2 in - type_of_product env name vars vars' - - | LetIn (name,c1,c2,c3) -> - let c1t = execute env c1 in - let _c2s = execute_is_type env c2 in - let () = check_cast env c1 c1t DEFAULTcast c2 in - let env1 = push_rel (LocalDef (name,c1,c2)) env in - let c3t = execute env1 c3 in - subst1 c1 c3t - - | Cast (c,k,t) -> - let ct = execute env c in - let _ts = (check_type env t (execute env t)) in - let () = check_cast env c ct k t in - t - - (* Inductive types *) - | Ind ind -> - type_of_inductive env ind - - | Construct c -> - type_of_constructor env c - - | Case (ci,p,c,lf) -> - let ct = execute env c in - let pt = execute env p in - let lft = execute_array env lf in - type_of_case env ci p pt c ct lf lft - - | Fix ((vn,i as vni),recdef) -> - let (fix_ty,recdef') = execute_recdef env recdef i in - let fix = (vni,recdef') in - check_fix env fix; fix_ty - - | CoFix (i,recdef) -> - let (fix_ty,recdef') = execute_recdef env recdef i in - let cofix = (i,recdef') in - check_cofix env cofix; fix_ty - - (* Partial proofs: unsupported by the kernel *) - | Meta _ -> - anomaly (Pp.str "the kernel does not support metavariables") - - | Evar _ -> - anomaly (Pp.str "the kernel does not support existential variables") - -and execute_is_type env constr = - let t = execute env constr in - check_type env constr t - -and execute_recdef env (names,lar,vdef) i = - let lart = execute_array env lar in - let lara = Array.map2 (check_assumption env) lar lart in - let env1 = push_rec_types (names,lara,vdef) env in - let vdeft = execute_array env1 vdef in - let () = check_fixpoint env1 names lara vdef vdeft in - (lara.(i),(names,lara,vdef)) - -and execute_array env = Array.map (execute env) - -(* Derived functions *) -let infer env constr = - let t = execute env constr in - make_judge constr t - -let infer = - if Flags.profile then - let infer_key = Profile.declare_profile "Fast_infer" in - Profile.profile2 infer_key (fun b c -> infer b c) - else (fun b c -> infer b c) - -let assumption_of_judgment env {uj_val=c; uj_type=t} = - check_assumption env c t - -let type_judgment env {uj_val=c; uj_type=t} = - let s = check_type env c t in - {utj_val = c; utj_type = s } - -let infer_type env constr = - let t = execute env constr in - let s = check_type env constr t in - {utj_val = constr; utj_type = s} - -let infer_v env cv = - let jv = execute_array env cv in - make_judgev cv jv - -(* Typing of several terms. *) - -let infer_local_decl env id = function - | Entries.LocalDefEntry c -> - let t = execute env c in - RelDecl.LocalDef (Name id, c, t) - | Entries.LocalAssumEntry c -> - let t = execute env c in - RelDecl.LocalAssum (Name id, check_assumption env c t) - -let infer_local_decls env decls = - let rec inferec env = function - | (id, d) :: l -> - let (env, l) = inferec env l in - let d = infer_local_decl env id d in - (push_rel d env, Context.Rel.add d l) - | [] -> (env, Context.Rel.empty) - in - inferec env decls - -let judge_of_prop = make_judge mkProp type1 -let judge_of_set = make_judge mkSet type1 -let judge_of_type u = make_judge (mkType u) (type_of_type u) - -let judge_of_prop_contents = function - | Null -> judge_of_prop - | Pos -> judge_of_set - -let judge_of_relative env k = make_judge (mkRel k) (type_of_relative env k) - -let judge_of_variable env x = make_judge (mkVar x) (type_of_variable env x) - -let judge_of_constant env cst = make_judge (mkConstU cst) (type_of_constant env cst) -let judge_of_constant_knowing_parameters env cst args = - make_judge (mkConstU cst) (type_of_constant_knowing_parameters env cst args) - -let judge_of_projection env p cj = - make_judge (mkProj (p,cj.uj_val)) (type_of_projection env p cj.uj_val cj.uj_type) - -let dest_judgev v = - Array.map j_val v, Array.map j_type v - -let judge_of_apply env funj argjv = - let args, argtys = dest_judgev argjv in - make_judge (mkApp (funj.uj_val, args)) (type_of_apply env funj.uj_val funj.uj_type args argtys) - -let judge_of_abstraction env x varj bodyj = - make_judge (mkLambda (x, varj.utj_val, bodyj.uj_val)) - (type_of_abstraction env x varj.utj_val bodyj.uj_type) - -let judge_of_product env x varj outj = - make_judge (mkProd (x, varj.utj_val, outj.utj_val)) - (mkSort (sort_of_product env varj.utj_type outj.utj_type)) - -let judge_of_letin env name defj typj j = - make_judge (mkLetIn (name, defj.uj_val, typj.utj_val, j.uj_val)) - (subst1 defj.uj_val j.uj_type) - -let judge_of_cast env cj k tj = - let () = check_cast env cj.uj_val cj.uj_type k tj.utj_val in - let c = match k with | REVERTcast -> cj.uj_val | _ -> mkCast (cj.uj_val, k, tj.utj_val) in - make_judge c tj.utj_val - -let judge_of_inductive env indu = - make_judge (mkIndU indu) (type_of_inductive env indu) - -let judge_of_constructor env cu = - make_judge (mkConstructU cu) (type_of_constructor env cu) - -let judge_of_case env ci pj cj lfj = - let lf, lft = dest_judgev lfj in - make_judge (mkCase (ci, (*nf_betaiota*) pj.uj_val, cj.uj_val, lft)) - (type_of_case env ci pj.uj_val pj.uj_type cj.uj_val cj.uj_type lf lft) - -let type_of_projection_constant env (p,u) = - let cst = Projection.constant p in - let cb = lookup_constant cst env in - match cb.const_proj with - | Some pb -> - if cb.const_polymorphic then - Vars.subst_instance_constr u pb.proj_type - else pb.proj_type - | None -> raise (Invalid_argument "type_of_projection: not a projection") - -(* Instantiation of terms on real arguments. *) - -(* Make a type polymorphic if an arity *) - -let extract_level env p = - let _,c = dest_prod_assum env p in - match kind_of_term c with Sort (Type u) -> Univ.Universe.level u | _ -> None - -let extract_context_levels env l = - let fold l = function - | RelDecl.LocalAssum (_,p) -> extract_level env p :: l - | RelDecl.LocalDef _ -> l - in - List.fold_left fold [] l - -let make_polymorphic_if_constant_for_ind env {uj_val = c; uj_type = t} = - let params, ccl = dest_prod_assum env t in - match kind_of_term ccl with - | Sort (Type u) -> - let ind, l = decompose_app (whd_all env c) in - if isInd ind && List.is_empty l then - let mis = lookup_mind_specif env (fst (destInd ind)) in - let nparams = Inductive.inductive_params mis in - let paramsl = CList.lastn nparams params in - let param_ccls = extract_context_levels env paramsl in - let s = { template_param_levels = param_ccls; template_level = u} in - TemplateArity (params,s) - else RegularArity t - | _ -> - RegularArity t diff --git a/kernel/fast_typeops.mli b/kernel/fast_typeops.mli deleted file mode 100644 index 73c63db681..0000000000 --- a/kernel/fast_typeops.mli +++ /dev/null @@ -1,126 +0,0 @@ -(************************************************************************) -(* v * The Coq Proof Assistant / The Coq Development Team *) -(* constr -> unsafe_judgment -val infer_v : env -> constr array -> unsafe_judgment array -val infer_type : env -> types -> unsafe_type_judgment - -val infer_local_decls : - env -> (Id.t * local_entry) list -> (env * Context.Rel.t) - -(** {6 Basic operations of the typing machine. } *) - -(** If [j] is the judgement {% $ %}c:t{% $ %}, then [assumption_of_judgement env j] - returns the type {% $ %}c{% $ %}, checking that {% $ %}t{% $ %} is a sort. *) - -val assumption_of_judgment : env -> unsafe_judgment -> types -val type_judgment : env -> unsafe_judgment -> unsafe_type_judgment - -(** {6 Type of sorts. } *) -val judge_of_prop : unsafe_judgment -val judge_of_set : unsafe_judgment -val judge_of_prop_contents : contents -> unsafe_judgment -val judge_of_type : universe -> unsafe_judgment - -(** {6 Type of a bound variable. } *) -val judge_of_relative : env -> int -> unsafe_judgment - -(** {6 Type of variables } *) -val judge_of_variable : env -> variable -> unsafe_judgment - -(** {6 type of a constant } *) - -val judge_of_constant : env -> pconstant -> unsafe_judgment - -val judge_of_constant_knowing_parameters : - env -> pconstant -> types Lazy.t array -> unsafe_judgment - -(** {6 type of an applied projection } *) - -val judge_of_projection : env -> Names.projection -> unsafe_judgment -> unsafe_judgment - -(** {6 Type of application. } *) -val judge_of_apply : - env -> unsafe_judgment -> unsafe_judgment array - -> unsafe_judgment - -(** {6 Type of an abstraction. } *) -val judge_of_abstraction : - env -> Name.t -> unsafe_type_judgment -> unsafe_judgment - -> unsafe_judgment - -val sort_of_product : env -> sorts -> sorts -> sorts - -(** {6 Type of a product. } *) -val judge_of_product : - env -> Name.t -> unsafe_type_judgment -> unsafe_type_judgment - -> unsafe_judgment - -(** s Type of a let in. *) -val judge_of_letin : - env -> Name.t -> unsafe_judgment -> unsafe_type_judgment -> unsafe_judgment - -> unsafe_judgment - -(** {6 Type of a cast. } *) -val judge_of_cast : - env -> unsafe_judgment -> cast_kind -> unsafe_type_judgment -> - unsafe_judgment - -(** {6 Inductive types. } *) - -val judge_of_inductive : env -> inductive puniverses -> unsafe_judgment - -(* val judge_of_inductive_knowing_parameters : *) -(* env -> inductive -> unsafe_judgment array -> unsafe_judgment *) - -val judge_of_constructor : env -> constructor puniverses -> unsafe_judgment - -(** {6 Type of Cases. } *) -val judge_of_case : env -> case_info - -> unsafe_judgment -> unsafe_judgment -> unsafe_judgment array - -> unsafe_judgment - -(* val type_of_constant : env -> pconstant -> types constrained *) - -val type_of_constant_type : env -> constant_type -> types - -val type_of_projection_constant : env -> Names.projection puniverses -> types - -val type_of_constant_in : env -> pconstant -> types - -val type_of_constant_type_knowing_parameters : - env -> constant_type -> types Lazy.t array -> types - -(* val type_of_constant_knowing_parameters : *) -(* env -> pconstant -> types Lazy.t array -> types constrained *) - -val type_of_constant_knowing_parameters_in : - env -> pconstant -> types Lazy.t array -> types - -(** Make a type polymorphic if an arity *) -val make_polymorphic_if_constant_for_ind : env -> unsafe_judgment -> - constant_type - -(** Check that hyps are included in env and fails with error otherwise *) -val check_hyps_inclusion : env -> ('a -> constr) -> 'a -> Context.Named.t -> unit diff --git a/kernel/kernel.mllib b/kernel/kernel.mllib index 15f213ce9c..4c540a6d73 100644 --- a/kernel/kernel.mllib +++ b/kernel/kernel.mllib @@ -32,7 +32,6 @@ Type_errors Modops Inductive Typeops -Fast_typeops Indtypes Cooking Term_typing diff --git a/kernel/term_typing.ml b/kernel/term_typing.ml index d8774944e4..3a0d1a2a5e 100644 --- a/kernel/term_typing.ml +++ b/kernel/term_typing.ml @@ -20,7 +20,6 @@ open Declarations open Environ open Entries open Typeops -open Fast_typeops module RelDecl = Context.Rel.Declaration module NamedDecl = Context.Named.Declaration diff --git a/kernel/typeops.ml b/kernel/typeops.ml index 24018ab31a..7d9a2aac09 100644 --- a/kernel/typeops.ml +++ b/kernel/typeops.ml @@ -14,11 +14,9 @@ open Term open Vars open Declarations open Environ -open Entries open Reduction open Inductive open Type_errors -open Context.Rel.Declaration module RelDecl = Context.Rel.Declaration module NamedDecl = Context.Named.Declaration @@ -38,61 +36,46 @@ let check_constraints cst env = if Environ.check_constraints cst env then () else error_unsatisfied_constraints env cst -(* This should be a type (a priori without intension to be an assumption) *) -let type_judgment env j = - match kind_of_term(whd_all env j.uj_type) with - | Sort s -> {utj_val = j.uj_val; utj_type = s } - | _ -> error_not_type env j +(* This should be a type (a priori without intention to be an assumption) *) +let check_type env c t = + match kind_of_term(whd_all env t) with + | Sort s -> s + | _ -> error_not_type env (make_judge c t) -(* This should be a type intended to be assumed. The error message is *) -(* not as useful as for [type_judgment]. *) -let assumption_of_judgment env j = - try (type_judgment env j).utj_val +(* This should be a type intended to be assumed. The error message is + not as useful as for [type_judgment]. *) +let check_assumption env t ty = + try let _ = check_type env t ty in t with TypeError _ -> - error_assumption env j + error_assumption env (make_judge t ty) (************************************************) -(* Incremental typing rules: builds a typing judgement given the *) -(* judgements for the subterms. *) +(* Incremental typing rules: builds a typing judgment given the *) +(* judgments for the subterms. *) (*s Type of sorts *) (* Prop and Set *) -let judge_of_prop = - { uj_val = mkProp; - uj_type = mkSort type1_sort } - -let judge_of_set = - { uj_val = mkSet; - uj_type = mkSort type1_sort } - -let judge_of_prop_contents = function - | Null -> judge_of_prop - | Pos -> judge_of_set +let type1 = mkSort type1_sort (* Type of Type(i). *) -let judge_of_type u = +let type_of_type u = let uu = Universe.super u in - { uj_val = mkType u; - uj_type = mkType uu } + mkType uu (*s Type of a de Bruijn index. *) -let judge_of_relative env n = +let type_of_relative env n = try - let typ = RelDecl.get_type (lookup_rel n env) in - { uj_val = mkRel n; - uj_type = lift n typ } + env |> lookup_rel n |> RelDecl.get_type |> lift n with Not_found -> error_unbound_rel env n (* Type of variables *) -let judge_of_variable env id = - try - let ty = named_type id env in - make_judge (mkVar id) ty +let type_of_variable env id = + try named_type id env with Not_found -> error_unbound_var env id @@ -101,7 +84,7 @@ let judge_of_variable env id = (* Checks if a context of variables can be instantiated by the variables of the current env. Order does not have to be checked assuming that all names are distinct *) -let check_hyps_inclusion env c sign = +let check_hyps_inclusion env f c sign = Context.Named.fold_outside (fun d1 () -> let open Context.Named.Declaration in @@ -117,7 +100,7 @@ let check_hyps_inclusion env c sign = | LocalDef _, LocalAssum _ -> raise NotConvertible | LocalDef (_,b2,_), LocalDef (_,b1,_) -> conv env b2 b1); with Not_found | NotConvertible | Option.Heterogeneous -> - error_reference_variables env id c) + error_reference_variables env id (f c)) sign ~init:() @@ -125,35 +108,9 @@ let check_hyps_inclusion env c sign = (* Make a type polymorphic if an arity *) -let extract_level env p = - let _,c = dest_prod_assum env p in - match kind_of_term c with Sort (Type u) -> Univ.Universe.level u | _ -> None - -let extract_context_levels env l = - let fold l = function - | LocalAssum (_,p) -> extract_level env p :: l - | LocalDef _ -> l - in - List.fold_left fold [] l - -let make_polymorphic_if_constant_for_ind env {uj_val = c; uj_type = t} = - let params, ccl = dest_prod_assum env t in - match kind_of_term ccl with - | Sort (Type u) -> - let ind, l = decompose_app (whd_all env c) in - if isInd ind && List.is_empty l then - let mis = lookup_mind_specif env (fst (destInd ind)) in - let nparams = Inductive.inductive_params mis in - let paramsl = CList.lastn nparams params in - let param_ccls = extract_context_levels env paramsl in - let s = { template_param_levels = param_ccls; template_level = u} in - TemplateArity (params,s) - else RegularArity t - | _ -> - RegularArity t - (* Type of constants *) + let type_of_constant_type_knowing_parameters env t paramtyps = match t with | RegularArity t -> t @@ -162,49 +119,28 @@ let type_of_constant_type_knowing_parameters env t paramtyps = let ctx,s = instantiate_universes env ctx ar paramtyps in mkArity (List.rev ctx,s) -let type_of_constant_knowing_parameters env cst paramtyps = - let cb = lookup_constant (fst cst) env in - let () = check_hyps_inclusion env (mkConstU cst) cb.const_hyps in +let type_of_constant_knowing_parameters env (kn,u as cst) args = + let cb = lookup_constant kn env in + let () = check_hyps_inclusion env mkConstU cst cb.const_hyps in let ty, cu = constant_type env cst in - type_of_constant_type_knowing_parameters env ty paramtyps, cu + let ty = type_of_constant_type_knowing_parameters env ty args in + let () = check_constraints cu env in + ty -let type_of_constant_knowing_parameters_in env cst paramtyps = - let cb = lookup_constant (fst cst) env in - let () = check_hyps_inclusion env (mkConstU cst) cb.const_hyps in +let type_of_constant_knowing_parameters_in env (kn,u as cst) args = + let cb = lookup_constant kn env in + let () = check_hyps_inclusion env mkConstU cst cb.const_hyps in let ty = constant_type_in env cst in - type_of_constant_type_knowing_parameters env ty paramtyps - -let type_of_constant_type env t = - type_of_constant_type_knowing_parameters env t [||] + type_of_constant_type_knowing_parameters env ty args let type_of_constant env cst = type_of_constant_knowing_parameters env cst [||] let type_of_constant_in env cst = - let cb = lookup_constant (fst cst) env in - let () = check_hyps_inclusion env (mkConstU cst) cb.const_hyps in - let ar = constant_type_in env cst in - type_of_constant_type_knowing_parameters env ar [||] - -let judge_of_constant_knowing_parameters env (kn,u as cst) args = - let c = mkConstU cst in - let ty, cu = type_of_constant_knowing_parameters env cst args in - let () = check_constraints cu env in - make_judge c ty - -let judge_of_constant env cst = - judge_of_constant_knowing_parameters env cst [||] - -let type_of_projection env (p,u) = - let cst = Projection.constant p in - let cb = lookup_constant cst env in - match cb.const_proj with - | Some pb -> - if cb.const_polymorphic then - Vars.subst_instance_constr u pb.proj_type - else pb.proj_type - | None -> raise (Invalid_argument "type_of_projection: not a projection") + type_of_constant_knowing_parameters_in env cst [||] +let type_of_constant_type env t = + type_of_constant_type_knowing_parameters env t [||] (* Type of a lambda-abstraction. *) @@ -218,40 +154,36 @@ let type_of_projection env (p,u) = and no upper constraint exists on the sort $s$, we don't need to compute $s$ *) -let judge_of_abstraction env name var j = - { uj_val = mkLambda (name, var.utj_val, j.uj_val); - uj_type = mkProd (name, var.utj_val, j.uj_type) } - -(* Type of let-in. *) - -let judge_of_letin env name defj typj j = - { uj_val = mkLetIn (name, defj.uj_val, typj.utj_val, j.uj_val) ; - uj_type = subst1 defj.uj_val j.uj_type } +let type_of_abstraction env name var ty = + mkProd (name, var, ty) (* Type of an application. *) -let judge_of_apply env funj argjv = - let rec apply_rec n typ = function - | [] -> - { uj_val = mkApp (j_val funj, Array.map j_val argjv); - uj_type = typ } - | hj::restjl -> - (match kind_of_term (whd_all env typ) with - | Prod (_,c1,c2) -> - (try - let () = conv_leq false env hj.uj_type c1 in - apply_rec (n+1) (subst1 hj.uj_val c2) restjl - with NotConvertible -> - error_cant_apply_bad_type env - (n,c1, hj.uj_type) - funj argjv) - - | _ -> - error_cant_apply_not_functional env funj argjv) - in - apply_rec 1 - funj.uj_type - (Array.to_list argjv) +let make_judgev c t = + Array.map2 make_judge c t + +let type_of_apply env func funt argsv argstv = + let len = Array.length argsv in + let rec apply_rec i typ = + if Int.equal i len then typ + else + (match kind_of_term (whd_all env typ) with + | Prod (_,c1,c2) -> + let arg = argsv.(i) and argt = argstv.(i) in + (try + let () = conv_leq false env argt c1 in + apply_rec (i+1) (subst1 arg c2) + with NotConvertible -> + error_cant_apply_bad_type env + (i+1,c1,argt) + (make_judge func funt) + (make_judgev argsv argstv)) + + | _ -> + error_cant_apply_not_functional env + (make_judge func funt) + (make_judgev argsv argstv)) + in apply_rec 0 funt (* Type of product *) @@ -284,10 +216,9 @@ let sort_of_product env domsort rangsort = where j.uj_type is convertible to a sort s2 *) -let judge_of_product env name t1 t2 = - let s = sort_of_product env t1.utj_type t2.utj_type in - { uj_val = mkProd (name, t1.utj_val, t2.utj_val); - uj_type = mkSort s } +let type_of_product env name s1 s2 = + let s = sort_of_product env s1 s2 in + mkSort s (* Type of a type cast *) @@ -298,29 +229,20 @@ let judge_of_product env name t1 t2 = env |- c:typ2 *) -let judge_of_cast env cj k tj = - let expected_type = tj.utj_val in +let check_cast env c ct k expected_type = try - let c, cst = - match k with - | VMcast -> - mkCast (cj.uj_val, k, expected_type), - Reduction.vm_conv CUMUL env cj.uj_type expected_type - | DEFAULTcast -> - mkCast (cj.uj_val, k, expected_type), - default_conv ~l2r:false CUMUL env cj.uj_type expected_type - | REVERTcast -> - cj.uj_val, - default_conv ~l2r:true CUMUL env cj.uj_type expected_type - | NATIVEcast -> - let sigma = Nativelambda.empty_evars in - mkCast (cj.uj_val, k, expected_type), - Nativeconv.native_conv CUMUL sigma env cj.uj_type expected_type - in - { uj_val = c; - uj_type = expected_type } + match k with + | VMcast -> + vm_conv CUMUL env ct expected_type + | DEFAULTcast -> + default_conv ~l2r:false CUMUL env ct expected_type + | REVERTcast -> + default_conv ~l2r:true CUMUL env ct expected_type + | NATIVEcast -> + let sigma = Nativelambda.empty_evars in + Nativeconv.native_conv CUMUL sigma env ct expected_type with NotConvertible -> - error_actual_type env cj expected_type + error_actual_type env (make_judge c ct) expected_type (* Inductive types. *) @@ -336,83 +258,78 @@ let judge_of_cast env cj k tj = the App case of execute; from this constraints, the expected dynamic constraints of the form u<=v are enforced *) -let judge_of_inductive_knowing_parameters env (ind,u as indu) args = - let c = mkIndU indu in +let type_of_inductive_knowing_parameters env (ind,u as indu) args = let (mib,mip) as spec = lookup_mind_specif env ind in - check_hyps_inclusion env c mib.mind_hyps; + check_hyps_inclusion env mkIndU indu mib.mind_hyps; let t,cst = Inductive.constrained_type_of_inductive_knowing_parameters env (spec,u) args in - check_constraints cst env; - make_judge c t + check_constraints cst env; + t -let judge_of_inductive env (ind,u as indu) = - let c = mkIndU indu in - let (mib,mip) as spec = lookup_mind_specif env ind in - check_hyps_inclusion env c mib.mind_hyps; - let t,cst = Inductive.constrained_type_of_inductive env (spec,u) in - check_constraints cst env; - (make_judge c t) +let type_of_inductive env (ind,u as indu) = + let (mib,mip) = lookup_mind_specif env ind in + check_hyps_inclusion env mkIndU indu mib.mind_hyps; + let t,cst = Inductive.constrained_type_of_inductive env ((mib,mip),u) in + check_constraints cst env; + t (* Constructors. *) -let judge_of_constructor env (c,u as cu) = - let constr = mkConstructU cu in - let _ = +let type_of_constructor env (c,u as cu) = + let () = let ((kn,_),_) = c in let mib = lookup_mind kn env in - check_hyps_inclusion env constr mib.mind_hyps in + check_hyps_inclusion env mkConstructU cu mib.mind_hyps + in let specif = lookup_mind_specif env (inductive_of_constructor c) in let t,cst = constrained_type_of_constructor cu specif in let () = check_constraints cst env in - (make_judge constr t) + t (* Case. *) -let check_branch_types env (ind,u) cj (lfj,explft) = - try conv_leq_vecti env (Array.map j_type lfj) explft +let check_branch_types env (ind,u) c ct lft explft = + try conv_leq_vecti env lft explft with NotConvertibleVect i -> - error_ill_formed_branch env cj.uj_val ((ind,i+1),u) lfj.(i).uj_type explft.(i) + error_ill_formed_branch env c ((ind,i+1),u) lft.(i) explft.(i) | Invalid_argument _ -> - error_number_branches env cj (Array.length explft) + error_number_branches env (make_judge c ct) (Array.length explft) -let judge_of_case env ci pj cj lfj = +let type_of_case env ci p pt c ct lf lft = let (pind, _ as indspec) = - try find_rectype env cj.uj_type - with Not_found -> error_case_not_inductive env cj in + try find_rectype env ct + with Not_found -> error_case_not_inductive env (make_judge c ct) in let () = check_case_info env pind ci in let (bty,rslty) = - type_case_branches env indspec pj cj.uj_val in - let () = check_branch_types env pind cj (lfj,bty) in - ({ uj_val = mkCase (ci, (*nf_betaiota*) pj.uj_val, cj.uj_val, - Array.map j_val lfj); - uj_type = rslty }) + type_case_branches env indspec (make_judge p pt) c in + let () = check_branch_types env pind c ct lft bty in + rslty -let judge_of_projection env p cj = +let type_of_projection env p c ct = let pb = lookup_projection p env in let (ind,u), args = - try find_rectype env cj.uj_type - with Not_found -> error_case_not_inductive env cj + try find_rectype env ct + with Not_found -> error_case_not_inductive env (make_judge c ct) in - assert(eq_mind pb.proj_ind (fst ind)); - let ty = Vars.subst_instance_constr u pb.Declarations.proj_type in - let ty = substl (cj.uj_val :: List.rev args) ty in - {uj_val = mkProj (p,cj.uj_val); - uj_type = ty} + assert(eq_mind pb.proj_ind (fst ind)); + let ty = Vars.subst_instance_constr u pb.Declarations.proj_type in + substl (c :: List.rev args) ty + (* Fixpoints. *) (* Checks the type of a general (co)fixpoint, i.e. without checking *) (* the specific guard condition. *) -let type_fixpoint env lna lar vdefj = - let lt = Array.length vdefj in +let check_fixpoint env lna lar vdef vdeft = + let lt = Array.length vdeft in assert (Int.equal (Array.length lar) lt); try - conv_leq_vecti env (Array.map j_type vdefj) (Array.map (fun ty -> lift lt ty) lar) + conv_leq_vecti env vdeft (Array.map (fun ty -> lift lt ty) lar) with NotConvertibleVect i -> - error_ill_typed_rec_body env i lna vdefj lar + error_ill_typed_rec_body env i lna (make_judgev vdef vdeft) lar (************************************************************************) (************************************************************************) @@ -422,95 +339,96 @@ let type_fixpoint env lna lar vdefj = Ind et Constructsi un jour cela devient des constructions arbitraires et non plus des variables *) let rec execute env cstr = + let open Context.Rel.Declaration in match kind_of_term cstr with (* Atomic terms *) | Sort (Prop c) -> - judge_of_prop_contents c + type1 | Sort (Type u) -> - judge_of_type u + type_of_type u | Rel n -> - judge_of_relative env n + type_of_relative env n | Var id -> - judge_of_variable env id + type_of_variable env id | Const c -> - judge_of_constant env c + type_of_constant env c | Proj (p, c) -> - let cj = execute env c in - judge_of_projection env p cj + let ct = execute env c in + type_of_projection env p c ct (* Lambda calculus operators *) | App (f,args) -> - let jl = execute_array env args in - let j = + let argst = execute_array env args in + let ft = match kind_of_term f with - | Ind ind when Environ.template_polymorphic_pind ind env -> - (* Sort-polymorphism of inductive types *) - let args = Array.map (fun j -> lazy j.uj_type) jl in - judge_of_inductive_knowing_parameters env ind args - | Const cst when Environ.template_polymorphic_pconstant cst env -> - (* Sort-polymorphism of constant *) - let args = Array.map (fun j -> lazy j.uj_type) jl in - judge_of_constant_knowing_parameters env cst args - | _ -> - (* No sort-polymorphism *) - execute env f + | Ind ind when Environ.template_polymorphic_pind ind env -> + (* Template sort-polymorphism of inductive types *) + let args = Array.map (fun t -> lazy t) argst in + type_of_inductive_knowing_parameters env ind args + | Const cst when Environ.template_polymorphic_pconstant cst env -> + (* Template sort-polymorphism of constants *) + let args = Array.map (fun t -> lazy t) argst in + type_of_constant_knowing_parameters env cst args + | _ -> + (* Full or no sort-polymorphism *) + execute env f in - judge_of_apply env j jl + + type_of_apply env f ft args argst | Lambda (name,c1,c2) -> - let varj = execute_type env c1 in - let env1 = push_rel (LocalAssum (name,varj.utj_val)) env in - let j' = execute env1 c2 in - judge_of_abstraction env name varj j' + let _ = execute_is_type env c1 in + let env1 = push_rel (LocalAssum (name,c1)) env in + let c2t = execute env1 c2 in + type_of_abstraction env name c1 c2t | Prod (name,c1,c2) -> - let varj = execute_type env c1 in - let env1 = push_rel (LocalAssum (name,varj.utj_val)) env in - let varj' = execute_type env1 c2 in - judge_of_product env name varj varj' + let vars = execute_is_type env c1 in + let env1 = push_rel (LocalAssum (name,c1)) env in + let vars' = execute_is_type env1 c2 in + type_of_product env name vars vars' | LetIn (name,c1,c2,c3) -> - let j1 = execute env c1 in - let j2 = execute_type env c2 in - let _ = judge_of_cast env j1 DEFAULTcast j2 in - let env1 = push_rel (LocalDef (name,j1.uj_val,j2.utj_val)) env in - let j' = execute env1 c3 in - judge_of_letin env name j1 j2 j' + let c1t = execute env c1 in + let _c2s = execute_is_type env c2 in + let () = check_cast env c1 c1t DEFAULTcast c2 in + let env1 = push_rel (LocalDef (name,c1,c2)) env in + let c3t = execute env1 c3 in + subst1 c1 c3t | Cast (c,k,t) -> - let cj = execute env c in - let tj = execute_type env t in - judge_of_cast env cj k tj + let ct = execute env c in + let _ts = (check_type env t (execute env t)) in + let () = check_cast env c ct k t in + t (* Inductive types *) | Ind ind -> - judge_of_inductive env ind + type_of_inductive env ind | Construct c -> - judge_of_constructor env c + type_of_constructor env c | Case (ci,p,c,lf) -> - let cj = execute env c in - let pj = execute env p in - let lfj = execute_array env lf in - judge_of_case env ci pj cj lfj + let ct = execute env c in + let pt = execute env p in + let lft = execute_array env lf in + type_of_case env ci p pt c ct lf lft | Fix ((vn,i as vni),recdef) -> let (fix_ty,recdef') = execute_recdef env recdef i in let fix = (vni,recdef') in - check_fix env fix; - make_judge (mkFix fix) fix_ty + check_fix env fix; fix_ty | CoFix (i,recdef) -> let (fix_ty,recdef') = execute_recdef env recdef i in let cofix = (i,recdef') in - check_cofix env cofix; - (make_judge (mkCoFix cofix) fix_ty) + check_cofix env cofix; fix_ty (* Partial proofs: unsupported by the kernel *) | Meta _ -> @@ -519,53 +437,158 @@ let rec execute env cstr = | Evar _ -> anomaly (Pp.str "the kernel does not support existential variables") -and execute_type env constr = - let j = execute env constr in - type_judgment env j +and execute_is_type env constr = + let t = execute env constr in + check_type env constr t and execute_recdef env (names,lar,vdef) i = - let larj = execute_array env lar in - let lara = Array.map (assumption_of_judgment env) larj in + let lart = execute_array env lar in + let lara = Array.map2 (check_assumption env) lar lart in let env1 = push_rec_types (names,lara,vdef) env in - let vdefj = execute_array env1 vdef in - let vdefv = Array.map j_val vdefj in - let () = type_fixpoint env1 names lara vdefj in - (lara.(i),(names,lara,vdefv)) + let vdeft = execute_array env1 vdef in + let () = check_fixpoint env1 names lara vdef vdeft in + (lara.(i),(names,lara,vdef)) and execute_array env = Array.map (execute env) (* Derived functions *) let infer env constr = - let j = execute env constr in - assert (eq_constr j.uj_val constr); - j + let t = execute env constr in + make_judge constr t + +let infer = + if Flags.profile then + let infer_key = Profile.declare_profile "Fast_infer" in + Profile.profile2 infer_key (fun b c -> infer b c) + else (fun b c -> infer b c) + +let assumption_of_judgment env {uj_val=c; uj_type=t} = + check_assumption env c t -(* let infer_key = Profile.declare_profile "infer" *) -(* let infer = Profile.profile2 infer_key infer *) +let type_judgment env {uj_val=c; uj_type=t} = + let s = check_type env c t in + {utj_val = c; utj_type = s } let infer_type env constr = - let j = execute_type env constr in - j + let t = execute env constr in + let s = check_type env constr t in + {utj_val = constr; utj_type = s} let infer_v env cv = let jv = execute_array env cv in - jv + make_judgev cv jv (* Typing of several terms. *) let infer_local_decl env id = function - | LocalDefEntry c -> - let j = infer env c in - LocalDef (Name id, j.uj_val, j.uj_type) - | LocalAssumEntry c -> - let j = infer env c in - LocalAssum (Name id, assumption_of_judgment env j) + | Entries.LocalDefEntry c -> + let t = execute env c in + RelDecl.LocalDef (Name id, c, t) + | Entries.LocalAssumEntry c -> + let t = execute env c in + RelDecl.LocalAssum (Name id, check_assumption env c t) let infer_local_decls env decls = let rec inferec env = function | (id, d) :: l -> let (env, l) = inferec env l in let d = infer_local_decl env id d in - (push_rel d env, Context.Rel.add d l) - | [] -> (env, Context.Rel.empty) in + (push_rel d env, Context.Rel.add d l) + | [] -> (env, Context.Rel.empty) + in inferec env decls + +let judge_of_prop = make_judge mkProp type1 +let judge_of_set = make_judge mkSet type1 +let judge_of_type u = make_judge (mkType u) (type_of_type u) + +let judge_of_prop_contents = function + | Null -> judge_of_prop + | Pos -> judge_of_set + +let judge_of_relative env k = make_judge (mkRel k) (type_of_relative env k) + +let judge_of_variable env x = make_judge (mkVar x) (type_of_variable env x) + +let judge_of_constant env cst = make_judge (mkConstU cst) (type_of_constant env cst) +let judge_of_constant_knowing_parameters env cst args = + make_judge (mkConstU cst) (type_of_constant_knowing_parameters env cst args) + +let judge_of_projection env p cj = + make_judge (mkProj (p,cj.uj_val)) (type_of_projection env p cj.uj_val cj.uj_type) + +let dest_judgev v = + Array.map j_val v, Array.map j_type v + +let judge_of_apply env funj argjv = + let args, argtys = dest_judgev argjv in + make_judge (mkApp (funj.uj_val, args)) (type_of_apply env funj.uj_val funj.uj_type args argtys) + +let judge_of_abstraction env x varj bodyj = + make_judge (mkLambda (x, varj.utj_val, bodyj.uj_val)) + (type_of_abstraction env x varj.utj_val bodyj.uj_type) + +let judge_of_product env x varj outj = + make_judge (mkProd (x, varj.utj_val, outj.utj_val)) + (mkSort (sort_of_product env varj.utj_type outj.utj_type)) + +let judge_of_letin env name defj typj j = + make_judge (mkLetIn (name, defj.uj_val, typj.utj_val, j.uj_val)) + (subst1 defj.uj_val j.uj_type) + +let judge_of_cast env cj k tj = + let () = check_cast env cj.uj_val cj.uj_type k tj.utj_val in + let c = match k with | REVERTcast -> cj.uj_val | _ -> mkCast (cj.uj_val, k, tj.utj_val) in + make_judge c tj.utj_val + +let judge_of_inductive env indu = + make_judge (mkIndU indu) (type_of_inductive env indu) + +let judge_of_constructor env cu = + make_judge (mkConstructU cu) (type_of_constructor env cu) + +let judge_of_case env ci pj cj lfj = + let lf, lft = dest_judgev lfj in + make_judge (mkCase (ci, (*nf_betaiota*) pj.uj_val, cj.uj_val, lft)) + (type_of_case env ci pj.uj_val pj.uj_type cj.uj_val cj.uj_type lf lft) + +let type_of_projection_constant env (p,u) = + let cst = Projection.constant p in + let cb = lookup_constant cst env in + match cb.const_proj with + | Some pb -> + if cb.const_polymorphic then + Vars.subst_instance_constr u pb.proj_type + else pb.proj_type + | None -> raise (Invalid_argument "type_of_projection: not a projection") + +(* Instantiation of terms on real arguments. *) + +(* Make a type polymorphic if an arity *) + +let extract_level env p = + let _,c = dest_prod_assum env p in + match kind_of_term c with Sort (Type u) -> Univ.Universe.level u | _ -> None + +let extract_context_levels env l = + let fold l = function + | RelDecl.LocalAssum (_,p) -> extract_level env p :: l + | RelDecl.LocalDef _ -> l + in + List.fold_left fold [] l + +let make_polymorphic_if_constant_for_ind env {uj_val = c; uj_type = t} = + let params, ccl = dest_prod_assum env t in + match kind_of_term ccl with + | Sort (Type u) -> + let ind, l = decompose_app (whd_all env c) in + if isInd ind && List.is_empty l then + let mis = lookup_mind_specif env (fst (destInd ind)) in + let nparams = Inductive.inductive_params mis in + let paramsl = CList.lastn nparams params in + let param_ccls = extract_context_levels env paramsl in + let s = { template_param_levels = param_ccls; template_level = u} in + TemplateArity (params,s) + else RegularArity t + | _ -> + RegularArity t diff --git a/kernel/typeops.mli b/kernel/typeops.mli index cfc82c1589..73c63db681 100644 --- a/kernel/typeops.mli +++ b/kernel/typeops.mli @@ -15,7 +15,7 @@ open Declarations (** {6 Typing functions (not yet tagged as safe) } - They return unsafe judgments that are "in context" of a set of + They return unsafe judgments that are "in context" of a set of (local) universe variables (the ones that appear in the term) and associated constraints. In case of polymorphic definitions, these variables and constraints will be generalized. @@ -101,15 +101,11 @@ val judge_of_case : env -> case_info -> unsafe_judgment -> unsafe_judgment -> unsafe_judgment array -> unsafe_judgment -(** Typecheck general fixpoint (not checking guard conditions) *) -(* val type_fixpoint : env -> Name.t array -> types array *) -(* -> unsafe_judgment array -> unit *) - (* val type_of_constant : env -> pconstant -> types constrained *) val type_of_constant_type : env -> constant_type -> types -val type_of_projection : env -> Names.projection puniverses -> types +val type_of_projection_constant : env -> Names.projection puniverses -> types val type_of_constant_in : env -> pconstant -> types @@ -127,4 +123,4 @@ val make_polymorphic_if_constant_for_ind : env -> unsafe_judgment -> constant_type (** Check that hyps are included in env and fails with error otherwise *) -val check_hyps_inclusion : env -> constr -> Context.Named.t -> unit +val check_hyps_inclusion : env -> ('a -> constr) -> 'a -> Context.Named.t -> unit diff --git a/pretyping/inductiveops.ml b/pretyping/inductiveops.ml index 29f57144a9..ac6d775e34 100644 --- a/pretyping/inductiveops.ml +++ b/pretyping/inductiveops.ml @@ -24,14 +24,14 @@ open Context.Rel.Declaration let type_of_inductive env (ind,u) = let (mib,_ as specif) = Inductive.lookup_mind_specif env ind in - Typeops.check_hyps_inclusion env (mkInd ind) mib.mind_hyps; + Typeops.check_hyps_inclusion env mkInd ind mib.mind_hyps; Inductive.type_of_inductive env (specif,u) (* Return type as quoted by the user *) let type_of_constructor env (cstr,u) = let (mib,_ as specif) = Inductive.lookup_mind_specif env (inductive_of_constructor cstr) in - Typeops.check_hyps_inclusion env (mkConstruct cstr) mib.mind_hyps; + Typeops.check_hyps_inclusion env mkConstruct cstr mib.mind_hyps; Inductive.type_of_constructor (cstr,u) specif (* Return constructor types in user form *) @@ -615,7 +615,7 @@ let type_of_projection_knowing_arg env sigma p c ty = raise (Invalid_argument "type_of_projection_knowing_arg_type: not an inductive type") in let (_,u), pars = dest_ind_family pars in - substl (c :: List.rev pars) (Typeops.type_of_projection env (p,u)) + substl (c :: List.rev pars) (Typeops.type_of_projection_constant env (p,u)) (***********************************************) (* Guard condition *) -- cgit v1.2.3 From 42f27beb63a629dcef514abb0b31dea193f35a38 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Fri, 16 Dec 2016 11:27:42 +0100 Subject: Fix incorrect documentation that prevents successful compilation (bug #5265). --- doc/refman/RefMan-syn.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/refman/RefMan-syn.tex b/doc/refman/RefMan-syn.tex index 1fcc1c0df4..21c39de967 100644 --- a/doc/refman/RefMan-syn.tex +++ b/doc/refman/RefMan-syn.tex @@ -649,7 +649,7 @@ A recursive pattern for binders can be used in position of a recursive pattern for terms. Here is an example: \begin{coq_example*} -Notation ``'FUNAPP' x .. y , f'' := +Notation "'FUNAPP' x .. y , f" := (fun x => .. (fun y => (.. (f x) ..) y ) ..) (at level 200, x binder, y binder, right associativity). \end{coq_example*} -- cgit v1.2.3 From 6bc7e65a97c27918ae8d20aade5a2d93bf8127fa Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Thu, 15 Dec 2016 21:39:52 +0100 Subject: Use Pp.quote in string options. --- library/goptions.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/goptions.ml b/library/goptions.ml index 7ddf46bdde..1c08b9539f 100644 --- a/library/goptions.ml +++ b/library/goptions.ml @@ -382,9 +382,9 @@ let msg_option_value (name,v) = | BoolValue false -> str "off" | IntValue (Some n) -> int n | IntValue None -> str "undefined" - | StringValue s -> str "\"" ++ str s ++ str "\"" + | StringValue s -> quote (str s) | StringOptValue None -> str"undefined" - | StringOptValue (Some s) -> str "\"" ++ str s ++ str "\"" + | StringOptValue (Some s) -> quote (str s) (* | IdentValue r -> pr_global_env Id.Set.empty r *) let print_option_value key = -- cgit v1.2.3 From fe4a29ef11c2db8ffb26ef0ba0775fc939471ac9 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Mon, 19 Dec 2016 08:49:15 +0100 Subject: Bump required OCaml version to 4.02.3. Was decided during the working group on September, 28th. --- configure.ml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/configure.ml b/configure.ml index 989f2ee223..8a0d9afd08 100644 --- a/configure.ml +++ b/configure.ml @@ -487,19 +487,14 @@ let caml_version_nums = "Is it installed properly?") let check_caml_version () = - if caml_version_nums >= [4;1;0] then - if caml_version_nums = [4;2;0] && not !Prefs.force_caml_version then - die ("Your version of OCaml is 4.02.0 which suffers from a bug inducing\n" ^ - "very slow compilation times. If you still want to use it, use \n" ^ - "option -force-caml-version.\n") - else - printf "You have OCaml %s. Good!\n" caml_version + if caml_version_nums >= [4;2;3] then + printf "You have OCaml %s. Good!\n" caml_version else let () = printf "Your version of OCaml is %s.\n" caml_version in if !Prefs.force_caml_version then printf "*Warning* Your version of OCaml is outdated.\n" else - die "You need OCaml 4.01 or later." + die "You need OCaml 4.02.3 or later." let _ = check_caml_version () @@ -554,13 +549,6 @@ let check_camlp5_version camlp5o = printf "You have Camlp5 %s. Good!\n" version; version | _ -> die "Error: unsupported Camlp5 (version < 6.06 or unrecognized).\n" -let check_caml_version_for_camlp4 () = - if caml_version_nums = [4;1;0] && !Prefs.debug && not !Prefs.force_caml_version then - die ("Your version of OCaml is detected to be 4.01.0 which fails to compile\n" ^ - "Coq in -debug mode with Camlp4. Remove -debug option or use a different\n" ^ - "version of OCaml or use Camlp5, or bypass this test by using option\n" ^ - "-force-caml-version.\n") - let config_camlpX () = try if not !Prefs.usecamlp5 then raise NoCamlp5; @@ -579,7 +567,6 @@ let config_camlpX () = let camlp4orf = which_camlpX "camlp4orf" in let version_line, _ = run ~err:StdOut camlp4orf ["-v"] in let camlp4_version = List.nth (string_split ' ' version_line) 2 in - check_caml_version_for_camlp4 (); "camlp4", camlp4orf, Filename.dirname camlp4orf, camlp4libdir, camlp4mod, camlp4_version with _ -> die "No Camlp4 installation found.\n" -- cgit v1.2.3 From a56e966162aee59b6044c1fd1d9d4e43c33eba35 Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Mon, 12 Dec 2016 16:37:03 -0500 Subject: Fix a typo in Hurkens.v comment --- theories/Logic/Hurkens.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theories/Logic/Hurkens.v b/theories/Logic/Hurkens.v index 841f843c07..56e03e965c 100644 --- a/theories/Logic/Hurkens.v +++ b/theories/Logic/Hurkens.v @@ -562,7 +562,7 @@ End Paradox. End NoRetractFromSmallPropositionToProp. -(** * Large universes are no retracts of [Prop]. *) +(** * Large universes are not retracts of [Prop]. *) (** The existence in the Calculus of Constructions with universes of a retract from some [Type] universe into [Prop] is inconsistent. *) -- cgit v1.2.3 From c793d102df3e007d824e79f499e71823207c301a Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Mon, 19 Dec 2016 11:58:39 +0100 Subject: Avoid concurrent runs when producing html documentation (bug #5269). Make does not allow for rules that produce multiple outputs (unless they are pattern rules). As a consequence, the hacha rule could be run several times concurrently, thus causing doc/refman/html to be deleted under the feet of some runs. This commit fixes the issue by turning the rule into a single-output rule and adding a dummy rule to handle all the other indexes. Note that this is not a perfect solution since, if the user were to manually delete one of the auxiliary index, it would not be rebuilt until the main index is. --- Makefile.doc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.doc b/Makefile.doc index cdd9852e87..9ae20ba765 100644 --- a/Makefile.doc +++ b/Makefile.doc @@ -201,15 +201,17 @@ doc/refman/styles.hva: doc/common/styles/html/$(HTMLSTYLE)/styles.hva $(INSTALLLIB) $< doc/refman INDEXES:= doc/refman/html/command-index.html doc/refman/html/tactic-index.html -ALLINDEXES:= doc/refman/html/index.html $(INDEXES) -refman-html-dir $(ALLINDEXES): doc/refman/Reference-Manual.html $(REFMANPNGFILES) \ +refman-html-dir $(INDEXES): doc/refman/html/index.html ; + +doc/refman/html/index.html: doc/refman/Reference-Manual.html $(REFMANPNGFILES) \ doc/refman/cover.html doc/refman/styles.hva doc/refman/index.html - rm -rf doc/refman/html $(MKDIR) doc/refman/html $(INSTALLLIB) $(REFMANPNGFILES) doc/refman/html (cd doc/refman/html; $(HACHA) -nolinks -tocbis -o toc.html ../styles.hva ../Reference-Manual.html) $(INSTALLLIB) doc/refman/cover.html doc/refman/html/index.html + @touch $(INDEXES) -$(INSTALLLIB) doc/common/styles/html/$(HTMLSTYLE)/*.css doc/refman/html refman-quick: -- cgit v1.2.3 From ac630f12c9d80c9387d44f3f1a1b22db5b5b89da Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Thu, 22 Dec 2016 13:48:01 +0100 Subject: Fixing anomaly EqUnknown in Equality Scheme (#5278). --- toplevel/auto_ind_decl.ml | 18 +++++++++--------- toplevel/indschemes.ml | 3 +++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/toplevel/auto_ind_decl.ml b/toplevel/auto_ind_decl.ml index b3144fa927..a527be32ba 100644 --- a/toplevel/auto_ind_decl.ml +++ b/toplevel/auto_ind_decl.ml @@ -204,19 +204,19 @@ let build_beq_scheme mode kn = end | Sort _ -> raise InductiveWithSort | Prod _ -> raise InductiveWithProduct - | Lambda _-> raise (EqUnknown "Lambda") - | LetIn _ -> raise (EqUnknown "LetIn") + | Lambda _-> raise (EqUnknown "abstraction") + | LetIn _ -> raise (EqUnknown "let-in") | Const kn -> (match Environ.constant_opt_value_in env kn with | None -> raise (ParameterWithoutEquality (fst kn)) | Some c -> aux (applist (c,a))) - | Proj _ -> raise (EqUnknown "Proj") - | Construct _ -> raise (EqUnknown "Construct") - | Case _ -> raise (EqUnknown "Case") - | CoFix _ -> raise (EqUnknown "CoFix") - | Fix _ -> raise (EqUnknown "Fix") - | Meta _ -> raise (EqUnknown "Meta") - | Evar _ -> raise (EqUnknown "Evar") + | Proj _ -> raise (EqUnknown "projection") + | Construct _ -> raise (EqUnknown "constructor") + | Case _ -> raise (EqUnknown "match") + | CoFix _ -> raise (EqUnknown "cofix") + | Fix _ -> raise (EqUnknown "fix") + | Meta _ -> raise (EqUnknown "meta-variable") + | Evar _ -> raise (EqUnknown "existential variable") in aux t in diff --git a/toplevel/indschemes.ml b/toplevel/indschemes.ml index aa2362ae5f..0e59f1aa98 100644 --- a/toplevel/indschemes.ml +++ b/toplevel/indschemes.ml @@ -185,6 +185,9 @@ let try_declare_scheme what f internal names kn = | DecidabilityMutualNotSupported -> alarm what internal (str "Decidability lemma for mutual inductive types not supported.") + | EqUnknown s -> + alarm what internal + (str "Found unsupported " ++ str s ++ str " while building Boolean equality.") | e when Errors.noncritical e -> alarm what internal (str "Unexpected error during scheme creation: " ++ Errors.print e) -- cgit v1.2.3 From f5575393258492837d3764d07f8290b576f61160 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Thu, 22 Dec 2016 21:32:35 +0100 Subject: Fixing injection in the presence of let-in in constructors. This also fixes decide equality, discriminate, ... (see e.g. #5279). --- kernel/vars.ml | 9 +++++++++ kernel/vars.mli | 4 ++++ tactics/equality.ml | 13 ++++++++----- test-suite/success/Discriminate.v | 7 +++++++ test-suite/success/Injection.v | 7 +++++++ 5 files changed, 35 insertions(+), 5 deletions(-) diff --git a/kernel/vars.ml b/kernel/vars.ml index b27e27fdac..4affb5f9fb 100644 --- a/kernel/vars.ml +++ b/kernel/vars.ml @@ -181,6 +181,15 @@ let subst_of_rel_context_instance sign l = let adjust_subst_to_rel_context sign l = List.rev (subst_of_rel_context_instance sign l) +let adjust_rel_to_rel_context sign n = + let rec aux sign = + let open RelDecl in + match sign with + | LocalAssum _ :: sign' -> let (n',p) = aux sign' in (n'+1,p) + | LocalDef (_,c,_)::sign' -> let (n',p) = aux sign' in (n'+1,if n' (0,n) + in snd (aux sign) + (* (thin_val sigma) removes identity substitutions from sigma *) let rec thin_val = function diff --git a/kernel/vars.mli b/kernel/vars.mli index 574d50eccb..f7535e6d8f 100644 --- a/kernel/vars.mli +++ b/kernel/vars.mli @@ -73,6 +73,10 @@ val subst_of_rel_context_instance : Context.Rel.t -> constr list -> substl (** For compatibility: returns the substitution reversed *) val adjust_subst_to_rel_context : Context.Rel.t -> constr list -> constr list +(** Take an index in an instance of a context and returns its index wrt to + the full context (e.g. 2 in [x:A;y:=b;z:C] is 3, i.e. a reference to z) *) +val adjust_rel_to_rel_context : Context.Rel.t -> int -> int + (** [substnl [a₁;...;an] k c] substitutes in parallel [a₁],...,[an] for respectively [Rel(k+1)],...,[Rel(k+n)] in [c]; it relocates accordingly indexes in [an],...,[a1] and [c]. In terms of typing, if diff --git a/tactics/equality.ml b/tactics/equality.ml index a0d2da863d..d44dcf10df 100644 --- a/tactics/equality.ml +++ b/tactics/equality.ml @@ -725,7 +725,7 @@ let find_positions env sigma t1 t2 = let hd1,args1 = whd_all_stack env sigma t1 in let hd2,args2 = whd_all_stack env sigma t2 in match (kind_of_term hd1, kind_of_term hd2) with - | Construct (sp1,_), Construct (sp2,_) + | Construct ((ind1,i1 as sp1),u1), Construct (sp2,_) when Int.equal (List.length args1) (constructor_nallargs_env env sp1) -> let sorts' = @@ -734,11 +734,14 @@ let find_positions env sigma t1 t2 = (* both sides are fully applied constructors, so either we descend, or we can discriminate here. *) if eq_constructor sp1 sp2 then - let nrealargs = constructor_nrealargs_env env sp1 in - let rargs1 = List.lastn nrealargs args1 in - let rargs2 = List.lastn nrealargs args2 in + let nparams = inductive_nparams_env env ind1 in + let params1,rargs1 = List.chop nparams args1 in + let _,rargs2 = List.chop nparams args2 in + let (mib,mip) = lookup_mind_specif env ind1 in + let ctxt = (get_constructor ((ind1,u1),mib,mip,params1) i1).cs_args in + let adjust i = Vars.adjust_rel_to_rel_context ctxt (i+1) - 1 in List.flatten - (List.map2_i (fun i -> findrec sorts' ((sp1,i)::posn)) + (List.map2_i (fun i -> findrec sorts' ((sp1,adjust i)::posn)) 0 rargs1 rargs2) else if Sorts.List.mem InType sorts' then (* see build_discriminator *) diff --git a/test-suite/success/Discriminate.v b/test-suite/success/Discriminate.v index a759674115..6abfca4c3f 100644 --- a/test-suite/success/Discriminate.v +++ b/test-suite/success/Discriminate.v @@ -38,3 +38,10 @@ Abort. Goal ~ identity 0 1. discriminate. Qed. + +(* Check discriminate on types with local definitions *) + +Inductive A := B (T := unit) (x y : bool) (z := x). +Goal forall x y, B x true = B y false -> False. +discriminate. +Qed. diff --git a/test-suite/success/Injection.v b/test-suite/success/Injection.v index da2183841d..78652fb64b 100644 --- a/test-suite/success/Injection.v +++ b/test-suite/success/Injection.v @@ -150,6 +150,13 @@ match goal with end. Abort. +(* Injection in the presence of local definitions *) +Inductive A := B (T := unit) (x y : bool) (z := x). +Goal forall x y x' y', B x y = B x' y' -> y = y'. +intros * [= H1 H2]. +exact H2. +Qed. + (* Injection does not project at positions in Prop... allow it? Inductive t (A:Prop) : Set := c : A -> t A. -- cgit v1.2.3 From 50c7e47da5e9eac9228ff0e2feeb283fcfebe1bc Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Thu, 22 Dec 2016 22:31:17 +0100 Subject: Fixing #5277 (Scheme Equality not robust wrt choice of names). This is only a quick fix, as hinted by Jason. --- test-suite/bugs/closed/5277.v | 11 +++++++++++ toplevel/auto_ind_decl.ml | 31 ++++++++++++++++++------------- 2 files changed, 29 insertions(+), 13 deletions(-) create mode 100644 test-suite/bugs/closed/5277.v diff --git a/test-suite/bugs/closed/5277.v b/test-suite/bugs/closed/5277.v new file mode 100644 index 0000000000..7abc38bfce --- /dev/null +++ b/test-suite/bugs/closed/5277.v @@ -0,0 +1,11 @@ +(* Scheme Equality not robust wrt names *) + +Module A1. + Inductive A (T : Type) := C (a : T). + Scheme Equality for A. (* success *) +End A1. + +Module A2. + Inductive A (x : Type) := C (a : x). + Scheme Equality for A. +End A2. diff --git a/toplevel/auto_ind_decl.ml b/toplevel/auto_ind_decl.ml index b1811d6a65..f4b0b1b776 100644 --- a/toplevel/auto_ind_decl.ml +++ b/toplevel/auto_ind_decl.ml @@ -520,12 +520,15 @@ let eqI ind l = (**********************************************************************) (* Boolean->Leibniz *) +open Namegen + let compute_bl_goal ind lnamesparrec nparrec = let eqI, eff = eqI ind lnamesparrec in let list_id = list_id lnamesparrec in + let avoid = List.fold_right (Nameops.name_fold (fun id l -> id::l)) (List.map RelDecl.get_name lnamesparrec) [] in let create_input c = - let x = Id.of_string "x" and - y = Id.of_string "y" in + let x = next_ident_away (Id.of_string "x") avoid and + y = next_ident_away (Id.of_string "y") avoid in let bl_typ = List.map (fun (s,seq,_,_) -> mkNamedProd x (mkVar s) ( mkNamedProd y (mkVar s) ( @@ -544,11 +547,11 @@ let compute_bl_goal ind lnamesparrec nparrec = mkNamedProd seq b a ) bl_input (List.rev list_id) (List.rev eqs_typ) in List.fold_left (fun a decl -> mkNamedProd - (match RelDecl.get_name decl with Name s -> s | Anonymous -> Id.of_string "A") + (match RelDecl.get_name decl with Name s -> s | Anonymous -> next_ident_away (Id.of_string "A") avoid) (RelDecl.get_type decl) a) eq_input lnamesparrec in - let n = Id.of_string "x" and - m = Id.of_string "y" in + let n = next_ident_away (Id.of_string "x") avoid and + m = next_ident_away (Id.of_string "y") avoid in let u = Univ.Instance.empty in create_input ( mkNamedProd n (mkFullInd (ind,u) nparrec) ( @@ -665,10 +668,11 @@ let _ = bl_scheme_kind_aux := fun () -> bl_scheme_kind let compute_lb_goal ind lnamesparrec nparrec = let list_id = list_id lnamesparrec in let eq = Lazy.force eq and tt = Lazy.force tt and bb = Lazy.force bb in + let avoid = List.fold_right (Nameops.name_fold (fun id l -> id::l)) (List.map RelDecl.get_name lnamesparrec) [] in let eqI, eff = eqI ind lnamesparrec in let create_input c = - let x = Id.of_string "x" and - y = Id.of_string "y" in + let x = next_ident_away (Id.of_string "x") avoid and + y = next_ident_away (Id.of_string "y") avoid in let lb_typ = List.map (fun (s,seq,_,_) -> mkNamedProd x (mkVar s) ( mkNamedProd y (mkVar s) ( @@ -690,8 +694,8 @@ let compute_lb_goal ind lnamesparrec nparrec = (match (RelDecl.get_name decl) with Name s -> s | Anonymous -> Id.of_string "A") (RelDecl.get_type decl) a) eq_input lnamesparrec in - let n = Id.of_string "x" and - m = Id.of_string "y" in + let n = next_ident_away (Id.of_string "x") avoid and + m = next_ident_away (Id.of_string "y") avoid in let u = Univ.Instance.empty in create_input ( mkNamedProd n (mkFullInd (ind,u) nparrec) ( @@ -794,9 +798,10 @@ let compute_dec_goal ind lnamesparrec nparrec = check_not_is_defined (); let eq = Lazy.force eq and tt = Lazy.force tt and bb = Lazy.force bb in let list_id = list_id lnamesparrec in + let avoid = List.fold_right (Nameops.name_fold (fun id l -> id::l)) (List.map RelDecl.get_name lnamesparrec) [] in let create_input c = - let x = Id.of_string "x" and - y = Id.of_string "y" in + let x = next_ident_away (Id.of_string "x") avoid and + y = next_ident_away (Id.of_string "y") avoid in let lb_typ = List.map (fun (s,seq,_,_) -> mkNamedProd x (mkVar s) ( mkNamedProd y (mkVar s) ( @@ -831,8 +836,8 @@ let compute_dec_goal ind lnamesparrec nparrec = (match RelDecl.get_name decl with Name s -> s | Anonymous -> Id.of_string "A") (RelDecl.get_type decl) a) eq_input lnamesparrec in - let n = Id.of_string "x" and - m = Id.of_string "y" in + let n = next_ident_away (Id.of_string "x") avoid and + m = next_ident_away (Id.of_string "y") avoid in let eqnm = mkApp(eq,[|mkFullInd ind (2*nparrec+2);mkVar n;mkVar m|]) in create_input ( mkNamedProd n (mkFullInd ind (2*nparrec)) ( -- cgit v1.2.3 From 021f94d7dfef5630e48e79c9238db3a24b2aa221 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Fri, 23 Dec 2016 09:28:47 +0100 Subject: Handle application of a primitive projection to a not yet evaluated cofixpoint (bug #5286). --- kernel/byterun/coq_interp.c | 63 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 15 deletions(-) diff --git a/kernel/byterun/coq_interp.c b/kernel/byterun/coq_interp.c index 5dec3b785c..af89712d5e 100644 --- a/kernel/byterun/coq_interp.c +++ b/kernel/byterun/coq_interp.c @@ -891,25 +891,58 @@ value coq_interprete Instruct(PROJ){ + do_proj: print_instr("PROJ"); if (Is_accu (accu)) { - value block; - /* Skip over the index of projected field */ - pc++; - /* Create atom */ - Alloc_small(block, 2, ATOM_PROJ_TAG); - Field(block, 0) = Field(coq_global_data, *pc); - Field(block, 1) = accu; - accu = block; - /* Create accumulator */ - Alloc_small(block, 2, Accu_tag); - Code_val(block) = accumulate; - Field(block, 1) = accu; - accu = block; + *--sp = accu; // Save matched block on stack + accu = Field(accu, 1); // Save atom to accu register + switch (Tag_val(accu)) { + case ATOM_COFIX_TAG: // We are forcing a cofix + { + mlsize_t i, nargs; + sp -= 2; + // Push the current instruction as the return address + sp[0] = (value)(pc - 1); + sp[1] = coq_env; + coq_env = Field(accu, 0); // Pointer to suspension + accu = sp[2]; // Save accumulator to accu register + sp[2] = Val_long(coq_extra_args); // Push number of args for return + nargs = Wosize_val(accu) - 2; // Number of args = size of accumulator - 1 (accumulator code) - 1 (atom) + // Push arguments to stack + CHECK_STACK(nargs + 1); + sp -= nargs; + for (i = 0; i < nargs; ++i) sp[i] = Field(accu, i + 2); + *--sp = accu; // Last argument is the pointer to the suspension + coq_extra_args = nargs; + pc = Code_val(coq_env); // Trigger evaluation + goto check_stack; + } + case ATOM_COFIXEVALUATED_TAG: + { + accu = Field(accu, 1); + ++sp; + goto do_proj; + } + default: + { + value block; + /* Skip over the index of projected field */ + ++pc; + /* Create atom */ + Alloc_small(accu, 2, ATOM_PROJ_TAG); + Field(accu, 0) = Field(coq_global_data, *pc++); + Field(accu, 1) = *sp++; + /* Create accumulator */ + Alloc_small(block, 2, Accu_tag); + Code_val(block) = accumulate; + Field(block, 1) = accu; + accu = block; + } + } } else { - accu = Field(accu, *pc++); + accu = Field(accu, *pc); + pc += 2; } - pc++; Next; } -- cgit v1.2.3 From 3b821bf60d89c386c27487e172e57a669b5c4662 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Fri, 23 Dec 2016 11:53:17 +0100 Subject: Excluding explicitly coinductive types in Scheme Equality (#5284). --- toplevel/auto_ind_decl.ml | 3 +++ toplevel/auto_ind_decl.mli | 1 + toplevel/indschemes.ml | 3 +++ 3 files changed, 7 insertions(+) diff --git a/toplevel/auto_ind_decl.ml b/toplevel/auto_ind_decl.ml index a527be32ba..ace99b7bbe 100644 --- a/toplevel/auto_ind_decl.ml +++ b/toplevel/auto_ind_decl.ml @@ -56,6 +56,7 @@ exception InductiveWithSort exception ParameterWithoutEquality of constant exception NonSingletonProp of inductive exception DecidabilityMutualNotSupported +exception NoDecidabilityCoInductive let dl = Loc.ghost @@ -301,6 +302,8 @@ let build_beq_scheme mode kn = let kelim = Inductive.elim_sorts (mib,mib.mind_packets.(i)) in if not (Sorts.List.mem InSet kelim) then raise (NonSingletonProp (kn,i)); + if mib.mind_finite = Decl_kinds.CoFinite then + raise NoDecidabilityCoInductive; let fix = mkFix (((Array.make nb_ind 0),i),(names,types,cores)) in create_input fix), Evd.make_evar_universe_context (Global.env ()) None), diff --git a/toplevel/auto_ind_decl.mli b/toplevel/auto_ind_decl.mli index b6c66a1e84..bdfe6e3fa7 100644 --- a/toplevel/auto_ind_decl.mli +++ b/toplevel/auto_ind_decl.mli @@ -24,6 +24,7 @@ exception InductiveWithSort exception ParameterWithoutEquality of constant exception NonSingletonProp of inductive exception DecidabilityMutualNotSupported +exception NoDecidabilityCoInductive val beq_scheme_kind : mutual scheme_kind val build_beq_scheme : mutual_scheme_object_function diff --git a/toplevel/indschemes.ml b/toplevel/indschemes.ml index 0e59f1aa98..a430d0ded2 100644 --- a/toplevel/indschemes.ml +++ b/toplevel/indschemes.ml @@ -188,6 +188,9 @@ let try_declare_scheme what f internal names kn = | EqUnknown s -> alarm what internal (str "Found unsupported " ++ str s ++ str " while building Boolean equality.") + | NoDecidabilityCoInductive -> + alarm what internal + (str "Scheme Equality is only for inductive types.") | e when Errors.noncritical e -> alarm what internal (str "Unexpected error during scheme creation: " ++ Errors.print e) -- cgit v1.2.3 From 827370fb97c138c16509bd549eaeddf94ca13c99 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Mon, 21 Nov 2016 12:49:17 +0100 Subject: Remove spurious spaces in merlin file generated by coq_makefile (bug #5213). --- tools/coq_makefile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/coq_makefile.ml b/tools/coq_makefile.ml index 617185b8fe..5e4e6645a4 100644 --- a/tools/coq_makefile.ml +++ b/tools/coq_makefile.ml @@ -823,7 +823,7 @@ let merlin targets (ml_inc,_,_) = print ".merlin:\n"; print "\t@echo 'FLG -rectypes' > .merlin\n" ; List.iter (fun c -> - printf "\t@echo \"B $(COQLIB) %s\" >> .merlin\n" c) + printf "\t@echo \"B $(COQLIB)%s\" >> .merlin\n" c) lib_dirs ; List.iter (fun (_,c) -> printf "\t@echo \"B %s\" >> .merlin\n" c; -- cgit v1.2.3 From dd710b9adbe7b27dccd6d4b21b90cb9bd07e5c07 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Mon, 26 Dec 2016 10:02:34 +0100 Subject: Fix some documentation typos. --- CHANGES | 4 ++-- config/coq_config.mli | 4 ++-- dev/doc/notes-on-conversion | 2 +- doc/faq/FAQ.tex | 4 ++-- ide/utils/configwin_keys.ml | 2 +- lib/profile.ml | 6 +++--- parsing/pcoq.mli | 4 ++-- proofs/proof_global.ml | 2 +- theories/FSets/FMapList.v | 2 +- theories/FSets/FMapWeakList.v | 2 +- theories/FSets/FSetList.v | 2 +- theories/FSets/FSetWeakList.v | 2 +- theories/MSets/MSetList.v | 2 +- theories/MSets/MSetWeakList.v | 2 +- theories/Numbers/BigNumPrelude.v | 4 ++-- theories/Strings/Ascii.v | 2 +- toplevel/vernacentries.ml | 2 +- 17 files changed, 24 insertions(+), 24 deletions(-) diff --git a/CHANGES b/CHANGES index 97106aaf15..6b620e4a48 100644 --- a/CHANGES +++ b/CHANGES @@ -991,7 +991,7 @@ Extraction instead of accessing their body, they are now considered as axioms. The previous behaviour can be reactivated via the option "Set Extraction AccessOpaque". -- The pretty-printer for Haskell now produces layout-independant code +- The pretty-printer for Haskell now produces layout-independent code - A new command "Separate Extraction cst1 cst2 ..." that mixes a minimal extracted environment a la "Recursive Extraction" and the production of several files (one per coq source) a la "Extraction Library" @@ -1676,7 +1676,7 @@ Tactics Moreover, romega now has a variant "romega with *" that can be also used on non-Z goals (nat, N, positive) via a call to a translation tactic named zify (its purpose is to Z-ify your goal...). This zify may also be used - independantly of romega. + independently of romega. - Tactic "remember" now supports an "in" clause to remember only selected occurrences of a term. - Tactic "pose proof" supports name overwriting in case of specialization of an diff --git a/config/coq_config.mli b/config/coq_config.mli index f250059316..269b68e4f6 100644 --- a/config/coq_config.mli +++ b/config/coq_config.mli @@ -37,7 +37,7 @@ val cflags : string (* arguments passed to gcc *) val best : string (* byte/opt *) val arch : string (* architecture *) val arch_is_win32 : bool -val osdeplibs : string (* OS dependant link options for ocamlc *) +val osdeplibs : string (* OS dependent link options for ocamlc *) val vmbyteflags : string list (* -custom/-dllib -lcoqrun *) @@ -56,7 +56,7 @@ val exec_extension : string (* "" under Unix, ".exe" under MS-windows *) val with_geoproof : bool ref (* to (de)activate functions specific to Geoproof with Coqide *) val browser : string -(** default web browser to use, may be overriden by environment +(** default web browser to use, may be overridden by environment variable COQREMOTEBROWSER *) val has_coqide : string diff --git a/dev/doc/notes-on-conversion b/dev/doc/notes-on-conversion index 6274275c9d..a81f170c63 100644 --- a/dev/doc/notes-on-conversion +++ b/dev/doc/notes-on-conversion @@ -21,7 +21,7 @@ Notation OMEGA := (ack 4 4). Definition f (x:nat) := x. -(* Evaluation in tactics can somehow be controled *) +(* Evaluation in tactics can somehow be controlled *) Lemma l1 : OMEGA = OMEGA. reflexivity. (* succeed: identity *) Qed. (* succeed: identity *) diff --git a/doc/faq/FAQ.tex b/doc/faq/FAQ.tex index 48b61827d1..213fb03137 100644 --- a/doc/faq/FAQ.tex +++ b/doc/faq/FAQ.tex @@ -2587,8 +2587,8 @@ It is the language of commands of Gallina i.e. definitions, lemmas, {\ldots} \Question{What is a dependent type?} -A dependant type is a type which depends on some term. For instance -``vector of size n'' is a dependant type representing all the vectors +A dependent type is a type which depends on some term. For instance +``vector of size n'' is a dependent type representing all the vectors of size $n$. Its type depends on $n$ \Question{What is a proof by reflection?} diff --git a/ide/utils/configwin_keys.ml b/ide/utils/configwin_keys.ml index 9f44e5c6be..e9b19da621 100644 --- a/ide/utils/configwin_keys.ml +++ b/ide/utils/configwin_keys.ml @@ -154,7 +154,7 @@ let xk_KP_9 = 0xFFB9 (* - * Auxilliary Functions; note the duplicate definitions for left and right + * Auxiliary Functions; note the duplicate definitions for left and right * function keys; Sun keyboards and a few other manufactures have such * function key groups on the left and/or right sides of the keyboard. * We've not found a keyboard with more than 35 function keys total. diff --git a/lib/profile.ml b/lib/profile.ml index 2350cd43ac..13c2d9c802 100644 --- a/lib/profile.ml +++ b/lib/profile.ml @@ -146,9 +146,9 @@ let merge_profile filename (curr_table, curr_outside, curr_total as new_data) = number of allocated bytes may exceed the maximum integer capacity (2^31 on 32-bits architectures); therefore, allocation is measured by small steps, total allocations are computed by adding elementary - measures and carries are controled from step to step *) + measures and carries are controlled from step to step *) -(* Unix measure of time is approximative and shoitt delays are often +(* Unix measure of time is approximate and short delays are often unperceivable; therefore, total times are measured in one (big) step to avoid rounding errors and to get the best possible approximation. @@ -358,7 +358,7 @@ let declare_profile name = prof_table := (name,e)::!prof_table; e -(* Default initialisation, may be overriden *) +(* Default initialization, may be overridden *) let _ = init_profile () (******************************) diff --git a/parsing/pcoq.mli b/parsing/pcoq.mli index 54e6423877..a44d942992 100644 --- a/parsing/pcoq.mli +++ b/parsing/pcoq.mli @@ -40,7 +40,7 @@ module Gram : GrammarSig | (together with a constr entry level, e.g. 50, and indications of) | (subentries, e.g. x in constr next level and y constr same level) | - | spliting into tokens by Metasyntax.split_notation_string + | splitting into tokens by Metasyntax.split_notation_string V [String "x"; String "+"; String "y"] : symbol_token list | @@ -128,7 +128,7 @@ val type_of_typed_entry : typed_entry -> entry_type val object_of_typed_entry : typed_entry -> grammar_object Gram.entry val weaken_entry : 'a Gram.entry -> grammar_object Gram.entry -(** Temporary activate camlp4 verbosity *) +(** Temporarily activate camlp4 verbosity *) val camlp4_verbosity : bool -> ('a -> unit) -> 'a -> unit diff --git a/proofs/proof_global.ml b/proofs/proof_global.ml index 541f299d4f..b00ecfad8a 100644 --- a/proofs/proof_global.ml +++ b/proofs/proof_global.ml @@ -610,7 +610,7 @@ module Bullet = struct let _ = register_behavior strict end - (* Current bullet behavior, controled by the option *) + (* Current bullet behavior, controlled by the option *) let current_behavior = ref Strict.strict let _ = diff --git a/theories/FSets/FMapList.v b/theories/FSets/FMapList.v index 13cb559b99..5acdb7eb7e 100644 --- a/theories/FSets/FMapList.v +++ b/theories/FSets/FMapList.v @@ -8,7 +8,7 @@ (** * Finite map library *) -(** This file proposes an implementation of the non-dependant interface +(** This file proposes an implementation of the non-dependent interface [FMapInterface.S] using lists of pairs ordered (increasing) with respect to left projection. *) diff --git a/theories/FSets/FMapWeakList.v b/theories/FSets/FMapWeakList.v index 0f11dd7a53..130cbee871 100644 --- a/theories/FSets/FMapWeakList.v +++ b/theories/FSets/FMapWeakList.v @@ -8,7 +8,7 @@ (** * Finite map library *) -(** This file proposes an implementation of the non-dependant interface +(** This file proposes an implementation of the non-dependent interface [FMapInterface.WS] using lists of pairs, unordered but without redundancy. *) Require Import FMapInterface. diff --git a/theories/FSets/FSetList.v b/theories/FSets/FSetList.v index 1f36306c34..9c3ec71ae3 100644 --- a/theories/FSets/FSetList.v +++ b/theories/FSets/FSetList.v @@ -8,7 +8,7 @@ (** * Finite sets library *) -(** This file proposes an implementation of the non-dependant +(** This file proposes an implementation of the non-dependent interface [FSetInterface.S] using strictly ordered list. *) Require Export FSetInterface. diff --git a/theories/FSets/FSetWeakList.v b/theories/FSets/FSetWeakList.v index 2ea32e97cb..9dbea88495 100644 --- a/theories/FSets/FSetWeakList.v +++ b/theories/FSets/FSetWeakList.v @@ -8,7 +8,7 @@ (** * Finite sets library *) -(** This file proposes an implementation of the non-dependant +(** This file proposes an implementation of the non-dependent interface [FSetInterface.WS] using lists without redundancy. *) Require Import FSetInterface. diff --git a/theories/MSets/MSetList.v b/theories/MSets/MSetList.v index fb0d1ad9df..05c20eb8fa 100644 --- a/theories/MSets/MSetList.v +++ b/theories/MSets/MSetList.v @@ -8,7 +8,7 @@ (** * Finite sets library *) -(** This file proposes an implementation of the non-dependant +(** This file proposes an implementation of the non-dependent interface [MSetInterface.S] using strictly ordered list. *) Require Export MSetInterface OrdersFacts OrdersLists. diff --git a/theories/MSets/MSetWeakList.v b/theories/MSets/MSetWeakList.v index 372acd56ad..2ac57a932b 100644 --- a/theories/MSets/MSetWeakList.v +++ b/theories/MSets/MSetWeakList.v @@ -8,7 +8,7 @@ (** * Finite sets library *) -(** This file proposes an implementation of the non-dependant +(** This file proposes an implementation of the non-dependent interface [MSetWeakInterface.S] using lists without redundancy. *) Require Import MSetInterface. diff --git a/theories/Numbers/BigNumPrelude.v b/theories/Numbers/BigNumPrelude.v index 45a7527c97..bd8930872c 100644 --- a/theories/Numbers/BigNumPrelude.v +++ b/theories/Numbers/BigNumPrelude.v @@ -10,7 +10,7 @@ (** * BigNumPrelude *) -(** Auxillary functions & theorems used for arbitrary precision efficient +(** Auxiliary functions & theorems used for arbitrary precision efficient numbers. *) @@ -22,7 +22,7 @@ Require Export Zpow_facts. Declare ML Module "numbers_syntax_plugin". (* *** Nota Bene *** - All results that were general enough has been moved in ZArith. + All results that were general enough have been moved in ZArith. Only remain here specialized lemmas and compatibility elements. (P.L. 5/11/2007). *) diff --git a/theories/Strings/Ascii.v b/theories/Strings/Ascii.v index 97cb746f37..55a533c55a 100644 --- a/theories/Strings/Ascii.v +++ b/theories/Strings/Ascii.v @@ -40,7 +40,7 @@ Defined. (** * Conversion between natural numbers modulo 256 and ascii characters *) -(** Auxillary function that turns a positive into an ascii by +(** Auxiliary function that turns a positive into an ascii by looking at the last 8 bits, ie z mod 2^8 *) Definition ascii_of_pos : positive -> ascii := diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index c76432ae3e..1328019713 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -2050,7 +2050,7 @@ let enforce_polymorphism = function | None -> Flags.is_universe_polymorphism () | Some b -> Flags.make_polymorphic_flag b; b -(** A global default timeout, controled by option "Set Default Timeout n". +(** A global default timeout, controlled by option "Set Default Timeout n". Use "Unset Default Timeout" to deactivate it (or set it to 0). *) let default_timeout = ref None -- cgit v1.2.3 From aad7ca30a093190be17ac504b8a36cb04ae928de Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 6 Dec 2016 17:52:26 +0100 Subject: Update documentation (bugs #5246 and #5251). --- doc/refman/RefMan-gal.tex | 6 +++--- doc/refman/RefMan-tac.tex | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/refman/RefMan-gal.tex b/doc/refman/RefMan-gal.tex index fcccd9cb4b..5880b6c848 100644 --- a/doc/refman/RefMan-gal.tex +++ b/doc/refman/RefMan-gal.tex @@ -711,9 +711,9 @@ definition have a special syntax: ``{\tt let fix}~$f$~{\ldots}~{\tt {\tt Inductive} \nelist{\inductivebody}{with} {\tt .} \\ & $|$ & {\tt CoInductive} \nelist{\inductivebody}{with} {\tt .} \\ & & \\ -{\inductivebody} & ::= & - {\ident} \zeroone{\binders} {\tt :} {\term} {\tt :=} \\ - && ~~\zeroone{\zeroone{\tt |} \nelist{$\!${\ident}$\!$ \zeroone{\binders} {\typecstrwithoutblank}}{|}} \\ +{\inductivebody} & ::= & + {\ident} \zeroone{\binders} {\typecstr} {\tt :=} \\ + && ~~\zeroone{\zeroone{\tt |} \nelist{$\!${\ident}$\!$ \zeroone{\binders} {\typecstr}}{|}} \\ & & \\ %% TODO: where ... %% Fixpoints {\fixpoint} & ::= & {\tt Fixpoint} \nelist{\fixpointbody}{with} {\tt .} \\ diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex index 11de4f35e0..d539af7e31 100644 --- a/doc/refman/RefMan-tac.tex +++ b/doc/refman/RefMan-tac.tex @@ -292,7 +292,7 @@ Section~\ref{pattern} to transform the goal so that it gets the form {\tt (fun $x$ => $Q$)~$u_1$~\ldots~$u_n$}. \begin{ErrMsgs} -\item \errindex{Impossible to unify \dots\ with \dots} +\item \errindex{Unable to unify \dots\ with \dots} The {\tt apply} tactic failed to match the conclusion of {\term} and the current goal. @@ -4593,7 +4593,7 @@ It is equivalent to {\tt apply refl\_equal}. \begin{ErrMsgs} \item \errindex{The conclusion is not a substitutive equation} -\item \errindex{Impossible to unify \dots\ with \dots} +\item \errindex{Unable to unify \dots\ with \dots} \end{ErrMsgs} \subsection{\tt symmetry} -- cgit v1.2.3 From 5f358c91347d4bbc2f4543012ff8b4bf3dab71c9 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 6 Dec 2016 18:53:22 +0100 Subject: Fix broken documentation in presence of \zeroone{... \tt ...}. The way \zeroone was defined, the \tt modifier was leaked outside the brackets, thus messing with the following text. There are a bunch of occurrences of this issue in the manual, so rather than turning all the \tt into \texttt, the definition of \zeroone is made more robust. Unfortunately, there is one single occurrence of \zeroone that does not support the more robust version. (Note that this specific usage of \zeroone is morally a bug, since it goes against all the LaTeX conventions.) So the commit also keeps the old leaky version of \zeroone around as \zeroonelax so that it can be used there. --- doc/common/macros.tex | 3 ++- doc/refman/RefMan-tac.tex | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/common/macros.tex b/doc/common/macros.tex index bbc78a8517..ce89c5b93e 100644 --- a/doc/common/macros.tex +++ b/doc/common/macros.tex @@ -72,7 +72,8 @@ %\newcommand{\spec}[1]{\{\,#1\,\}} % Building regular expressions -\newcommand{\zeroone}[1]{\mbox{\sl [}#1\mbox{\sl ]}} +\newcommand{\zeroone}[1]{\mbox{\sl [}{#1}\mbox{\sl ]}} +\newcommand{\zeroonelax}[1]{\mbox{\sl [}#1\mbox{\sl ]}} %\newcommand{\zeroonemany}[1]{$\{$#1$\}$*} %\newcommand{\onemany}[1]{$\{$#1$\}$+} \newcommand{\nelistnosep}[1]{{#1} \mbox{\dots} {#1}} diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex index d539af7e31..d05f74f72a 100644 --- a/doc/refman/RefMan-tac.tex +++ b/doc/refman/RefMan-tac.tex @@ -114,7 +114,7 @@ following syntax: \begin{tabular}{lcl} {\occclause} & ::= & {\tt in} {\occgoalset} \\ {\occgoalset} & ::= & - \zeroone{{\ident$_1$} \zeroone{\atoccurrences} {\tt ,} \\ + \zeroonelax{{\ident$_1$} \zeroone{\atoccurrences} {\tt ,} \\ & & {\dots} {\tt ,}\\ & & {\ident$_m$} \zeroone{\atoccurrences}}\\ & & \zeroone{{\tt |-} \zeroone{{\tt *} \zeroone{\atoccurrences}}}\\ -- cgit v1.2.3 From 63ca4aac83ced14b9b8065ef43e29f7c2dfd331c Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Fri, 23 Dec 2016 09:28:47 +0100 Subject: Handle application of a primitive projection to a not yet evaluated cofixpoint (bug #5286). --- kernel/byterun/coq_interp.c | 63 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 15 deletions(-) diff --git a/kernel/byterun/coq_interp.c b/kernel/byterun/coq_interp.c index 35abd011bb..a67c27e87f 100644 --- a/kernel/byterun/coq_interp.c +++ b/kernel/byterun/coq_interp.c @@ -898,25 +898,58 @@ value coq_interprete Instruct(PROJ){ + do_proj: print_instr("PROJ"); if (Is_accu (accu)) { - value block; - /* Skip over the index of projected field */ - pc++; - /* Create atom */ - Alloc_small(block, 2, ATOM_PROJ_TAG); - Field(block, 0) = Field(coq_global_data, *pc); - Field(block, 1) = accu; - accu = block; - /* Create accumulator */ - Alloc_small(block, 2, Accu_tag); - Code_val(block) = accumulate; - Field(block, 1) = accu; - accu = block; + *--sp = accu; // Save matched block on stack + accu = Field(accu, 1); // Save atom to accu register + switch (Tag_val(accu)) { + case ATOM_COFIX_TAG: // We are forcing a cofix + { + mlsize_t i, nargs; + sp -= 2; + // Push the current instruction as the return address + sp[0] = (value)(pc - 1); + sp[1] = coq_env; + coq_env = Field(accu, 0); // Pointer to suspension + accu = sp[2]; // Save accumulator to accu register + sp[2] = Val_long(coq_extra_args); // Push number of args for return + nargs = Wosize_val(accu) - 2; // Number of args = size of accumulator - 1 (accumulator code) - 1 (atom) + // Push arguments to stack + CHECK_STACK(nargs + 1); + sp -= nargs; + for (i = 0; i < nargs; ++i) sp[i] = Field(accu, i + 2); + *--sp = accu; // Last argument is the pointer to the suspension + coq_extra_args = nargs; + pc = Code_val(coq_env); // Trigger evaluation + goto check_stack; + } + case ATOM_COFIXEVALUATED_TAG: + { + accu = Field(accu, 1); + ++sp; + goto do_proj; + } + default: + { + value block; + /* Skip over the index of projected field */ + ++pc; + /* Create atom */ + Alloc_small(accu, 2, ATOM_PROJ_TAG); + Field(accu, 0) = Field(coq_global_data, *pc++); + Field(accu, 1) = *sp++; + /* Create accumulator */ + Alloc_small(block, 2, Accu_tag); + Code_val(block) = accumulate; + Field(block, 1) = accu; + accu = block; + } + } } else { - accu = Field(accu, *pc++); + accu = Field(accu, *pc); + pc += 2; } - pc++; Next; } -- cgit v1.2.3 From ac9b9415e884dc478b1776b8792c690f61efd5ed Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Wed, 28 Dec 2016 16:57:35 +0100 Subject: Fix some typos in tutorial (bug #5294). This commit uses the proper url for bug reporting, marks urls as such, stops qualifying the Coq'Art book as new, and fix the spacing after the Coq name. --- doc/tutorial/Tutorial.tex | 61 ++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/doc/tutorial/Tutorial.tex b/doc/tutorial/Tutorial.tex index 973a0b75e0..0d537256bb 100644 --- a/doc/tutorial/Tutorial.tex +++ b/doc/tutorial/Tutorial.tex @@ -3,6 +3,7 @@ \usepackage[utf8]{inputenc} \usepackage{textcomp} \usepackage{pslatex} +\usepackage{hyperref} \input{../common/version.tex} \input{../common/macros.tex} @@ -17,7 +18,7 @@ \chapter*{Getting started} -\Coq\ is a Proof Assistant for a Logical Framework known as the Calculus +\Coq{} is a Proof Assistant for a Logical Framework known as the Calculus of Inductive Constructions. It allows the interactive construction of formal proofs, and also the manipulation of functional programs consistently with their specifications. It runs as a computer program @@ -29,7 +30,7 @@ possibilities of \Coq, but rather to present in the most elementary manner a tutorial on the basic specification language, called Gallina, in which formal axiomatisations may be developed, and on the main proof tools. For more advanced information, the reader could refer to -the \Coq{} Reference Manual or the \textit{Coq'Art}, a new book by Y. +the \Coq{} Reference Manual or the \textit{Coq'Art}, a book by Y. Bertot and P. Castéran on practical uses of the \Coq{} system. Coq can be used from a standard teletype-like shell window but @@ -39,9 +40,9 @@ and Pcoq.}. Instructions on installation procedures, as well as more comprehensive documentation, may be found in the standard distribution of \Coq, -which may be obtained from \Coq{} web site \texttt{http://coq.inria.fr}. +which may be obtained from \Coq{} web site \url{https://coq.inria.fr/}. -In the following, we assume that \Coq~ is called from a standard +In the following, we assume that \Coq{} is called from a standard teletype-like shell window. All examples preceded by the prompting sequence \verb:Coq < : represent user input, terminated by a period. @@ -51,10 +52,10 @@ users screen. When used from a graphical user interface such as CoqIde, the prompt is not displayed: user input is given in one window and \Coq's answers are displayed in a different window. -The sequence of such examples is a valid \Coq~ +The sequence of such examples is a valid \Coq{} session, unless otherwise specified. This version of the tutorial has been prepared on a PC workstation running Linux. The standard -invocation of \Coq\ delivers a message such as: +invocation of \Coq{} delivers a message such as: \begin{small} \begin{flushleft} @@ -67,17 +68,17 @@ Coq < \end{flushleft} \end{small} -The first line gives a banner stating the precise version of \Coq~ +The first line gives a banner stating the precise version of \Coq{} used. You should always return this banner when you report an anomaly to our bug-tracking system -\verb|http://logical.futurs.inria.fr/coq-bugs| +\url{https://coq.inria.fr/bugs/}. \chapter{Basic Predicate Calculus} \section{An overview of the specification language Gallina} A formal development in Gallina consists in a sequence of {\sl declarations} -and {\sl definitions}. You may also send \Coq~ {\sl commands} which are +and {\sl definitions}. You may also send \Coq{} {\sl commands} which are not really part of the formal development, but correspond to information requests, or service routine invocations. For instance, the command: \begin{verbatim} @@ -106,7 +107,7 @@ of the system, called respectively \verb:Prop:, \verb:Set:, and Every valid expression $e$ in Gallina is associated with a specification, itself a valid expression, called its {\sl type} $\tau(E)$. We write $e:\tau(E)$ for the judgment that $e$ is of type $E$. -You may request \Coq~ to return to you the type of a valid expression by using +You may request \Coq{} to return to you the type of a valid expression by using the command \verb:Check:: \begin{coq_eval} @@ -130,7 +131,7 @@ Check nat. The specification \verb:Set: is an abstract type, one of the basic sorts of the Gallina language, whereas the notions $nat$ and $O$ are notions which are defined in the arithmetic prelude, -automatically loaded when running the \Coq\ system. +automatically loaded when running the \Coq{} system. We start by introducing a so-called section name. The role of sections is to structure the modelisation by limiting the scope of parameters, @@ -206,7 +207,7 @@ We may optionally indicate the required type: Definition two : nat := S one. \end{coq_example} -Actually \Coq~ allows several possible syntaxes: +Actually \Coq{} allows several possible syntaxes: \begin{coq_example} Definition three := S two : nat. \end{coq_example} @@ -249,7 +250,7 @@ explicitly the type of the quantified variable. We check: Check (forall m:nat, gt m 0). \end{coq_example} We may revert to the clean state of -our initial session using the \Coq~ \verb:Reset: command: +our initial session using the \Coq{} \verb:Reset: command: \begin{coq_example} Reset Initial. \end{coq_example} @@ -340,7 +341,7 @@ assumption. \end{coq_example} The proof is now finished. We may either discard it, by using the -command \verb:Abort: which returns to the standard \Coq~ toplevel loop +command \verb:Abort: which returns to the standard \Coq{} toplevel loop without further ado, or else save it as a lemma in the current context, under name say \verb:trivial_lemma:: \begin{coq_example} @@ -414,7 +415,7 @@ backtrack one step, and more generally \verb:Undo n: to backtrack n steps. We end this section by showing a useful command, \verb:Inspect n.:, -which inspects the global \Coq~ environment, showing the last \verb:n: declared +which inspects the global \Coq{} environment, showing the last \verb:n: declared notions: \begin{coq_example} Inspect 3. @@ -429,7 +430,7 @@ their value (or proof-term) is omitted. \subsection{Conjunction} We have seen how \verb:intro: and \verb:apply: tactics could be combined -in order to prove implicational statements. More generally, \Coq~ favors a style +in order to prove implicational statements. More generally, \Coq{} favors a style of reasoning, called {\sl Natural Deduction}, which decomposes reasoning into so called {\sl introduction rules}, which tell how to prove a goal whose main operator is a given propositional connective, and {\sl elimination rules}, @@ -528,7 +529,7 @@ such a simple tautology. The reason is that we want to keep \subsection{Tauto} A complete tactic for propositional -tautologies is indeed available in \Coq~ as the \verb:tauto: tactic. +tautologies is indeed available in \Coq{} as the \verb:tauto: tactic. \begin{coq_example} Restart. tauto. @@ -555,7 +556,7 @@ The two instantiations are effected automatically by the tactic \verb:apply: when pattern-matching a goal. The specialist will of course recognize our proof term as a $\lambda$-term, used as notation for the natural deduction proof term through the Curry-Howard isomorphism. The -naive user of \Coq~ may safely ignore these formal details. +naive user of \Coq{} may safely ignore these formal details. Let us exercise the \verb:tauto: tactic on a more complex example: \begin{coq_example} @@ -579,7 +580,7 @@ argument fails. This may come as a surprise to someone familiar with classical reasoning. Peirce's lemma is true in Boolean logic, i.e. it evaluates to \verb:true: for every truth-assignment to \verb:A: and \verb:B:. Indeed the double negation -of Peirce's law may be proved in \Coq~ using \verb:tauto:: +of Peirce's law may be proved in \Coq{} using \verb:tauto:: \begin{coq_example} Abort. Lemma NNPeirce : ~ ~ (((A -> B) -> A) -> A). @@ -588,7 +589,7 @@ Qed. \end{coq_example} In classical logic, the double negation of a proposition is equivalent to this -proposition, but in the constructive logic of \Coq~ this is not so. If you +proposition, but in the constructive logic of \Coq{} this is not so. If you want to use classical logic in \Coq, you have to import explicitly the \verb:Classical: module, which will declare the axiom \verb:classic: of excluded middle, and classical tautologies such as de Morgan's laws. @@ -652,7 +653,7 @@ function and predicate symbols. \subsection{Sections and signatures} Usually one works in some domain of discourse, over which range the individual -variables and function symbols. In \Coq~ we speak in a language with a rich +variables and function symbols. In \Coq{} we speak in a language with a rich variety of types, so me may mix several domains of discourse, in our multi-sorted language. For the moment, we just do a few exercises, over a domain of discourse \verb:D: axiomatised as a \verb:Set:, and we consider two @@ -660,7 +661,7 @@ predicate symbols \verb:P: and \verb:R: over \verb:D:, of arities respectively 1 and 2. Such abstract entities may be entered in the context as global variables. But we must be careful about the pollution of our global environment by such declarations. For instance, we have already -polluted our \Coq~ session by declaring the variables +polluted our \Coq{} session by declaring the variables \verb:n:, \verb:Pos_n:, \verb:A:, \verb:B:, and \verb:C:. \begin{coq_example} @@ -714,7 +715,7 @@ Check ex. \end{coq_example} and the notation \verb+(exists x:D, P x)+ is just concrete syntax for the expression \verb+(ex D (fun x:D => P x))+. -Existential quantification is handled in \Coq~ in a similar +Existential quantification is handled in \Coq{} in a similar fashion to the connectives \verb:/\: and \verb:\/: : it is introduced by the proof combinator \verb:ex_intro:, which is invoked by the specific tactic \verb:Exists:, and its elimination provides a witness \verb+a:D+ to @@ -951,7 +952,7 @@ Abort. \subsection{Equality} -The basic equality provided in \Coq~ is Leibniz equality, noted infix like +The basic equality provided in \Coq{} is Leibniz equality, noted infix like \verb+x=y+, when \verb:x: and \verb:y: are two expressions of type the same Set. The replacement of \verb:x: by \verb:y: in any term is effected by a variety of tactics, such as \verb:rewrite: @@ -1208,7 +1209,7 @@ About prim_rec. Oops! Instead of the expected type \verb+nat->(nat->nat->nat)->nat->nat+ we get an apparently more complicated expression. Indeed the type of \verb:prim_rec: is equivalent by rule $\beta$ to its expected type; this may -be checked in \Coq~ by command \verb:Eval Cbv Beta:, which $\beta$-reduces +be checked in \Coq{} by command \verb:Eval Cbv Beta:, which $\beta$-reduces an expression to its {\sl normal form}: \begin{coq_example} Eval cbv beta in @@ -1228,7 +1229,7 @@ That is, we specify that \verb+(addition n m)+ computes by cases on \verb:n: according to its main constructor; when \verb:n = O:, we get \verb:m:; when \verb:n = S p:, we get \verb:(S rec):, where \verb:rec: is the result of the recursive computation \verb+(addition p m)+. Let us verify it by -asking \Coq~to compute for us say $2+3$: +asking \Coq{} to compute for us say $2+3$: \begin{coq_example} Eval compute in (addition (S (S O)) (S (S (S O)))). \end{coq_example} @@ -1275,7 +1276,7 @@ as subgoals the corresponding instantiations of the base case \verb:(P O): , and of the inductive step \verb+forall y:nat, P y -> P (S y)+. In each case we get an instance of function \verb:plus: in which its second argument starts with a constructor, and is thus amenable to simplification -by primitive recursion. The \Coq~tactic \verb:simpl: can be used for +by primitive recursion. The \Coq{} tactic \verb:simpl: can be used for this purpose: \begin{coq_example} simpl. @@ -1488,7 +1489,7 @@ Set Printing Width 60. \section{Opening library modules} -When you start \Coq~ without further requirements in the command line, +When you start \Coq{} without further requirements in the command line, you get a bare system with few libraries loaded. As we saw, a standard prelude module provides the standard logic connectives, and a few arithmetic notions. If you want to load and open other modules from @@ -1503,9 +1504,9 @@ Such a command looks for a (compiled) module file \verb:Arith.vo: in the libraries registered by \Coq. Libraries inherit the structure of the file system of the operating system and are registered with the command \verb:Add LoadPath:. Physical directories are mapped to -logical directories. Especially the standard library of \Coq~ is +logical directories. Especially the standard library of \Coq{} is pre-registered as a library of name \verb=Coq=. Modules have absolute -unique names denoting their place in \Coq~ libraries. An absolute +unique names denoting their place in \Coq{} libraries. An absolute name is a sequence of single identifiers separated by dots. E.g. the module \verb=Arith= has full name \verb=Coq.Arith.Arith= and because it resides in eponym subdirectory \verb=Arith= of the standard -- cgit v1.2.3 From 11bdfe88061c5bda160baec625b862a146809024 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Wed, 4 Jan 2017 19:15:26 +0100 Subject: Fixing another inconsistency when looking for camlp5o when camlp5dir is given. This was not fixed by b9a15a390f yet. --- configure.ml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/configure.ml b/configure.ml index 99f5ae5424..42c2e2785d 100644 --- a/configure.ml +++ b/configure.ml @@ -514,6 +514,20 @@ let camltag = match caml_version_list with (** * CamlpX configuration *) (* Convention: we use camldir as a prioritary location for camlpX, if given *) +(* i.e., in the case of camlp5, we search for a copy of camlp5o which *) +(* answers the right camlp5 lib dir *) + +let strip_slash dir = + let n = String.length dir in + if n>0 && dir.[n - 1] = '/' then String.sub dir 0 (n-1) else dir + +let which_camlp5o_for camlp5lib = + let camlp5o = Filename.concat camlbin "camlp5o" in + let camlp5lib = strip_slash camlp5lib in + if fst (tryrun camlp5o ["-where"]) = camlp5lib then camlp5o else + let camlp5o = which "camlp5o" in + if fst (tryrun camlp5o ["-where"]) = camlp5lib then camlp5o else + die ("Error: cannot find Camlp5 binaries corresponding to Camlp5 library " ^ camlp5lib) let which_camlpX base = let file = Filename.concat camlbin base in @@ -528,7 +542,7 @@ let check_camlp5 testcma = match !Prefs.camlp5dir with | Some dir -> if Sys.file_exists (dir/testcma) then let camlp5o = - try which_camlpX "camlp5o" + try which_camlp5o_for dir with Not_found -> die "Error: cannot find Camlp5 binaries in path.\n" in dir, camlp5o else -- cgit v1.2.3 From 65816f94ba427edf8999bf42633d0aad064e8ce4 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Thu, 5 Jan 2017 19:54:41 +0100 Subject: Fixing a little bug in printing cofix with no arguments. --- printing/ppconstr.ml | 2 +- test-suite/output/Fixpoint.out | 2 ++ test-suite/output/Fixpoint.v | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/printing/ppconstr.ml b/printing/ppconstr.ml index e21bfa007d..31d87f0ff1 100644 --- a/printing/ppconstr.ml +++ b/printing/ppconstr.ml @@ -418,7 +418,7 @@ end) = struct let pr_recursive_decl pr pr_dangling dangling_with_for id bl annot t c = let pr_body = if dangling_with_for then pr_dangling else pr in - pr_id id ++ str" " ++ + pr_id id ++ (if bl = [] then mt () else str" ") ++ hov 0 (pr_undelimited_binders spc (pr ltop) bl ++ annot) ++ pr_opt_type_spc pr t ++ str " :=" ++ pr_sep_com (fun () -> brk(1,2)) (pr_body ltop) c diff --git a/test-suite/output/Fixpoint.out b/test-suite/output/Fixpoint.out index a13ae4624a..6879cbc3c2 100644 --- a/test-suite/output/Fixpoint.out +++ b/test-suite/output/Fixpoint.out @@ -10,3 +10,5 @@ let fix f (m : nat) : nat := match m with end in f 0 : nat Ltac f id1 id2 := fix id1 2 with (id2 (n:_) (H:odd n) {struct H} : n >= 1) + = cofix inf : Inf := {| projS := inf |} + : Inf diff --git a/test-suite/output/Fixpoint.v b/test-suite/output/Fixpoint.v index 8afa50ba57..fafb478bad 100644 --- a/test-suite/output/Fixpoint.v +++ b/test-suite/output/Fixpoint.v @@ -44,4 +44,7 @@ fix even_pos_odd_pos 2 with (odd_pos_even_pos n (H:odd n) {struct H} : n >= 1). omega. Qed. - +CoInductive Inf := S { projS : Inf }. +Definition expand_Inf (x : Inf) := S (projS x). +CoFixpoint inf := S inf. +Eval compute in inf. -- cgit v1.2.3 From c1ad8fa3eadba95691248cd5cd9c2e2efbe6e215 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Mon, 9 Jan 2017 14:38:42 +0100 Subject: Relax required OCaml to 4.02.1. We did not decide precisely what minor version we would support, so relaxing. We document why 4.02.0 is not supported (its use is also discouraged by the OCaml team, see e.g. https://ocaml.org/releases/). --- INSTALL | 13 +++++++------ INSTALL.ide | 2 +- configure.ml | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/INSTALL b/INSTALL index df9e855274..9454bba4ab 100644 --- a/INSTALL +++ b/INSTALL @@ -29,17 +29,18 @@ WHAT DO YOU NEED ? To compile Coq V8.6 yourself, you need: - - Objective Caml version 4.01.0 or later + - OCaml version 4.02.1 or later (available at http://caml.inria.fr/) + OCaml version 4.02.0 is not supported because of a severe performance + issue increasing compilation time. + - Findlib (included in OCaml binary distribution under windows, probably available in your distribution and for sure at http://projects.camlcity.org/projects/findlib.html) - Camlp5 (version >= 6.02) (Coq compiles with Camlp4 but might be - less well supported, for instance, Objective Caml version 4.02.1 - is then needed or a patched version of 4.01.0 as e.g. version - 4.01.0-4 in Debian Jessie) + less well supported) - GNU Make version 3.81 or later @@ -65,8 +66,8 @@ INSTALLATION PROCEDURE IN DETAILS (NORMAL USERS). computer and that "ocamlc" (or, better, its native code version "ocamlc.opt") lies in a directory which is present in your $PATH environment variable. At the time of writing this sentence, all - versions of Objective Caml later or equal to 4.01.0 are - supported to the exception of Objective Caml 4.02.0. + versions of Objective Caml later or equal to 4.02.1 are + supported. To get Coq in native-code, (it runs 4 to 10 times faster than bytecode, but it takes more time to get compiled and the binary is diff --git a/INSTALL.ide b/INSTALL.ide index cb7ca325f7..513e37c91f 100644 --- a/INSTALL.ide +++ b/INSTALL.ide @@ -22,7 +22,7 @@ Else, read the rest of this document to compile your own CoqIde. COMPILATION REQUIREMENTS -- OCaml >= 4.01 with native threads support. +- OCaml >= 4.02.1 with native threads support. - make world must succeed. - The graphical toolkit GTK+ 2.x. See http://www.gtk.org. The official supported version is at least 2.24.x. diff --git a/configure.ml b/configure.ml index 8a0d9afd08..d6552687c1 100644 --- a/configure.ml +++ b/configure.ml @@ -487,14 +487,14 @@ let caml_version_nums = "Is it installed properly?") let check_caml_version () = - if caml_version_nums >= [4;2;3] then + if caml_version_nums >= [4;2;1] then printf "You have OCaml %s. Good!\n" caml_version else let () = printf "Your version of OCaml is %s.\n" caml_version in if !Prefs.force_caml_version then printf "*Warning* Your version of OCaml is outdated.\n" else - die "You need OCaml 4.02.3 or later." + die "You need OCaml 4.02.1 or later." let _ = check_caml_version () -- cgit v1.2.3 From 37817bb5ac6bb9fa9a4d67a5604a35424f7b343d Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Mon, 9 Jan 2017 16:40:08 +0100 Subject: OCaml's -dtypes flag is deprecated and replaced by -annot. --- configure.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ml b/configure.ml index d6552687c1..f75bbb538c 100644 --- a/configure.ml +++ b/configure.ml @@ -381,7 +381,7 @@ let coq_debug_flag = if !Prefs.debug then "-g" else "" let coq_profile_flag = if !Prefs.profile then "-p" else "" let coq_annotate_flag = if !Prefs.annotate - then if program_in_path "ocamlmerlin" then "-bin-annot" else "-dtypes" + then if program_in_path "ocamlmerlin" then "-bin-annot" else "-annot" else "" let cflags = "-Wall -Wno-unused -g -O2" -- cgit v1.2.3 From 34c19354c9997621a40ad053a2a12edcd8c5b5e4 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Mon, 9 Jan 2017 17:14:05 +0100 Subject: Avoid using the deprecated Scanf.fscanf function. --- lib/aux_file.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/aux_file.ml b/lib/aux_file.ml index 0f0f09aa23..17f55330de 100644 --- a/lib/aux_file.ml +++ b/lib/aux_file.ml @@ -76,14 +76,15 @@ let load_aux_file_for vfile = let add loc k v = h := set !h loc k v in let aux_fname = aux_file_name_for vfile in try - let ic = open_in aux_fname in - let ver, hash, fname = Scanf.fscanf ic "COQAUX%d %s %s\n" ret3 in + let ib = Scanf.Scanning.from_channel (open_in aux_fname) in + let ver, hash, fname = + Scanf.bscanf ib "COQAUX%d %s %s\n" ret3 in if ver <> version then raise (Failure "aux file version mismatch"); if fname <> vfile then raise (Failure "aux file name mismatch"); let only_dummyloc = Digest.to_hex (Digest.file vfile) <> hash in while true do - let i, j, k, v = Scanf.fscanf ic "%d %d %s %S\n" ret4 in + let i, j, k, v = Scanf.bscanf ib "%d %d %s %S\n" ret4 in if not only_dummyloc || (i = 0 && j = 0) then add (i,j) k v; done; raise End_of_file -- cgit v1.2.3 From 5391d15256af65a0ba0ead4ee6d1ec16f7e362cc Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Thu, 12 Jan 2017 14:03:47 +0100 Subject: Fix configure crash on some version strings of camlp5, e.g. "6.18-exp" (bug #5307). --- configure.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ml b/configure.ml index 42c2e2785d..04b04979d9 100644 --- a/configure.ml +++ b/configure.ml @@ -563,7 +563,7 @@ let check_camlp5 testcma = match !Prefs.camlp5dir with let check_camlp5_version camlp5o = let version_line, _ = run ~err:StdOut camlp5o ["-v"] in let version = List.nth (string_split ' ' version_line) 2 in - match string_split '.' version with + match numeric_prefix_list version with | major::minor::_ when s2i major > 6 || (s2i major, s2i minor) >= (6,6) -> printf "You have Camlp5 %s. Good!\n" version; version | _ -> die "Error: unsupported Camlp5 (version < 6.06 or unrecognized).\n" -- cgit v1.2.3 From aa21c209f85f37b3d16ff499bbeac15e967bf78f Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Fri, 13 Jan 2017 08:40:17 +0100 Subject: Fix broken .aux machinery. Coq expects aux_file_name_for to give the aux file corresponding to the input file whichever its Coq-related extension, be it .v or .vo or .vio. Commit 3e6fa1c broke this contract when fixing bug #5183. As a consequence, depending on the execution path, Coq would try to save or load from either .foo.aux or .foo.vo.aux or .foo.vio.aux. This commit reverts 3e6fa1c and fixes bug #5183 much earlier in the call chain by not initializing hints when the input file does not end with .v. This also restores 8.5 behavior with respect to aux file naming. --- ide/ide_slave.ml | 3 ++- lib/aux_file.ml | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ide/ide_slave.ml b/ide/ide_slave.ml index 5b07d3ec3b..c0c4131ac5 100644 --- a/ide/ide_slave.ml +++ b/ide/ide_slave.ml @@ -392,7 +392,8 @@ let init = Stm.add false ~ontop:(Stm.get_current_state ()) 0 (Printf.sprintf "Add LoadPath \"%s\". " dir) else Stm.get_current_state (), `NewTip in - Stm.set_compilation_hints file; + if Filename.check_suffix file ".v" then + Stm.set_compilation_hints file; Stm.finish (); initial_id end diff --git a/lib/aux_file.ml b/lib/aux_file.ml index 0f0f09aa23..c6c7b42429 100644 --- a/lib/aux_file.ml +++ b/lib/aux_file.ml @@ -17,10 +17,6 @@ let version = 1 let oc = ref None -let chop_extension f = - if check_suffix f ".v" then chop_extension f - else f - let aux_file_name_for vfile = dirname vfile ^ "/." ^ chop_extension(basename vfile) ^ ".aux" -- cgit v1.2.3 From 9568a34f665a6f3dca06271ffd6e914d9bd2a5ad Mon Sep 17 00:00:00 2001 From: Erik Martin-Dorel Date: Fri, 13 Jan 2017 08:42:13 +0100 Subject: Properly remove aux files in subdirectories (bug #5089). The aux file for foo/bar.v is foo/.bar.aux, not .foo/bar.aux. --- tools/coq_makefile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/coq_makefile.ml b/tools/coq_makefile.ml index eab909f5b1..b7dd5f2a14 100644 --- a/tools/coq_makefile.ml +++ b/tools/coq_makefile.ml @@ -390,7 +390,7 @@ let clean sds sps = let () = if !some_vfile then let () = print "cleanall:: clean\n" in - print "\trm -f $(patsubst %.v,.%.aux,$(VFILES))\n\n" in + print "\trm -f $(foreach f,$(VFILES:.v=),$(dir $(f)).$(notdir $(f)).aux)\n\n" in print "archclean::\n"; print "\trm -f *.cmx *.o\n"; List.iter -- cgit v1.2.3 From 6424a49842ed9982c7edd1b847d88d66508f072b Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Wed, 11 Jan 2017 13:59:54 +0100 Subject: Fix race condition in STM DAG generation (in debug mode). The same file name for .dot graphs could be used by concurrent processes. --- lib/system.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/system.ml b/lib/system.ml index 4b99de707b..1817aed1fc 100644 --- a/lib/system.ml +++ b/lib/system.ml @@ -309,6 +309,7 @@ let with_time time f x = raise e let process_id () = - if Flags.async_proofs_is_worker () then !Flags.async_proofs_worker_id - else Printf.sprintf "master:%d" (Thread.id (Thread.self ())) - + Printf.sprintf "%d:%s:%d" (Unix.getpid ()) + (if Flags.async_proofs_is_worker () then !Flags.async_proofs_worker_id + else "master") + (Thread.id (Thread.self ())) -- cgit v1.2.3 From 93ee722a9612d57a7928eaeb8ccede688214d158 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Mon, 16 Jan 2017 15:44:14 +0100 Subject: Fixing (part of) #5303 (clarifications around Record/Structure/Variant). - We fix the inconsistency of Structure and Record which according to doc are the same. - We improve the error message when not using { ... } for Record or Structure. --- toplevel/vernacentries.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index 41ee165ff8..6736d83293 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -570,10 +570,10 @@ let vernac_inductive poly lo finite indl = | _ -> () (* dumping is done by vernac_record (called below) *) ) indl; match indl with - | [ ( _ , _ , _ ,Record, Constructors _ ),_ ] -> - CErrors.error "The Record keyword cannot be used to define a variant type. Use Variant instead." + | [ ( _ , _ , _ ,(Record|Structure), Constructors _ ),_ ] -> + CErrors.error "The Record keyword is for types defined using the syntax { ... }." | [ (_ , _ , _ ,Variant, RecordDecl _),_ ] -> - CErrors.error "The Variant keyword cannot be used to define a record type. Use Record instead." + CErrors.error "The Variant keyword does not support syntax { ... }." | [ ( id , bl , c , b, RecordDecl (oc,fs) ), [] ] -> vernac_record (match b with Class _ -> Class false | _ -> b) poly finite id bl c oc fs -- cgit v1.2.3 From 23ffecc39a064775724ad524bd97f30fb8e763cd Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Tue, 17 Jan 2017 10:47:34 +0100 Subject: STM: fix run-time classification of VernacInstance (fix #5313) --- stm/stm.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stm/stm.ml b/stm/stm.ml index b4331dc460..f577994ffa 100644 --- a/stm/stm.ml +++ b/stm/stm.ml @@ -2584,12 +2584,12 @@ let process_transaction ?(newtip=Stateid.fresh ()) ~tty if not in_proof && Proof_global.there_are_pending_proofs () then begin let bname = VCS.mk_branch_name x in - let opacity_of_produced_term = - match x.expr with + let rec opacity_of_produced_term = function (* This AST is ambiguous, hence we check it dynamically *) | VernacInstance (false, _,_ , None, _) -> GuaranteesOpacity + | VernacLocal (_,e) -> opacity_of_produced_term e | _ -> Doesn'tGuaranteeOpacity in - VCS.commit id (Fork (x,bname,opacity_of_produced_term,[])); + VCS.commit id (Fork (x,bname,opacity_of_produced_term x.expr,[])); let proof_mode = default_proof_mode () in VCS.branch bname (`Proof (proof_mode, VCS.proof_nesting () + 1)); Proof_global.activate_proof_mode proof_mode; -- cgit v1.2.3 From 8d783c10d9505cbc1beb1c8e3451ea5dd567f260 Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Tue, 17 Jan 2017 11:23:48 +0100 Subject: Mapping named_context_val preserves sharing when possible. This was deactivated by 27c9346 and made an optimization moot in eauto. This optimization was physically checking for equality, but as lists where rebuilt by the mapping, this was never true. Some contribs were thus quite slower, including persistent-union-find which was twice slower. This 2-line patch fixes it by trying to preserve sharing as much as possible. Note that we should still do something about eauto, because it does redo useless work a lot whenever the environment only changes a bit, while we could cache this computation. --- kernel/pre_env.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/pre_env.ml b/kernel/pre_env.ml index 7be8606ef4..f211583e06 100644 --- a/kernel/pre_env.ml +++ b/kernel/pre_env.ml @@ -156,7 +156,8 @@ let map_named_val f ctxt = (accu, d') in let map, ctx = List.fold_map fold ctxt.env_named_map ctxt.env_named_ctx in - { env_named_ctx = ctx; env_named_map = map } + if map == ctxt.env_named_map then ctxt + else { env_named_ctx = ctx; env_named_map = map } let push_named d env = (* if not (env.env_rel_context = []) then raise (ASSERT env.env_rel_context); -- cgit v1.2.3 From a9b76df171ceea443885bb4be919ea586a82beee Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Fri, 20 Jan 2017 10:55:17 +0100 Subject: Do not add redundant side effects in tactic code. This was observable in long proofs, because side effects kept being duplicated, leading to an additional cost linear in the size of the proof. This commit touches kernel files, but the corresponding API is only used in tactic-facing code so that the side_effects type remains opaque. Thus it does not affect the kernel safety. --- kernel/safe_typing.ml | 4 ++-- kernel/term_typing.mli | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/safe_typing.ml b/kernel/safe_typing.ml index 09f7bd75cd..95d9c75d30 100644 --- a/kernel/safe_typing.ml +++ b/kernel/safe_typing.ml @@ -213,8 +213,8 @@ type private_constant_role = Term_typing.side_effect_role = | Schema of inductive * string let empty_private_constants = [] -let add_private x xs = x :: xs -let concat_private xs ys = xs @ ys +let add_private x xs = if List.mem_f Term_typing.equal_eff x xs then xs else x :: xs +let concat_private xs ys = List.fold_right add_private xs ys let mk_pure_proof = Term_typing.mk_pure_proof let inline_private_constants_in_constr = Term_typing.inline_side_effects let inline_private_constants_in_definition_entry = Term_typing.inline_entry_side_effects diff --git a/kernel/term_typing.mli b/kernel/term_typing.mli index fcd95576c0..89b5fc40e3 100644 --- a/kernel/term_typing.mli +++ b/kernel/term_typing.mli @@ -30,6 +30,7 @@ val inline_entry_side_effects : yet type checked proof. *) val uniq_seff : side_effects -> side_effects +val equal_eff : side_effect -> side_effect -> bool val translate_constant : structure_body -> env -> constant -> side_effects constant_entry -> -- cgit v1.2.3 From 1d4c34c79624fb81e64dfed8874b2fc9fa66c070 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Fri, 20 Jan 2017 13:51:37 +0100 Subject: Process Next Obligation proofs in parallel (fix #5314) --- intf/vernacexpr.mli | 3 +++ ltac/g_obligations.ml4 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/intf/vernacexpr.mli b/intf/vernacexpr.mli index 92e4dd618e..c9fb1b5986 100644 --- a/intf/vernacexpr.mli +++ b/intf/vernacexpr.mli @@ -524,6 +524,9 @@ and vernac_control = | VtObserve of Stateid.t | VtBack of Stateid.t | VtPG +(* Qed typically generates an opaque proof term. Still, by declaring + * a proof terminator one can use such opaque term to generate transparent + * ones. In this corner case the STM needs to know... *) and opacity_guarantee = | GuaranteesOpacity (** Only generates opaque terms at [Qed] *) | Doesn'tGuaranteeOpacity (** May generate transparent terms even with [Qed].*) diff --git a/ltac/g_obligations.ml4 b/ltac/g_obligations.ml4 index 987b9d5387..2ae183e6e9 100644 --- a/ltac/g_obligations.ml4 +++ b/ltac/g_obligations.ml4 @@ -66,7 +66,7 @@ GEXTEND Gram open Obligations -let classify_obbl _ = Vernacexpr.(VtStartProof ("Classic",Doesn'tGuaranteeOpacity,[]), VtLater) +let classify_obbl _ = Vernacexpr.(VtStartProof ("Classic",GuaranteesOpacity,[]), VtLater) VERNAC COMMAND EXTEND Obligations CLASSIFIED BY classify_obbl | [ "Obligation" integer(num) "of" ident(name) ":" lglob(t) withtac(tac) ] -> -- cgit v1.2.3 From 6ff62ec78d5517ec5905041fa2e4926e15ff89f0 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Sat, 21 Jan 2017 07:51:15 +0100 Subject: Revert "Process Next Obligation proofs in parallel (fix #5314)" This reverts commit 1d4c34c79624fb81e64dfed8874b2fc9fa66c070. It seems the proof terminator of obligation.ml, in the case in which Set Shrink Obligation is set, accesses the opaque proof. --- intf/vernacexpr.mli | 3 --- ltac/g_obligations.ml4 | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/intf/vernacexpr.mli b/intf/vernacexpr.mli index c9fb1b5986..92e4dd618e 100644 --- a/intf/vernacexpr.mli +++ b/intf/vernacexpr.mli @@ -524,9 +524,6 @@ and vernac_control = | VtObserve of Stateid.t | VtBack of Stateid.t | VtPG -(* Qed typically generates an opaque proof term. Still, by declaring - * a proof terminator one can use such opaque term to generate transparent - * ones. In this corner case the STM needs to know... *) and opacity_guarantee = | GuaranteesOpacity (** Only generates opaque terms at [Qed] *) | Doesn'tGuaranteeOpacity (** May generate transparent terms even with [Qed].*) diff --git a/ltac/g_obligations.ml4 b/ltac/g_obligations.ml4 index 2ae183e6e9..987b9d5387 100644 --- a/ltac/g_obligations.ml4 +++ b/ltac/g_obligations.ml4 @@ -66,7 +66,7 @@ GEXTEND Gram open Obligations -let classify_obbl _ = Vernacexpr.(VtStartProof ("Classic",GuaranteesOpacity,[]), VtLater) +let classify_obbl _ = Vernacexpr.(VtStartProof ("Classic",Doesn'tGuaranteeOpacity,[]), VtLater) VERNAC COMMAND EXTEND Obligations CLASSIFIED BY classify_obbl | [ "Obligation" integer(num) "of" ident(name) ":" lglob(t) withtac(tac) ] -> -- cgit v1.2.3 From e91ae93106b6bd6d92ef53ac18b04654485a8106 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sun, 22 Jan 2017 10:52:18 +0100 Subject: Fixing bugs in typing "match" (regressions #5322 and #5324 + bugs with let-ins). A cleaning done in ade2363e35 (Dec 2015) was hinting at bugs in typing a matching over a "catch-all" variable, when let-ins occur in the arity. However ade2363e35 failed to understand what was the correct fix, introducing instead the regressions mentioned in #5322 and #5324. This fixes all of #5322 and #5324, as well as the handling of let-ins in the arity. Thanks to Jason for helping in diagnosing the problem. --- pretyping/cases.ml | 10 ++++++---- test-suite/bugs/closed/5322.v | 14 ++++++++++++++ test-suite/success/Case22.v | 28 ++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 test-suite/bugs/closed/5322.v diff --git a/pretyping/cases.ml b/pretyping/cases.ml index 6e4d72705b..ef3e53bf1f 100644 --- a/pretyping/cases.ml +++ b/pretyping/cases.ml @@ -847,7 +847,7 @@ let subst_predicate (subst,copt) ccl tms = | Some c -> c::subst in substnl_predicate sigma 0 ccl tms -let specialize_predicate_var (cur,typ,dep) tms ccl = +let specialize_predicate_var (cur,typ,dep) env tms ccl = let c = match dep with | Anonymous -> None | Name _ -> Some cur @@ -855,7 +855,9 @@ let specialize_predicate_var (cur,typ,dep) tms ccl = let l = match typ with | IsInd (_, IndType (_, _), []) -> [] - | IsInd (_, IndType (_, realargs), names) -> realargs + | IsInd (_, IndType (indf, realargs), names) -> + let arsign,_ = get_arity env indf in + subst_of_rel_context_instance arsign realargs | NotInd _ -> [] in subst_predicate (l,c) ccl tms @@ -1390,7 +1392,7 @@ and match_current pb (initial,tomatch) = and shift_problem ((current,t),_,na) pb = let ty = type_of_tomatch t in let tomatch = lift_tomatch_stack 1 pb.tomatch in - let pred = specialize_predicate_var (current,t,na) pb.tomatch pb.pred in + let pred = specialize_predicate_var (current,t,na) pb.env pb.tomatch pb.pred in let pb = { pb with env = push_rel (LocalDef (na,current,ty)) pb.env; @@ -1407,7 +1409,7 @@ and shift_problem ((current,t),_,na) pb = are already introduced in the context, we avoid creating aliases to themselves by treating this case specially. *) and pop_problem ((current,t),_,na) pb = - let pred = specialize_predicate_var (current,t,na) pb.tomatch pb.pred in + let pred = specialize_predicate_var (current,t,na) pb.env pb.tomatch pb.pred in let pb = { pb with pred = pred; diff --git a/test-suite/bugs/closed/5322.v b/test-suite/bugs/closed/5322.v new file mode 100644 index 0000000000..01aec8f29b --- /dev/null +++ b/test-suite/bugs/closed/5322.v @@ -0,0 +1,14 @@ +(* Regression in computing types of branches in "match" *) +Inductive flat_type := Unit | Prod (A B : flat_type). +Inductive exprf (op : flat_type -> flat_type -> Type) {var : Type} : flat_type +-> Type := +| Op {t1 tR} (opc : op t1 tR) (args : exprf op t1) : exprf op tR. +Inductive op : flat_type -> flat_type -> Type := a : op Unit Unit. +Arguments Op {_ _ _ _} _ _. +Definition bound_op {var} + {src2 dst2} + (opc2 : op src2 dst2) + : forall (args2 : exprf op (var:=var) src2), Op opc2 args2 = Op opc2 args2. + refine match opc2 return (forall args2, Op opc2 args2 = Op opc2 args2) with + | _ => _ + end. diff --git a/test-suite/success/Case22.v b/test-suite/success/Case22.v index 3c696502cd..465b3eb8c0 100644 --- a/test-suite/success/Case22.v +++ b/test-suite/success/Case22.v @@ -41,6 +41,7 @@ Definition F (x:IND True) (A:Type) := Theorem paradox : False. (* This succeeded in 8.3, 8.4 and 8.5beta1 because F had wrong type *) Fail Proof (F C False). +Abort. (* Another bug found in November 2015 (a substitution was wrongly reversed at pretyping level) *) @@ -61,3 +62,30 @@ Inductive Ind2 (b:=1) (c:nat) : Type := Constr2 : Ind2 c. Eval vm_compute in Constr2 2. + +(* A bug introduced in ade2363 (similar to #5322 and #5324). This + commit started to see that some List.rev was wrong in the "var" + case of a pattern-matching problem but it failed to see that a + transformation from a list of arguments into a substitution was + still needed. *) + +(* The order of real arguments was made wrong by ade2363 in the "var" + case of the compilation of "match" *) + +Inductive IND2 : forall X Y:Type, Type := + CONSTR2 : IND2 unit Empty_set. + +Check fun x:IND2 bool nat => + match x in IND2 a b return a with + | y => _ + end = true. + +(* From January 2017, using the proper function to turn arguments into + a substitution up to a context possibly containing let-ins, so that + the following, which was wrong also before ade2363, now works + correctly *) + +Check fun x:Ind bool nat => + match x in Ind _ X Y Z return Z with + | y => (true,0) + end. -- cgit v1.2.3 From d6bcc6ebe4f65d0555414851f7e4fb6fa1fb22a4 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sun, 22 Jan 2017 15:05:08 +0100 Subject: Adding a new evar source to remember the name of evars which were named in the original term. Useful at least for debugging, useful to give a better message than "this placeholder", even if in the loc is known in this case. --- engine/evd.ml | 1 + interp/constrintern.ml | 4 +++- intf/evar_kinds.mli | 1 + pretyping/cases.ml | 6 +++--- toplevel/himsg.ml | 2 ++ 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/engine/evd.ml b/engine/evd.ml index bffb407274..7006fde3cc 100644 --- a/engine/evd.ml +++ b/engine/evd.ml @@ -1299,6 +1299,7 @@ let pr_decl (decl,ok) = print_constr c ++ str (if ok then ")" else "}") let pr_evar_source = function + | Evar_kinds.NamedHole id -> pr_id id | Evar_kinds.QuestionMark _ -> str "underscore" | Evar_kinds.CasesType false -> str "pattern-matching return predicate" | Evar_kinds.CasesType true -> diff --git a/interp/constrintern.ml b/interp/constrintern.ml index 235e6e24f6..c102d8e117 100644 --- a/interp/constrintern.ml +++ b/interp/constrintern.ml @@ -1739,7 +1739,9 @@ let internalize globalenv env allow_patvar (_, ntnvars as lvar) c = let k = match k with | None -> let st = Evar_kinds.Define (not (Program.get_proofs_transparency ())) in - Evar_kinds.QuestionMark st + (match naming with + | Misctypes.IntroIdentifier id -> Evar_kinds.NamedHole id + | _ -> Evar_kinds.QuestionMark st) | Some k -> k in let solve = match solve with diff --git a/intf/evar_kinds.mli b/intf/evar_kinds.mli index afc5e3bab9..470ad2a23b 100644 --- a/intf/evar_kinds.mli +++ b/intf/evar_kinds.mli @@ -20,6 +20,7 @@ type t = | ImplicitArg of global_reference * (int * Id.t option) * bool (** Force inference *) | BinderType of Name.t + | NamedHole of Id.t (* coming from some ?[id] syntax *) | QuestionMark of obligation_definition_status | CasesType of bool (* true = a subterm of the type *) | InternalHole diff --git a/pretyping/cases.ml b/pretyping/cases.ml index 4684469826..95341307a3 100644 --- a/pretyping/cases.ml +++ b/pretyping/cases.ml @@ -275,9 +275,9 @@ let rec find_row_ind = function let inductive_template evdref env tmloc ind = let indu = evd_comb1 (Evd.fresh_inductive_instance env) evdref ind in let arsign = inductive_alldecls_env env indu in - let hole_source = match tmloc with - | Some loc -> fun i -> (loc, Evar_kinds.TomatchTypeParameter (ind,i)) - | None -> fun _ -> (Loc.ghost, Evar_kinds.InternalHole) in + let hole_source i = match tmloc with + | Some loc -> (loc, Evar_kinds.TomatchTypeParameter (ind,i)) + | None -> (Loc.ghost, Evar_kinds.TomatchTypeParameter (ind,i)) in let (_,evarl,_) = List.fold_right (fun decl (subst,evarl,n) -> diff --git a/toplevel/himsg.ml b/toplevel/himsg.ml index 891662b93a..6cff805fc2 100644 --- a/toplevel/himsg.ml +++ b/toplevel/himsg.ml @@ -532,6 +532,8 @@ let pr_trailing_ne_context_of env sigma = else (str " in environment:"++ pr_context_unlimited env sigma) let rec explain_evar_kind env sigma evk ty = function + | Evar_kinds.NamedHole id -> + strbrk "the existential variable named " ++ pr_id id | Evar_kinds.QuestionMark _ -> strbrk "this placeholder of type " ++ ty | Evar_kinds.CasesType false -> -- cgit v1.2.3 From a6f687852c0c7509a06fdf16c0af29129b3566d5 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Mon, 23 Jan 2017 10:32:08 +0100 Subject: Fixing unification regression #5323. Tracking conversion problems to reconsider was lost for evars subject to restriction (field last_mods was not updated and conversion problems not considered to be changed). --- pretyping/evd.ml | 5 ++++- test-suite/bugs/closed/5323.v | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 test-suite/bugs/closed/5323.v diff --git a/pretyping/evd.ml b/pretyping/evd.ml index 2f4b8fc12f..7b0ffd8b1d 100644 --- a/pretyping/evd.ml +++ b/pretyping/evd.ml @@ -898,13 +898,16 @@ let restrict evk evk' filter ?candidates evd = { evar_info with evar_filter = filter; evar_candidates = candidates; evar_extra = Store.empty } in + let last_mods = match evd.conv_pbs with + | [] -> evd.last_mods + | _ -> Evar.Set.add evk evd.last_mods in let evar_names = EvNames.reassign_name_defined evk evk' evd.evar_names in let ctxt = Filter.filter_list filter (evar_context evar_info) in let id_inst = Array.map_of_list (fun (id,_,_) -> mkVar id) ctxt in let body = mkEvar(evk',id_inst) in let (defn_evars, undf_evars) = define_aux evd.defn_evars evd.undf_evars evk body in { evd with undf_evars = EvMap.add evk' evar_info' undf_evars; - defn_evars; evar_names } + defn_evars; last_mods; evar_names } let downcast evk ccl evd = let evar_info = EvMap.find evk evd.undf_evars in diff --git a/test-suite/bugs/closed/5323.v b/test-suite/bugs/closed/5323.v new file mode 100644 index 0000000000..295b7cd9f5 --- /dev/null +++ b/test-suite/bugs/closed/5323.v @@ -0,0 +1,26 @@ +(* Revealed a missing re-consideration of postponed problems *) + +Module A. +Inductive flat_type := Unit | Prod (A B : flat_type). +Inductive exprf (op : flat_type -> flat_type -> Type) {var : Type} : flat_type +-> Type := +| Op {t1 tR} (opc : op t1 tR) (args : exprf op t1) : exprf op tR. +Inductive op : flat_type -> flat_type -> Type := . +Arguments Op {_ _ _ _} _ _. +Definition bound_op {var} + {src2 dst2} + (opc2 : op src2 dst2) + : forall (args2 : exprf op (var:=var) src2), Op opc2 args2 = Op opc2 args2 + := match opc2 return (forall args2, Op opc2 args2 = Op opc2 args2) with end. +End A. + +(* A shorter variant *) +Module B. +Inductive exprf (op : unit -> Type) : Type := +| A : exprf op +| Op tR (opc : op tR) (args : exprf op) : exprf op. +Inductive op : unit -> Type := . +Definition bound_op (dst2 : unit) (opc2 : op dst2) + : forall (args2 : exprf op), Op op dst2 opc2 args2 = A op + := match opc2 in op h return (forall args2 : exprf ?[U], Op ?[V] ?[I] opc2 args2 = A op) with end. +End B. -- cgit v1.2.3 From 180775636f5ec93e95df681951fafb321f8ebe67 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Thu, 26 Jan 2017 00:53:23 +0100 Subject: Fixing #5326 (anomaly on some unsupported case of 'pat). We complete the support of 'pat in this particular case (a 'pat under a binder in a notation). --- interp/topconstr.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/interp/topconstr.ml b/interp/topconstr.ml index 79eeacf354..d388376bc2 100644 --- a/interp/topconstr.ml +++ b/interp/topconstr.ml @@ -92,8 +92,9 @@ let rec fold_local_binders g f n acc b = function f n (fold_local_binders g f n' acc b l) t | LocalRawDef ((_,na),t)::l -> f n (fold_local_binders g f (name_fold g na n) acc b l) t - | LocalPattern _::l -> - assert false + | LocalPattern (_,pat,t)::l -> + let acc = fold_local_binders g f (cases_pattern_fold_names g n pat) acc b l in + Option.fold_left (f n) acc t | [] -> f n acc b -- cgit v1.2.3 From 86116b181bb866c7f63a37796e1388f731ce7204 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Thu, 26 Jan 2017 11:38:19 +0100 Subject: [native comp] Improve error message on linking error. The native compiler doesn't support `Require` inside `Module` sections in some cases, we improve the error message. See: https://coq.inria.fr/bugs/show_bug.cgi?id=4335 This patch improves the error message and gives the user some feedback. --- kernel/safe_typing.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/safe_typing.ml b/kernel/safe_typing.ml index 8b28cd87bd..7e28b1c567 100644 --- a/kernel/safe_typing.ml +++ b/kernel/safe_typing.ml @@ -795,7 +795,10 @@ type compiled_library = { type native_library = Nativecode.global list let get_library_native_symbols senv dir = - DPMap.find dir senv.native_symbols + try DPMap.find dir senv.native_symbols + with Not_found -> Errors.errorlabstrm "get_library_native_symbols" + Pp.((str "Linker error in the native compiler. Are you using Require inside a nested Module declaration?") ++ fnl () ++ + (str "This use case is not supported, but disabling the native compiler may help.")) (** FIXME: MS: remove?*) let current_modpath senv = senv.modpath -- cgit v1.2.3 From c7a0568967a8a6e40888a2106b9b59325f2f09a5 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Thu, 26 Jan 2017 13:24:04 +0100 Subject: Adding a printer for Proof.proof reflecting the focusing layout. This is a modest contribution serving before all the purpose of displaying the focus stack and the shelf and give_up list. It does not print the sigma (while it could). Any improvements are welcome. --- dev/include | 2 +- dev/top_printers.ml | 3 ++- proofs/proof.ml | 16 ++++++++++++++++ proofs/proof.mli | 2 ++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/dev/include b/dev/include index 9068688f19..0f43f00729 100644 --- a/dev/include +++ b/dev/include @@ -61,7 +61,7 @@ (*#install_printer (* hints_path *) pphintspath;;*) #install_printer (* goal *) ppgoal;; (*#install_printer (* sigma goal *) ppsigmagoal;;*) -(*#install_printer (* proof *) pproof;;*) +#install_printer (* proof *) pproof;; #install_printer (* Goal.goal *) ppgoalgoal;; #install_printer (* proofview *) ppproofview;; #install_printer (* metaset.t *) ppmetas;; diff --git a/dev/top_printers.ml b/dev/top_printers.ml index b552d99949..4fcad88202 100644 --- a/dev/top_printers.ml +++ b/dev/top_printers.ml @@ -200,7 +200,8 @@ let pppftreestate p = pp(print_pftreestate p) (* let ppsigmagoal g = pp(pr_goal (sig_it g)) *) (* let prgls gls = pp(pr_gls gls) *) (* let prglls glls = pp(pr_glls glls) *) -(* let pproof p = pp(print_proof Evd.empty empty_named_context p) *) + +let pproof p = pp(Proof.pr_proof p) let ppuni u = pp(pr_uni u) let ppuni_level u = pp (Level.pr u) diff --git a/proofs/proof.ml b/proofs/proof.ml index 0a3b08c04a..b2103489a7 100644 --- a/proofs/proof.ml +++ b/proofs/proof.ml @@ -372,6 +372,22 @@ let in_proof p k = k (Proofview.return p.proofview) let unshelve p = { p with proofview = Proofview.unshelve (p.shelf) (p.proofview) ; shelf = [] } +let pr_proof p = + let p = map_structured_proof p (fun _sigma g -> g) in + Pp.( + let pr_goal_list = prlist_with_sep spc Goal.pr_goal in + let rec aux acc = function + | [] -> acc + | (before,after)::stack -> + aux (pr_goal_list before ++ spc () ++ str "{" ++ acc ++ str "}" ++ spc () ++ + pr_goal_list after) stack in + str "[" ++ str "focus structure: " ++ + aux (pr_goal_list p.fg_goals) p.bg_goals ++ str ";" ++ spc () ++ + str "shelved: " ++ pr_goal_list p.shelved_goals ++ str ";" ++ spc () ++ + str "given up: " ++ pr_goal_list p.given_up_goals ++ + str "]" + ) + (*** Compatibility layer with <=v8.2 ***) module V82 = struct let subgoals p = diff --git a/proofs/proof.mli b/proofs/proof.mli index 5053fc7fb9..8dc165e72e 100644 --- a/proofs/proof.mli +++ b/proofs/proof.mli @@ -182,6 +182,8 @@ val in_proof : proof -> (Evd.evar_map -> 'a) -> 'a focused goals. *) val unshelve : proof -> proof +val pr_proof : proof -> Pp.std_ppcmds + (*** Compatibility layer with <=v8.2 ***) module V82 : sig val subgoals : proof -> Goal.goal list Evd.sigma -- cgit v1.2.3 From 22e2e5722d233bbd939cd235650497e30e506e63 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Fri, 27 Jan 2017 09:29:53 +0100 Subject: Fix documentation typos. --- ide/interface.mli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ide/interface.mli b/ide/interface.mli index 2a9b8b241f..123cac6c22 100644 --- a/ide/interface.mli +++ b/ide/interface.mli @@ -139,7 +139,7 @@ type add_rty = state_id * ((unit, state_id) union * string) [Inr (start,(stop,tip))] if [id] is in a zone that can be focused. In that case the zone is delimited by [start] and [stop] while [tip] is the new document [tip]. Edits made by subsequent [add] are always - performend on top of [id]. *) + performed on top of [id]. *) type edit_at_sty = state_id type edit_at_rty = (unit, state_id * (state_id * state_id)) union @@ -153,7 +153,7 @@ type query_rty = string type goals_sty = unit type goals_rty = goals option -(** Retrieve the list of unintantiated evars in the current proof. [None] if no +(** Retrieve the list of uninstantiated evars in the current proof. [None] if no proof is in progress. *) type evars_sty = unit type evars_rty = evar list option -- cgit v1.2.3 From 90b6969c467f097a4d7da0140e1351ef98d6401d Mon Sep 17 00:00:00 2001 From: Gaetan Gilbert Date: Sat, 28 Jan 2017 14:11:50 +0100 Subject: Remove useless comments --- kernel/typeops.mli | 8 -------- plugins/extraction/extraction.ml | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/kernel/typeops.mli b/kernel/typeops.mli index 73c63db681..007acae604 100644 --- a/kernel/typeops.mli +++ b/kernel/typeops.mli @@ -91,9 +91,6 @@ val judge_of_cast : val judge_of_inductive : env -> inductive puniverses -> unsafe_judgment -(* val judge_of_inductive_knowing_parameters : *) -(* env -> inductive -> unsafe_judgment array -> unsafe_judgment *) - val judge_of_constructor : env -> constructor puniverses -> unsafe_judgment (** {6 Type of Cases. } *) @@ -101,8 +98,6 @@ val judge_of_case : env -> case_info -> unsafe_judgment -> unsafe_judgment -> unsafe_judgment array -> unsafe_judgment -(* val type_of_constant : env -> pconstant -> types constrained *) - val type_of_constant_type : env -> constant_type -> types val type_of_projection_constant : env -> Names.projection puniverses -> types @@ -112,9 +107,6 @@ val type_of_constant_in : env -> pconstant -> types val type_of_constant_type_knowing_parameters : env -> constant_type -> types Lazy.t array -> types -(* val type_of_constant_knowing_parameters : *) -(* env -> pconstant -> types Lazy.t array -> types constrained *) - val type_of_constant_knowing_parameters_in : env -> pconstant -> types Lazy.t array -> types diff --git a/plugins/extraction/extraction.ml b/plugins/extraction/extraction.ml index 33fab74e13..2b19c2805f 100644 --- a/plugins/extraction/extraction.ml +++ b/plugins/extraction/extraction.ml @@ -258,7 +258,7 @@ let rec extract_type env db j c args = | Const (kn,u as c) -> let r = ConstRef kn in let cb = lookup_constant kn env in - let typ = Typeops.type_of_constant_in env c in (* FIXME constraints *) + let typ = Typeops.type_of_constant_in env c in (match flag_of_type env typ with | (Logic,_) -> assert false (* Cf. logical cases above *) | (Info, TypeScheme) -> -- cgit v1.2.3 From 6e4c4578044c15ec172009a570d13b9e168cb93e Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Sat, 28 Jan 2017 19:02:20 +0100 Subject: Fix bug #5262: Error should tell me which name is duplicated. --- toplevel/record.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/toplevel/record.ml b/toplevel/record.ml index ef09f6fa54..b8dcf81fde 100644 --- a/toplevel/record.ml +++ b/toplevel/record.ml @@ -550,8 +550,10 @@ let definition_structure (kind,poly,finite,(is_coe,((loc,idstruc),pl)),ps,cfs,id | Vernacexpr.DefExpr ((_,Name id),_,_) -> id::acc | _ -> acc in let allnames = idstruc::(List.fold_left extract_name [] fs) in - if not (List.distinct_f Id.compare allnames) - then error "Two objects have the same name"; + let () = match List.duplicates Id.equal allnames with + | [] -> () + | id :: _ -> errorlabstrm "" (str "Two objects have the same name" ++ spc () ++ quote (Id.print id)) + in let isnot_class = match kind with Class false -> false | _ -> true in if isnot_class && List.exists (fun opt -> not (Option.is_empty opt)) priorities then error "Priorities only allowed for type class substructures"; -- cgit v1.2.3 From a54dccb53fa8d6c12745b5f7b2c3c993a915b5bd Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Fri, 2 Dec 2016 12:23:14 +0100 Subject: Fix a typo in STM universe communications. --- stm/asyncTaskQueue.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stm/asyncTaskQueue.ml b/stm/asyncTaskQueue.ml index fa6422cdc5..8acc3c233a 100644 --- a/stm/asyncTaskQueue.ml +++ b/stm/asyncTaskQueue.ml @@ -170,7 +170,7 @@ module Make(T : Task) = struct | Unix.WSIGNALED sno -> Printf.sprintf "signalled(%d)" sno | Unix.WSTOPPED sno -> Printf.sprintf "stopped(%d)" sno) in let more_univs n = - CList.init 10 (fun _ -> + CList.init n (fun _ -> Universes.new_univ_level (Global.current_dirpath ())) in let rec kill_if () = -- cgit v1.2.3 From f5923c2174fbb419397f127af31ab1cd0b223e0a Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Tue, 31 Jan 2017 06:36:25 +0100 Subject: Fixing #5311 (anomaly on unexpected intro pattern). This was introduced in 8.5 while reorganizing the structure of intro-patterns. --- tactics/tacinterp.ml | 2 +- test-suite/bugs/closed/5331.v | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test-suite/bugs/closed/5331.v diff --git a/tactics/tacinterp.ml b/tactics/tacinterp.ml index 23d188aa73..2cfd2d6b12 100644 --- a/tactics/tacinterp.ml +++ b/tactics/tacinterp.ml @@ -894,7 +894,7 @@ let interp_or_and_intro_pattern_option ist env sigma = function (match coerce_to_intro_pattern env (Id.Map.find id ist.lfun) with | IntroAction (IntroOrAndPattern l) -> sigma, Some (loc,l) | _ -> - raise (CannotCoerceTo "a disjunctive/conjunctive introduction pattern")) + user_err_loc (loc,"", str "Cannot coerce to a disjunctive/conjunctive pattern.")) | Some (ArgArg (loc,l)) -> let sigma,l = interp_or_and_intro_pattern ist env sigma l in sigma, Some (loc,l) diff --git a/test-suite/bugs/closed/5331.v b/test-suite/bugs/closed/5331.v new file mode 100644 index 0000000000..0d72fcb5df --- /dev/null +++ b/test-suite/bugs/closed/5331.v @@ -0,0 +1,11 @@ +(* Checking no anomaly on some unexpected intropattern *) + +Ltac ih H := induction H as H. +Ltac ih' H H' := induction H as H'. + +Goal True -> True. +Fail intro H; ih H. +intro H; ih' H ipattern:[]. +exact I. +Qed. + -- cgit v1.2.3 From 0f15957f17db9dcefbef481b47e97d507d5297af Mon Sep 17 00:00:00 2001 From: Pierre-Yves Strub Date: Fri, 3 Feb 2017 11:38:59 +0100 Subject: Travis CI configuration. Runs validate & test-suite. --- .travis.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..32db3f3018 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +sudo: required +dist: precise +language: ocaml +cache: + apt: true +install: +- sudo add-apt-repository --yes ppa:avsm/ppa +- sudo apt-get update -q -y +- sudo apt-get install -q -y opam +- opam init --compiler=4.02.3 -y -v +- eval $(opam config env) +- opam config var root +- opam install -y -v camlp5 ocamlfind +- opam list +script: +- ./configure -local +- make +- travis_wait make validate +- travis_wait make test-suite -- cgit v1.2.3 From 4d8320aad05cb8654da9a710089fe4451b530800 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Strub Date: Sat, 4 Feb 2017 11:21:37 +0100 Subject: [travis] CoqIde + doc + last available LST --- .travis.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 32db3f3018..2b28cb0223 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,28 @@ -sudo: required -dist: precise +dist: trusty language: ocaml cache: apt: true + directories: + - $HOME/.opam +addons: + apt: + sources: + - avsm + packages: + - opam + - libgtk2.0-dev + - libgtksourceview2.0-dev + - texlive-latex-base + - transfig + - imagemagick install: -- sudo add-apt-repository --yes ppa:avsm/ppa -- sudo apt-get update -q -y -- sudo apt-get install -q -y opam -- opam init --compiler=4.02.3 -y -v +- "[ -e .opam ] || opam init --compiler=4.02.3 -y" - eval $(opam config env) - opam config var root -- opam install -y -v camlp5 ocamlfind +- opam install -y camlp5 ocamlfind lablgtk-extras hevea - opam list script: -- ./configure -local +- ./configure -local -usecamlp5 -native-compiler yes -coqide opt -with-doc yes - make - travis_wait make validate - travis_wait make test-suite -- cgit v1.2.3 From c20491301e55b5bbf44b4c81f5a7a9c5a0b07111 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Strub Date: Sat, 4 Feb 2017 13:24:46 +0100 Subject: [travis] : more apt deps + parallel jobs + non-container based --- .travis.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2b28cb0223..3e71a71570 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ dist: trusty +sudo: required language: ocaml cache: apt: true @@ -10,19 +11,28 @@ addons: - avsm packages: - opam + - aspcud - libgtk2.0-dev - libgtksourceview2.0-dev - texlive-latex-base + - texlive-latex-recommended + - texlive-latex-extra + - texlive-math-extra + - texlive-fonts-recommended + - texlive-fonts-extra + - latex-xcolor + - ghostscript - transfig - imagemagick install: -- "[ -e .opam ] || opam init --compiler=4.02.3 -y" +- ": ${NJOBS:=1}" +- "[ -e .opam ] || opam init -j ${NJOBS} --compiler=4.02.3 -n -y" - eval $(opam config env) - opam config var root -- opam install -y camlp5 ocamlfind lablgtk-extras hevea +- opam install -j ${NJOBS} -y camlp5 ocamlfind lablgtk-extras hevea - opam list script: - ./configure -local -usecamlp5 -native-compiler yes -coqide opt -with-doc yes -- make -- travis_wait make validate -- travis_wait make test-suite +- make -j ${NJOBS} +- travis_wait make -j ${NJOBS} validate +- travis_wait make -j ${NJOBS} test-suite -- cgit v1.2.3 From 348160a1c59da5c448a56a2e2802865f94a40ddc Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Sat, 4 Feb 2017 21:18:54 +0100 Subject: [travis] Run tests using a parallel matrix. We also optimize `travis_wait` use. --- .travis.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3e71a71570..f9d4965638 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,13 @@ addons: - ghostscript - transfig - imagemagick +env: + global: + - NJOBS=1 + matrix: + - TEST_TARGET="validate" TW="travis_wait" + - TEST_TARGET="test-suite" TW="" install: -- ": ${NJOBS:=1}" - "[ -e .opam ] || opam init -j ${NJOBS} --compiler=4.02.3 -n -y" - eval $(opam config env) - opam config var root @@ -34,5 +39,4 @@ install: script: - ./configure -local -usecamlp5 -native-compiler yes -coqide opt -with-doc yes - make -j ${NJOBS} -- travis_wait make -j ${NJOBS} validate -- travis_wait make -j ${NJOBS} test-suite +- ${TW} make -j ${NJOBS} ${TEST_TARGET} -- cgit v1.2.3 From 3e07baa69f1e7de02670dd20dd7577d70c2f2653 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Sat, 4 Feb 2017 21:25:14 +0100 Subject: [travis] [External CI] compcert HoTT math-comp - Improve the setup to support external contribs. We use a more minimalistic Coq build, gaining a few extra minutes. - [math-comp] workaround `make -j` bug to enable parallel building. --- .travis.yml | 78 +++++++++++++++++++++++++++++++++---------- Makefile | 5 +++ Makefile.contrib | 13 ++++++++ tools/ci/contrib-compcert.sh | 17 ++++++++++ tools/ci/contrib-hott.sh | 13 ++++++++ tools/ci/contrib-math-comp.sh | 15 +++++++++ 6 files changed, 124 insertions(+), 17 deletions(-) create mode 100644 Makefile.contrib create mode 100755 tools/ci/contrib-compcert.sh create mode 100755 tools/ci/contrib-hott.sh create mode 100755 tools/ci/contrib-math-comp.sh diff --git a/.travis.yml b/.travis.yml index f9d4965638..ab59cf6bf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,31 +12,75 @@ addons: packages: - opam - aspcud - - libgtk2.0-dev - - libgtksourceview2.0-dev - - texlive-latex-base - - texlive-latex-recommended - - texlive-latex-extra - - texlive-math-extra - - texlive-fonts-recommended - - texlive-fonts-extra - - latex-xcolor - - ghostscript - - transfig - - imagemagick env: global: - NJOBS=1 + - COMPILER="4.02.3" + # Main test suites matrix: - - TEST_TARGET="validate" TW="travis_wait" - - TEST_TARGET="test-suite" TW="" + - TEST_TARGET="validate" TW="travis_wait" + - TEST_TARGET="contrib-hott" + - TEST_TARGET="contrib-math-comp" + - TEST_TARGET="contrib-compcert" + +matrix: + # Extra is Full COQ build and test-suite with two compilers + include: + - env: + - TEST_TARGET="test-suite" + - EXTRA_CONF="-coqide opt -with-doc yes" + - EXTRA_OPAM="lablgtk-extras hevea" + addons: + apt: + sources: + - avsm + packages: + - opam + - aspcud + - libgtk2.0-dev + - libgtksourceview2.0-dev + - texlive-latex-base + - texlive-latex-recommended + - texlive-latex-extra + - texlive-math-extra + - texlive-fonts-recommended + - texlive-fonts-extra + - latex-xcolor + - ghostscript + - transfig + - imagemagick + - env: + - TEST_TARGET="test-suite" + - COMPILER="4.04.0" + - EXTRA_CONF="-coqide opt -with-doc yes" + - EXTRA_OPAM="lablgtk-extras hevea" + addons: + apt: + sources: + - avsm + packages: + - opam + - aspcud + - libgtk2.0-dev + - libgtksourceview2.0-dev + - texlive-latex-base + - texlive-latex-recommended + - texlive-latex-extra + - texlive-math-extra + - texlive-fonts-recommended + - texlive-fonts-extra + - latex-xcolor + - ghostscript + - transfig + - imagemagick + install: -- "[ -e .opam ] || opam init -j ${NJOBS} --compiler=4.02.3 -n -y" +- "[ -e .opam ] || opam init -j ${NJOBS} --compiler=${COMPILER} -n -y" - eval $(opam config env) - opam config var root -- opam install -j ${NJOBS} -y camlp5 ocamlfind lablgtk-extras hevea +- opam install -j ${NJOBS} -y camlp5 ocamlfind ${EXTRA_OPAM} - opam list script: -- ./configure -local -usecamlp5 -native-compiler yes -coqide opt -with-doc yes +- ./configure -local -usecamlp5 -native-compiler yes ${EXTRA_CONF} - make -j ${NJOBS} - ${TW} make -j ${NJOBS} ${TEST_TARGET} diff --git a/Makefile b/Makefile index 0f9619c01b..25a97f9bb1 100644 --- a/Makefile +++ b/Makefile @@ -245,6 +245,11 @@ devdocclean: rm -f $(OCAMLDOCDIR)/ocamldoc.sty $(OCAMLDOCDIR)/coq.tex rm -f $(OCAMLDOCDIR)/html/*.html +########################################################################### +# Contrib tests +########################################################################### +include Makefile.contrib + ########################################################################### # Emacs tags ########################################################################### diff --git a/Makefile.contrib b/Makefile.contrib new file mode 100644 index 0000000000..2e3ed94c53 --- /dev/null +++ b/Makefile.contrib @@ -0,0 +1,13 @@ +.PHONY: contrib-all contrib-hott contrib-math-comp + +contrib-all: contrib-hott contrib-math-comp + +# TODO Do generic rule +contrib-hott: + ./tools/ci/contrib-hott.sh + +contrib-math-comp: + ./tools/ci/contrib-math-comp.sh + +contrib-compcert: + ./tools/ci/contrib-compcert.sh diff --git a/tools/ci/contrib-compcert.sh b/tools/ci/contrib-compcert.sh new file mode 100755 index 0000000000..416e283254 --- /dev/null +++ b/tools/ci/contrib-compcert.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Proof of concept contrib build script. + +set -xe + +export PATH=`pwd`/bin:$PATH +ls `pwd`/bin + +opam install -j ${NJOBS} -y menhir +git clone --depth 3 -b coq-8.6 https://github.com/maximedenes/CompCert.git + +pushd CompCert +# Patch to avoid the upper version limit +sed -i.bak 's/8.6)/8.6|trunk)/' configure +./configure x86_32-linux && make -j ${NJOBS} +popd diff --git a/tools/ci/contrib-hott.sh b/tools/ci/contrib-hott.sh new file mode 100755 index 0000000000..35af76ceb7 --- /dev/null +++ b/tools/ci/contrib-hott.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Proof of concept contrib build script. + +set -xe + +export PATH=`pwd`/bin:$PATH + +git clone --depth 3 -b mz-8.6 https://github.com/ejgallego/HoTT.git + +pushd HoTT +./autogen.sh && ./configure && make -j ${NJOBS} +popd diff --git a/tools/ci/contrib-math-comp.sh b/tools/ci/contrib-math-comp.sh new file mode 100755 index 0000000000..39a92a2d89 --- /dev/null +++ b/tools/ci/contrib-math-comp.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Proof of concept contrib build script. + +set -xe + +export PATH=`pwd`/bin:$PATH + +git clone --depth 3 https://github.com/math-comp/math-comp.git + +# odd_order takes too much time for travis. +( cd math-comp/mathcomp && \ + sed -i.bak '/PFsection/d' Make && \ + sed -i.bak '/stripped_odd_order_theorem/d' Make && \ + make Makefile.coq && make -f Makefile.coq -j ${NJOBS} all ) -- cgit v1.2.3 From 3a66f149a34613ef0ed04046fed3947e8e720cd6 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Sat, 4 Feb 2017 22:32:49 +0100 Subject: [travis] Improvements to main script - Add README.ci Suggestions and comments welcome. - Use the system compiler to get some boot speedup. - Build log folding. - Set NJOBS=2 (very moderate speedup) - Set language to a defined value. OPAM itself recommends C, so we follow suit. - Remove spurious `.opam`test No harm in testing we are in the right opam setting even if the cache did exist. Anyways, it seems that the previous was spurious, as it was testing if ~/coq/.opam did exists. I think the correct command would have been: ```shell [ -e ${HOME}/.opam ] || opam init ... ``` See the log at https://travis-ci.org/coq/coq/builds/198948812 for an example. --- .travis.yml | 27 ++++++++++++++++++---- README.ci | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 README.ci diff --git a/.travis.yml b/.travis.yml index ab59cf6bf7..14573e2952 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ dist: trusty sudo: required -language: ocaml +# Until Ocaml becomes a language, we set a known one. +language: c cache: apt: true directories: @@ -14,8 +15,9 @@ addons: - aspcud env: global: - - NJOBS=1 - - COMPILER="4.02.3" + - NJOBS=2 + # system is == 4.02.3 + - COMPILER="system" # Main test suites matrix: - TEST_TARGET="validate" TW="travis_wait" @@ -24,7 +26,12 @@ env: - TEST_TARGET="contrib-compcert" matrix: - # Extra is Full COQ build and test-suite with two compilers + + allow_failures: + - env: TEST_TARGET="ci-cpdt" + + # Full Coq test-suite with two compilers + # [TODO: use yaml refs and avoid duplication for packages list] include: - env: - TEST_TARGET="test-suite" @@ -75,12 +82,22 @@ matrix: - imagemagick install: -- "[ -e .opam ] || opam init -j ${NJOBS} --compiler=${COMPILER} -n -y" +- opam init -j ${NJOBS} --compiler=${COMPILER} -n -y - eval $(opam config env) - opam config var root - opam install -j ${NJOBS} -y camlp5 ocamlfind ${EXTRA_OPAM} - opam list + script: + +- echo 'Configuring Coq...' && echo -en 'travis_fold:start:coq.config\\r' - ./configure -local -usecamlp5 -native-compiler yes ${EXTRA_CONF} +- echo -en 'travis_fold:end:coq.config\\r' + +- echo 'Building Coq...' && echo -en 'travis_fold:start:coq.build\\r' - make -j ${NJOBS} +- echo -en 'travis_fold:end:coq.build\\r' + +- echo 'Running tests...' && echo -en 'travis_fold:start:coq.test\\r' - ${TW} make -j ${NJOBS} ${TEST_TARGET} +- echo -en 'travis_fold:end:coq.test\\r' diff --git a/README.ci b/README.ci new file mode 100644 index 0000000000..ed2ba9126e --- /dev/null +++ b/README.ci @@ -0,0 +1,77 @@ +**WARNING:** This document is a work in progress and intended as a RFC. +If you are not a Coq Developer, don't follow this instructions yet. + +Introduction +============ + +The Coq Travis CI infrastructure is meant to provide lightweight +automatics testing of pull requests. + +More comprehensive testing is the responsability of Coq's [Jenkins CI +server](https://ci.inria.fr/coq/) see, [XXX: add document] for +instructions on how to add your development to Jenkins. + +How to submit your development for Coq Travis CI +================================================ + +Travis CI provides a convenient way to perform testing of Coq changes +versus a set of curated libraries. + +Are you an author of a Coq library who would be interested in having +the latest Coq changes validated against your development? + +If so, keep reading! Getting Coq changes tested against your library +is easy, all that you need to do is: + +1.- Put you development in a public repository tracking coq trunk. +2.- Make sure that your development builds in less than 35 minutes. +3.- Submit a PR adding you development. +4.- ? +5.- Profit! Your library is now part of Coq's continous integration! + +Note that by partipating in this program, you assume a reasonable +compromise to discuss and eventually integrate compatibility changes +upstream. + +Get in touch with us to discuss any special need your development may +have. + +Maintaining your contribution manually [current method] +====================================== + +To add your contribution to the Coq Travis CI set, add a script for +building your library to `tools/ci/`, update `.travis.yml` and +`Makefile.ci`. Then, submit a PR. + +Maintaining your contribution as an OPAM package [work in progress] [to be implemented] +================================================ + +You can also provide an opam package for your contribution XXX at +https://github.com/coq/opam-coq-archive + +Then, add a `ci-opam-XXX` target to the `.travis.yml` file, the +package XXX.dev will be tested against each Coq commit and pull +request. + +- TODO: The main question here is what to do with `.opam` caching. We + could disable it altogether, however this will have an impact. We + could install a dummy Coq package, but `coq-*` dependencies will be + botched too. Need to think more. + +PR Overlays [work in progress] [to be implemented] +=========== + +It is common for PR to break some of the external tests. To this +purpose, we provide a method for particular PR to overlay the +repositories of some of the tests so they can provide fixed +developments. + +The general idea is that the PR author will drop a file +`tools/ci/overlays/$branch.overlay` where branch name is taken from +`${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}` +that is to say, the name of the original branch for the PR. + +The `.overlay` file will contain a set of variables that will be used +to do the corresponding `opam pin` or to overload the corresponding +git repositories, etc... + -- cgit v1.2.3 From 138a4da7f0133d7b4ea06cfbc938d23ddb88c97d Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Sat, 4 Feb 2017 23:55:24 +0100 Subject: [travis] [External CI] Script renaming. --- .travis.yml | 6 +++--- Makefile | 4 ++-- Makefile.ci | 13 +++++++++++++ Makefile.contrib | 13 ------------- tools/ci/ci-compcert.sh | 17 +++++++++++++++++ tools/ci/ci-hott.sh | 13 +++++++++++++ tools/ci/ci-math-comp.sh | 15 +++++++++++++++ tools/ci/contrib-compcert.sh | 17 ----------------- tools/ci/contrib-hott.sh | 13 ------------- tools/ci/contrib-math-comp.sh | 15 --------------- 10 files changed, 63 insertions(+), 63 deletions(-) create mode 100644 Makefile.ci delete mode 100644 Makefile.contrib create mode 100755 tools/ci/ci-compcert.sh create mode 100755 tools/ci/ci-hott.sh create mode 100755 tools/ci/ci-math-comp.sh delete mode 100755 tools/ci/contrib-compcert.sh delete mode 100755 tools/ci/contrib-hott.sh delete mode 100755 tools/ci/contrib-math-comp.sh diff --git a/.travis.yml b/.travis.yml index 14573e2952..c85122ac96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,9 +21,9 @@ env: # Main test suites matrix: - TEST_TARGET="validate" TW="travis_wait" - - TEST_TARGET="contrib-hott" - - TEST_TARGET="contrib-math-comp" - - TEST_TARGET="contrib-compcert" + - TEST_TARGET="ci-hott" + - TEST_TARGET="ci-math-comp" + - TEST_TARGET="ci-compcert" matrix: diff --git a/Makefile b/Makefile index 25a97f9bb1..e1d6e8e1d2 100644 --- a/Makefile +++ b/Makefile @@ -246,9 +246,9 @@ devdocclean: rm -f $(OCAMLDOCDIR)/html/*.html ########################################################################### -# Contrib tests +# Continuous Intregration Tests ########################################################################### -include Makefile.contrib +include Makefile.ci ########################################################################### # Emacs tags diff --git a/Makefile.ci b/Makefile.ci new file mode 100644 index 0000000000..ada698e0a6 --- /dev/null +++ b/Makefile.ci @@ -0,0 +1,13 @@ +.PHONY: ci-all ci-hott ci-math-comp ci-compcert + +ci-all: ci-hott ci-math-comp ci-compcert + +# TODO Do generic rule +ci-hott: + ./tools/ci/ci-hott.sh + +ci-math-comp: + ./tools/ci/ci-math-comp.sh + +ci-compcert: + ./tools/ci/ci-compcert.sh diff --git a/Makefile.contrib b/Makefile.contrib deleted file mode 100644 index 2e3ed94c53..0000000000 --- a/Makefile.contrib +++ /dev/null @@ -1,13 +0,0 @@ -.PHONY: contrib-all contrib-hott contrib-math-comp - -contrib-all: contrib-hott contrib-math-comp - -# TODO Do generic rule -contrib-hott: - ./tools/ci/contrib-hott.sh - -contrib-math-comp: - ./tools/ci/contrib-math-comp.sh - -contrib-compcert: - ./tools/ci/contrib-compcert.sh diff --git a/tools/ci/ci-compcert.sh b/tools/ci/ci-compcert.sh new file mode 100755 index 0000000000..416e283254 --- /dev/null +++ b/tools/ci/ci-compcert.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Proof of concept contrib build script. + +set -xe + +export PATH=`pwd`/bin:$PATH +ls `pwd`/bin + +opam install -j ${NJOBS} -y menhir +git clone --depth 3 -b coq-8.6 https://github.com/maximedenes/CompCert.git + +pushd CompCert +# Patch to avoid the upper version limit +sed -i.bak 's/8.6)/8.6|trunk)/' configure +./configure x86_32-linux && make -j ${NJOBS} +popd diff --git a/tools/ci/ci-hott.sh b/tools/ci/ci-hott.sh new file mode 100755 index 0000000000..35af76ceb7 --- /dev/null +++ b/tools/ci/ci-hott.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Proof of concept contrib build script. + +set -xe + +export PATH=`pwd`/bin:$PATH + +git clone --depth 3 -b mz-8.6 https://github.com/ejgallego/HoTT.git + +pushd HoTT +./autogen.sh && ./configure && make -j ${NJOBS} +popd diff --git a/tools/ci/ci-math-comp.sh b/tools/ci/ci-math-comp.sh new file mode 100755 index 0000000000..39a92a2d89 --- /dev/null +++ b/tools/ci/ci-math-comp.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Proof of concept contrib build script. + +set -xe + +export PATH=`pwd`/bin:$PATH + +git clone --depth 3 https://github.com/math-comp/math-comp.git + +# odd_order takes too much time for travis. +( cd math-comp/mathcomp && \ + sed -i.bak '/PFsection/d' Make && \ + sed -i.bak '/stripped_odd_order_theorem/d' Make && \ + make Makefile.coq && make -f Makefile.coq -j ${NJOBS} all ) diff --git a/tools/ci/contrib-compcert.sh b/tools/ci/contrib-compcert.sh deleted file mode 100755 index 416e283254..0000000000 --- a/tools/ci/contrib-compcert.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# Proof of concept contrib build script. - -set -xe - -export PATH=`pwd`/bin:$PATH -ls `pwd`/bin - -opam install -j ${NJOBS} -y menhir -git clone --depth 3 -b coq-8.6 https://github.com/maximedenes/CompCert.git - -pushd CompCert -# Patch to avoid the upper version limit -sed -i.bak 's/8.6)/8.6|trunk)/' configure -./configure x86_32-linux && make -j ${NJOBS} -popd diff --git a/tools/ci/contrib-hott.sh b/tools/ci/contrib-hott.sh deleted file mode 100755 index 35af76ceb7..0000000000 --- a/tools/ci/contrib-hott.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Proof of concept contrib build script. - -set -xe - -export PATH=`pwd`/bin:$PATH - -git clone --depth 3 -b mz-8.6 https://github.com/ejgallego/HoTT.git - -pushd HoTT -./autogen.sh && ./configure && make -j ${NJOBS} -popd diff --git a/tools/ci/contrib-math-comp.sh b/tools/ci/contrib-math-comp.sh deleted file mode 100755 index 39a92a2d89..0000000000 --- a/tools/ci/contrib-math-comp.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Proof of concept contrib build script. - -set -xe - -export PATH=`pwd`/bin:$PATH - -git clone --depth 3 https://github.com/math-comp/math-comp.git - -# odd_order takes too much time for travis. -( cd math-comp/mathcomp && \ - sed -i.bak '/PFsection/d' Make && \ - sed -i.bak '/stripped_odd_order_theorem/d' Make && \ - make Makefile.coq && make -f Makefile.coq -j ${NJOBS} all ) -- cgit v1.2.3 From 487e19a495b8727b0d3f11a8f0238d17aa9e9303 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Sun, 5 Feb 2017 01:02:39 +0100 Subject: [travis] [External CI] C-Corn color coquelicot cpdt fiat-crypto floqc iris-coq math-classes sf - [TLC] [metacoq] not ready for 8.6 yet --- .travis.yml | 13 ++++++++++++- Makefile.ci | 17 +++++++---------- tools/ci/ci-color.sh | 8 ++++++++ tools/ci/ci-common.sh | 6 ++++++ tools/ci/ci-compcert.sh | 13 +++---------- tools/ci/ci-coquelicot.sh | 29 +++++++++++++++++++++++++++++ tools/ci/ci-cpdt.sh | 10 ++++++++++ tools/ci/ci-fiat-crypto.sh | 12 ++++++++++++ tools/ci/ci-flocq.sh | 9 +++++++++ tools/ci/ci-hott.sh | 11 +++-------- tools/ci/ci-iris-coq.sh | 30 ++++++++++++++++++++++++++++++ tools/ci/ci-math-classes.sh | 12 ++++++++++++ tools/ci/ci-math-comp.sh | 8 +++----- tools/ci/ci-metacoq.sh | 16 ++++++++++++++++ tools/ci/ci-sf.sh | 11 +++++++++++ tools/ci/ci-tlc.sh | 8 ++++++++ 16 files changed, 179 insertions(+), 34 deletions(-) create mode 100755 tools/ci/ci-color.sh create mode 100644 tools/ci/ci-common.sh create mode 100755 tools/ci/ci-coquelicot.sh create mode 100755 tools/ci/ci-cpdt.sh create mode 100755 tools/ci/ci-fiat-crypto.sh create mode 100755 tools/ci/ci-flocq.sh create mode 100755 tools/ci/ci-iris-coq.sh create mode 100755 tools/ci/ci-math-classes.sh create mode 100755 tools/ci/ci-metacoq.sh create mode 100755 tools/ci/ci-sf.sh create mode 100755 tools/ci/ci-tlc.sh diff --git a/.travis.yml b/.travis.yml index c85122ac96..1dc08fb3db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,9 +21,20 @@ env: # Main test suites matrix: - TEST_TARGET="validate" TW="travis_wait" + - TEST_TARGET="ci-color" + - TEST_TARGET="ci-compcert" + - TEST_TARGET="ci-coquelicot" + - TEST_TARGET="ci-cpdt" + - TEST_TARGET="ci-fiat-crypto" + - TEST_TARGET="ci-flocq" - TEST_TARGET="ci-hott" + - TEST_TARGET="ci-iris-coq" + - TEST_TARGET="ci-math-classes" - TEST_TARGET="ci-math-comp" - - TEST_TARGET="ci-compcert" + - TEST_TARGET="ci-sf" + # Not ready yet for 8.7 + # - TEST_TARGET="ci-metacoq" + # - TEST_TARGET="ci-tlc" matrix: diff --git a/Makefile.ci b/Makefile.ci index ada698e0a6..d10ff3ad96 100644 --- a/Makefile.ci +++ b/Makefile.ci @@ -1,13 +1,10 @@ -.PHONY: ci-all ci-hott ci-math-comp ci-compcert +CI_TARGETS=ci-all ci-hott ci-math-comp ci-compcert ci-sf ci-cpdt \ + ci-color ci-math-classes ci-tlc ci-fiat-crypto \ + ci-coquelicot ci-flocq ci-iris-coq ci-metacoq -ci-all: ci-hott ci-math-comp ci-compcert +.PHONY: $(CI_TARGETS) -# TODO Do generic rule -ci-hott: - ./tools/ci/ci-hott.sh +# Generic rule, we use make to easy travis integraton with mixed rules +$(CI_TARGETS): ci-%: + ./tools/ci/ci-$*.sh -ci-math-comp: - ./tools/ci/ci-math-comp.sh - -ci-compcert: - ./tools/ci/ci-compcert.sh diff --git a/tools/ci/ci-color.sh b/tools/ci/ci-color.sh new file mode 100755 index 0000000000..78ae7f02f9 --- /dev/null +++ b/tools/ci/ci-color.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +svn checkout https://scm.gforge.inria.fr/anonscm/svn/color/trunk/color color + +( cd color && make -j ${NJOBS} ) diff --git a/tools/ci/ci-common.sh b/tools/ci/ci-common.sh new file mode 100644 index 0000000000..2a6601e045 --- /dev/null +++ b/tools/ci/ci-common.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -xe + +export PATH=`pwd`/bin:$PATH +ls `pwd`/bin diff --git a/tools/ci/ci-compcert.sh b/tools/ci/ci-compcert.sh index 416e283254..d4023c9165 100755 --- a/tools/ci/ci-compcert.sh +++ b/tools/ci/ci-compcert.sh @@ -1,17 +1,10 @@ #!/bin/bash -# Proof of concept contrib build script. - -set -xe - -export PATH=`pwd`/bin:$PATH -ls `pwd`/bin +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh opam install -j ${NJOBS} -y menhir git clone --depth 3 -b coq-8.6 https://github.com/maximedenes/CompCert.git -pushd CompCert # Patch to avoid the upper version limit -sed -i.bak 's/8.6)/8.6|trunk)/' configure -./configure x86_32-linux && make -j ${NJOBS} -popd +( cd CompCert && sed -i.bak 's/8.6)/8.6|trunk)/' configure && ./configure x86_32-linux && make -j ${NJOBS} ) diff --git a/tools/ci/ci-coquelicot.sh b/tools/ci/ci-coquelicot.sh new file mode 100755 index 0000000000..4a23e51be6 --- /dev/null +++ b/tools/ci/ci-coquelicot.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +git clone --depth 3 https://github.com/math-comp/math-comp.git + +# coquelicot just needs mathcomp +( cd math-comp/mathcomp && \ + sed -i.bak '/ssrtest/d' Make && \ + sed -i.bak '/odd_order/d' Make && \ + sed -i.bak '/all\/all.v/d' Make && \ + sed -i.bak '/character/d' Make && \ + sed -i.bak '/real_closed/d' Make && \ + sed -i.bak '/solvable/d' Make && \ + sed -i.bak '/field/d' Make && \ + sed -i.bak '/fingroup/d' Make && \ + sed -i.bak '/algebra/d' Make && \ + make -j ${NJOBS} && make install ) + +# Setup ssr +# echo "Add ML Path \"`pwd`/math-comp/mathcomp/\"." > ${HOME}/.coqrc +# echo "Add LoadPath \"`pwd`/math-comp/mathcomp/\" as mathcomp." >> ${HOME}/.coqrc + +# Setup coquelicot +git clone --depth 3 https://scm.gforge.inria.fr/anonscm/git/coquelicot/coquelicot.git + +( cd coquelicot && ./autogen.sh && ./configure && ./remake -j${NJOBS} ) diff --git a/tools/ci/ci-cpdt.sh b/tools/ci/ci-cpdt.sh new file mode 100755 index 0000000000..18d7561804 --- /dev/null +++ b/tools/ci/ci-cpdt.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +wget http://adam.chlipala.net/cpdt/cpdt.tgz +tar xvfz cpdt.tgz + +( cd cpdt && make clean && make -j ${NJOBS} ) + diff --git a/tools/ci/ci-fiat-crypto.sh b/tools/ci/ci-fiat-crypto.sh new file mode 100755 index 0000000000..c594f83603 --- /dev/null +++ b/tools/ci/ci-fiat-crypto.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +git clone --depth 3 https://github.com/mit-plv/fiat-crypto.git + +( cd fiat-crypto && make -j ${NJOBS} ) + +# ( cd corn && make -j ${NJOBS} ) + diff --git a/tools/ci/ci-flocq.sh b/tools/ci/ci-flocq.sh new file mode 100755 index 0000000000..b9cf649a1a --- /dev/null +++ b/tools/ci/ci-flocq.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +git clone --depth 3 https://scm.gforge.inria.fr/anonscm/git/flocq/flocq.git + +( cd flocq && ./autogen.sh && ./configure && ./remake -j${NJOBS} ) diff --git a/tools/ci/ci-hott.sh b/tools/ci/ci-hott.sh index 35af76ceb7..8f82ba9f21 100755 --- a/tools/ci/ci-hott.sh +++ b/tools/ci/ci-hott.sh @@ -1,13 +1,8 @@ #!/bin/bash -# Proof of concept contrib build script. - -set -xe - -export PATH=`pwd`/bin:$PATH +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh git clone --depth 3 -b mz-8.6 https://github.com/ejgallego/HoTT.git -pushd HoTT -./autogen.sh && ./configure && make -j ${NJOBS} -popd +( cd HoTT && ./autogen.sh && ./configure && make -j ${NJOBS} ) diff --git a/tools/ci/ci-iris-coq.sh b/tools/ci/ci-iris-coq.sh new file mode 100755 index 0000000000..c1306e070d --- /dev/null +++ b/tools/ci/ci-iris-coq.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +# XXX: Refactor into install-ssreflect +git clone --depth 1 https://github.com/math-comp/math-comp.git + +# coquelicot just needs mathcomp +( cd math-comp/mathcomp && \ + sed -i.bak '/ssrtest/d' Make && \ + sed -i.bak '/odd_order/d' Make && \ + sed -i.bak '/all\/all.v/d' Make && \ + sed -i.bak '/character/d' Make && \ + sed -i.bak '/real_closed/d' Make && \ + sed -i.bak '/solvable/d' Make && \ + sed -i.bak '/field/d' Make && \ + sed -i.bak '/fingroup/d' Make && \ + sed -i.bak '/algebra/d' Make && \ + make -j ${NJOBS} && make install ) + +# Setup ssr = This doesn't work as coq_makefile will pass -q to coqc :S :S +# echo "Add ML Path \"`pwd`/math-comp/mathcomp/\"." > ${HOME}/.coqrc +# echo "Add LoadPath \"`pwd`/math-comp/mathcomp/\" as mathcomp." >> ${HOME}/.coqrc + +# Setup Iris +git clone --depth 1 https://gitlab.mpi-sws.org/FP/iris-coq.git + +( cd iris-coq && make -j ${NJOBS} ) diff --git a/tools/ci/ci-math-classes.sh b/tools/ci/ci-math-classes.sh new file mode 100755 index 0000000000..9127c18951 --- /dev/null +++ b/tools/ci/ci-math-classes.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +git clone --depth 1 -b v8.6 https://github.com/math-classes/math-classes.git +( cd math-classes && make -j ${NJOBS} && make install ) + +git clone --depth 1 -b v8.6 https://github.com/c-corn/corn.git +( cd corn && make -j ${NJOBS} ) + diff --git a/tools/ci/ci-math-comp.sh b/tools/ci/ci-math-comp.sh index 39a92a2d89..b833792419 100755 --- a/tools/ci/ci-math-comp.sh +++ b/tools/ci/ci-math-comp.sh @@ -1,10 +1,8 @@ #!/bin/bash -# Proof of concept contrib build script. - -set -xe - -export PATH=`pwd`/bin:$PATH +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh git clone --depth 3 https://github.com/math-comp/math-comp.git diff --git a/tools/ci/ci-metacoq.sh b/tools/ci/ci-metacoq.sh new file mode 100755 index 0000000000..9a9bd3648b --- /dev/null +++ b/tools/ci/ci-metacoq.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +# MetaCoq + UniCoq + +git clone --depth 1 https://github.com/unicoq/unicoq.git + +( cd unicoq && coq_makefile -f Make -o Makefile && make -j ${NJOBS} && make install ) + +git clone --depth 1 https://github.com/MetaCoq/MetaCoq.git + +( cd MetaCoq && coq_makefile -f _CoqProject -o Makefile && make -j ${NJOBS} ) + diff --git a/tools/ci/ci-sf.sh b/tools/ci/ci-sf.sh new file mode 100755 index 0000000000..5e41211f1a --- /dev/null +++ b/tools/ci/ci-sf.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +wget https://www.cis.upenn.edu/~bcpierce/sf/current/sf.tgz +tar xvfz sf.tgz + +( cd sf && sed -i.bak 's/(K,N)/((K,N))/' LibTactics.v && make clean && make -j ${NJOBS} ) + + diff --git a/tools/ci/ci-tlc.sh b/tools/ci/ci-tlc.sh new file mode 100755 index 0000000000..2161a11461 --- /dev/null +++ b/tools/ci/ci-tlc.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +git clone https://gforge.inria.fr/git/tlc/tlc.git + +( cd tlc && make -j ${NJOBS} ) -- cgit v1.2.3 From 27be8637d1f073c245c32aa7c336fb70e1b82c20 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Tue, 7 Feb 2017 08:17:52 +0100 Subject: [travis] Move ci files from `tools` to `dev`. --- Makefile.ci | 2 +- README.ci | 4 ++-- dev/ci/ci-color.sh | 8 ++++++++ dev/ci/ci-common.sh | 6 ++++++ dev/ci/ci-compcert.sh | 10 ++++++++++ dev/ci/ci-coquelicot.sh | 29 +++++++++++++++++++++++++++++ dev/ci/ci-cpdt.sh | 10 ++++++++++ dev/ci/ci-fiat-crypto.sh | 12 ++++++++++++ dev/ci/ci-flocq.sh | 9 +++++++++ dev/ci/ci-hott.sh | 8 ++++++++ dev/ci/ci-iris-coq.sh | 30 ++++++++++++++++++++++++++++++ dev/ci/ci-math-classes.sh | 12 ++++++++++++ dev/ci/ci-math-comp.sh | 13 +++++++++++++ dev/ci/ci-metacoq.sh | 16 ++++++++++++++++ dev/ci/ci-sf.sh | 11 +++++++++++ dev/ci/ci-tlc.sh | 8 ++++++++ tools/ci/ci-color.sh | 8 -------- tools/ci/ci-common.sh | 6 ------ tools/ci/ci-compcert.sh | 10 ---------- tools/ci/ci-coquelicot.sh | 29 ----------------------------- tools/ci/ci-cpdt.sh | 10 ---------- tools/ci/ci-fiat-crypto.sh | 12 ------------ tools/ci/ci-flocq.sh | 9 --------- tools/ci/ci-hott.sh | 8 -------- tools/ci/ci-iris-coq.sh | 30 ------------------------------ tools/ci/ci-math-classes.sh | 12 ------------ tools/ci/ci-math-comp.sh | 13 ------------- tools/ci/ci-metacoq.sh | 16 ---------------- tools/ci/ci-sf.sh | 11 ----------- tools/ci/ci-tlc.sh | 8 -------- 30 files changed, 185 insertions(+), 185 deletions(-) create mode 100755 dev/ci/ci-color.sh create mode 100644 dev/ci/ci-common.sh create mode 100755 dev/ci/ci-compcert.sh create mode 100755 dev/ci/ci-coquelicot.sh create mode 100755 dev/ci/ci-cpdt.sh create mode 100755 dev/ci/ci-fiat-crypto.sh create mode 100755 dev/ci/ci-flocq.sh create mode 100755 dev/ci/ci-hott.sh create mode 100755 dev/ci/ci-iris-coq.sh create mode 100755 dev/ci/ci-math-classes.sh create mode 100755 dev/ci/ci-math-comp.sh create mode 100755 dev/ci/ci-metacoq.sh create mode 100755 dev/ci/ci-sf.sh create mode 100755 dev/ci/ci-tlc.sh delete mode 100755 tools/ci/ci-color.sh delete mode 100644 tools/ci/ci-common.sh delete mode 100755 tools/ci/ci-compcert.sh delete mode 100755 tools/ci/ci-coquelicot.sh delete mode 100755 tools/ci/ci-cpdt.sh delete mode 100755 tools/ci/ci-fiat-crypto.sh delete mode 100755 tools/ci/ci-flocq.sh delete mode 100755 tools/ci/ci-hott.sh delete mode 100755 tools/ci/ci-iris-coq.sh delete mode 100755 tools/ci/ci-math-classes.sh delete mode 100755 tools/ci/ci-math-comp.sh delete mode 100755 tools/ci/ci-metacoq.sh delete mode 100755 tools/ci/ci-sf.sh delete mode 100755 tools/ci/ci-tlc.sh diff --git a/Makefile.ci b/Makefile.ci index d10ff3ad96..d69028ce13 100644 --- a/Makefile.ci +++ b/Makefile.ci @@ -6,5 +6,5 @@ CI_TARGETS=ci-all ci-hott ci-math-comp ci-compcert ci-sf ci-cpdt \ # Generic rule, we use make to easy travis integraton with mixed rules $(CI_TARGETS): ci-%: - ./tools/ci/ci-$*.sh + ./dev/ci/ci-$*.sh diff --git a/README.ci b/README.ci index ed2ba9126e..dcf93cf00e 100644 --- a/README.ci +++ b/README.ci @@ -40,7 +40,7 @@ Maintaining your contribution manually [current method] ====================================== To add your contribution to the Coq Travis CI set, add a script for -building your library to `tools/ci/`, update `.travis.yml` and +building your library to `dev/ci/`, update `.travis.yml` and `Makefile.ci`. Then, submit a PR. Maintaining your contribution as an OPAM package [work in progress] [to be implemented] @@ -67,7 +67,7 @@ repositories of some of the tests so they can provide fixed developments. The general idea is that the PR author will drop a file -`tools/ci/overlays/$branch.overlay` where branch name is taken from +`dev/ci/overlays/$branch.overlay` where branch name is taken from `${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}` that is to say, the name of the original branch for the PR. diff --git a/dev/ci/ci-color.sh b/dev/ci/ci-color.sh new file mode 100755 index 0000000000..78ae7f02f9 --- /dev/null +++ b/dev/ci/ci-color.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +svn checkout https://scm.gforge.inria.fr/anonscm/svn/color/trunk/color color + +( cd color && make -j ${NJOBS} ) diff --git a/dev/ci/ci-common.sh b/dev/ci/ci-common.sh new file mode 100644 index 0000000000..2a6601e045 --- /dev/null +++ b/dev/ci/ci-common.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -xe + +export PATH=`pwd`/bin:$PATH +ls `pwd`/bin diff --git a/dev/ci/ci-compcert.sh b/dev/ci/ci-compcert.sh new file mode 100755 index 0000000000..d4023c9165 --- /dev/null +++ b/dev/ci/ci-compcert.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +opam install -j ${NJOBS} -y menhir +git clone --depth 3 -b coq-8.6 https://github.com/maximedenes/CompCert.git + +# Patch to avoid the upper version limit +( cd CompCert && sed -i.bak 's/8.6)/8.6|trunk)/' configure && ./configure x86_32-linux && make -j ${NJOBS} ) diff --git a/dev/ci/ci-coquelicot.sh b/dev/ci/ci-coquelicot.sh new file mode 100755 index 0000000000..4a23e51be6 --- /dev/null +++ b/dev/ci/ci-coquelicot.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +git clone --depth 3 https://github.com/math-comp/math-comp.git + +# coquelicot just needs mathcomp +( cd math-comp/mathcomp && \ + sed -i.bak '/ssrtest/d' Make && \ + sed -i.bak '/odd_order/d' Make && \ + sed -i.bak '/all\/all.v/d' Make && \ + sed -i.bak '/character/d' Make && \ + sed -i.bak '/real_closed/d' Make && \ + sed -i.bak '/solvable/d' Make && \ + sed -i.bak '/field/d' Make && \ + sed -i.bak '/fingroup/d' Make && \ + sed -i.bak '/algebra/d' Make && \ + make -j ${NJOBS} && make install ) + +# Setup ssr +# echo "Add ML Path \"`pwd`/math-comp/mathcomp/\"." > ${HOME}/.coqrc +# echo "Add LoadPath \"`pwd`/math-comp/mathcomp/\" as mathcomp." >> ${HOME}/.coqrc + +# Setup coquelicot +git clone --depth 3 https://scm.gforge.inria.fr/anonscm/git/coquelicot/coquelicot.git + +( cd coquelicot && ./autogen.sh && ./configure && ./remake -j${NJOBS} ) diff --git a/dev/ci/ci-cpdt.sh b/dev/ci/ci-cpdt.sh new file mode 100755 index 0000000000..18d7561804 --- /dev/null +++ b/dev/ci/ci-cpdt.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +wget http://adam.chlipala.net/cpdt/cpdt.tgz +tar xvfz cpdt.tgz + +( cd cpdt && make clean && make -j ${NJOBS} ) + diff --git a/dev/ci/ci-fiat-crypto.sh b/dev/ci/ci-fiat-crypto.sh new file mode 100755 index 0000000000..c594f83603 --- /dev/null +++ b/dev/ci/ci-fiat-crypto.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +git clone --depth 3 https://github.com/mit-plv/fiat-crypto.git + +( cd fiat-crypto && make -j ${NJOBS} ) + +# ( cd corn && make -j ${NJOBS} ) + diff --git a/dev/ci/ci-flocq.sh b/dev/ci/ci-flocq.sh new file mode 100755 index 0000000000..b9cf649a1a --- /dev/null +++ b/dev/ci/ci-flocq.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +git clone --depth 3 https://scm.gforge.inria.fr/anonscm/git/flocq/flocq.git + +( cd flocq && ./autogen.sh && ./configure && ./remake -j${NJOBS} ) diff --git a/dev/ci/ci-hott.sh b/dev/ci/ci-hott.sh new file mode 100755 index 0000000000..8f82ba9f21 --- /dev/null +++ b/dev/ci/ci-hott.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +git clone --depth 3 -b mz-8.6 https://github.com/ejgallego/HoTT.git + +( cd HoTT && ./autogen.sh && ./configure && make -j ${NJOBS} ) diff --git a/dev/ci/ci-iris-coq.sh b/dev/ci/ci-iris-coq.sh new file mode 100755 index 0000000000..c1306e070d --- /dev/null +++ b/dev/ci/ci-iris-coq.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +# XXX: Refactor into install-ssreflect +git clone --depth 1 https://github.com/math-comp/math-comp.git + +# coquelicot just needs mathcomp +( cd math-comp/mathcomp && \ + sed -i.bak '/ssrtest/d' Make && \ + sed -i.bak '/odd_order/d' Make && \ + sed -i.bak '/all\/all.v/d' Make && \ + sed -i.bak '/character/d' Make && \ + sed -i.bak '/real_closed/d' Make && \ + sed -i.bak '/solvable/d' Make && \ + sed -i.bak '/field/d' Make && \ + sed -i.bak '/fingroup/d' Make && \ + sed -i.bak '/algebra/d' Make && \ + make -j ${NJOBS} && make install ) + +# Setup ssr = This doesn't work as coq_makefile will pass -q to coqc :S :S +# echo "Add ML Path \"`pwd`/math-comp/mathcomp/\"." > ${HOME}/.coqrc +# echo "Add LoadPath \"`pwd`/math-comp/mathcomp/\" as mathcomp." >> ${HOME}/.coqrc + +# Setup Iris +git clone --depth 1 https://gitlab.mpi-sws.org/FP/iris-coq.git + +( cd iris-coq && make -j ${NJOBS} ) diff --git a/dev/ci/ci-math-classes.sh b/dev/ci/ci-math-classes.sh new file mode 100755 index 0000000000..9127c18951 --- /dev/null +++ b/dev/ci/ci-math-classes.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +git clone --depth 1 -b v8.6 https://github.com/math-classes/math-classes.git +( cd math-classes && make -j ${NJOBS} && make install ) + +git clone --depth 1 -b v8.6 https://github.com/c-corn/corn.git +( cd corn && make -j ${NJOBS} ) + diff --git a/dev/ci/ci-math-comp.sh b/dev/ci/ci-math-comp.sh new file mode 100755 index 0000000000..b833792419 --- /dev/null +++ b/dev/ci/ci-math-comp.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +git clone --depth 3 https://github.com/math-comp/math-comp.git + +# odd_order takes too much time for travis. +( cd math-comp/mathcomp && \ + sed -i.bak '/PFsection/d' Make && \ + sed -i.bak '/stripped_odd_order_theorem/d' Make && \ + make Makefile.coq && make -f Makefile.coq -j ${NJOBS} all ) diff --git a/dev/ci/ci-metacoq.sh b/dev/ci/ci-metacoq.sh new file mode 100755 index 0000000000..9a9bd3648b --- /dev/null +++ b/dev/ci/ci-metacoq.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# $0 is not the safest way, but... +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +# MetaCoq + UniCoq + +git clone --depth 1 https://github.com/unicoq/unicoq.git + +( cd unicoq && coq_makefile -f Make -o Makefile && make -j ${NJOBS} && make install ) + +git clone --depth 1 https://github.com/MetaCoq/MetaCoq.git + +( cd MetaCoq && coq_makefile -f _CoqProject -o Makefile && make -j ${NJOBS} ) + diff --git a/dev/ci/ci-sf.sh b/dev/ci/ci-sf.sh new file mode 100755 index 0000000000..5e41211f1a --- /dev/null +++ b/dev/ci/ci-sf.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +wget https://www.cis.upenn.edu/~bcpierce/sf/current/sf.tgz +tar xvfz sf.tgz + +( cd sf && sed -i.bak 's/(K,N)/((K,N))/' LibTactics.v && make clean && make -j ${NJOBS} ) + + diff --git a/dev/ci/ci-tlc.sh b/dev/ci/ci-tlc.sh new file mode 100755 index 0000000000..2161a11461 --- /dev/null +++ b/dev/ci/ci-tlc.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +git clone https://gforge.inria.fr/git/tlc/tlc.git + +( cd tlc && make -j ${NJOBS} ) diff --git a/tools/ci/ci-color.sh b/tools/ci/ci-color.sh deleted file mode 100755 index 78ae7f02f9..0000000000 --- a/tools/ci/ci-color.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -ci_dir="$(dirname "$0")" -source ${ci_dir}/ci-common.sh - -svn checkout https://scm.gforge.inria.fr/anonscm/svn/color/trunk/color color - -( cd color && make -j ${NJOBS} ) diff --git a/tools/ci/ci-common.sh b/tools/ci/ci-common.sh deleted file mode 100644 index 2a6601e045..0000000000 --- a/tools/ci/ci-common.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -xe - -export PATH=`pwd`/bin:$PATH -ls `pwd`/bin diff --git a/tools/ci/ci-compcert.sh b/tools/ci/ci-compcert.sh deleted file mode 100755 index d4023c9165..0000000000 --- a/tools/ci/ci-compcert.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -ci_dir="$(dirname "$0")" -source ${ci_dir}/ci-common.sh - -opam install -j ${NJOBS} -y menhir -git clone --depth 3 -b coq-8.6 https://github.com/maximedenes/CompCert.git - -# Patch to avoid the upper version limit -( cd CompCert && sed -i.bak 's/8.6)/8.6|trunk)/' configure && ./configure x86_32-linux && make -j ${NJOBS} ) diff --git a/tools/ci/ci-coquelicot.sh b/tools/ci/ci-coquelicot.sh deleted file mode 100755 index 4a23e51be6..0000000000 --- a/tools/ci/ci-coquelicot.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# $0 is not the safest way, but... -ci_dir="$(dirname "$0")" -source ${ci_dir}/ci-common.sh - -git clone --depth 3 https://github.com/math-comp/math-comp.git - -# coquelicot just needs mathcomp -( cd math-comp/mathcomp && \ - sed -i.bak '/ssrtest/d' Make && \ - sed -i.bak '/odd_order/d' Make && \ - sed -i.bak '/all\/all.v/d' Make && \ - sed -i.bak '/character/d' Make && \ - sed -i.bak '/real_closed/d' Make && \ - sed -i.bak '/solvable/d' Make && \ - sed -i.bak '/field/d' Make && \ - sed -i.bak '/fingroup/d' Make && \ - sed -i.bak '/algebra/d' Make && \ - make -j ${NJOBS} && make install ) - -# Setup ssr -# echo "Add ML Path \"`pwd`/math-comp/mathcomp/\"." > ${HOME}/.coqrc -# echo "Add LoadPath \"`pwd`/math-comp/mathcomp/\" as mathcomp." >> ${HOME}/.coqrc - -# Setup coquelicot -git clone --depth 3 https://scm.gforge.inria.fr/anonscm/git/coquelicot/coquelicot.git - -( cd coquelicot && ./autogen.sh && ./configure && ./remake -j${NJOBS} ) diff --git a/tools/ci/ci-cpdt.sh b/tools/ci/ci-cpdt.sh deleted file mode 100755 index 18d7561804..0000000000 --- a/tools/ci/ci-cpdt.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -ci_dir="$(dirname "$0")" -source ${ci_dir}/ci-common.sh - -wget http://adam.chlipala.net/cpdt/cpdt.tgz -tar xvfz cpdt.tgz - -( cd cpdt && make clean && make -j ${NJOBS} ) - diff --git a/tools/ci/ci-fiat-crypto.sh b/tools/ci/ci-fiat-crypto.sh deleted file mode 100755 index c594f83603..0000000000 --- a/tools/ci/ci-fiat-crypto.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# $0 is not the safest way, but... -ci_dir="$(dirname "$0")" -source ${ci_dir}/ci-common.sh - -git clone --depth 3 https://github.com/mit-plv/fiat-crypto.git - -( cd fiat-crypto && make -j ${NJOBS} ) - -# ( cd corn && make -j ${NJOBS} ) - diff --git a/tools/ci/ci-flocq.sh b/tools/ci/ci-flocq.sh deleted file mode 100755 index b9cf649a1a..0000000000 --- a/tools/ci/ci-flocq.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# $0 is not the safest way, but... -ci_dir="$(dirname "$0")" -source ${ci_dir}/ci-common.sh - -git clone --depth 3 https://scm.gforge.inria.fr/anonscm/git/flocq/flocq.git - -( cd flocq && ./autogen.sh && ./configure && ./remake -j${NJOBS} ) diff --git a/tools/ci/ci-hott.sh b/tools/ci/ci-hott.sh deleted file mode 100755 index 8f82ba9f21..0000000000 --- a/tools/ci/ci-hott.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -ci_dir="$(dirname "$0")" -source ${ci_dir}/ci-common.sh - -git clone --depth 3 -b mz-8.6 https://github.com/ejgallego/HoTT.git - -( cd HoTT && ./autogen.sh && ./configure && make -j ${NJOBS} ) diff --git a/tools/ci/ci-iris-coq.sh b/tools/ci/ci-iris-coq.sh deleted file mode 100755 index c1306e070d..0000000000 --- a/tools/ci/ci-iris-coq.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -# $0 is not the safest way, but... -ci_dir="$(dirname "$0")" -source ${ci_dir}/ci-common.sh - -# XXX: Refactor into install-ssreflect -git clone --depth 1 https://github.com/math-comp/math-comp.git - -# coquelicot just needs mathcomp -( cd math-comp/mathcomp && \ - sed -i.bak '/ssrtest/d' Make && \ - sed -i.bak '/odd_order/d' Make && \ - sed -i.bak '/all\/all.v/d' Make && \ - sed -i.bak '/character/d' Make && \ - sed -i.bak '/real_closed/d' Make && \ - sed -i.bak '/solvable/d' Make && \ - sed -i.bak '/field/d' Make && \ - sed -i.bak '/fingroup/d' Make && \ - sed -i.bak '/algebra/d' Make && \ - make -j ${NJOBS} && make install ) - -# Setup ssr = This doesn't work as coq_makefile will pass -q to coqc :S :S -# echo "Add ML Path \"`pwd`/math-comp/mathcomp/\"." > ${HOME}/.coqrc -# echo "Add LoadPath \"`pwd`/math-comp/mathcomp/\" as mathcomp." >> ${HOME}/.coqrc - -# Setup Iris -git clone --depth 1 https://gitlab.mpi-sws.org/FP/iris-coq.git - -( cd iris-coq && make -j ${NJOBS} ) diff --git a/tools/ci/ci-math-classes.sh b/tools/ci/ci-math-classes.sh deleted file mode 100755 index 9127c18951..0000000000 --- a/tools/ci/ci-math-classes.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# $0 is not the safest way, but... -ci_dir="$(dirname "$0")" -source ${ci_dir}/ci-common.sh - -git clone --depth 1 -b v8.6 https://github.com/math-classes/math-classes.git -( cd math-classes && make -j ${NJOBS} && make install ) - -git clone --depth 1 -b v8.6 https://github.com/c-corn/corn.git -( cd corn && make -j ${NJOBS} ) - diff --git a/tools/ci/ci-math-comp.sh b/tools/ci/ci-math-comp.sh deleted file mode 100755 index b833792419..0000000000 --- a/tools/ci/ci-math-comp.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# $0 is not the safest way, but... -ci_dir="$(dirname "$0")" -source ${ci_dir}/ci-common.sh - -git clone --depth 3 https://github.com/math-comp/math-comp.git - -# odd_order takes too much time for travis. -( cd math-comp/mathcomp && \ - sed -i.bak '/PFsection/d' Make && \ - sed -i.bak '/stripped_odd_order_theorem/d' Make && \ - make Makefile.coq && make -f Makefile.coq -j ${NJOBS} all ) diff --git a/tools/ci/ci-metacoq.sh b/tools/ci/ci-metacoq.sh deleted file mode 100755 index 9a9bd3648b..0000000000 --- a/tools/ci/ci-metacoq.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# $0 is not the safest way, but... -ci_dir="$(dirname "$0")" -source ${ci_dir}/ci-common.sh - -# MetaCoq + UniCoq - -git clone --depth 1 https://github.com/unicoq/unicoq.git - -( cd unicoq && coq_makefile -f Make -o Makefile && make -j ${NJOBS} && make install ) - -git clone --depth 1 https://github.com/MetaCoq/MetaCoq.git - -( cd MetaCoq && coq_makefile -f _CoqProject -o Makefile && make -j ${NJOBS} ) - diff --git a/tools/ci/ci-sf.sh b/tools/ci/ci-sf.sh deleted file mode 100755 index 5e41211f1a..0000000000 --- a/tools/ci/ci-sf.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -ci_dir="$(dirname "$0")" -source ${ci_dir}/ci-common.sh - -wget https://www.cis.upenn.edu/~bcpierce/sf/current/sf.tgz -tar xvfz sf.tgz - -( cd sf && sed -i.bak 's/(K,N)/((K,N))/' LibTactics.v && make clean && make -j ${NJOBS} ) - - diff --git a/tools/ci/ci-tlc.sh b/tools/ci/ci-tlc.sh deleted file mode 100755 index 2161a11461..0000000000 --- a/tools/ci/ci-tlc.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -ci_dir="$(dirname "$0")" -source ${ci_dir}/ci-common.sh - -git clone https://gforge.inria.fr/git/tlc/tlc.git - -( cd tlc && make -j ${NJOBS} ) -- cgit v1.2.3 From f8c1284a3f5454964aa3002575159b2c9c3df34c Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Tue, 7 Feb 2017 11:04:27 +0100 Subject: [travis] Enable 32bit test-suite + validate. --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1dc08fb3db..7529870cdd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ addons: packages: - opam - aspcud + - gcc-multilib env: global: - NJOBS=2 @@ -20,7 +21,9 @@ env: - COMPILER="system" # Main test suites matrix: - - TEST_TARGET="validate" TW="travis_wait" + - TEST_TARGET="test-suite" COMPILER="4.02.3+32bit" + - TEST_TARGET="validate" TW="travis_wait" + - TEST_TARGET="validate" COMPILER="4.02.3+32bit" TW="travis_wait" - TEST_TARGET="ci-color" - TEST_TARGET="ci-compcert" - TEST_TARGET="ci-coquelicot" -- cgit v1.2.3 From 2a59cdce8c142d451988709a3939b884c63993c9 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Tue, 7 Feb 2017 14:04:43 +0100 Subject: [travis] [External CI] GeoCoq --- .travis.yml | 1 + Makefile.ci | 2 +- dev/ci/ci-geocoq.sh | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 dev/ci/ci-geocoq.sh diff --git a/.travis.yml b/.travis.yml index 7529870cdd..188e446007 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,7 @@ env: - TEST_TARGET="ci-compcert" - TEST_TARGET="ci-coquelicot" - TEST_TARGET="ci-cpdt" + - TEST_TARGET="ci-geocoq" - TEST_TARGET="ci-fiat-crypto" - TEST_TARGET="ci-flocq" - TEST_TARGET="ci-hott" diff --git a/Makefile.ci b/Makefile.ci index d69028ce13..040144e6e8 100644 --- a/Makefile.ci +++ b/Makefile.ci @@ -1,6 +1,6 @@ CI_TARGETS=ci-all ci-hott ci-math-comp ci-compcert ci-sf ci-cpdt \ ci-color ci-math-classes ci-tlc ci-fiat-crypto \ - ci-coquelicot ci-flocq ci-iris-coq ci-metacoq + ci-coquelicot ci-flocq ci-iris-coq ci-metacoq ci-geocoq .PHONY: $(CI_TARGETS) diff --git a/dev/ci/ci-geocoq.sh b/dev/ci/ci-geocoq.sh new file mode 100755 index 0000000000..7b5811dc4a --- /dev/null +++ b/dev/ci/ci-geocoq.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +ci_dir="$(dirname "$0")" +source ${ci_dir}/ci-common.sh + +# XXX: replace by generic template +GeoCoq_CI_BRANCH=master +GeoCoq_CI_GITURL=https://github.com/GeoCoq/GeoCoq.git + +git clone --depth 1 -b ${GeoCoq_CI_BRANCH} ${GeoCoq_CI_GITURL} + +( cd GeoCoq && ./configure.sh && make -j ${NJOBS} ) -- cgit v1.2.3 From 0fd7b204e9b74e12788a391e1e4fc2d61c4763fd Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Mon, 23 Jan 2017 18:17:09 +0100 Subject: Type cleanup in `Metasyntax` Types were a bit difficult to read as they were mostly based on anonymous products, this commit replaces them by named records and refactors out some imperative code. There is still quite a bit of room for improvement, but at least the records provide a basis for more fine-grained understanding and documentation. --- toplevel/metasyntax.ml | 249 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 165 insertions(+), 84 deletions(-) diff --git a/toplevel/metasyntax.ml b/toplevel/metasyntax.ml index f28ef3f650..0aaf6afd7e 100644 --- a/toplevel/metasyntax.ml +++ b/toplevel/metasyntax.ml @@ -20,10 +20,8 @@ open Extend open Libobject open Constrintern open Vernacexpr -open Pcoq open Libnames open Tok -open Egramcoq open Notation open Nameops @@ -46,7 +44,7 @@ let add_token_obj s = Lib.add_anonymous_leaf (inToken s) let entry_buf = Buffer.create 64 -type any_entry = AnyEntry : 'a Gram.entry -> any_entry +type any_entry = AnyEntry : 'a Pcoq.Gram.entry -> any_entry let grammars : any_entry list String.Map.t ref = ref String.Map.empty @@ -56,7 +54,7 @@ let register_grammar name grams = let pr_entry e = let () = Buffer.clear entry_buf in let ft = Format.formatter_of_buffer entry_buf in - let () = Gram.entry_print ft e in + let () = Pcoq.Gram.entry_print ft e in str (Buffer.contents entry_buf) let pr_registered_grammar name = @@ -65,7 +63,7 @@ let pr_registered_grammar name = | None -> error "Unknown or unprintable grammar entry." | Some entries -> let pr_one (AnyEntry e) = - str "Entry " ++ str (Gram.Entry.name e) ++ str " is" ++ fnl () ++ + str "Entry " ++ str (Pcoq.Gram.Entry.name e) ++ str " is" ++ fnl () ++ pr_entry e in prlist pr_one entries @@ -738,52 +736,74 @@ let inSyntaxExtension : syntax_extension_obj -> obj = (* Interpreting user-provided modifiers *) -let interp_modifiers modl = - let onlyparsing = ref false in - let onlyprinting = ref false in - let compat = ref None in - let rec interp assoc level etyps format extra = function - | [] -> - (assoc,level,etyps,!onlyparsing,!onlyprinting,!compat,format,extra) +(* XXX: We could move this to the parser itself *) +module NotationMods = struct + +type notation_modifier = { + assoc : gram_assoc option; + level : int option; + etyps : (Id.t * simple_constr_prod_entry_key) list; + + (* common to syn_data below *) + only_parsing : bool; + only_printing : bool; + compat : compat_version option; + format : string Loc.located option; + extra : (string * string) list; +} + +let default = { + assoc = None; + level = None; + etyps = []; + only_parsing = false; + only_printing = false; + compat = None; + format = None; + extra = []; +} + +end + +let interp_modifiers modl = let open NotationMods in + let rec interp acc = function + | [] -> acc | SetEntryType (s,typ) :: l -> let id = Id.of_string s in - if Id.List.mem_assoc id etyps then + if Id.List.mem_assoc id acc.etyps then user_err ~hdr:"Metasyntax.interp_modifiers" (str s ++ str " is already assigned to an entry or constr level."); - interp assoc level ((id,typ)::etyps) format extra l + interp { acc with etyps = (id,typ) :: acc.etyps; } l | SetItemLevel ([],n) :: l -> - interp assoc level etyps format extra l + interp acc l | SetItemLevel (s::idl,n) :: l -> let id = Id.of_string s in - if Id.List.mem_assoc id etyps then + if Id.List.mem_assoc id acc.etyps then user_err ~hdr:"Metasyntax.interp_modifiers" (str s ++ str " is already assigned to an entry or constr level."); let typ = ETConstr (n,()) in - interp assoc level ((id,typ)::etyps) format extra (SetItemLevel (idl,n)::l) + interp { acc with etyps = (id,typ)::acc.etyps; } (SetItemLevel (idl,n)::l) | SetLevel n :: l -> - if not (Option.is_empty level) then error "A level is given more than once."; - interp assoc (Some n) etyps format extra l + + interp { acc with level = Some n; } l | SetAssoc a :: l -> - if not (Option.is_empty assoc) then error"An associativity is given more than once."; - interp (Some a) level etyps format extra l - | SetOnlyParsing :: l -> - onlyparsing := true; - interp assoc level etyps format extra l + if not (Option.is_empty acc.assoc) then error "An associativity is given more than once."; + interp { acc with assoc = Some a; } l + | SetOnlyParsing :: l -> + interp { acc with only_parsing = true; } l | SetOnlyPrinting :: l -> - onlyprinting := true; - interp assoc level etyps format extra l + interp { acc with only_printing = true; } l | SetCompatVersion v :: l -> - compat := Some v; - interp assoc level etyps format extra l + interp { acc with compat = Some v; } l | SetFormat ("text",s) :: l -> - if not (Option.is_empty format) then error "A format is given more than once."; - interp assoc level etyps (Some s) extra l + if not (Option.is_empty acc.format) then error "A format is given more than once."; + interp { acc with format = Some s; } l | SetFormat (k,(_,s)) :: l -> - interp assoc level etyps format ((k,s) :: extra) l - in interp None None [] None [] modl + interp { acc with extra = (k,s)::acc.extra; } l + in interp default modl let check_infix_modifiers modifiers = - let (_, _, t, _, _, _, _, _) = interp_modifiers modifiers in + let t = (interp_modifiers modifiers).NotationMods.etyps in if not (List.is_empty t) then error "Explicit entry level or type unexpected in infix notation." @@ -990,18 +1010,59 @@ let remove_curly_brackets l = | x :: l -> x :: aux false l in aux true l +module SynData = struct + + (* XXX: Document *) + type syn_data = { + + (* Notation name and location *) + info : notation * notation_location; + + (* Fields coming from the vernac-level modifiers *) + only_parsing : bool; + only_printing : bool; + compat : compat_version option; + format : string Loc.located option; + extra : (string * string) list; + + (* XXX: Callback to printing, must remove *) + msgs : ((std_ppcmds -> unit) * std_ppcmds) list; + + (* Fields for internalization *) + recvars : (Id.t * Id.t) list; + mainvars : Id.List.elt list; + intern_typs : notation_var_internalization_type list; + + (* Notation data for parsing *) + + level : int; + syntax_data : (Id.t * (production_level, production_position) constr_entry_key_gen) list * (* typs *) + symbol list; (* symbols *) + not_data : notation * (* notation *) + (int * parenRelation) list * (* precedence *) + bool; (* needs_squash *) + } + +end + let compute_syntax_data df modifiers = - let (assoc,n,etyps,onlyparse,onlyprint,compat,fmt,extra) = interp_modifiers modifiers in - let assoc = match assoc with None -> (* default *) Some NonA | a -> a in + let open SynData in + let open NotationMods in + let mods = interp_modifiers modifiers in + let assoc = Option.append mods.assoc (Some NonA) in let toks = split_notation_string df in - let (recvars,mainvars,symbols) = analyze_notation_tokens toks in - let _ = check_useless_entry_types recvars mainvars etyps in + let recvars,mainvars,symbols = analyze_notation_tokens toks in + let _ = check_useless_entry_types recvars mainvars mods.etyps in + + (* Notations for interp and grammar *) let ntn_for_interp = make_notation_key symbols in let symbols' = remove_curly_brackets symbols in - let need_squash = not (List.equal Notation.symbol_eq symbols symbols') in let ntn_for_grammar = make_notation_key symbols' in check_rule_productivity symbols'; - let msgs,n = find_precedence n etyps symbols' in + + (* Misc *) + let need_squash = not (List.equal Notation.symbol_eq symbols symbols') in + let msgs,n = find_precedence mods.level mods.etyps symbols' in let innerlevel = NumLevel 200 in let typs = find_symbols @@ -1010,25 +1071,44 @@ let compute_syntax_data df modifiers = (NumLevel n,BorderProd(Right,assoc)) symbols' in (* To globalize... *) - let etyps = join_auxiliary_recursive_types recvars etyps in + let etyps = join_auxiliary_recursive_types recvars mods.etyps in let sy_typs = List.map (set_entry_type etyps) typs in - let prec = (n,List.map (assoc_of_type n) sy_typs) in + let prec = List.map (assoc_of_type n) sy_typs in let i_typs = set_internalization_type sy_typs in - let sy_data = (n,sy_typs,symbols',fmt) in - let sy_fulldata = (i_typs,ntn_for_grammar,prec,need_squash,sy_data) in + let sy_data = (sy_typs,symbols') in + let sy_fulldata = (ntn_for_grammar,prec,need_squash) in let df' = ((Lib.library_dp(),Lib.current_dirpath true),df) in - let i_data = (onlyparse,onlyprint,compat,recvars,mainvars,(ntn_for_interp,df')) in + let i_data = ntn_for_interp, df' in + (* Return relevant data for interpretation and for parsing/printing *) - (msgs,i_data,i_typs,sy_fulldata,extra) + { info = i_data; + + only_parsing = mods.only_parsing; + only_printing = mods.only_printing; + compat = mods.compat; + format = mods.format; + extra = mods.extra; + + msgs; + + recvars; + mainvars; + intern_typs = i_typs; + + level = n; + syntax_data = sy_data; + not_data = sy_fulldata; + } let compute_pure_syntax_data df mods = - let (msgs,(onlyparse,onlyprint,_,_,_,_),_,sy_data,extra) = compute_syntax_data df mods in + let open SynData in + let sd = compute_syntax_data df mods in let msgs = - if onlyparse then + if sd.only_parsing then (Feedback.msg_warning ?loc:None, - strbrk "The only parsing modifier has no effect in Reserved Notation.")::msgs - else msgs in - msgs, sy_data, extra, onlyprint + strbrk "The only parsing modifier has no effect in Reserved Notation.")::sd.msgs + else sd.msgs in + { sd with msgs } (**********************************************************************) (* Registration of notations interpretation *) @@ -1091,7 +1171,7 @@ let with_lib_stk_protection f x = let with_syntax_protection f x = with_lib_stk_protection - (with_grammar_rule_protection + (Pcoq.with_grammar_rule_protection (with_notation_protection f)) x (**********************************************************************) @@ -1145,10 +1225,10 @@ let recover_notation_syntax rawntn = (**********************************************************************) (* Main entry point for building parsing and printing rules *) -let make_pa_rule i_typs (n,typs,symbols,_) ntn onlyprint = +let make_pa_rule i_typs level (typs,symbols) ntn onlyprint = let assoc = recompute_assoc typs in let prod = make_production typs symbols in - { notgram_level = n; + { notgram_level = level; notgram_assoc = assoc; notgram_notation = ntn; notgram_prods = prod; @@ -1156,21 +1236,23 @@ let make_pa_rule i_typs (n,typs,symbols,_) ntn onlyprint = notgram_onlyprinting = onlyprint; } -let make_pp_rule (n,typs,symbols,fmt) = +let make_pp_rule level (typs,symbols) fmt = match fmt with - | None -> [UnpBox (PpHOVB 0, make_hunks typs symbols n)] - | Some fmt -> hunks_of_format (n, List.split typs) (symbols, parse_format fmt) - -let make_syntax_rules (i_typs,ntn,prec,need_squash,sy_data) extra onlyprint compat = - let pa_rule = make_pa_rule i_typs sy_data ntn onlyprint in - let pp_rule = make_pp_rule sy_data in + | None -> [UnpBox (PpHOVB 0, make_hunks typs symbols level)] + | Some fmt -> hunks_of_format (level, List.split typs) (symbols, parse_format fmt) + +(* let make_syntax_rules i_typs (ntn,prec,need_squash) sy_data fmt extra onlyprint compat = *) +let make_syntax_rules (sd : SynData.syn_data) = let open SynData in + let ntn, prec, need_squash = sd.not_data in + let pa_rule = make_pa_rule sd.intern_typs sd.level sd.syntax_data ntn sd.only_printing in + let pp_rule = make_pp_rule sd.level sd.syntax_data sd.format in let sy = { - synext_level = prec; + synext_level = (sd.level, prec); synext_notation = ntn; - synext_notgram = pa_rule; + synext_notgram = pa_rule; synext_unparsing = pp_rule; - synext_extra = extra; - synext_compat = compat; + synext_extra = sd.extra; + synext_compat = sd.compat; } in (* By construction, the rule for "{ _ }" is declared, but we need to redeclare it because the file where it is declared needs not be open @@ -1185,39 +1267,39 @@ let to_map l = List.fold_left fold Id.Map.empty l let add_notation_in_scope local df c mods scope = - let (msgs,i_data,i_typs,sy_data,extra) = compute_syntax_data df mods in + let open SynData in + let sd = compute_syntax_data df mods in (* Prepare the interpretation *) - let (onlyparse, onlyprint, compat, recvars,mainvars, df') = i_data in (* Prepare the parsing and printing rules *) - let sy_rules = make_syntax_rules sy_data extra onlyprint compat in - let i_vars = make_internalization_vars recvars mainvars i_typs in + let sy_rules = make_syntax_rules sd in + let i_vars = make_internalization_vars sd.recvars sd.mainvars sd.intern_typs in let nenv = { ninterp_var_type = to_map i_vars; - ninterp_rec_vars = to_map recvars; + ninterp_rec_vars = to_map sd.recvars; } in let (acvars, ac, reversible) = interp_notation_constr nenv c in - let interp = make_interpretation_vars recvars acvars in + let interp = make_interpretation_vars sd.recvars acvars in let map (x, _) = try Some (x, Id.Map.find x interp) with Not_found -> None in - let onlyparse = is_not_printable onlyparse (not reversible) ac in + let onlyparse = is_not_printable sd.only_parsing (not reversible) ac in let notation = { notobj_local = local; notobj_scope = scope; notobj_interp = (List.map_filter map i_vars, ac); (** Order is important here! *) notobj_onlyparse = onlyparse; - notobj_onlyprint = onlyprint; - notobj_compat = compat; - notobj_notation = df'; + notobj_onlyprint = sd.only_printing; + notobj_compat = sd.compat; + notobj_notation = sd.info; } in (* Ready to change the global state *) - Flags.if_verbose (List.iter (fun (f,x) -> f x)) msgs; + Flags.if_verbose (List.iter (fun (f,x) -> f x)) sd.msgs; Lib.add_anonymous_leaf (inSyntaxExtension (local, sy_rules)); Lib.add_anonymous_leaf (inNotation notation); - df' + sd.info let add_notation_interpretation_core local df ?(impls=empty_internalization_env) c scope onlyparse onlyprint compat = let dfs = split_notation_string df in - let (recvars,mainvars,symbs) = analyze_notation_tokens dfs in + let recvars,mainvars,symbs = analyze_notation_tokens dfs in (* Recover types of variables and pa/pp rules; redeclare them if needed *) let i_typs, onlyprint = if not (is_numeral symbs) then begin let i_typs,sy_rules,onlyprint' = recover_notation_syntax (make_notation_key symbs) in @@ -1227,8 +1309,8 @@ let add_notation_interpretation_core local df ?(impls=empty_internalization_env) i_typs, onlyprint end else [], false in (* Declare interpretation *) - let path = (Lib.library_dp(),Lib.current_dirpath true) in - let df' = (make_notation_key symbs,(path,df)) in + let path = (Lib.library_dp(), Lib.current_dirpath true) in + let df' = (make_notation_key symbs, (path,df)) in let i_vars = make_internalization_vars recvars mainvars i_typs in let nenv = { ninterp_var_type = to_map i_vars; @@ -1253,10 +1335,10 @@ let add_notation_interpretation_core local df ?(impls=empty_internalization_env) (* Notations without interpretation (Reserved Notation) *) -let add_syntax_extension local ((loc,df),mods) = - let msgs, sy_data, extra, onlyprint = compute_pure_syntax_data df mods in - let sy_rules = make_syntax_rules sy_data extra onlyprint None in - Flags.if_verbose (List.iter (fun (f,x) -> f x)) msgs; +let add_syntax_extension local ((loc,df),mods) = let open SynData in + let psd = compute_pure_syntax_data df mods in + let sy_rules = make_syntax_rules {psd with compat = None} in + Flags.if_verbose (List.iter (fun (f,x) -> f x)) psd.msgs; Lib.add_anonymous_leaf (inSyntaxExtension(local,sy_rules)) (* Notations with only interpretation *) @@ -1385,4 +1467,3 @@ let add_syntactic_definition ident (vars,c) local onlyparse = | p -> p in Syntax_def.declare_syntactic_definition local ident onlyparse (vars,pat) - -- cgit v1.2.3 From c176063e57d1555fa7acd273dd151e35a01e58d1 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Tue, 7 Feb 2017 15:38:54 +0100 Subject: [travis] [External CI] iris-coq: fix dependencies --- dev/ci/ci-iris-coq.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dev/ci/ci-iris-coq.sh b/dev/ci/ci-iris-coq.sh index c1306e070d..e97e2c19e3 100755 --- a/dev/ci/ci-iris-coq.sh +++ b/dev/ci/ci-iris-coq.sh @@ -24,6 +24,11 @@ git clone --depth 1 https://github.com/math-comp/math-comp.git # echo "Add ML Path \"`pwd`/math-comp/mathcomp/\"." > ${HOME}/.coqrc # echo "Add LoadPath \"`pwd`/math-comp/mathcomp/\" as mathcomp." >> ${HOME}/.coqrc +# Setup stdpp +git clone --depth 1 https://gitlab.mpi-sws.org/robbertkrebbers/coq-stdpp.git + +( cd coq-stdpp && make -j ${NJOBS} && make install ) + # Setup Iris git clone --depth 1 https://gitlab.mpi-sws.org/FP/iris-coq.git -- cgit v1.2.3 From fedf877e14ed75fd7156a97f5bd6dcdc9c6ffcef Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Tue, 7 Feb 2017 15:58:02 +0100 Subject: [travis] [External CI] [geocoq] don't build slow file Unfortunately `Ch16_coordinates_with_functions.v` takes alone ~15 minutes which is too much for Travis. Pity, because it was a nice use case. --- dev/ci/ci-geocoq.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dev/ci/ci-geocoq.sh b/dev/ci/ci-geocoq.sh index 7b5811dc4a..589a826e02 100755 --- a/dev/ci/ci-geocoq.sh +++ b/dev/ci/ci-geocoq.sh @@ -9,4 +9,8 @@ GeoCoq_CI_GITURL=https://github.com/GeoCoq/GeoCoq.git git clone --depth 1 -b ${GeoCoq_CI_BRANCH} ${GeoCoq_CI_GITURL} -( cd GeoCoq && ./configure.sh && make -j ${NJOBS} ) +( cd GeoCoq && \ + ./configure.sh && \ + sed -i.bak '/Ch16_coordinates_with_functions\.v/d' Make && \ + coq_makefile -f Make -o Makefile && \ + make -j ${NJOBS} ) -- cgit v1.2.3 From 5484ba750ef4526dde29ffc1474ca5d145f3ec04 Mon Sep 17 00:00:00 2001 From: Pierre Letouzey Date: Sat, 4 Feb 2017 01:01:05 +0100 Subject: Extraction: fix complexity issue #5310 A double call to pp_module_type inside Ocaml.pp_specif was causing an complexity blowup when pretty-printing heavily modular extracted code. I wasn't able to figure out why this double call is there. It could be the leftover of some intermediate work in 2007 before commit 350398eae (which introduced global printing phases Pre/Impl/Intf). Anyway I'm reasonably sure that today these two pp_module_type calls produce the exact same pretty-printed signature (even if there's a large bunch of imperative states around). Moreover, this duplicated signature is actually slightly wrong: when we alias a module M with a unambiguous name like Coq__123, the type of Coq__123 should not be an exact copy of the type of M, but rather a "strengthened" version of it (with equality between inductive types). So the best solution is now to use this funny feature of OCaml introduced in 3.12 : module Coq__123 : module type of struct include M end This "module type of struct include" is slightly awkward, but short, correct, and trivial to produce :-). And I doubt anybody will object to the (rare) use of some 3.12 features in extracted code of 2017... --- plugins/extraction/ocaml.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/extraction/ocaml.ml b/plugins/extraction/ocaml.ml index 1c29a9bc24..5d10cb939d 100644 --- a/plugins/extraction/ocaml.ml +++ b/plugins/extraction/ocaml.ml @@ -618,12 +618,13 @@ let rec pp_specif = function with Not_found -> pp_spec s) | (l,Smodule mt) -> let def = pp_module_type [] mt in - let def' = pp_module_type [] mt in let name = pp_modname (MPdot (top_visible_mp (), l)) in hov 1 (str "module " ++ name ++ str " :" ++ fnl () ++ def) ++ (try let ren = Common.check_duplicate (top_visible_mp ()) l in - fnl () ++ hov 1 (str ("module "^ren^" :") ++ fnl () ++ def') + fnl () ++ + hov 1 (str ("module "^ren^" :") ++ spc () ++ + str "module type of struct include " ++ name ++ str " end") with Not_found -> Pp.mt ()) | (l,Smodtype mt) -> let def = pp_module_type [] mt in -- cgit v1.2.3 From c04f336b2efb43401dee3a5bb9dceaeac815ef00 Mon Sep 17 00:00:00 2001 From: Pierre Letouzey Date: Sat, 4 Feb 2017 19:22:11 +0100 Subject: configure: avoid deprecated warnings --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 09585e59ee..79c512f8a0 100755 --- a/configure +++ b/configure @@ -26,7 +26,7 @@ done ## We check that $cmd is ok before the real exec $cmd -`$cmd -version > /dev/null 2>&1` && exec $cmd $script "$@" +`$cmd -version > /dev/null 2>&1` && exec $cmd -w "-3" $script "$@" ## If we're still here, something is wrong with $cmd -- cgit v1.2.3 From af4962a9211a707943e7b0627439a731c3e7d23f Mon Sep 17 00:00:00 2001 From: Pierre Letouzey Date: Sat, 4 Feb 2017 19:29:15 +0100 Subject: Extraction : get_duplicates (via option) instead of check_duplicates (via Not_found) This clarifies the execution flow --- plugins/extraction/common.ml | 16 ++++++++------- plugins/extraction/common.mli | 2 +- plugins/extraction/ocaml.ml | 45 ++++++++++++++++++++----------------------- 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/plugins/extraction/common.ml b/plugins/extraction/common.ml index 9446cf667c..de97ba97c3 100644 --- a/plugins/extraction/common.ml +++ b/plugins/extraction/common.ml @@ -308,15 +308,16 @@ end module DupMap = Map.Make(DupOrd) -let add_duplicate, check_duplicate = +let add_duplicate, get_duplicate = let index = ref 0 and dups = ref DupMap.empty in register_cleanup (fun () -> index := 0; dups := DupMap.empty); let add mp l = incr index; let ren = "Coq__" ^ string_of_int !index in dups := DupMap.add (mp,l) ren !dups - and check mp l = DupMap.find (mp, l) !dups - in (add,check) + and get mp l = + try Some (DupMap.find (mp, l) !dups) with Not_found -> None + in (add,get) type reset_kind = AllButExternal | Everything @@ -510,10 +511,11 @@ let pp_duplicate k' prefix mp rls olab = (* Here rls=s::rls', we search the label for s inside mp *) List.tl rls, get_nth_label_mp (mp_length mp - mp_length prefix) mp in - try dottify (check_duplicate prefix lbl :: rls') - with Not_found -> - assert (get_phase () == Pre); (* otherwise it's too late *) - add_duplicate prefix lbl; dottify rls + match get_duplicate prefix lbl with + | Some ren -> dottify (ren :: rls') + | None -> + assert (get_phase () == Pre); (* otherwise it's too late *) + add_duplicate prefix lbl; dottify rls let fstlev_ks k = function | [] -> assert false diff --git a/plugins/extraction/common.mli b/plugins/extraction/common.mli index 2f5601964e..b8e95afb38 100644 --- a/plugins/extraction/common.mli +++ b/plugins/extraction/common.mli @@ -62,7 +62,7 @@ val top_visible_mp : unit -> module_path val push_visible : module_path -> module_path list -> unit val pop_visible : unit -> unit -val check_duplicate : module_path -> Label.t -> string +val get_duplicate : module_path -> Label.t -> string option type reset_kind = AllButExternal | Everything diff --git a/plugins/extraction/ocaml.ml b/plugins/extraction/ocaml.ml index 5d10cb939d..31e481d123 100644 --- a/plugins/extraction/ocaml.ml +++ b/plugins/extraction/ocaml.ml @@ -610,30 +610,29 @@ let pp_alias_spec ren = function let rec pp_specif = function | (_,Spec (Sval _ as s)) -> pp_spec s | (l,Spec s) -> - (try - let ren = Common.check_duplicate (top_visible_mp ()) l in + (match Common.get_duplicate (top_visible_mp ()) l with + | None -> pp_spec s + | Some ren -> hov 1 (str ("module "^ren^" : sig") ++ fnl () ++ pp_spec s) ++ fnl () ++ str "end" ++ fnl () ++ - pp_alias_spec ren s - with Not_found -> pp_spec s) + pp_alias_spec ren s) | (l,Smodule mt) -> let def = pp_module_type [] mt in let name = pp_modname (MPdot (top_visible_mp (), l)) in hov 1 (str "module " ++ name ++ str " :" ++ fnl () ++ def) ++ - (try - let ren = Common.check_duplicate (top_visible_mp ()) l in + (match Common.get_duplicate (top_visible_mp ()) l with + | None -> Pp.mt () + | Some ren -> fnl () ++ hov 1 (str ("module "^ren^" :") ++ spc () ++ - str "module type of struct include " ++ name ++ str " end") - with Not_found -> Pp.mt ()) + str "module type of struct include " ++ name ++ str " end")) | (l,Smodtype mt) -> let def = pp_module_type [] mt in let name = pp_modname (MPdot (top_visible_mp (), l)) in hov 1 (str "module type " ++ name ++ str " =" ++ fnl () ++ def) ++ - (try - let ren = Common.check_duplicate (top_visible_mp ()) l in - fnl () ++ str ("module type "^ren^" = ") ++ name - with Not_found -> Pp.mt ()) + (match Common.get_duplicate (top_visible_mp ()) l with + | None -> Pp.mt () + | Some ren -> fnl () ++ str ("module type "^ren^" = ") ++ name) and pp_module_type params = function | MTident kn -> @@ -682,12 +681,12 @@ let is_short = function MEident _ | MEapply _ -> true | _ -> false let rec pp_structure_elem = function | (l,SEdecl d) -> - (try - let ren = Common.check_duplicate (top_visible_mp ()) l in + (match Common.get_duplicate (top_visible_mp ()) l with + | None -> pp_decl d + | Some ren -> hov 1 (str ("module "^ren^" = struct") ++ fnl () ++ pp_decl d) ++ fnl () ++ str "end" ++ fnl () ++ - pp_alias_decl ren d - with Not_found -> pp_decl d) + pp_alias_decl ren d) | (l,SEmodule m) -> let typ = (* virtual printing of the type, in order to have a correct mli later*) @@ -700,18 +699,16 @@ let rec pp_structure_elem = function hov 1 (str "module " ++ name ++ typ ++ str " =" ++ (if is_short m.ml_mod_expr then spc () else fnl ()) ++ def) ++ - (try - let ren = Common.check_duplicate (top_visible_mp ()) l in - fnl () ++ str ("module "^ren^" = ") ++ name - with Not_found -> mt ()) + (match Common.get_duplicate (top_visible_mp ()) l with + | Some ren -> fnl () ++ str ("module "^ren^" = ") ++ name + | None -> mt ()) | (l,SEmodtype m) -> let def = pp_module_type [] m in let name = pp_modname (MPdot (top_visible_mp (), l)) in hov 1 (str "module type " ++ name ++ str " =" ++ fnl () ++ def) ++ - (try - let ren = Common.check_duplicate (top_visible_mp ()) l in - fnl () ++ str ("module type "^ren^" = ") ++ name - with Not_found -> mt ()) + (match Common.get_duplicate (top_visible_mp ()) l with + | None -> mt () + | Some ren -> fnl () ++ str ("module type "^ren^" = ") ++ name) and pp_module_expr params = function | MEident mp -> pp_modname mp -- cgit v1.2.3 From 8ef3bc0e8a65b3a0338da39aa54cd75b1c2c1bb7 Mon Sep 17 00:00:00 2001 From: Pierre Letouzey Date: Sat, 4 Feb 2017 19:55:18 +0100 Subject: Extraction: simplify the generated code for difficult name conflicts No more pp_alias_spec et pp_alias_decl. Instead, we use "include" and "module type of". The extracted code might hence need OCaml 3.12 (quite rarely) --- plugins/extraction/ocaml.ml | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/plugins/extraction/ocaml.ml b/plugins/extraction/ocaml.ml index 31e481d123..404939cff9 100644 --- a/plugins/extraction/ocaml.ml +++ b/plugins/extraction/ocaml.ml @@ -555,24 +555,6 @@ let pp_decl = function | Dfix (rv,defs,typs) -> pp_Dfix (rv,defs,typs) -let pp_alias_decl ren = function - | Dind (kn,i) -> pp_mind kn { i with ind_equiv = RenEquiv ren } - | Dtype (r, l, _) -> - let name = pp_global Type r in - let l = rename_tvars keywords l in - let ids = pp_parameters l in - hov 2 (str "type " ++ ids ++ name ++ str " =" ++ spc () ++ ids ++ - str (ren^".") ++ name) - | Dterm (r, a, t) -> - let name = pp_global Term r in - hov 2 (str "let " ++ name ++ str (" = "^ren^".") ++ name) - | Dfix (rv, _, _) -> - prvecti (fun i r -> if is_inline_custom r then mt () else - let name = pp_global Term r in - hov 2 (str "let " ++ name ++ str (" = "^ren^".") ++ name) ++ - fnl ()) - rv - let pp_spec = function | Sval (r,_) when is_inline_custom r -> mt () | Stype (r,_,_) when is_inline_custom r -> mt () @@ -597,16 +579,6 @@ let pp_spec = function in hov 2 (str "type " ++ ids ++ name ++ def) -let pp_alias_spec ren = function - | Sind (kn,i) -> pp_mind kn { i with ind_equiv = RenEquiv ren } - | Stype (r,l,_) -> - let name = pp_global Type r in - let l = rename_tvars keywords l in - let ids = pp_parameters l in - hov 2 (str "type " ++ ids ++ name ++ str " =" ++ spc () ++ ids ++ - str (ren^".") ++ name) - | Sval _ -> assert false - let rec pp_specif = function | (_,Spec (Sval _ as s)) -> pp_spec s | (l,Spec s) -> @@ -615,7 +587,7 @@ let rec pp_specif = function | Some ren -> hov 1 (str ("module "^ren^" : sig") ++ fnl () ++ pp_spec s) ++ fnl () ++ str "end" ++ fnl () ++ - pp_alias_spec ren s) + str ("include module type of struct include "^ren^" end")) | (l,Smodule mt) -> let def = pp_module_type [] mt in let name = pp_modname (MPdot (top_visible_mp (), l)) in @@ -685,8 +657,7 @@ let rec pp_structure_elem = function | None -> pp_decl d | Some ren -> hov 1 (str ("module "^ren^" = struct") ++ fnl () ++ pp_decl d) ++ - fnl () ++ str "end" ++ fnl () ++ - pp_alias_decl ren d) + fnl () ++ str "end" ++ fnl () ++ str ("include "^ren)) | (l,SEmodule m) -> let typ = (* virtual printing of the type, in order to have a correct mli later*) -- cgit v1.2.3 From 69c4e7cfa0271f024b2178082e4be2e3ca3be263 Mon Sep 17 00:00:00 2001 From: Pierre Letouzey Date: Sun, 5 Feb 2017 01:46:41 +0100 Subject: Extraction: avoid deprecated functions of module String - A few tweaks of string are now done via the Bytes module - lots of String.capitalize_ascii and co --- plugins/extraction/common.ml | 13 ++++++++----- plugins/extraction/common.mli | 3 +++ plugins/extraction/haskell.ml | 4 ++-- plugins/extraction/scheme.ml | 7 +------ plugins/extraction/table.ml | 11 ++++++----- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/plugins/extraction/common.ml b/plugins/extraction/common.ml index de97ba97c3..b93a76b966 100644 --- a/plugins/extraction/common.ml +++ b/plugins/extraction/common.ml @@ -92,9 +92,11 @@ let begins_with_CoqXX s = let unquote s = if lang () != Scheme then s else - let s = String.copy s in - for i=0 to String.length s - 1 do if s.[i] == '\'' then s.[i] <- '~' done; - s + let b = Bytes.of_string s in + for i=0 to Bytes.length b - 1 do + if Bytes.get b i == '\'' then Bytes.set b i '~' + done; + Bytes.to_string b let rec qualify delim = function | [] -> assert false @@ -110,12 +112,13 @@ let pseudo_qualify = qualify "__" let is_upper s = match s.[0] with 'A' .. 'Z' -> true | _ -> false let is_lower s = match s.[0] with 'a' .. 'z' | '_' -> true | _ -> false -let lowercase_id id = Id.of_string (String.uncapitalize (ascii_of_id id)) +let lowercase_id id = + Id.of_string (String.uncapitalize_ascii (ascii_of_id id)) let uppercase_id id = let s = ascii_of_id id in assert (not (String.is_empty s)); if s.[0] == '_' then Id.of_string ("Coq_"^s) - else Id.of_string (String.capitalize s) + else Id.of_string (String.capitalize_ascii s) type kind = Term | Type | Cons | Mod diff --git a/plugins/extraction/common.mli b/plugins/extraction/common.mli index b8e95afb38..a6351fc4c4 100644 --- a/plugins/extraction/common.mli +++ b/plugins/extraction/common.mli @@ -36,6 +36,9 @@ val pr_binding : Id.t list -> std_ppcmds val rename_id : Id.t -> Id.Set.t -> Id.t +(** For Scheme extraction, replace the ['] by [~] *) +val unquote : string -> string + type env = Id.t list * Id.Set.t val empty_env : unit -> env diff --git a/plugins/extraction/haskell.ml b/plugins/extraction/haskell.ml index 0692c88cd1..83bb2e135e 100644 --- a/plugins/extraction/haskell.ml +++ b/plugins/extraction/haskell.ml @@ -21,8 +21,8 @@ open Common (*s Haskell renaming issues. *) -let pr_lower_id id = str (String.uncapitalize (Id.to_string id)) -let pr_upper_id id = str (String.capitalize (Id.to_string id)) +let pr_lower_id id = str (String.uncapitalize_ascii (Id.to_string id)) +let pr_upper_id id = str (String.capitalize_ascii (Id.to_string id)) let keywords = List.fold_right (fun s -> Id.Set.add (Id.of_string s)) diff --git a/plugins/extraction/scheme.ml b/plugins/extraction/scheme.ml index a6309e61f9..3bd16138f9 100644 --- a/plugins/extraction/scheme.ml +++ b/plugins/extraction/scheme.ml @@ -39,12 +39,7 @@ let preamble _ comment _ usf = str "(load \"macros_extr.scm\")\n\n" ++ (if usf.mldummy then str "(define __ (lambda (_) __))\n\n" else mt ()) -let pr_id id = - let s = Id.to_string id in - for i = 0 to String.length s - 1 do - if s.[i] == '\'' then s.[i] <- '~' - done; - str s +let pr_id id = str (unquote (Id.to_string id)) let paren = pp_par true diff --git a/plugins/extraction/table.ml b/plugins/extraction/table.ml index 5e7d810c93..a8d49ffda5 100644 --- a/plugins/extraction/table.ml +++ b/plugins/extraction/table.ml @@ -55,7 +55,7 @@ let is_modfile = function | _ -> false let raw_string_of_modfile = function - | MPfile f -> String.capitalize (Id.to_string (List.hd (DirPath.repr f))) + | MPfile f -> String.capitalize_ascii (Id.to_string (List.hd (DirPath.repr f))) | _ -> assert false let is_toplevel mp = @@ -773,13 +773,14 @@ let file_of_modfile mp = | MPfile f -> Id.to_string (List.hd (DirPath.repr f)) | _ -> assert false in - let s = String.copy (string_of_modfile mp) in - if s.[0] != s0.[0] then s.[0] <- s0.[0]; - s + let s = Bytes.of_string (string_of_modfile mp) in + let () = Bytes.set s 0 (s0.[0]) in + Bytes.to_string s let add_blacklist_entries l = blacklist_table := - List.fold_right (fun s -> Id.Set.add (Id.of_string (String.capitalize s))) + List.fold_right + (fun s -> Id.Set.add (Id.of_string (String.capitalize_ascii s))) l !blacklist_table (* Registration of operations for rollback. *) -- cgit v1.2.3 From 093ce7c6a03e6e48c9b8f20a810d553fb953fe72 Mon Sep 17 00:00:00 2001 From: Pierre Letouzey Date: Sun, 5 Feb 2017 02:01:56 +0100 Subject: Extraction: remove the "print to devnull" hack now that pp isn't lazy anymore --- plugins/extraction/extract_env.ml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/extraction/extract_env.ml b/plugins/extraction/extract_env.ml index 52f22ee603..e019bb3c2a 100644 --- a/plugins/extraction/extract_env.ml +++ b/plugins/extraction/extract_env.ml @@ -507,8 +507,7 @@ let print_structure_to_file (fn,si,mo) dry struc = in (* First, a dry run, for computing objects to rename or duplicate *) set_phase Pre; - let devnull = formatter true None in - pp_with devnull (d.pp_struct struc); + ignore (d.pp_struct struc); let opened = opened_libraries () in (* Print the implementation *) let cout = if dry then None else Option.map open_out fn in -- cgit v1.2.3 From df14dac0e6e9d9819dcc3b1601e150af7c142597 Mon Sep 17 00:00:00 2001 From: Pierre Letouzey Date: Sun, 5 Feb 2017 02:12:36 +0100 Subject: Extraction cosmetic: no whitespaces in printing empty modules --- plugins/extraction/ocaml.ml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/extraction/ocaml.ml b/plugins/extraction/ocaml.ml index 404939cff9..d89bf95ee8 100644 --- a/plugins/extraction/ocaml.ml +++ b/plugins/extraction/ocaml.ml @@ -625,8 +625,10 @@ and pp_module_type params = function let l = List.rev l in pop_visible (); str "sig" ++ fnl () ++ - v 1 (str " " ++ prlist_with_sep cut2 identity l) ++ - fnl () ++ str "end" + (if List.is_empty l then mt () + else + v 1 (str " " ++ prlist_with_sep cut2 identity l) ++ fnl ()) + ++ str "end" | MTwith(mt,ML_With_type(idl,vl,typ)) -> let ids = pp_parameters (rename_tvars keywords vl) in let mp_mt = msid_of_mt mt in @@ -701,8 +703,10 @@ and pp_module_expr params = function let l = List.rev l in pop_visible (); str "struct" ++ fnl () ++ - v 1 (str " " ++ prlist_with_sep cut2 identity l) ++ - fnl () ++ str "end" + (if List.is_empty l then mt () + else + v 1 (str " " ++ prlist_with_sep cut2 identity l) ++ fnl ()) + ++ str "end" let rec prlist_sep_nonempty sep f = function | [] -> mt () -- cgit v1.2.3 From 3550120641c3b8d84290dc950e717aaf099775f9 Mon Sep 17 00:00:00 2001 From: Pierre Letouzey Date: Tue, 7 Feb 2017 23:28:36 +0100 Subject: Revert "Extraction: avoid deprecated functions of module String" This reverts commit 69c4e7cfa0271f024b2178082e4be2e3ca3be263. String.capitalize_ascii are only available for ocaml >= 4.03, sorry... --- plugins/extraction/common.ml | 13 +++++-------- plugins/extraction/common.mli | 3 --- plugins/extraction/haskell.ml | 4 ++-- plugins/extraction/scheme.ml | 7 ++++++- plugins/extraction/table.ml | 11 +++++------ 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/plugins/extraction/common.ml b/plugins/extraction/common.ml index b93a76b966..de97ba97c3 100644 --- a/plugins/extraction/common.ml +++ b/plugins/extraction/common.ml @@ -92,11 +92,9 @@ let begins_with_CoqXX s = let unquote s = if lang () != Scheme then s else - let b = Bytes.of_string s in - for i=0 to Bytes.length b - 1 do - if Bytes.get b i == '\'' then Bytes.set b i '~' - done; - Bytes.to_string b + let s = String.copy s in + for i=0 to String.length s - 1 do if s.[i] == '\'' then s.[i] <- '~' done; + s let rec qualify delim = function | [] -> assert false @@ -112,13 +110,12 @@ let pseudo_qualify = qualify "__" let is_upper s = match s.[0] with 'A' .. 'Z' -> true | _ -> false let is_lower s = match s.[0] with 'a' .. 'z' | '_' -> true | _ -> false -let lowercase_id id = - Id.of_string (String.uncapitalize_ascii (ascii_of_id id)) +let lowercase_id id = Id.of_string (String.uncapitalize (ascii_of_id id)) let uppercase_id id = let s = ascii_of_id id in assert (not (String.is_empty s)); if s.[0] == '_' then Id.of_string ("Coq_"^s) - else Id.of_string (String.capitalize_ascii s) + else Id.of_string (String.capitalize s) type kind = Term | Type | Cons | Mod diff --git a/plugins/extraction/common.mli b/plugins/extraction/common.mli index a6351fc4c4..b8e95afb38 100644 --- a/plugins/extraction/common.mli +++ b/plugins/extraction/common.mli @@ -36,9 +36,6 @@ val pr_binding : Id.t list -> std_ppcmds val rename_id : Id.t -> Id.Set.t -> Id.t -(** For Scheme extraction, replace the ['] by [~] *) -val unquote : string -> string - type env = Id.t list * Id.Set.t val empty_env : unit -> env diff --git a/plugins/extraction/haskell.ml b/plugins/extraction/haskell.ml index 83bb2e135e..0692c88cd1 100644 --- a/plugins/extraction/haskell.ml +++ b/plugins/extraction/haskell.ml @@ -21,8 +21,8 @@ open Common (*s Haskell renaming issues. *) -let pr_lower_id id = str (String.uncapitalize_ascii (Id.to_string id)) -let pr_upper_id id = str (String.capitalize_ascii (Id.to_string id)) +let pr_lower_id id = str (String.uncapitalize (Id.to_string id)) +let pr_upper_id id = str (String.capitalize (Id.to_string id)) let keywords = List.fold_right (fun s -> Id.Set.add (Id.of_string s)) diff --git a/plugins/extraction/scheme.ml b/plugins/extraction/scheme.ml index 3bd16138f9..a6309e61f9 100644 --- a/plugins/extraction/scheme.ml +++ b/plugins/extraction/scheme.ml @@ -39,7 +39,12 @@ let preamble _ comment _ usf = str "(load \"macros_extr.scm\")\n\n" ++ (if usf.mldummy then str "(define __ (lambda (_) __))\n\n" else mt ()) -let pr_id id = str (unquote (Id.to_string id)) +let pr_id id = + let s = Id.to_string id in + for i = 0 to String.length s - 1 do + if s.[i] == '\'' then s.[i] <- '~' + done; + str s let paren = pp_par true diff --git a/plugins/extraction/table.ml b/plugins/extraction/table.ml index a8d49ffda5..5e7d810c93 100644 --- a/plugins/extraction/table.ml +++ b/plugins/extraction/table.ml @@ -55,7 +55,7 @@ let is_modfile = function | _ -> false let raw_string_of_modfile = function - | MPfile f -> String.capitalize_ascii (Id.to_string (List.hd (DirPath.repr f))) + | MPfile f -> String.capitalize (Id.to_string (List.hd (DirPath.repr f))) | _ -> assert false let is_toplevel mp = @@ -773,14 +773,13 @@ let file_of_modfile mp = | MPfile f -> Id.to_string (List.hd (DirPath.repr f)) | _ -> assert false in - let s = Bytes.of_string (string_of_modfile mp) in - let () = Bytes.set s 0 (s0.[0]) in - Bytes.to_string s + let s = String.copy (string_of_modfile mp) in + if s.[0] != s0.[0] then s.[0] <- s0.[0]; + s let add_blacklist_entries l = blacklist_table := - List.fold_right - (fun s -> Id.Set.add (Id.of_string (String.capitalize_ascii s))) + List.fold_right (fun s -> Id.Set.add (Id.of_string (String.capitalize s))) l !blacklist_table (* Registration of operations for rollback. *) -- cgit v1.2.3 From f30822ba46d08d65597e0e3230ea6ad86c98453f Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Mon, 7 Nov 2016 16:03:53 +0100 Subject: Proofview: tclINDEPENDENTL --- engine/proofview.ml | 29 ++++++++++++++++++++++++++++- engine/proofview.mli | 1 + tactics/tacticals.ml | 13 +++++++++++++ tactics/tacticals.mli | 1 + 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/engine/proofview.ml b/engine/proofview.ml index 2fbabb7492..721389af4f 100644 --- a/engine/proofview.ml +++ b/engine/proofview.ml @@ -453,6 +453,25 @@ let iter_goal i = Solution.get >>= fun evd -> Comb.set CList.(undefined evd (flatten (rev subgoals))) +(** List iter but allocates a list of results *) +let map_goal i = + let rev = List.rev in (* hem... Proof masks List... *) + let open Proof in + Comb.get >>= fun initial -> + Proof.List.fold_left begin fun (acc, subgoals as cur) goal -> + Solution.get >>= fun step -> + match Evarutil.advance step goal with + | None -> return cur + | Some goal -> + Comb.set [goal] >> + i goal >>= fun res -> + Proof.map (fun comb -> comb :: subgoals) Comb.get >>= fun x -> + return (res :: acc, x) + end ([],[]) initial >>= fun (results_rev, subgoals) -> + Solution.get >>= fun evd -> + Comb.set CList.(undefined evd (flatten (rev subgoals))) >> + return (rev results_rev) + (** A variant of [Monad.List.fold_left2] where the first list is the list of focused goals. The argument tactic is executed in a focus comprising only of the current goal, a goal which has been solved @@ -585,7 +604,15 @@ let tclINDEPENDENT tac = let tac = InfoL.tag (Info.DBranch) tac in InfoL.tag (Info.Dispatch) (iter_goal (fun _ -> tac)) - +let tclINDEPENDENTL tac = + let open Proof in + Pv.get >>= fun initial -> + match initial.comb with + | [] -> tclUNIT [] + | [_] -> tac >>= fun x -> return [x] + | _ -> + let tac = InfoL.tag (Info.DBranch) tac in + InfoL.tag (Info.Dispatch) (map_goal (fun _ -> tac)) (** {7 Goal manipulation} *) diff --git a/engine/proofview.mli b/engine/proofview.mli index 90be2f90ab..294b03dca2 100644 --- a/engine/proofview.mli +++ b/engine/proofview.mli @@ -292,6 +292,7 @@ val tclEXTEND : unit tactic list -> unit tactic -> unit tactic list -> unit tact independent of backtracking in another. It is equivalent to [tclEXTEND [] tac []]. *) val tclINDEPENDENT : unit tactic -> unit tactic +val tclINDEPENDENTL: 'a tactic -> 'a list tactic (** {7 Goal manipulation} *) diff --git a/tactics/tacticals.ml b/tactics/tacticals.ml index 93c04e373c..c5562b326c 100644 --- a/tactics/tacticals.ml +++ b/tactics/tacticals.ml @@ -368,6 +368,16 @@ module New = struct catch_failerror e <*> t2 end end + + let tclORELSE0L t1 t2 = + tclINDEPENDENTL begin + tclORELSE + t1 + begin fun e -> + catch_failerror e <*> t2 + end + end + let tclORELSE t1 t2 = tclORELSE0 (tclPROGRESS t1) t2 @@ -419,6 +429,9 @@ module New = struct let tclTRY t = tclORELSE0 t (tclUNIT ()) + + let tclTRYb t = + tclORELSE0L (t <*> tclUNIT true) (tclUNIT false) let tclIFTHENELSE t1 t2 t3 = tclINDEPENDENT begin diff --git a/tactics/tacticals.mli b/tactics/tacticals.mli index 18cf03c51d..7aacc52f33 100644 --- a/tactics/tacticals.mli +++ b/tactics/tacticals.mli @@ -209,6 +209,7 @@ module New : sig val tclMAP : ('a -> unit tactic) -> 'a list -> unit tactic val tclTRY : unit tactic -> unit tactic + val tclTRYb : unit tactic -> bool list tactic val tclFIRST : unit tactic list -> unit tactic val tclIFTHENELSE : unit tactic -> unit tactic -> unit tactic -> unit tactic val tclIFTHENSVELSE : unit tactic -> unit tactic array -> unit tactic -> unit tactic -- cgit v1.2.3 From 7ce9edaeb49520990efb6785627cc1d6c80f7be6 Mon Sep 17 00:00:00 2001 From: Arnaud Spiwack Date: Tue, 14 Feb 2017 08:50:16 +0100 Subject: Test-suite: output of Search Fix the ordering of the results in the output of Search to correspond to the "priority" ordering. --- test-suite/output/Search.out | 114 ++++++++++++++++++------------------ test-suite/output/SearchHead.out | 42 ++++++------- test-suite/output/SearchPattern.out | 84 +++++++++++++------------- 3 files changed, 120 insertions(+), 120 deletions(-) diff --git a/test-suite/output/Search.out b/test-suite/output/Search.out index c17b285bc9..81fda176ec 100644 --- a/test-suite/output/Search.out +++ b/test-suite/output/Search.out @@ -1,108 +1,108 @@ le_n: forall n : nat, n <= n +le_0_n: forall n : nat, 0 <= n le_S: forall n m : nat, n <= m -> n <= S m +le_n_S: forall n m : nat, n <= m -> S n <= S m +le_pred: forall n m : nat, n <= m -> Nat.pred n <= Nat.pred m +le_S_n: forall n m : nat, S n <= S m -> n <= m +min_l: forall n m : nat, n <= m -> Nat.min n m = n +max_r: forall n m : nat, n <= m -> Nat.max n m = m +min_r: forall n m : nat, m <= n -> Nat.min n m = m +max_l: forall n m : nat, m <= n -> Nat.max n m = n le_ind: forall (n : nat) (P : nat -> Prop), P n -> (forall m : nat, n <= m -> P m -> P (S m)) -> forall n0 : nat, n <= n0 -> P n0 -le_pred: forall n m : nat, n <= m -> Nat.pred n <= Nat.pred m -le_S_n: forall n m : nat, S n <= S m -> n <= m -le_0_n: forall n : nat, 0 <= n -le_n_S: forall n m : nat, n <= m -> S n <= S m -max_l: forall n m : nat, m <= n -> Nat.max n m = n -max_r: forall n m : nat, n <= m -> Nat.max n m = m -min_l: forall n m : nat, n <= m -> Nat.min n m = n -min_r: forall n m : nat, m <= n -> Nat.min n m = m -true: bool false: bool -bool_rect: forall P : bool -> Type, P true -> P false -> forall b : bool, P b -bool_ind: forall P : bool -> Prop, P true -> P false -> forall b : bool, P b -bool_rec: forall P : bool -> Set, P true -> P false -> forall b : bool, P b -andb: bool -> bool -> bool -orb: bool -> bool -> bool -implb: bool -> bool -> bool -xorb: bool -> bool -> bool +true: bool +is_true: bool -> Prop negb: bool -> bool -andb_prop: forall a b : bool, (a && b)%bool = true -> a = true /\ b = true -andb_true_intro: - forall b1 b2 : bool, b1 = true /\ b2 = true -> (b1 && b2)%bool = true eq_true: bool -> Prop -eq_true_rect: - forall P : bool -> Type, P true -> forall b : bool, eq_true b -> P b -eq_true_ind: - forall P : bool -> Prop, P true -> forall b : bool, eq_true b -> P b +implb: bool -> bool -> bool +orb: bool -> bool -> bool +andb: bool -> bool -> bool +xorb: bool -> bool -> bool +Nat.even: nat -> bool +Nat.odd: nat -> bool +BoolSpec: Prop -> Prop -> bool -> Prop +Nat.eqb: nat -> nat -> bool +Nat.testbit: nat -> nat -> bool +Nat.ltb: nat -> nat -> bool +Nat.leb: nat -> nat -> bool +Nat.bitwise: (bool -> bool -> bool) -> nat -> nat -> nat -> nat +bool_ind: forall P : bool -> Prop, P true -> P false -> forall b : bool, P b +bool_rec: forall P : bool -> Set, P true -> P false -> forall b : bool, P b eq_true_rec: forall P : bool -> Set, P true -> forall b : bool, eq_true b -> P b -is_true: bool -> Prop -eq_true_ind_r: - forall (P : bool -> Prop) (b : bool), P b -> eq_true b -> P true -eq_true_rec_r: - forall (P : bool -> Set) (b : bool), P b -> eq_true b -> P true +eq_true_ind: + forall P : bool -> Prop, P true -> forall b : bool, eq_true b -> P b eq_true_rect_r: forall (P : bool -> Type) (b : bool), P b -> eq_true b -> P true -BoolSpec: Prop -> Prop -> bool -> Prop +eq_true_rec_r: + forall (P : bool -> Set) (b : bool), P b -> eq_true b -> P true +eq_true_rect: + forall P : bool -> Type, P true -> forall b : bool, eq_true b -> P b +bool_rect: forall P : bool -> Type, P true -> P false -> forall b : bool, P b +eq_true_ind_r: + forall (P : bool -> Prop) (b : bool), P b -> eq_true b -> P true +andb_true_intro: + forall b1 b2 : bool, b1 = true /\ b2 = true -> (b1 && b2)%bool = true +andb_prop: forall a b : bool, (a && b)%bool = true -> a = true /\ b = true BoolSpec_ind: forall (P Q : Prop) (P0 : bool -> Prop), (P -> P0 true) -> (Q -> P0 false) -> forall b : bool, BoolSpec P Q b -> P0 b -Nat.eqb: nat -> nat -> bool -Nat.leb: nat -> nat -> bool -Nat.ltb: nat -> nat -> bool -Nat.even: nat -> bool -Nat.odd: nat -> bool -Nat.testbit: nat -> nat -> bool -Nat.bitwise: (bool -> bool -> bool) -> nat -> nat -> nat -> nat bool_choice: forall (S : Set) (R1 R2 : S -> Prop), (forall x : S, {R1 x} + {R2 x}) -> {f : S -> bool | forall x : S, f x = true /\ R1 x \/ f x = false /\ R2 x} -eq_S: forall x y : nat, x = y -> S x = S y -f_equal_nat: forall (B : Type) (f : nat -> B) (x y : nat), x = y -> f x = f y -f_equal_pred: forall x y : nat, x = y -> Nat.pred x = Nat.pred y +mult_n_O: forall n : nat, 0 = n * 0 +plus_O_n: forall n : nat, 0 + n = n +plus_n_O: forall n : nat, n = n + 0 +n_Sn: forall n : nat, n <> S n pred_Sn: forall n : nat, n = Nat.pred (S n) +O_S: forall n : nat, 0 <> S n +f_equal_pred: forall x y : nat, x = y -> Nat.pred x = Nat.pred y +eq_S: forall x y : nat, x = y -> S x = S y eq_add_S: forall n m : nat, S n = S m -> n = m +min_r: forall n m : nat, m <= n -> Nat.min n m = m +min_l: forall n m : nat, n <= m -> Nat.min n m = n +max_r: forall n m : nat, n <= m -> Nat.max n m = m +max_l: forall n m : nat, m <= n -> Nat.max n m = n +plus_Sn_m: forall n m : nat, S n + m = S (n + m) +plus_n_Sm: forall n m : nat, S (n + m) = n + S m +f_equal_nat: forall (B : Type) (f : nat -> B) (x y : nat), x = y -> f x = f y not_eq_S: forall n m : nat, n <> m -> S n <> S m -O_S: forall n : nat, 0 <> S n -n_Sn: forall n : nat, n <> S n +mult_n_Sm: forall n m : nat, n * m + n = n * S m f_equal2_plus: forall x1 y1 x2 y2 : nat, x1 = y1 -> x2 = y2 -> x1 + x2 = y1 + y2 +f_equal2_mult: + forall x1 y1 x2 y2 : nat, x1 = y1 -> x2 = y2 -> x1 * x2 = y1 * y2 f_equal2_nat: forall (B : Type) (f : nat -> nat -> B) (x1 y1 x2 y2 : nat), x1 = y1 -> x2 = y2 -> f x1 x2 = f y1 y2 -plus_n_O: forall n : nat, n = n + 0 -plus_O_n: forall n : nat, 0 + n = n -plus_n_Sm: forall n m : nat, S (n + m) = n + S m -plus_Sn_m: forall n m : nat, S n + m = S (n + m) -f_equal2_mult: - forall x1 y1 x2 y2 : nat, x1 = y1 -> x2 = y2 -> x1 * x2 = y1 * y2 -mult_n_O: forall n : nat, 0 = n * 0 -mult_n_Sm: forall n m : nat, n * m + n = n * S m -max_l: forall n m : nat, m <= n -> Nat.max n m = n -max_r: forall n m : nat, n <= m -> Nat.max n m = m -min_l: forall n m : nat, n <= m -> Nat.min n m = n -min_r: forall n m : nat, m <= n -> Nat.min n m = m -andb_prop: forall a b : bool, (a && b)%bool = true -> a = true /\ b = true andb_true_intro: forall b1 b2 : bool, b1 = true /\ b2 = true -> (b1 && b2)%bool = true +andb_prop: forall a b : bool, (a && b)%bool = true -> a = true /\ b = true bool_choice: forall (S : Set) (R1 R2 : S -> Prop), (forall x : S, {R1 x} + {R2 x}) -> {f : S -> bool | forall x : S, f x = true /\ R1 x \/ f x = false /\ R2 x} -andb_prop: forall a b : bool, (a && b)%bool = true -> a = true /\ b = true andb_true_intro: forall b1 b2 : bool, b1 = true /\ b2 = true -> (b1 && b2)%bool = true andb_prop: forall a b : bool, (a && b)%bool = true -> a = true /\ b = true -h': newdef n <> n +andb_prop: forall a b : bool, (a && b)%bool = true -> a = true /\ b = true h: n <> newdef n h': newdef n <> n h: n <> newdef n +h': newdef n <> n h: n <> newdef n h: n <> newdef n -h': ~ P n h: P n h': ~ P n h: P n h': ~ P n h: P n +h': ~ P n h: P n h: P n diff --git a/test-suite/output/SearchHead.out b/test-suite/output/SearchHead.out index 0d5924ec61..7038eac22c 100644 --- a/test-suite/output/SearchHead.out +++ b/test-suite/output/SearchHead.out @@ -1,39 +1,39 @@ le_n: forall n : nat, n <= n +le_0_n: forall n : nat, 0 <= n le_S: forall n m : nat, n <= m -> n <= S m le_pred: forall n m : nat, n <= m -> Nat.pred n <= Nat.pred m -le_S_n: forall n m : nat, S n <= S m -> n <= m -le_0_n: forall n : nat, 0 <= n le_n_S: forall n m : nat, n <= m -> S n <= S m -true: bool +le_S_n: forall n m : nat, S n <= S m -> n <= m false: bool -andb: bool -> bool -> bool -orb: bool -> bool -> bool +true: bool +negb: bool -> bool implb: bool -> bool -> bool +orb: bool -> bool -> bool +andb: bool -> bool -> bool xorb: bool -> bool -> bool -negb: bool -> bool -Nat.eqb: nat -> nat -> bool -Nat.leb: nat -> nat -> bool -Nat.ltb: nat -> nat -> bool Nat.even: nat -> bool Nat.odd: nat -> bool +Nat.leb: nat -> nat -> bool +Nat.ltb: nat -> nat -> bool Nat.testbit: nat -> nat -> bool -eq_S: forall x y : nat, x = y -> S x = S y -f_equal_pred: forall x y : nat, x = y -> Nat.pred x = Nat.pred y +Nat.eqb: nat -> nat -> bool +mult_n_O: forall n : nat, 0 = n * 0 +plus_O_n: forall n : nat, 0 + n = n +plus_n_O: forall n : nat, n = n + 0 pred_Sn: forall n : nat, n = Nat.pred (S n) +f_equal_pred: forall x y : nat, x = y -> Nat.pred x = Nat.pred y eq_add_S: forall n m : nat, S n = S m -> n = m -f_equal2_plus: - forall x1 y1 x2 y2 : nat, x1 = y1 -> x2 = y2 -> x1 + x2 = y1 + y2 -plus_n_O: forall n : nat, n = n + 0 -plus_O_n: forall n : nat, 0 + n = n +eq_S: forall x y : nat, x = y -> S x = S y +max_r: forall n m : nat, n <= m -> Nat.max n m = m +max_l: forall n m : nat, m <= n -> Nat.max n m = n +min_r: forall n m : nat, m <= n -> Nat.min n m = m +min_l: forall n m : nat, n <= m -> Nat.min n m = n plus_n_Sm: forall n m : nat, S (n + m) = n + S m plus_Sn_m: forall n m : nat, S n + m = S (n + m) +mult_n_Sm: forall n m : nat, n * m + n = n * S m +f_equal2_plus: + forall x1 y1 x2 y2 : nat, x1 = y1 -> x2 = y2 -> x1 + x2 = y1 + y2 f_equal2_mult: forall x1 y1 x2 y2 : nat, x1 = y1 -> x2 = y2 -> x1 * x2 = y1 * y2 -mult_n_O: forall n : nat, 0 = n * 0 -mult_n_Sm: forall n m : nat, n * m + n = n * S m -max_l: forall n m : nat, m <= n -> Nat.max n m = n -max_r: forall n m : nat, n <= m -> Nat.max n m = m -min_l: forall n m : nat, n <= m -> Nat.min n m = n -min_r: forall n m : nat, m <= n -> Nat.min n m = m h: newdef n h: P n diff --git a/test-suite/output/SearchPattern.out b/test-suite/output/SearchPattern.out index f3c12effca..45ff5e73b6 100644 --- a/test-suite/output/SearchPattern.out +++ b/test-suite/output/SearchPattern.out @@ -1,77 +1,77 @@ -true: bool false: bool -andb: bool -> bool -> bool -orb: bool -> bool -> bool +true: bool +negb: bool -> bool implb: bool -> bool -> bool +orb: bool -> bool -> bool +andb: bool -> bool -> bool xorb: bool -> bool -> bool -negb: bool -> bool -Nat.eqb: nat -> nat -> bool -Nat.leb: nat -> nat -> bool -Nat.ltb: nat -> nat -> bool Nat.even: nat -> bool Nat.odd: nat -> bool +Nat.leb: nat -> nat -> bool +Nat.ltb: nat -> nat -> bool Nat.testbit: nat -> nat -> bool -O: nat -S: nat -> nat -length: forall A : Type, list A -> nat +Nat.eqb: nat -> nat -> bool +Nat.two: nat Nat.zero: nat Nat.one: nat -Nat.two: nat -Nat.succ: nat -> nat +O: nat +Nat.double: nat -> nat +Nat.sqrt: nat -> nat +Nat.div2: nat -> nat +Nat.log2: nat -> nat Nat.pred: nat -> nat +Nat.square: nat -> nat +S: nat -> nat +Nat.succ: nat -> nat +Nat.ldiff: nat -> nat -> nat Nat.add: nat -> nat -> nat -Nat.double: nat -> nat +Nat.lor: nat -> nat -> nat +Nat.lxor: nat -> nat -> nat +Nat.land: nat -> nat -> nat Nat.mul: nat -> nat -> nat Nat.sub: nat -> nat -> nat Nat.max: nat -> nat -> nat -Nat.min: nat -> nat -> nat -Nat.pow: nat -> nat -> nat Nat.div: nat -> nat -> nat +Nat.pow: nat -> nat -> nat +Nat.min: nat -> nat -> nat Nat.modulo: nat -> nat -> nat Nat.gcd: nat -> nat -> nat -Nat.square: nat -> nat Nat.sqrt_iter: nat -> nat -> nat -> nat -> nat -Nat.sqrt: nat -> nat Nat.log2_iter: nat -> nat -> nat -> nat -> nat -Nat.log2: nat -> nat -Nat.div2: nat -> nat +length: forall A : Type, list A -> nat Nat.bitwise: (bool -> bool -> bool) -> nat -> nat -> nat -> nat -Nat.land: nat -> nat -> nat -Nat.lor: nat -> nat -> nat +Nat.div2: nat -> nat +Nat.sqrt: nat -> nat +Nat.log2: nat -> nat +Nat.double: nat -> nat +Nat.pred: nat -> nat +Nat.square: nat -> nat +Nat.succ: nat -> nat +S: nat -> nat Nat.ldiff: nat -> nat -> nat +Nat.pow: nat -> nat -> nat +Nat.land: nat -> nat -> nat Nat.lxor: nat -> nat -> nat -S: nat -> nat -Nat.succ: nat -> nat -Nat.pred: nat -> nat -Nat.add: nat -> nat -> nat -Nat.double: nat -> nat +Nat.div: nat -> nat -> nat Nat.mul: nat -> nat -> nat -Nat.sub: nat -> nat -> nat -Nat.max: nat -> nat -> nat Nat.min: nat -> nat -> nat -Nat.pow: nat -> nat -> nat -Nat.div: nat -> nat -> nat Nat.modulo: nat -> nat -> nat +Nat.sub: nat -> nat -> nat +Nat.lor: nat -> nat -> nat Nat.gcd: nat -> nat -> nat -Nat.square: nat -> nat -Nat.sqrt_iter: nat -> nat -> nat -> nat -> nat -Nat.sqrt: nat -> nat +Nat.max: nat -> nat -> nat +Nat.add: nat -> nat -> nat Nat.log2_iter: nat -> nat -> nat -> nat -> nat -Nat.log2: nat -> nat -Nat.div2: nat -> nat +Nat.sqrt_iter: nat -> nat -> nat -> nat -> nat Nat.bitwise: (bool -> bool -> bool) -> nat -> nat -> nat -> nat -Nat.land: nat -> nat -> nat -Nat.lor: nat -> nat -> nat -Nat.ldiff: nat -> nat -> nat -Nat.lxor: nat -> nat -> nat mult_n_Sm: forall n m : nat, n * m + n = n * S m -identity_refl: forall (A : Type) (a : A), identity a a iff_refl: forall A : Prop, A <-> A +le_n: forall n : nat, n <= n +identity_refl: forall (A : Type) (a : A), identity a a eq_refl: forall (A : Type) (x : A), x = x Nat.divmod: nat -> nat -> nat -> nat -> nat * nat -le_n: forall n : nat, n <= n -pair: forall A B : Type, A -> B -> A * B conj: forall A B : Prop, A -> B -> A /\ B +pair: forall A B : Type, A -> B -> A * B Nat.divmod: nat -> nat -> nat -> nat -> nat * nat h: n <> newdef n h: n <> newdef n -- cgit v1.2.3