581 library; beside being useful in applications, they may serve |
581 library; beside being useful in applications, they may serve |
582 as a tutorial for customizing the code generator setup. |
582 as a tutorial for customizing the code generator setup. |
583 |
583 |
584 \begin{description} |
584 \begin{description} |
585 |
585 |
586 \item[\isa{Pretty{\isacharunderscore}Int}] represents \isa{HOL} integers by big |
586 \item[\isa{Code{\isacharunderscore}Integer}] represents \isa{HOL} integers by big |
587 integer literals in target languages. |
587 integer literals in target languages. |
588 \item[\isa{Pretty{\isacharunderscore}Char}] represents \isa{HOL} characters by |
588 \item[\isa{Code{\isacharunderscore}Char}] represents \isa{HOL} characters by |
589 character literals in target languages. |
589 character literals in target languages. |
590 \item[\isa{Pretty{\isacharunderscore}Char{\isacharunderscore}chr}] like \isa{Pretty{\isacharunderscore}Char}, |
590 \item[\isa{Code{\isacharunderscore}Char{\isacharunderscore}chr}] like \isa{Code{\isacharunderscore}Char}, |
591 but also offers treatment of character codes; includes |
591 but also offers treatment of character codes; includes |
592 \isa{Pretty{\isacharunderscore}Int}. |
592 \isa{Code{\isacharunderscore}Integer}. |
593 \item[\isa{Executable{\isacharunderscore}Rat}] implements rational |
|
594 numbers. |
|
595 \item[\isa{Executable{\isacharunderscore}Real}] implements a subset of real numbers, |
|
596 namly those representable by rational numbers. |
|
597 \item[\isa{Efficient{\isacharunderscore}Nat}] \label{eff_nat} implements natural numbers by integers, |
593 \item[\isa{Efficient{\isacharunderscore}Nat}] \label{eff_nat} implements natural numbers by integers, |
598 which in general will result in higher efficency; pattern |
594 which in general will result in higher efficency; pattern |
599 matching with \isa{{\isadigit{0}}} / \isa{Suc} |
595 matching with \isa{{\isadigit{0}}} / \isa{Suc} |
600 is eliminated; includes \isa{Pretty{\isacharunderscore}Int}. |
596 is eliminated; includes \isa{Code{\isacharunderscore}Integer}. |
601 \item[\isa{ML{\isacharunderscore}String}] provides an additional datatype \isa{mlstring}; |
597 \item[\isa{Code{\isacharunderscore}Index}] provides an additional datatype |
602 in the \isa{HOL} default setup, strings in HOL are mapped to list |
598 \isa{index} which is mapped to target-language built-in integers. |
603 of \isa{HOL} characters in SML; values of type \isa{mlstring} are |
599 Useful for code setups which involve e.g. indexing of |
604 mapped to strings in SML. |
600 target-language arrays. |
|
601 \item[\isa{Code{\isacharunderscore}Message}] provides an additional datatype |
|
602 \isa{message{\isacharunderscore}string} which is isomorphic to strings; |
|
603 \isa{message{\isacharunderscore}string}s are mapped to target-language strings. |
|
604 Useful for code setups which involve e.g. printing (error) messages. |
605 |
605 |
606 \end{description} |
606 \end{description} |
607 |
607 |
608 \begin{warn} |
608 \begin{warn} |
609 When importing any of these theories, they should form the last |
609 When importing any of these theories, they should form the last |
1505 % |
1505 % |
1506 \isatagmlref |
1506 \isatagmlref |
1507 % |
1507 % |
1508 \begin{isamarkuptext}% |
1508 \begin{isamarkuptext}% |
1509 \begin{mldecls} |
1509 \begin{mldecls} |
1510 \indexml{Code.add-func}\verb|Code.add_func: bool -> thm -> theory -> theory| \\ |
1510 \indexml{Code.add-func}\verb|Code.add_func: thm -> theory -> theory| \\ |
1511 \indexml{Code.del-func}\verb|Code.del_func: thm -> theory -> theory| \\ |
1511 \indexml{Code.del-func}\verb|Code.del_func: thm -> theory -> theory| \\ |
1512 \indexml{Code.add-funcl}\verb|Code.add_funcl: string * thm list Susp.T -> theory -> theory| \\ |
1512 \indexml{Code.add-funcl}\verb|Code.add_funcl: string * thm list Susp.T -> theory -> theory| \\ |
1513 \indexml{Code.add-inline}\verb|Code.add_inline: thm -> theory -> theory| \\ |
1513 \indexml{Code.add-inline}\verb|Code.add_inline: thm -> theory -> theory| \\ |
1514 \indexml{Code.del-inline}\verb|Code.del_inline: thm -> theory -> theory| \\ |
1514 \indexml{Code.del-inline}\verb|Code.del_inline: thm -> theory -> theory| \\ |
1515 \indexml{Code.add-inline-proc}\verb|Code.add_inline_proc: string * (theory -> cterm list -> thm list)|\isasep\isanewline% |
1515 \indexml{Code.add-inline-proc}\verb|Code.add_inline_proc: string * (theory -> cterm list -> thm list)|\isasep\isanewline% |