(* * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) * * SPDX-License-Identifier: BSD-2-Clause *) theory GenericTag imports HOL.HOL begin text \ Generic annotation constant. @{typ 'ns} is a namespace parameter and should be a different type or constant for each distinct use of this constant. @{typ 'tag} is an arbitrary annotation associated with the actual value @{term x}. \ definition generic_tag :: "'ns \ 'tag \ 'a \ 'a" where remove_generic_tag[code del]: "generic_tag _ _ x \ x" text \Often the tagged value is a proposition to be proved.\ lemma generic_tagP_I: "P \ generic_tag ns tag P" by (simp add: remove_generic_tag) lemma generic_tag_True: "generic_tag ns tag True" by (simp add: remove_generic_tag) text \We often want to avoid rewriting under annotations.\ lemma generic_tag_cong: "x = x' \ generic_tag ns tag x = generic_tag ns tag x'" by simp end