forked from seL4/l4v
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenericTag.thy
38 lines (30 loc) · 1020 Bytes
/
GenericTag.thy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
(*
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
*
* SPDX-License-Identifier: BSD-2-Clause
*)
theory GenericTag
imports
HOL.HOL
begin
text \<open>
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}.
\<close>
definition generic_tag :: "'ns \<Rightarrow> 'tag \<Rightarrow> 'a \<Rightarrow> 'a"
where remove_generic_tag[code del]: "generic_tag _ _ x \<equiv> x"
text \<open>Often the tagged value is a proposition to be proved.\<close>
lemma generic_tagP_I:
"P \<Longrightarrow> 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 \<open>We often want to avoid rewriting under annotations.\<close>
lemma generic_tag_cong:
"x = x' \<Longrightarrow> generic_tag ns tag x = generic_tag ns tag x'"
by simp
end