aboutsummaryrefslogtreecommitdiff
path: root/spartan/lib/congruence.ML
blob: bb7348cd02a8a8542c4dba7918831924c08ce313 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
signature Sym_Attr_Data =
sig
  val name: string
  val symmetry_rule: thm
end

functor Sym_Attr (D: Sym_Attr_Data) =
struct
  local
    val distinct_prems = the_single o Seq.list_of o Tactic.distinct_subgoals_tac
  in
    val attr = Thm.rule_attribute []
      (K (fn th => distinct_prems (th RS D.symmetry_rule) handle THM _ => th))
    val setup = Attrib.setup (Binding.name D.name) (Scan.succeed attr) ""
  end
end