quotient_info.ML
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Fri, 27 Nov 2009 08:15:23 +0100
changeset 416 3f3927f793d4
parent 406 f32237ef18a6
child 450 2dc708ddb93a
permissions -rw-r--r--
Removing arguments of tactics: absrep, rel_refl, reps_same are computed.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
signature QUOTIENT_INFO =
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
sig
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
  type maps_info = {mapfun: string, relfun: string}
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
  val maps_lookup: theory -> string -> maps_info option
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
  val maps_update_thy: string -> maps_info -> theory -> theory    
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
  val maps_update: string -> maps_info -> Proof.context -> Proof.context     
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
  type quotient_info = {qtyp: typ, rtyp: typ, rel: term, equiv_thm: thm}
310
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
     9
  val print_quotinfo: Proof.context -> unit
311
77fc6f3c0343 changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents: 310
diff changeset
    10
  val quotdata_lookup_thy: theory -> string -> quotient_info option
77fc6f3c0343 changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents: 310
diff changeset
    11
  val quotdata_lookup: Proof.context -> string -> quotient_info option
77fc6f3c0343 changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents: 310
diff changeset
    12
  val quotdata_update_thy: string -> (typ * typ * term * thm) -> theory -> theory
77fc6f3c0343 changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents: 310
diff changeset
    13
  val quotdata_update: string -> (typ * typ * term * thm) -> Proof.context -> Proof.context
268
4d58c02289ca simplified the quotient_def code; type of the defined constant must now be given; for-part eliminated
Christian Urban <urbanc@in.tum.de>
parents: 264
diff changeset
    14
310
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
    15
  type qconsts_info = {qconst: term, rconst: term}
318
746b17e1d6d8 fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents: 314
diff changeset
    16
  val qconsts_transfer: morphism -> qconsts_info -> qconsts_info
310
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
    17
  val qconsts_lookup: theory -> string -> qconsts_info option
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
    18
  val qconsts_update_thy: string -> qconsts_info -> theory -> theory    
321
f46dc0ca08c3 simplified get_fun so that it uses directly rty and qty, instead of qenv
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
    19
  val qconsts_update_gen: string -> qconsts_info -> Context.generic -> Context.generic 
310
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
    20
  val print_qconstinfo: Proof.context -> unit
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
end;
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
structure Quotient_Info: QUOTIENT_INFO =
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
struct
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
268
4d58c02289ca simplified the quotient_def code; type of the defined constant must now be given; for-part eliminated
Christian Urban <urbanc@in.tum.de>
parents: 264
diff changeset
    26
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
(* data containers *)
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
(*******************)
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
(* info about map- and rel-functions *)
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
type maps_info = {mapfun: string, relfun: string}
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
306
e7279efbe3dd updated to new Theory_Data and to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents: 268
diff changeset
    33
structure MapsData = Theory_Data
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
  (type T = maps_info Symtab.table
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
   val empty = Symtab.empty
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
   val extend = I
306
e7279efbe3dd updated to new Theory_Data and to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents: 268
diff changeset
    37
   val merge = Symtab.merge (K true))
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
val maps_lookup = Symtab.lookup o MapsData.get
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
fun maps_update_thy k minfo = MapsData.map (Symtab.update (k, minfo))
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
fun maps_update k minfo = ProofContext.theory (maps_update_thy k minfo)
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
fun maps_attribute_aux s minfo = Thm.declaration_attribute 
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
  (fn thm => Context.mapping (maps_update_thy s minfo) (maps_update s minfo))
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
(* attribute to be used in declare statements *)
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
fun maps_attribute (ctxt, (tystr, (mapstr, relstr))) = 
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
let  
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
  val thy = ProofContext.theory_of ctxt
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
  val tyname = Sign.intern_type thy tystr
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
  val mapname = Sign.intern_const thy mapstr
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
  val relname = Sign.intern_const thy relstr
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
in
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
  maps_attribute_aux tyname {mapfun = mapname, relfun = relname}
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
end
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
val maps_attr_parser = 
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
      Args.context -- Scan.lift
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
       ((Args.name --| OuterParse.$$$ "=") -- 
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
         (OuterParse.$$$ "(" |-- Args.name --| OuterParse.$$$ "," -- 
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
           Args.name --| OuterParse.$$$ ")"))
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
val _ = Context.>> (Context.map_theory
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
         (Attrib.setup @{binding "map"} (maps_attr_parser >> maps_attribute) 
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
           "declaration of map information"))
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
329
5d06e1dba69a slight tuning
Christian Urban <urbanc@in.tum.de>
parents: 324
diff changeset
    69
(* info about quotient types *)
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
type quotient_info = {qtyp: typ, rtyp: typ, rel: term, equiv_thm: thm}
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
306
e7279efbe3dd updated to new Theory_Data and to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents: 268
diff changeset
    72
structure QuotData = Theory_Data
311
77fc6f3c0343 changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents: 310
diff changeset
    73
  (type T = quotient_info Symtab.table
77fc6f3c0343 changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents: 310
diff changeset
    74
   val empty = Symtab.empty
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
   val extend = I
311
77fc6f3c0343 changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents: 310
diff changeset
    76
   val merge = Symtab.merge (K true)) 
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
320
7d3d86beacd6 started regularize of rtrm/qtrm version; looks quite promising
Christian Urban <urbanc@in.tum.de>
parents: 318
diff changeset
    78
fun quotdata_lookup_thy thy str = 
7d3d86beacd6 started regularize of rtrm/qtrm version; looks quite promising
Christian Urban <urbanc@in.tum.de>
parents: 318
diff changeset
    79
    Symtab.lookup (QuotData.get thy) (Sign.intern_type thy str)
7d3d86beacd6 started regularize of rtrm/qtrm version; looks quite promising
Christian Urban <urbanc@in.tum.de>
parents: 318
diff changeset
    80
311
77fc6f3c0343 changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents: 310
diff changeset
    81
val quotdata_lookup = quotdata_lookup_thy o ProofContext.theory_of
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
314
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 311
diff changeset
    83
fun quotdata_update_thy qty_name (qty, rty, rel, equiv_thm) =
311
77fc6f3c0343 changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents: 310
diff changeset
    84
      QuotData.map (Symtab.update (qty_name, {qtyp = qty, rtyp = rty, rel = rel, equiv_thm = equiv_thm}))
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
311
77fc6f3c0343 changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents: 310
diff changeset
    86
fun quotdata_update qty_name (qty, rty, rel, equiv_thm) = 
77fc6f3c0343 changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents: 310
diff changeset
    87
      ProofContext.theory (quotdata_update_thy qty_name (qty, rty, rel, equiv_thm))
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
310
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
    89
fun print_quotinfo ctxt =
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
let
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
  fun prt_quot {qtyp, rtyp, rel, equiv_thm} = 
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
      Pretty.block (Library.separate (Pretty.brk 2)
324
Christian Urban <urbanc@in.tum.de>
parents: 322
diff changeset
    93
          [Pretty.str "quotient type:", 
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
           Syntax.pretty_typ ctxt qtyp,
324
Christian Urban <urbanc@in.tum.de>
parents: 322
diff changeset
    95
           Pretty.str "raw type:", 
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
           Syntax.pretty_typ ctxt rtyp,
324
Christian Urban <urbanc@in.tum.de>
parents: 322
diff changeset
    97
           Pretty.str "relation:", 
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
           Syntax.pretty_term ctxt rel,
324
Christian Urban <urbanc@in.tum.de>
parents: 322
diff changeset
    99
           Pretty.str "equiv. thm:", 
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
           Syntax.pretty_term ctxt (prop_of equiv_thm)])
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
in
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
  QuotData.get (ProofContext.theory_of ctxt)
311
77fc6f3c0343 changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents: 310
diff changeset
   103
  |> Symtab.dest
77fc6f3c0343 changed the quotdata to be a symtab table (needs fixing)
Christian Urban <urbanc@in.tum.de>
parents: 310
diff changeset
   104
  |> map (prt_quot o snd)
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
  |> Pretty.big_list "quotients:" 
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
  |> Pretty.writeln
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
end
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
val _ = 
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
  OuterSyntax.improper_command "print_quotients" "print out all quotients" 
310
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   111
    OuterKeyword.diag (Scan.succeed (Toplevel.keep (print_quotinfo o Toplevel.context_of)))
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
268
4d58c02289ca simplified the quotient_def code; type of the defined constant must now be given; for-part eliminated
Christian Urban <urbanc@in.tum.de>
parents: 264
diff changeset
   113
310
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   114
(* information about quotient constants *)
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   115
type qconsts_info = {qconst: term, rconst: term}
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   116
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   117
structure QConstsData = Theory_Data
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   118
  (type T = qconsts_info Symtab.table
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   119
   val empty = Symtab.empty
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   120
   val extend = I
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   121
   val merge = Symtab.merge (K true))
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   122
318
746b17e1d6d8 fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents: 314
diff changeset
   123
fun qconsts_transfer phi {qconst, rconst} =
746b17e1d6d8 fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents: 314
diff changeset
   124
    {qconst = Morphism.term phi qconst,
746b17e1d6d8 fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents: 314
diff changeset
   125
     rconst = Morphism.term phi rconst}
746b17e1d6d8 fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents: 314
diff changeset
   126
310
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   127
val qconsts_lookup = Symtab.lookup o QConstsData.get
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   128
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   129
fun qconsts_update_thy k qcinfo = QConstsData.map (Symtab.update (k, qcinfo))
324
Christian Urban <urbanc@in.tum.de>
parents: 322
diff changeset
   130
fun qconsts_update_gen k qcinfo = Context.mapping (qconsts_update_thy k qcinfo) I
310
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   131
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   132
fun print_qconstinfo ctxt =
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   133
let
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   134
  fun prt_qconst {qconst, rconst} = 
318
746b17e1d6d8 fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents: 314
diff changeset
   135
      Pretty.block (separate (Pretty.brk 1)
310
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   136
          [Syntax.pretty_term ctxt qconst,
318
746b17e1d6d8 fixed the storage of qconst definitions
Christian Urban <urbanc@in.tum.de>
parents: 314
diff changeset
   137
           Pretty.str ":=",
310
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   138
           Syntax.pretty_term ctxt rconst])
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   139
in
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   140
  QConstsData.get (ProofContext.theory_of ctxt)
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   141
  |> Symtab.dest
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   142
  |> map (prt_qconst o snd)
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   143
  |> Pretty.big_list "quotient constants:" 
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   144
  |> Pretty.writeln
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   145
end
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   146
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   147
val _ = 
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   148
  OuterSyntax.improper_command "print_quotconsts" "print out all quotient constants" 
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   149
    OuterKeyword.diag (Scan.succeed (Toplevel.keep (print_qconstinfo o Toplevel.context_of)))
fec6301a1989 added a container for quotient constants (does not work yet though)
Christian Urban <urbanc@in.tum.de>
parents: 306
diff changeset
   150
264
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   151
end; (* structure *)
d0581fbc096c split quotient.ML into two files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
314
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 311
diff changeset
   153
open Quotient_Info