equal
deleted
inserted
replaced
2261 class: @{syntax name} |
2261 class: @{syntax name} |
2262 ; |
2262 ; |
2263 path: @{syntax embedded} |
2263 path: @{syntax embedded} |
2264 ; |
2264 ; |
2265 @@{attribute (HOL) code} ('equation' | 'nbe' | 'abstype' | 'abstract' |
2265 @@{attribute (HOL) code} ('equation' | 'nbe' | 'abstype' | 'abstract' |
2266 | 'del' | 'drop:' (const+) | 'abort:' (const+))? |
2266 | 'drop:' (const+) | 'drop' | 'abort:' (const+) | 'abort')? |
2267 ; |
2267 ; |
2268 @@{command (HOL) code_datatype} (const+) |
2268 @@{command (HOL) code_datatype} (const+) |
2269 ; |
2269 ; |
2270 @@{attribute (HOL) code_unfold} 'del'? |
2270 @@{attribute (HOL) code_unfold} 'del'? |
2271 ; |
2271 ; |
2384 Variant \<open>code equation\<close> declares a conventional equation as code equation. |
2384 Variant \<open>code equation\<close> declares a conventional equation as code equation. |
2385 |
2385 |
2386 Variant \<open>code nbe\<close> accepts also non-left-linear equations for |
2386 Variant \<open>code nbe\<close> accepts also non-left-linear equations for |
2387 \<^emph>\<open>normalization by evaluation\<close> only. |
2387 \<^emph>\<open>normalization by evaluation\<close> only. |
2388 |
2388 |
2389 Variant \<open>code del\<close> deselects a code equation for code generation. |
|
2390 |
|
2391 Multiple \<open>code equation\<close> / \<open>code nbe\<close> declarations referring to the same |
2389 Multiple \<open>code equation\<close> / \<open>code nbe\<close> declarations referring to the same |
2392 constant within the same theory are handled as \<^emph>\<open>one\<close> function declaration |
2390 constant within the same theory are handled as \<^emph>\<open>one\<close> function declaration |
2393 for that particular constant: the first code declaration within a theory |
2391 for that particular constant: the first code declaration within a theory |
2394 disregards any previous function declaration and superseedes any equations |
2392 disregards any previous function declaration and superseedes any equations |
2395 from preceeding theories. |
2393 from preceeding theories. |
2409 depending on the syntactic shape of the underlying equation. |
2407 depending on the syntactic shape of the underlying equation. |
2410 |
2408 |
2411 Variants \<open>code drop:\<close> and \<open>code abort:\<close> take a list of constants as arguments |
2409 Variants \<open>code drop:\<close> and \<open>code abort:\<close> take a list of constants as arguments |
2412 and drop all code equations declared for them. In the case of \<open>abort\<close>, |
2410 and drop all code equations declared for them. In the case of \<open>abort\<close>, |
2413 these constants if needed are implemented by program abort |
2411 these constants if needed are implemented by program abort |
2414 (exception). |
2412 (exception). Variants \<open>code drop\<close> and \<open>code abort\<close> derive the affected |
|
2413 constants from the underlying theorems interpreted as code equations. |
2415 |
2414 |
2416 \<^descr> @{command (HOL) "code_datatype"} specifies a constructor set for a logical |
2415 \<^descr> @{command (HOL) "code_datatype"} specifies a constructor set for a logical |
2417 type. |
2416 type. |
2418 |
2417 |
2419 \<^descr> @{command (HOL) "print_codesetup"} gives an overview on selected code |
2418 \<^descr> @{command (HOL) "print_codesetup"} gives an overview on selected code |