src/Pure/Isar/isar_syn.ML
changeset 8464 0f78101b249a
parent 8454 fff900f59153
child 8500 efa136cbde29
equal deleted inserted replaced
8463:56949c077bd5 8464:0f78101b249a
   296 
   296 
   297 val thenP =
   297 val thenP =
   298   OuterSyntax.command "then" "forward chaining" K.prf_chain
   298   OuterSyntax.command "then" "forward chaining" K.prf_chain
   299     (P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.chain)));
   299     (P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.chain)));
   300 
   300 
   301 val thenceP =
       
   302   OuterSyntax.command "thence" "forward chaining, including full export (EXPERIMENTAL!)" K.prf_chain
       
   303     (P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.export_chain)));
       
   304 
       
   305 val fromP =
   301 val fromP =
   306   OuterSyntax.command "from" "forward chaining from given facts" K.prf_chain
   302   OuterSyntax.command "from" "forward chaining from given facts" K.prf_chain
   307     (P.xthms1 -- P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.from_facts)));
   303     (P.xthms1 -- P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.from_facts)));
   308 
   304 
   309 val withP =
   305 val withP =
   466 
   462 
   467 
   463 
   468 
   464 
   469 (** diagnostic commands (for interactive mode only) **)
   465 (** diagnostic commands (for interactive mode only) **)
   470 
   466 
       
   467 val opt_modes = Scan.optional (P.$$$ "(" |-- P.!!! (Scan.repeat1 P.xname --| P.$$$ ")")) [];
       
   468 
       
   469 
   471 val pretty_setmarginP =
   470 val pretty_setmarginP =
   472   OuterSyntax.improper_command "pretty_setmargin" "change default margin for pretty printing"
   471   OuterSyntax.improper_command "pretty_setmargin" "change default margin for pretty printing"
   473     K.diag (P.nat >> IsarCmd.pretty_setmargin);
   472     K.diag (P.nat >> IsarCmd.pretty_setmargin);
   474 
   473 
   475 val print_commandsP =
   474 val print_commandsP =
   515 val print_casesP =
   514 val print_casesP =
   516   OuterSyntax.improper_command "print_cases" "print cases of proof context" K.diag
   515   OuterSyntax.improper_command "print_cases" "print cases of proof context" K.diag
   517     (Scan.succeed IsarCmd.print_cases);
   516     (Scan.succeed IsarCmd.print_cases);
   518 
   517 
   519 val print_thmsP =
   518 val print_thmsP =
   520   OuterSyntax.improper_command "thm" "print theorems" K.diag (P.xthms1 >> IsarCmd.print_thms);
   519   OuterSyntax.improper_command "thm" "print theorems" K.diag
       
   520     (opt_modes -- P.xthms1 >> IsarCmd.print_thms);
   521 
   521 
   522 val print_propP =
   522 val print_propP =
   523   OuterSyntax.improper_command "prop" "read and print proposition" K.diag
   523   OuterSyntax.improper_command "prop" "read and print proposition" K.diag
   524     (P.term >> IsarCmd.print_prop);
   524     (opt_modes -- P.term >> IsarCmd.print_prop);
   525 
   525 
   526 val print_termP =
   526 val print_termP =
   527   OuterSyntax.improper_command "term" "read and print term" K.diag
   527   OuterSyntax.improper_command "term" "read and print term" K.diag
   528     (P.term >> IsarCmd.print_term);
   528     (opt_modes -- P.term >> IsarCmd.print_term);
   529 
   529 
   530 val print_typeP =
   530 val print_typeP =
   531   OuterSyntax.improper_command "typ" "read and print type" K.diag
   531   OuterSyntax.improper_command "typ" "read and print type" K.diag
   532     (P.typ >> IsarCmd.print_type);
   532     (opt_modes -- P.typ >> IsarCmd.print_type);
   533 
   533 
   534 
   534 
   535 
   535 
   536 (** system commands (for interactive mode only) **)
   536 (** system commands (for interactive mode only) **)
   537 
   537 
   579   OuterSyntax.improper_command "kill_thy" "kill theory -- try to remove from loader database"
   579   OuterSyntax.improper_command "kill_thy" "kill theory -- try to remove from loader database"
   580     K.diag (P.name >> IsarCmd.kill_thy);
   580     K.diag (P.name >> IsarCmd.kill_thy);
   581 
   581 
   582 val prP =
   582 val prP =
   583   OuterSyntax.improper_command "pr" "print current toplevel state" K.diag
   583   OuterSyntax.improper_command "pr" "print current toplevel state" K.diag
   584     (Scan.option P.nat >> (Toplevel.print oo IsarCmd.pr));
   584     (opt_modes -- Scan.option P.nat >> IsarCmd.pr);
   585 
   585 
   586 val disable_prP =
   586 val disable_prP =
   587   OuterSyntax.improper_command "disable_pr" "disable printing of toplevel state" K.diag
   587   OuterSyntax.improper_command "disable_pr" "disable printing of toplevel state" K.diag
   588     (Scan.succeed IsarCmd.disable_pr);
   588     (Scan.succeed IsarCmd.disable_pr);
   589 
   589 
   637   ml_commandP, ml_setupP, setupP, parse_ast_translationP,
   637   ml_commandP, ml_setupP, setupP, parse_ast_translationP,
   638   parse_translationP, print_translationP, typed_print_translationP,
   638   parse_translationP, print_translationP, typed_print_translationP,
   639   print_ast_translationP, token_translationP, oracleP,
   639   print_ast_translationP, token_translationP, oracleP,
   640   (*proof commands*)
   640   (*proof commands*)
   641   theoremP, lemmaP, showP, haveP, thusP, henceP, assumeP, presumeP,
   641   theoremP, lemmaP, showP, haveP, thusP, henceP, assumeP, presumeP,
   642   defP, fixP, letP, caseP, thenP, thenceP, fromP, withP, noteP,
   642   defP, fixP, letP, caseP, thenP, fromP, withP, noteP, beginP, endP,
   643   beginP, endP, nextP, qedP, terminal_proofP, immediate_proofP,
   643   nextP, qedP, terminal_proofP, immediate_proofP, default_proofP,
   644   default_proofP, skip_proofP, forget_proofP, deferP, preferP, applyP,
   644   skip_proofP, forget_proofP, deferP, preferP, applyP, apply_endP,
   645   apply_endP, proofP, alsoP, finallyP, backP, cannot_undoP,
   645   proofP, alsoP, finallyP, backP, cannot_undoP, clear_undosP, redoP,
   646   clear_undosP, redoP, undos_proofP, kill_proofP, undoP,
   646   undos_proofP, kill_proofP, undoP,
   647   (*diagnostic commands*)
   647   (*diagnostic commands*)
   648   pretty_setmarginP, print_commandsP, print_contextP, print_theoryP,
   648   pretty_setmarginP, print_commandsP, print_contextP, print_theoryP,
   649   print_syntaxP, print_theoremsP, print_attributesP, print_methodsP,
   649   print_syntaxP, print_theoremsP, print_attributesP, print_methodsP,
   650   thms_containingP, print_bindsP, print_lthmsP, print_casesP,
   650   thms_containingP, print_bindsP, print_lthmsP, print_casesP,
   651   print_thmsP, print_propP, print_termP, print_typeP,
   651   print_thmsP, print_propP, print_termP, print_typeP,