doc-src/IsarRef/Thy/HOL_Specific.thy
changeset 46447 f37da60a8cc6
parent 46028 9f113cdf3d66
child 46448 f1201fac7398
equal deleted inserted replaced
46446:45ff234921a3 46447:f37da60a8cc6
  1261     @{command_def (HOL) "quotient_type"} & : & @{text "local_theory \<rightarrow> proof(prove)"}\\
  1261     @{command_def (HOL) "quotient_type"} & : & @{text "local_theory \<rightarrow> proof(prove)"}\\
  1262     @{command_def (HOL) "quotient_definition"} & : & @{text "local_theory \<rightarrow> proof(prove)"}\\
  1262     @{command_def (HOL) "quotient_definition"} & : & @{text "local_theory \<rightarrow> proof(prove)"}\\
  1263     @{command_def (HOL) "print_quotmaps"} & : & @{text "context \<rightarrow>"}\\
  1263     @{command_def (HOL) "print_quotmaps"} & : & @{text "context \<rightarrow>"}\\
  1264     @{command_def (HOL) "print_quotients"} & : & @{text "context \<rightarrow>"}\\
  1264     @{command_def (HOL) "print_quotients"} & : & @{text "context \<rightarrow>"}\\
  1265     @{command_def (HOL) "print_quotconsts"} & : & @{text "context \<rightarrow>"}\\
  1265     @{command_def (HOL) "print_quotconsts"} & : & @{text "context \<rightarrow>"}\\
       
  1266     @{method_def (HOL) "lifting"} & : & @{text method} \\
       
  1267     @{method_def (HOL) "lifting_setup"} & : & @{text method} \\
       
  1268     @{method_def (HOL) "descending"} & : & @{text method} \\
       
  1269     @{method_def (HOL) "descending_setup"} & : & @{text method} \\
       
  1270     @{method_def (HOL) "partiality_descending"} & : & @{text method} \\
       
  1271     @{method_def (HOL) "partiality_descending_setup"} & : & @{text method} \\
       
  1272     @{method_def (HOL) "regularize"} & : & @{text method} \\
       
  1273     @{method_def (HOL) "injection"} & : & @{text method} \\
       
  1274     @{method_def (HOL) "cleaning"} & : & @{text method} \\
       
  1275     @{attribute_def (HOL) "quot_lifted"} & : & @{text attribute} \\
       
  1276     @{attribute_def (HOL) "quot_respect"} & : & @{text attribute} \\
       
  1277     @{attribute_def (HOL) "quot_preserve"} & : & @{text attribute} \\
  1266   \end{matharray}
  1278   \end{matharray}
  1267 
  1279 
  1268   @{rail "
  1280   @{rail "
  1269     @@{command (HOL) quotient_type} (spec + @'and');
  1281     @@{command (HOL) quotient_type} (spec + @'and');
  1270 
  1282 
  1274   "}
  1286   "}
  1275 
  1287 
  1276   @{rail "
  1288   @{rail "
  1277     @@{command (HOL) quotient_definition} constdecl? @{syntax thmdecl}? \\
  1289     @@{command (HOL) quotient_definition} constdecl? @{syntax thmdecl}? \\
  1278     @{syntax term} 'is' @{syntax term};
  1290     @{syntax term} 'is' @{syntax term};
  1279  
  1291 
  1280     constdecl: @{syntax name} ('::' @{syntax type})? @{syntax mixfix}?
  1292     constdecl: @{syntax name} ('::' @{syntax type})? @{syntax mixfix}?
  1281   "}
  1293   "}
  1282 
  1294 
       
  1295   @{rail "
       
  1296     @@{method (HOL) lifting} @{syntax thmrefs}?
       
  1297     ;
       
  1298 
       
  1299     @@{method (HOL) lifting_setup} @{syntax thmrefs}?
       
  1300     ;
       
  1301   "}
       
  1302 
  1283   \begin{description}
  1303   \begin{description}
  1284   
  1304 
  1285   \item @{command (HOL) "quotient_type"} defines quotient types. The injection from a quotient type 
  1305   \item @{command (HOL) "quotient_type"} defines quotient types. The injection from a quotient type 
  1286   to a raw type is called @{text rep_t}, its inverse @{text abs_t} unless explicit @{keyword (HOL)
  1306   to a raw type is called @{text rep_t}, its inverse @{text abs_t} unless explicit @{keyword (HOL)
  1287   "morphisms"} specification provides alternative names.
  1307   "morphisms"} specification provides alternative names. @{command (HOL) "quotient_type"} requires
       
  1308   the user to prove that the relation is an equivalence relation (predicate @{text equivp}), unless
       
  1309   the user specifies explicitely @{text partial} in which case the obligation is @{text part_equivp}.
       
  1310   A quotient defined with @{text partial} is weaker in the sense that less things can be proved
       
  1311   automatically.
  1288 
  1312 
  1289   \item @{command (HOL) "quotient_definition"} defines a constant on the quotient type.
  1313   \item @{command (HOL) "quotient_definition"} defines a constant on the quotient type.
  1290 
  1314 
  1291   \item @{command (HOL) "print_quotmaps"} prints quotient map functions.
  1315   \item @{command (HOL) "print_quotmaps"} prints quotient map functions.
  1292 
  1316 
  1293   \item @{command (HOL) "print_quotients"} prints quotients.
  1317   \item @{command (HOL) "print_quotients"} prints quotients.
  1294 
  1318 
  1295   \item @{command (HOL) "print_quotconsts"} prints quotient constants.
  1319   \item @{command (HOL) "print_quotconsts"} prints quotient constants.
       
  1320 
       
  1321   \item @{method (HOL) "lifting"} and @{method (HOL) "lifting_setup"}
       
  1322     methods match the current goal with the given raw theorem to be
       
  1323     lifted producing three new subgoals: regularization, injection and
       
  1324     cleaning subgoals. @{method (HOL) "lifting"} tries to apply the
       
  1325     heuristics for automatically solving these three subgoals and
       
  1326     leaves only the subgoals unsolved by the heuristics to the user as
       
  1327     opposed to @{method (HOL) "lifting_setup"} which leaves the three
       
  1328     subgoals unsolved.
       
  1329 
       
  1330   \item @{method (HOL) "descending"} and @{method (HOL)
       
  1331     "descending_setup"} try to guess a raw statement that would lift
       
  1332     to the current subgoal. Such statement is assumed as a new subgoal
       
  1333     and @{method (HOL) "descending"} continues in the same way as
       
  1334     @{method (HOL) "lifting"} does. @{method (HOL) "descending"} tries
       
  1335     to solve the arising regularization, injection and cleaning
       
  1336     subgoals with the analoguous method @{method (HOL)
       
  1337     "descending_setup"} which leaves the four unsolved subgoals.
       
  1338 
       
  1339   \item @{method (HOL) "partiality_descending"} finds the regularized
       
  1340     theorem that would lift to the current subgoal, lifts it and
       
  1341     leaves as a subgoal. This method can be used with partial
       
  1342     equivalence quotients where the non regularized statements would
       
  1343     not be true. @{method (HOL) "partiality_descending_setup"} leaves
       
  1344     the injection and cleaning subgoals unchanged.
       
  1345 
       
  1346   \item @{method (HOL) "regularize"} applies the regularization
       
  1347     heuristics to the current subgoal.
       
  1348 
       
  1349   \item @{method (HOL) "injection"} applies the injection heuristics
       
  1350     to the current goal using the stored quotient respectfulness
       
  1351     theorems.
       
  1352 
       
  1353   \item @{method (HOL) "cleaning"} applies the injection cleaning
       
  1354     heuristics to the current subgoal using the stored quotient
       
  1355     preservation theorems.
       
  1356 
       
  1357   \item @{attribute (HOL) quot_lifted} attribute tries to
       
  1358     automatically transport the theorem to the quotient type.
       
  1359     The attribute uses all the defined quotients types and quotient
       
  1360     constants often producing undesired results or theorems that
       
  1361     cannot be lifted.
       
  1362 
       
  1363   \item @{attribute (HOL) quot_respect} and @{attribute (HOL)
       
  1364     quot_preserve} attributes declare a theorem as a respectfulness
       
  1365     and preservation theorem respectively.  These are stored in the
       
  1366     local theory store and used by the @{method (HOL) "injection"}
       
  1367     and @{method (HOL) "cleaning"} methods respectively.
  1296 
  1368 
  1297   \end{description}
  1369   \end{description}
  1298 
  1370 
  1299 *}
  1371 *}
  1300 
  1372