src/FOLP/simp.ML
changeset 42364 8c674b3b8e44
parent 42284 326f57825e1a
child 44121 44adaa6db327
equal deleted inserted replaced
42363:e52e3f697510 42364:8c674b3b8e44
    81 fun lhs_net_tac net =
    81 fun lhs_net_tac net =
    82   SUBGOAL(fn (prem,i) =>
    82   SUBGOAL(fn (prem,i) =>
    83           biresolve_tac (Net.unify_term net
    83           biresolve_tac (Net.unify_term net
    84                        (lhs_of (Logic.strip_assums_concl prem))) i);
    84                        (lhs_of (Logic.strip_assums_concl prem))) i);
    85 
    85 
    86 fun nth_subgoal i thm = List.nth(prems_of thm,i-1);
    86 fun nth_subgoal i thm = nth (prems_of thm) (i - 1);
    87 
    87 
    88 fun goal_concl i thm = Logic.strip_assums_concl (nth_subgoal i thm);
    88 fun goal_concl i thm = Logic.strip_assums_concl (nth_subgoal i thm);
    89 
    89 
    90 fun lhs_of_eq i thm = lhs_of(goal_concl i thm)
    90 fun lhs_of_eq i thm = lhs_of(goal_concl i thm)
    91 and rhs_of_eq i thm = rhs_of(goal_concl i thm);
    91 and rhs_of_eq i thm = rhs_of(goal_concl i thm);
   420     else case Seq.pull(cong_tac i thm) of
   420     else case Seq.pull(cong_tac i thm) of
   421             SOME(thm',_) =>
   421             SOME(thm',_) =>
   422                     let val ps = prems_of thm
   422                     let val ps = prems_of thm
   423                         and ps' = prems_of thm';
   423                         and ps' = prems_of thm';
   424                         val n = length(ps')-length(ps);
   424                         val n = length(ps')-length(ps);
   425                         val a = length(Logic.strip_assums_hyp(List.nth(ps,i-1)))
   425                         val a = length(Logic.strip_assums_hyp(nth ps (i - 1)))
   426                         val l = map (length o Logic.strip_assums_hyp) (take n (drop (i-1) ps'));
   426                         val l = map (length o Logic.strip_assums_hyp) (take n (drop (i-1) ps'));
   427                     in (simp_refl(rev(l),a,REW::ss),thm',anet,ats,cs) end
   427                     in (simp_refl(rev(l),a,REW::ss),thm',anet,ats,cs) end
   428           | NONE => (REW::ss,thm,anet,ats,cs);
   428           | NONE => (REW::ss,thm,anet,ats,cs);
   429 
   429 
   430 (*NB: the "Adding rewrites:" trace will look strange because assumptions
   430 (*NB: the "Adding rewrites:" trace will look strange because assumptions