781 \begin{matharray}{rcl} |
781 \begin{matharray}{rcl} |
782 @{method_def (HOL) iprover} & : & @{text method} \\ |
782 @{method_def (HOL) iprover} & : & @{text method} \\ |
783 \end{matharray} |
783 \end{matharray} |
784 |
784 |
785 \begin{rail} |
785 \begin{rail} |
786 'iprover' ('!' ?) (rulemod *) |
786 'iprover' ('!' ?) ( rulemod * ) |
787 ; |
787 ; |
788 \end{rail} |
788 \end{rail} |
789 |
789 |
790 The @{method (HOL) iprover} method performs intuitionistic proof |
790 The @{method (HOL) iprover} method performs intuitionistic proof |
791 search, depending on specifically declared rules from the context, |
791 search, depending on specifically declared rules from the context, |
822 geometry. See @{"file" "~~/src/HOL/ex/Coherent.thy"} for some |
822 geometry. See @{"file" "~~/src/HOL/ex/Coherent.thy"} for some |
823 examples. |
823 examples. |
824 *} |
824 *} |
825 |
825 |
826 |
826 |
|
827 section {* Checking and refuting propositions *} |
|
828 |
|
829 text {* |
|
830 Identifying incorrect propositions usually involves evaluation of |
|
831 particular assignments and systematic counter example search. This |
|
832 is supported by the following commands. |
|
833 |
|
834 \begin{matharray}{rcl} |
|
835 @{command_def (HOL) "value"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\ |
|
836 @{command_def (HOL) "quickcheck"}@{text "\<^sup>*"} & : & @{text "proof \<rightarrow>"} \\ |
|
837 @{command_def (HOL) "quickcheck_params"} & : & @{text "theory \<rightarrow> theory"} |
|
838 \end{matharray} |
|
839 |
|
840 \begin{rail} |
|
841 'value' ( ( '[' name ']' ) ? ) modes? term |
|
842 ; |
|
843 |
|
844 'quickcheck' ( ( '[' args ']' ) ? ) nat? |
|
845 ; |
|
846 |
|
847 'quickcheck_params' ( ( '[' args ']' ) ? ) |
|
848 ; |
|
849 |
|
850 modes: '(' (name + ) ')' |
|
851 ; |
|
852 |
|
853 args: ( name '=' value + ',' ) |
|
854 ; |
|
855 \end{rail} |
|
856 |
|
857 \begin{description} |
|
858 |
|
859 \item @{command (HOL) "value"}~@{text t} evaluates and prints a |
|
860 term; optionally @{text modes} can be specified, which are |
|
861 appended to the current print mode (see also \cite{isabelle-ref}). |
|
862 Internally, the evaluation is performed by registered evaluators, |
|
863 which are invoked sequentially until a result is returned. |
|
864 Alternatively a specific evaluator can be selected using square |
|
865 brackets; available evaluators include @{text nbe} for |
|
866 \emph{normalization by evaluation} and \emph{code} for code |
|
867 generation in SML. |
|
868 |
|
869 \item @{command (HOL) "quickcheck"} tests the current goal for |
|
870 counter examples using a series of arbitrary assignments for its |
|
871 free variables; by default the first subgoal is tested, an other |
|
872 can be selected explicitly using an optional goal index. |
|
873 A number of configuration options are supported for |
|
874 @{command (HOL) "quickcheck"}, notably: |
|
875 |
|
876 \begin{description} |
|
877 |
|
878 \item[size] specifies the maximum size of the search space for |
|
879 assignment values. |
|
880 |
|
881 \item[iterations] sets how many sets of assignments are |
|
882 generated for each particular size. |
|
883 |
|
884 \end{description} |
|
885 |
|
886 These option can be given within square brackets. |
|
887 |
|
888 \item @{command (HOL) "quickcheck_params"} changes quickcheck |
|
889 configuration options persitently. |
|
890 |
|
891 \end{description} |
|
892 *} |
|
893 |
|
894 |
827 section {* Invoking automated reasoning tools -- The Sledgehammer *} |
895 section {* Invoking automated reasoning tools -- The Sledgehammer *} |
828 |
896 |
829 text {* |
897 text {* |
830 Isabelle/HOL includes a generic \emph{ATP manager} that allows |
898 Isabelle/HOL includes a generic \emph{ATP manager} that allows |
831 external automated reasoning tools to crunch a pending goal. |
899 external automated reasoning tools to crunch a pending goal. |
987 One framework generates code from both functional and relational |
1055 One framework generates code from both functional and relational |
988 programs to SML. See \cite{isabelle-HOL} for further information |
1056 programs to SML. See \cite{isabelle-HOL} for further information |
989 (this actually covers the new-style theory format as well). |
1057 (this actually covers the new-style theory format as well). |
990 |
1058 |
991 \begin{matharray}{rcl} |
1059 \begin{matharray}{rcl} |
992 @{command_def (HOL) "value"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\ |
|
993 @{command_def (HOL) "code_module"} & : & @{text "theory \<rightarrow> theory"} \\ |
1060 @{command_def (HOL) "code_module"} & : & @{text "theory \<rightarrow> theory"} \\ |
994 @{command_def (HOL) "code_library"} & : & @{text "theory \<rightarrow> theory"} \\ |
1061 @{command_def (HOL) "code_library"} & : & @{text "theory \<rightarrow> theory"} \\ |
995 @{command_def (HOL) "consts_code"} & : & @{text "theory \<rightarrow> theory"} \\ |
1062 @{command_def (HOL) "consts_code"} & : & @{text "theory \<rightarrow> theory"} \\ |
996 @{command_def (HOL) "types_code"} & : & @{text "theory \<rightarrow> theory"} \\ |
1063 @{command_def (HOL) "types_code"} & : & @{text "theory \<rightarrow> theory"} \\ |
997 @{attribute_def (HOL) code} & : & @{text attribute} \\ |
1064 @{attribute_def (HOL) code} & : & @{text attribute} \\ |
998 \end{matharray} |
1065 \end{matharray} |
999 |
1066 |
1000 \begin{rail} |
1067 \begin{rail} |
1001 'value' term |
|
1002 ; |
|
1003 |
|
1004 ( 'code\_module' | 'code\_library' ) modespec ? name ? \\ |
1068 ( 'code\_module' | 'code\_library' ) modespec ? name ? \\ |
1005 ( 'file' name ) ? ( 'imports' ( name + ) ) ? \\ |
1069 ( 'file' name ) ? ( 'imports' ( name + ) ) ? \\ |
1006 'contains' ( ( name '=' term ) + | term + ) |
1070 'contains' ( ( name '=' term ) + | term + ) |
1007 ; |
1071 ; |
1008 |
1072 |
1031 ; |
1095 ; |
1032 |
1096 |
1033 'code' (name)? |
1097 'code' (name)? |
1034 ; |
1098 ; |
1035 \end{rail} |
1099 \end{rail} |
1036 |
|
1037 \begin{description} |
|
1038 |
|
1039 \item @{command (HOL) "value"}~@{text t} evaluates and prints a term |
|
1040 using the code generator. |
|
1041 |
|
1042 \end{description} |
|
1043 |
1100 |
1044 \medskip The other framework generates code from functional programs |
1101 \medskip The other framework generates code from functional programs |
1045 (including overloading using type classes) to SML \cite{SML}, OCaml |
1102 (including overloading using type classes) to SML \cite{SML}, OCaml |
1046 \cite{OCaml} and Haskell \cite{haskell-revised-report}. |
1103 \cite{OCaml} and Haskell \cite{haskell-revised-report}. |
1047 Conceptually, code generation is split up in three steps: |
1104 Conceptually, code generation is split up in three steps: |