src/HOL/Statespace/distinct_tree_prover.ML
changeset 38549 d0385f2764d8
parent 36943 ae740b96b914
child 38558 32ad17fe2b9c
equal deleted inserted replaced
38548:dea0d2cca822 38549:d0385f2764d8
   341     val thm = distinctTreeProver dist_thm x_path y_path;
   341     val thm = distinctTreeProver dist_thm x_path y_path;
   342   in SOME thm  
   342   in SOME thm  
   343   end handle Option => NONE)
   343   end handle Option => NONE)
   344 
   344 
   345 fun distinctTree_tac names ctxt 
   345 fun distinctTree_tac names ctxt 
   346       (Const ("Trueprop",_) $ (Const ("Not", _) $ (Const ("op =", _) $ x $ y)), i) =
   346       (Const (@{const_name "Trueprop"},_) $ (Const (@{const_name "Not"}, _) $ (Const (@{const_name "op ="}, _) $ x $ y)), i) =
   347   (case get_fst_success (neq_x_y ctxt x y) names of
   347   (case get_fst_success (neq_x_y ctxt x y) names of
   348      SOME neq => rtac neq i
   348      SOME neq => rtac neq i
   349    | NONE => no_tac)
   349    | NONE => no_tac)
   350   | distinctTree_tac _ _ _ = no_tac;
   350   | distinctTree_tac _ _ _ = no_tac;
   351 
   351 
   354                  SOME ctxt => SUBGOAL (distinctTree_tac names ctxt)
   354                  SOME ctxt => SUBGOAL (distinctTree_tac names ctxt)
   355                 | NONE => fn i => no_tac)
   355                 | NONE => fn i => no_tac)
   356 
   356 
   357 fun distinct_simproc names =
   357 fun distinct_simproc names =
   358   Simplifier.simproc @{theory HOL} "DistinctTreeProver.distinct_simproc" ["x = y"]
   358   Simplifier.simproc @{theory HOL} "DistinctTreeProver.distinct_simproc" ["x = y"]
   359     (fn thy => fn ss => fn (Const ("op =",_)$x$y) =>
   359     (fn thy => fn ss => fn (Const (@{const_name "op ="},_)$x$y) =>
   360         case try Simplifier.the_context ss of
   360         case try Simplifier.the_context ss of
   361         SOME ctxt => Option.map (fn neq => neq_to_eq_False OF [neq]) 
   361         SOME ctxt => Option.map (fn neq => neq_to_eq_False OF [neq]) 
   362                       (get_fst_success (neq_x_y ctxt x y) names)
   362                       (get_fst_success (neq_x_y ctxt x y) names)
   363        | NONE => NONE
   363        | NONE => NONE
   364     )
   364     )