diff -r 894e82be8d05 -r af4c18c30593 src/HOL/Bali/WellType.thy --- a/src/HOL/Bali/WellType.thy Tue Feb 09 16:07:09 2010 +0100 +++ b/src/HOL/Bali/WellType.thy Wed Feb 10 00:45:16 2010 +0100 @@ -43,11 +43,9 @@ "env" <= (type) "\prg::prog,cls::qtname,lcl::lenv,\::'a\" - -syntax +abbreviation pkg :: "env \ pname" --{* select the current package from an environment *} -translations - "pkg e" == "pid (cls e)" + where "pkg e == pid (cls e)" section "Static overloading: maximally specific methods " @@ -426,29 +424,33 @@ E,dt\e#es\\T#Ts" -syntax (* for purely static typing *) - "_wt" :: "env \ [term,tys] \ bool" ("_|-_::_" [51,51,51] 50) - "_wt_stmt" :: "env \ stmt \ bool" ("_|-_:<>" [51,51 ] 50) - "_ty_expr" :: "env \ [expr ,ty ] \ bool" ("_|-_:-_" [51,51,51] 50) - "_ty_var" :: "env \ [var ,ty ] \ bool" ("_|-_:=_" [51,51,51] 50) - "_ty_exprs":: "env \ [expr list, - \ ty list] \ bool" ("_|-_:#_" [51,51,51] 50) +(* for purely static typing *) +abbreviation + wt_syntax :: "env \ [term,tys] \ bool" ("_|-_::_" [51,51,51] 50) + where "E|-t::T == E,empty_dt\t\ T" + +abbreviation + wt_stmt_syntax :: "env \ stmt \ bool" ("_|-_:<>" [51,51 ] 50) + where "E|-s:<> == E|-In1r s :: Inl (PrimT Void)" + +abbreviation + ty_expr_syntax :: "env \ [expr, ty] \ bool" ("_|-_:-_" [51,51,51] 50) + where "E|-e:-T == E|-In1l e :: Inl T" -syntax (xsymbols) - "_wt" :: "env \ [term,tys] \ bool" ("_\_\_" [51,51,51] 50) - "_wt_stmt" :: "env \ stmt \ bool" ("_\_\\" [51,51 ] 50) - "_ty_expr" :: "env \ [expr ,ty ] \ bool" ("_\_\-_" [51,51,51] 50) - "_ty_var" :: "env \ [var ,ty ] \ bool" ("_\_\=_" [51,51,51] 50) - "_ty_exprs" :: "env \ [expr list, - \ ty list] \ bool" ("_\_\\_" [51,51,51] 50) +abbreviation + ty_var_syntax :: "env \ [var, ty] \ bool" ("_|-_:=_" [51,51,51] 50) + where "E|-e:=T == E|-In2 e :: Inl T" -translations - "E\t\ T" == "E,empty_dt\t\ T" - "E\s\\" == "E\In1r s\CONST Inl (PrimT Void)" - "E\e\-T" == "E\In1l e\CONST Inl T" - "E\e\=T" == "E\In2 e\CONST Inl T" - "E\e\\T" == "E\In3 e\CONST Inr T" +abbreviation + ty_exprs_syntax :: "env \ [expr list, ty list] \ bool" ("_|-_:#_" [51,51,51] 50) + where "E|-e:#T == E|-In3 e :: Inr T" +notation (xsymbols) + wt_syntax ("_\_\_" [51,51,51] 50) and + wt_stmt_syntax ("_\_\\" [51,51 ] 50) and + ty_expr_syntax ("_\_\-_" [51,51,51] 50) and + ty_var_syntax ("_\_\=_" [51,51,51] 50) and + ty_exprs_syntax ("_\_\\_" [51,51,51] 50) declare not_None_eq [simp del] declare split_if [split del] split_if_asm [split del]