src/HOL/Hoare_Parallel/Quote_Antiquote.thy
author blanchet
Mon, 09 Aug 2010 12:48:40 +0200
changeset 38286 c9c7bd836894
parent 35113 1a0c129bb2e0
child 42284 326f57825e1a
permissions -rw-r--r--
disable Nitpick on Cygwin while I'm on vacation; I'll look into the timeout once I'm back


header {* \section{Concrete Syntax} *}

theory Quote_Antiquote imports Main begin

syntax
  "_quote"     :: "'b \<Rightarrow> ('a \<Rightarrow> 'b)"                ("(\<guillemotleft>_\<guillemotright>)" [0] 1000)
  "_antiquote" :: "('a \<Rightarrow> 'b) \<Rightarrow> 'b"                ("\<acute>_" [1000] 1000)
  "_Assert"    :: "'a \<Rightarrow> 'a set"                    ("(.{_}.)" [0] 1000)

syntax (xsymbols)
  "_Assert"    :: "'a \<Rightarrow> 'a set"            ("(\<lbrace>_\<rbrace>)" [0] 1000)

translations
  ".{b}." \<rightharpoonup> "CONST Collect \<guillemotleft>b\<guillemotright>"

parse_translation {*
  let
    fun quote_tr [t] = Syntax.quote_tr @{syntax_const "_antiquote"} t
      | quote_tr ts = raise TERM ("quote_tr", ts);
  in [(@{syntax_const "_quote"}, quote_tr)] end
*}

end