src/HOL/Hoare_Parallel/Quote_Antiquote.thy
author wenzelm
Sat, 17 Aug 2013 19:13:28 +0200
changeset 53052 a0db255af8c5
parent 52143 36ffe23b25f8
child 53241 effd8fcabca2
permissions -rw-r--r--
sledgehammer sendback always uses Markup.padding_command: sensible default for most practical applications -- old-style in-line replacement is superseded by auto mode or panel; back to Normal mode: with output_result it is sufficient to determine TTY vs. PIDE operation;


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_Trans.quote_tr @{syntax_const "_antiquote"} t
      | quote_tr ts = raise TERM ("quote_tr", ts);
  in [(@{syntax_const "_quote"}, K quote_tr)] end
*}

end