如何显示为nat,int等实例化的类型类?

时间:2014-02-16 22:41:09

标签: isabelle

我在带有instance+[ ]natinstantiation+[ ]nat的src / HOL文件夹上做了一个grep,也许我找到了所有已经为nat实例化的类型类。

由于我还要查看intratreal如何实例化,这很重要,如果有一个命令可以做到这一点很方便,例如{{1 },它将显示类型类的依赖项。

下面,我在输入print_dependencies时,只需查看命令完成下拉框,即可显示我找到的所有打印和可视化命令。

我还展示了print_的实例化,我在根文件夹src / HOL的文件中找到了这些实例,其中章节与HOL文档相对应。

nat

可视化和打印命令:

subsection {* Nat class instantiations *}
(*
Ch.15 Nat
  zero
  comm_monoid_diff
  comm_semiring_1_cancel
  linorder
  order_bot
  no_top
  linordered_semidom
  no_zero_divisors
  wellorder proof
  ordered_cancel_comm_monoid_diff
  distrib_lattice
Ch.37 Int
Ch.39 Divides
  semiring_numeral_div
Ch.42 Semiring_Normalization
  comm_semiring_1_cancel_crossproduct
Ch.72 Fact
  fact
Ch.73 Parity
  even_odd
Ch.74 GCD
  gcd
  Gcd
*)

1 个答案:

答案 0 :(得分:2)

Isabelle中的print_classes命令还列出了所有已定义的类,以及已将哪些类型实例化到类中。将输出复制到文件中,并通过grep命令运行它:

grep -F 'nat ::'

给出了nat已被实例化的类的列表,这是一个相当长的列表:

nat :: ab_semigroup_add
nat :: ab_semigroup_mult
nat :: bot
nat :: cancel_ab_semigroup_add
nat :: cancel_comm_monoid_add
nat :: cancel_semigroup_add
nat :: card_UNIV
nat :: comm_monoid_add
nat :: comm_monoid_diff
nat :: comm_monoid_mult
nat :: comm_semiring
nat :: comm_semiring_0
nat :: comm_semiring_0_cancel
nat :: comm_semiring_1
nat :: comm_semiring_1_cancel
nat :: comm_semiring_1_cancel_crossproduct
nat :: distrib_lattice
nat :: div
nat :: dvd
nat :: enum_alt
nat :: enumeration_alt
nat :: equal
nat :: even_odd
nat :: exhaustive
nat :: finite_UNIV
nat :: full_exhaustive
nat :: inf
nat :: lattice
nat :: linorder
nat :: linordered_ab_semigroup_add
nat :: linordered_cancel_ab_semigroup_add
nat :: linordered_comm_semiring_strict
nat :: linordered_semidom
nat :: linordered_semiring
nat :: linordered_semiring_strict
nat :: minus
nat :: monoid_add
nat :: monoid_mult
nat :: mult_zero
nat :: narrowing
nat :: no_top
nat :: no_zero_divisors
nat :: numeral
nat :: one
nat :: ord
nat :: order
nat :: order_bot
nat :: ordered_ab_semigroup_add
nat :: ordered_ab_semigroup_add_imp_le
nat :: ordered_cancel_ab_semigroup_add
nat :: ordered_cancel_comm_monoid_diff
nat :: ordered_cancel_comm_semiring
nat :: ordered_cancel_semiring
nat :: ordered_comm_monoid_add
nat :: ordered_comm_semiring
nat :: ordered_semiring
nat :: partial_term_of
nat :: plus
nat :: power
nat :: preorder
nat :: random
nat :: semigroup_add
nat :: semigroup_mult
nat :: semilattice_inf
nat :: semilattice_sup
nat :: semiring
nat :: semiring_0
nat :: semiring_0_cancel
nat :: semiring_1
nat :: semiring_1_cancel
nat :: semiring_char_0
nat :: semiring_div
nat :: semiring_numeral
nat :: semiring_numeral_div
nat :: size
nat :: sup
nat :: term_of
nat :: times
nat :: type
nat :: typerep
nat :: wellorder
nat :: zero
nat :: zero_neq_one

根据需要。