src/Pure/proofterm.ML
changeset 36740 6248aa22c694
parent 36732 9c2ee10809b2
child 36741 d65ed9d7275e
     1.1 --- a/src/Pure/proofterm.ML	Sat May 08 14:41:23 2010 +0200
     1.2 +++ b/src/Pure/proofterm.ML	Sat May 08 15:24:59 2010 +0200
     1.3 @@ -110,6 +110,11 @@
     1.4    val equal_elim: term -> term -> proof -> proof -> proof
     1.5    val strip_shyps_proof: Sorts.algebra -> (typ * sort) list -> (typ * sort) list ->
     1.6      sort list -> proof -> proof
     1.7 +  val classrel_proof: theory -> class * class -> proof
     1.8 +  val arity_proof: theory -> string * sort list * class -> proof
     1.9 +  val install_axclass_proofs:
    1.10 +   {classrel_proof: theory -> class * class -> proof,
    1.11 +    arity_proof: theory -> string * sort list * class -> proof} -> unit
    1.12    val axm_proof: string -> term -> proof
    1.13    val oracle_proof: string -> term -> oracle * proof
    1.14    val promise_proof: theory -> serial -> term -> proof
    1.15 @@ -886,7 +891,7 @@
    1.16    equal_elim_axm %> remove_types A %> remove_types B %% prf1 %% prf2;
    1.17  
    1.18  
    1.19 -(**** sort hypotheses ****)
    1.20 +(**** type classes ****)
    1.21  
    1.22  fun strip_shyps_proof algebra present witnessed extra_sorts prf =
    1.23    let
    1.24 @@ -902,6 +907,30 @@
    1.25    in Same.commit (map_proof_types_same (Term_Subst.map_atypsT_same replace)) prf end;
    1.26  
    1.27  
    1.28 +local
    1.29 +
    1.30 +type axclass_proofs =
    1.31 + {classrel_proof: theory -> class * class -> proof,
    1.32 +  arity_proof: theory -> string * sort list * class -> proof};
    1.33 +
    1.34 +val axclass_proofs: axclass_proofs Single_Assignment.var =
    1.35 +  Single_Assignment.var "Proofterm.axclass_proofs";
    1.36 +
    1.37 +fun axclass_proof which thy x =
    1.38 +  (case Single_Assignment.peek axclass_proofs of
    1.39 +    NONE => raise Fail "Axclass proof operations not installed"
    1.40 +  | SOME prfs => which prfs thy x);
    1.41 +
    1.42 +in
    1.43 +
    1.44 +val classrel_proof = axclass_proof #classrel_proof;
    1.45 +val arity_proof = axclass_proof #arity_proof;
    1.46 +
    1.47 +fun install_axclass_proofs prfs = Single_Assignment.assign axclass_proofs prfs;
    1.48 +
    1.49 +end;
    1.50 +
    1.51 +
    1.52  (***** axioms and theorems *****)
    1.53  
    1.54  val proofs = Unsynchronized.ref 2;