diff options
Diffstat (limited to 'contrib/setoid_ring')
-rw-r--r-- | contrib/setoid_ring/Ring_tac.v | 9 | ||||
-rw-r--r-- | contrib/setoid_ring/newring.ml4 | 7 |
2 files changed, 13 insertions, 3 deletions
diff --git a/contrib/setoid_ring/Ring_tac.v b/contrib/setoid_ring/Ring_tac.v index b55c5443..d8bb9eae 100644 --- a/contrib/setoid_ring/Ring_tac.v +++ b/contrib/setoid_ring/Ring_tac.v @@ -152,8 +152,15 @@ Ltac ParseRingComponents lemma := (* ring tactics *) +Ltac relation_carrier req := + let ty := type of req in + match eval hnf in ty with + ?R -> _ => R + | _ => fail 1000 "Equality has no relation type" + end. + Ltac FV_hypo_tac mkFV req lH := - let R := match type of req with ?R -> _ => R end in + let R := relation_carrier req in let FV_hypo_l_tac h := match h with @mkhypo (req ?pe _) _ => mkFV pe end in let FV_hypo_r_tac h := diff --git a/contrib/setoid_ring/newring.ml4 b/contrib/setoid_ring/newring.ml4 index f963fc9c..134ba1a8 100644 --- a/contrib/setoid_ring/newring.ml4 +++ b/contrib/setoid_ring/newring.ml4 @@ -8,7 +8,7 @@ (*i camlp4deps: "parsing/grammar.cma" i*) -(*i $Id: newring.ml4 9968 2007-07-11 15:49:07Z barras $ i*) +(*i $Id: newring.ml4 10047 2007-07-24 17:55:18Z barras $ i*) open Pp open Util @@ -465,7 +465,8 @@ let op_smorph r add mul req m1 m2 = let default_ring_equality (r,add,mul,opp,req) = let is_setoid = function - {rel_refl=Some _; rel_sym=Some _;rel_trans=Some _} -> true + {rel_refl=Some _; rel_sym=Some _;rel_trans=Some _;rel_aeq=rel} -> + eq_constr req rel (* Qu: use conversion ? *) | _ -> false in match default_relation_for_carrier ~filter:is_setoid r with Leibniz _ -> @@ -625,6 +626,7 @@ let interp_sign env sign = (* Same remark on ill-typed terms ... *) let add_theory name rth eqth morphth cst_tac (pre,post) power sign = + check_required_library (cdir@["Ring_base"]); let env = Global.env() in let sigma = Evd.empty in let (kind,r,zero,one,add,mul,sub,opp,req) = dest_ring env sigma rth in @@ -986,6 +988,7 @@ let default_field_equality r inv req = inv_m.lem let add_field_theory name fth eqth morphth cst_tac inj (pre,post) power sign = + check_required_library (cdir@["Field_tac"]); let env = Global.env() in let sigma = Evd.empty in let (kind,r,zero,one,add,mul,sub,opp,div,inv,req,rth) = |