695 from executable specifications, both functional and relational programs. |
695 from executable specifications, both functional and relational programs. |
696 Isabelle/HOL instantiates these mechanisms in a way that is amenable to |
696 Isabelle/HOL instantiates these mechanisms in a way that is amenable to |
697 end-user applications. See \cite{isabelle-HOL} for further information (this |
697 end-user applications. See \cite{isabelle-HOL} for further information (this |
698 actually covers the new-style theory format as well). |
698 actually covers the new-style theory format as well). |
699 |
699 |
700 \indexisarcmd{generate-code}\indexisarcmd{consts-code}\indexisarcmd{types-code} |
700 \indexisarcmd{code-module}\indexisarcmd{code-library}\indexisarcmd{consts-code}\indexisarcmd{types-code} |
701 \indexisaratt{code} |
701 \indexisaratt{code} |
702 |
702 |
703 \begin{matharray}{rcl} |
703 \begin{matharray}{rcl} |
704 \isarcmd{generate_code} & : & \isartrans{theory}{theory} \\ |
704 \isarcmd{code_module} & : & \isartrans{theory}{theory} \\ |
|
705 \isarcmd{code_library} & : & \isartrans{theory}{theory} \\ |
705 \isarcmd{consts_code} & : & \isartrans{theory}{theory} \\ |
706 \isarcmd{consts_code} & : & \isartrans{theory}{theory} \\ |
706 \isarcmd{types_code} & : & \isartrans{theory}{theory} \\ |
707 \isarcmd{types_code} & : & \isartrans{theory}{theory} \\ |
707 code & : & \isaratt \\ |
708 code & : & \isaratt \\ |
708 \end{matharray} |
709 \end{matharray} |
709 |
710 |
710 \railalias{generatecode}{generate\_code} |
711 \railalias{verblbrace}{\texttt{\ttlbrace*}} |
711 \railterm{generatecode} |
712 \railalias{verbrbrace}{\texttt{*\ttrbrace}} |
|
713 \railterm{verblbrace} |
|
714 \railterm{verbrbrace} |
|
715 |
|
716 \railalias{codemodule}{code\_module} |
|
717 \railterm{codemodule} |
|
718 |
|
719 \railalias{codelibrary}{code\_library} |
|
720 \railterm{codelibrary} |
712 |
721 |
713 \railalias{constscode}{consts\_code} |
722 \railalias{constscode}{consts\_code} |
714 \railterm{constscode} |
723 \railterm{constscode} |
715 |
724 |
716 \railalias{typescode}{types\_code} |
725 \railalias{typescode}{types\_code} |
717 \railterm{typescode} |
726 \railterm{typescode} |
718 |
727 |
719 \begin{rail} |
728 \begin{rail} |
720 generatecode ( () | '(' name ')') ((name '=' term) +) |
729 ( codemodule | codelibrary ) modespec ? name ? \\ |
721 ; |
730 ( 'file' name ) ? ( 'imports' ( name + ) ) ? \\ |
722 constscode (name ('::' type)? template +) |
731 'contains' ( ( name '=' term ) + | term + ); |
723 ; |
732 |
724 typescode (name template +) |
733 modespec : '(' ( name * ) ')'; |
725 ; |
734 |
726 template: '(' string ')' |
735 constscode (codespec +); |
727 ; |
736 |
728 |
737 codespec : name ( '::' type) ? template attachment ?; |
729 'code' (name)? |
738 |
730 ; |
739 typescode (tycodespec +); |
|
740 |
|
741 tycodespec : name template attachment ?; |
|
742 |
|
743 template: '(' string ')'; |
|
744 |
|
745 attachment: 'attach' modespec ? verblbrace text verbrbrace; |
|
746 |
|
747 'code' (name)?; |
731 \end{rail} |
748 \end{rail} |
732 |
749 |
733 |
750 |
734 \section{HOLCF} |
751 \section{HOLCF} |
735 |
752 |