symbolic syntax for x^2 (faills back on plain infix "^");
authorwenzelm
Sun, 13 Jan 2002 21:13:59 +0100
changeset 12738 9d80e3746eb0
parent 12737 b0b012b11a36
child 12739 1fce8f51034d
symbolic syntax for x^2 (faills back on plain infix "^");
src/HOL/Numeral.thy
--- a/src/HOL/Numeral.thy	Sun Jan 13 21:13:27 2002 +0100
+++ b/src/HOL/Numeral.thy	Sun Jan 13 21:13:59 2002 +0100
@@ -31,9 +31,19 @@
 
 setup NumeralSyntax.setup
 
+syntax (xsymbols)
+  "_square" :: "'a => 'a"  ("(_\<twosuperior>)" [1000] 999)
+syntax (HTML output)
+  "_square" :: "'a => 'a"  ("(_\<twosuperior>)" [1000] 999)
+syntax (output)
+  "_square" :: "'a => 'a"  ("(_ ^/ 2)" [81] 80)
+translations
+  "x\<twosuperior>" == "x^2"
+  "x\<twosuperior>" <= "x^(2::nat)"
 
-(*Unfold all "let"s involving constants*)
+
 lemma Let_number_of [simp]: "Let (number_of v) f == f (number_of v)"
+  -- {* Unfold all @{text let}s involving constants *}
   by (simp add: Let_def)
 
 lemma Let_0 [simp]: "Let 0 f == f 0"