src/Pure/Proof/proof_rewrite_rules.ML
changeset 11612 ae8450657bf0
parent 11539 0f17da240450
child 12002 bc9b5bad0e7b
equal deleted inserted replaced
11611:b0c69f4db64c 11612:ae8450657bf0
    15 structure ProofRewriteRules : PROOF_REWRITE_RULES =
    15 structure ProofRewriteRules : PROOF_REWRITE_RULES =
    16 struct
    16 struct
    17 
    17 
    18 open Proofterm;
    18 open Proofterm;
    19 
    19 
    20 fun rew _ (PThm (("ProtoPure.rev_triv_goal", _), _, _, _) %% _ %
    20 fun rew _ (PThm (("ProtoPure.rev_triv_goal", _), _, _, _) % _ %%
    21       (PThm (("ProtoPure.triv_goal", _), _, _, _) %% _ % prf)) = Some prf
    21       (PThm (("ProtoPure.triv_goal", _), _, _, _) % _ %% prf)) = Some prf
    22   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) %% _ %% _ %
    22   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) % _ % _ %%
    23       (PAxm ("ProtoPure.equal_intr", _, _) %% _ %% _ % prf % _)) = Some prf
    23       (PAxm ("ProtoPure.equal_intr", _, _) % _ % _ %% prf %% _)) = Some prf
    24   | rew _ (PAxm ("ProtoPure.symmetric", _, _) %% _ %% _ %
    24   | rew _ (PAxm ("ProtoPure.symmetric", _, _) % _ % _ %%
    25       (PAxm ("ProtoPure.equal_intr", _, _) %% A %% B % prf1 % prf2)) =
    25       (PAxm ("ProtoPure.equal_intr", _, _) % A % B %% prf1 %% prf2)) =
    26           Some (equal_intr_axm %% B %% A % prf2 % prf1)
    26           Some (equal_intr_axm % B % A %% prf2 %% prf1)
    27 
    27 
    28   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) %% Some X %% Some Y %
    28   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) % Some X % Some Y %%
    29       (PAxm ("ProtoPure.combination", _, _) %% _ %% _ %% _ %% _ %
    29       (PAxm ("ProtoPure.combination", _, _) % _ % _ % _ % _ %%
    30         (PAxm ("ProtoPure.combination", _, _) %% Some (Const ("==>", _)) %% _ %% _ %% _ %
    30         (PAxm ("ProtoPure.combination", _, _) % Some (Const ("==>", _)) % _ % _ % _ %%
    31            (PAxm ("ProtoPure.reflexive", _, _) %% _) % prf1) % prf2)) =
    31            (PAxm ("ProtoPure.reflexive", _, _) % _) %% prf1) %% prf2)) =
    32       let
    32       let
    33         val _ $ A $ C = Envir.beta_norm X;
    33         val _ $ A $ C = Envir.beta_norm X;
    34         val _ $ B $ D = Envir.beta_norm Y
    34         val _ $ B $ D = Envir.beta_norm Y
    35       in Some (AbsP ("H1", None, AbsP ("H2", None,
    35       in Some (AbsP ("H1", None, AbsP ("H2", None,
    36         equal_elim_axm %%% C %%% D % incr_pboundvars 2 0 prf2 %
    36         equal_elim_axm %> C %> D %% incr_pboundvars 2 0 prf2 %%
    37           (PBound 1 % (equal_elim_axm %%% B %%% A %
    37           (PBound 1 %% (equal_elim_axm %> B %> A %%
    38             (symmetric_axm %% None %% None % incr_pboundvars 2 0 prf1) % PBound 0)))))
    38             (symmetric_axm % None % None %% incr_pboundvars 2 0 prf1) %% PBound 0)))))
    39       end
    39       end
    40 
    40 
    41   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) %% Some X %% Some Y %
    41   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) % Some X % Some Y %%
    42       (PAxm ("ProtoPure.symmetric", _, _) %% _ %% _ %
    42       (PAxm ("ProtoPure.symmetric", _, _) % _ % _ %%
    43         (PAxm ("ProtoPure.combination", _, _) %% _ %% _ %% _ %% _ %
    43         (PAxm ("ProtoPure.combination", _, _) % _ % _ % _ % _ %%
    44           (PAxm ("ProtoPure.combination", _, _) %% Some (Const ("==>", _)) %% _ %% _ %% _ %
    44           (PAxm ("ProtoPure.combination", _, _) % Some (Const ("==>", _)) % _ % _ % _ %%
    45              (PAxm ("ProtoPure.reflexive", _, _) %% _) % prf1) % prf2))) =
    45              (PAxm ("ProtoPure.reflexive", _, _) % _) %% prf1) %% prf2))) =
    46       let
    46       let
    47         val _ $ A $ C = Envir.beta_norm Y;
    47         val _ $ A $ C = Envir.beta_norm Y;
    48         val _ $ B $ D = Envir.beta_norm X
    48         val _ $ B $ D = Envir.beta_norm X
    49       in Some (AbsP ("H1", None, AbsP ("H2", None,
    49       in Some (AbsP ("H1", None, AbsP ("H2", None,
    50         equal_elim_axm %%% D %%% C %
    50         equal_elim_axm %> D %> C %%
    51           (symmetric_axm %% None %% None % incr_pboundvars 2 0 prf2)
    51           (symmetric_axm % None % None %% incr_pboundvars 2 0 prf2)
    52             % (PBound 1 % (equal_elim_axm %%% A %%% B % incr_pboundvars 2 0 prf1 % PBound 0)))))
    52             %% (PBound 1 %% (equal_elim_axm %> A %> B %% incr_pboundvars 2 0 prf1 %% PBound 0)))))
    53       end
    53       end
    54 
    54 
    55   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) %% Some X %% Some Y %
    55   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) % Some X % Some Y %%
    56       (PAxm ("ProtoPure.combination", _, _) %% Some (Const ("all", _)) %% _ %% _ %% _ %
    56       (PAxm ("ProtoPure.combination", _, _) % Some (Const ("all", _)) % _ % _ % _ %%
    57         (PAxm ("ProtoPure.reflexive", _, _) %% _) %
    57         (PAxm ("ProtoPure.reflexive", _, _) % _) %%
    58           (PAxm ("ProtoPure.abstract_rule", _, _) %% _ %% _ % prf))) =
    58           (PAxm ("ProtoPure.abstract_rule", _, _) % _ % _ %% prf))) =
    59       let
    59       let
    60         val _ $ P = Envir.beta_norm X;
    60         val _ $ P = Envir.beta_norm X;
    61         val _ $ Q = Envir.beta_norm Y;
    61         val _ $ Q = Envir.beta_norm Y;
    62       in Some (AbsP ("H", None, Abst ("x", None,
    62       in Some (AbsP ("H", None, Abst ("x", None,
    63           equal_elim_axm %%% incr_boundvars 1 P $ Bound 0 %%% incr_boundvars 1 Q $ Bound 0 %
    63           equal_elim_axm %> incr_boundvars 1 P $ Bound 0 %> incr_boundvars 1 Q $ Bound 0 %%
    64             (incr_pboundvars 1 1 prf %%% Bound 0) % (PBound 0 %%% Bound 0))))
    64             (incr_pboundvars 1 1 prf %> Bound 0) %% (PBound 0 %> Bound 0))))
    65       end
    65       end
    66 
    66 
    67   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) %% Some X %% Some Y %
    67   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) % Some X % Some Y %%
    68       (PAxm ("ProtoPure.symmetric", _, _) %% _ %% _ %        
    68       (PAxm ("ProtoPure.symmetric", _, _) % _ % _ %%        
    69         (PAxm ("ProtoPure.combination", _, _) %% Some (Const ("all", _)) %% _ %% _ %% _ %
    69         (PAxm ("ProtoPure.combination", _, _) % Some (Const ("all", _)) % _ % _ % _ %%
    70           (PAxm ("ProtoPure.reflexive", _, _) %% _) %
    70           (PAxm ("ProtoPure.reflexive", _, _) % _) %%
    71             (PAxm ("ProtoPure.abstract_rule", _, _) %% _ %% _ % prf)))) =
    71             (PAxm ("ProtoPure.abstract_rule", _, _) % _ % _ %% prf)))) =
    72       let
    72       let
    73         val _ $ P = Envir.beta_norm X;
    73         val _ $ P = Envir.beta_norm X;
    74         val _ $ Q = Envir.beta_norm Y;
    74         val _ $ Q = Envir.beta_norm Y;
    75       in Some (AbsP ("H", None, Abst ("x", None,
    75       in Some (AbsP ("H", None, Abst ("x", None,
    76         equal_elim_axm %%% incr_boundvars 1 P $ Bound 0 %%% incr_boundvars 1 Q $ Bound 0 %
    76         equal_elim_axm %> incr_boundvars 1 P $ Bound 0 %> incr_boundvars 1 Q $ Bound 0 %%
    77           (symmetric_axm %% None %% None % (incr_pboundvars 1 1 prf %%% Bound 0))
    77           (symmetric_axm % None % None %% (incr_pboundvars 1 1 prf %> Bound 0))
    78             % (PBound 0 %%% Bound 0))))
    78             %% (PBound 0 %> Bound 0))))
    79       end
    79       end
    80 
    80 
    81   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) %% Some A %% Some C %
    81   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) % Some A % Some C %%
    82       (PAxm ("ProtoPure.transitive", _, _) %% _ %% Some B %% _ % prf1 % prf2) % prf3) =
    82       (PAxm ("ProtoPure.transitive", _, _) % _ % Some B % _ %% prf1 %% prf2) %% prf3) =
    83          Some (equal_elim_axm %%% B %%% C % prf2 %
    83          Some (equal_elim_axm %> B %> C %% prf2 %%
    84            (equal_elim_axm %%% A %%% B % prf1 % prf3))
    84            (equal_elim_axm %> A %> B %% prf1 %% prf3))
    85   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) %% Some A %% Some C %
    85   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) % Some A % Some C %%
    86       (PAxm ("ProtoPure.symmetric", _, _) %% _ %% _ %
    86       (PAxm ("ProtoPure.symmetric", _, _) % _ % _ %%
    87         (PAxm ("ProtoPure.transitive", _, _) %% _ %% Some B %% _ % prf1 % prf2)) % prf3) =
    87         (PAxm ("ProtoPure.transitive", _, _) % _ % Some B % _ %% prf1 %% prf2)) %% prf3) =
    88          Some (equal_elim_axm %%% B %%% C % (symmetric_axm %% None %% None % prf1) %
    88          Some (equal_elim_axm %> B %> C %% (symmetric_axm % None % None %% prf1) %%
    89            (equal_elim_axm %%% A %%% B % (symmetric_axm %% None %% None % prf2) % prf3))
    89            (equal_elim_axm %> A %> B %% (symmetric_axm % None % None %% prf2) %% prf3))
    90 
    90 
    91   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) %% _ %% _ %
    91   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) % _ % _ %%
    92       (PAxm ("ProtoPure.reflexive", _, _) %% _) % prf) = Some prf
    92       (PAxm ("ProtoPure.reflexive", _, _) % _) %% prf) = Some prf
    93   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) %% _ %% _ %
    93   | rew _ (PAxm ("ProtoPure.equal_elim", _, _) % _ % _ %%
    94       (PAxm ("ProtoPure.symmetric", _, _) %% _ %% _ %
    94       (PAxm ("ProtoPure.symmetric", _, _) % _ % _ %%
    95         (PAxm ("ProtoPure.reflexive", _, _) %% _)) % prf) = Some prf
    95         (PAxm ("ProtoPure.reflexive", _, _) % _)) %% prf) = Some prf
    96 
    96 
    97   | rew _ _ = None;
    97   | rew _ _ = None;
    98 
    98 
    99 val rprocs = [("Pure/meta_equality", rew)];
    99 val rprocs = [("Pure/meta_equality", rew)];
   100 
   100