equal
deleted
inserted
replaced
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 ) |