let PTEDevice-GRE = try PTEDevice-GRE with emptyset
let PTEDevice-nGRE = try PTEDevice-nGRE with emptyset
let PTEDevice-nGnRE = try PTEDevice-nGnRE with emptyset
let PTEDevice-nGnRnE = try PTEDevice-nGnRnE with emptyset
let DeviceMemoryType-conflict = (PTEDevice-GRE & PTEDevice-nGRE)
| (PTEDevice-GRE & PTEDevice-nGnRE)
| (PTEDevice-GRE & PTEDevice-nGnRnE)
| (PTEDevice-nGRE & PTEDevice-nGnRE)
| (PTEDevice-nGRE & PTEDevice-nGnRnE)
| (PTEDevice-nGnRE & PTEDevice-nGnRnE)
assert empty DeviceMemoryType-conflict as Invalid-Device-Memory-Type
let PTEDevice = try PTEDevice with emptyset
let PTEDevice = PTEDevice
| PTEDevice-GRE | PTEDevice-nGRE | PTEDevice-nGnRE | PTEDevice-nGnRnE
let PTENon-shareable = try PTENon-shareable with emptyset
let PTEInner-shareable = try PTEInner-shareable with emptyset
let PTEOuter-shareable = try PTEOuter-shareable with emptyset
let Shareability-conflict = (PTENon-shareable & PTEInner-shareable)
| (PTEInner-shareable & PTEOuter-shareable)
| (PTENon-shareable & PTEOuter-shareable)
assert empty Shareability-conflict as Invalid-Shareability
let PTEInner-write-back = try PTEInner-write-back with emptyset
let PTEInner-write-through = try PTEInner-write-through with emptyset
let PTEInner-non-cacheable = try PTEInner-non-cacheable with emptyset
let InnerCacheability-conflict = (PTEInner-write-back & PTEInner-write-through)
| (PTEInner-write-through & PTEInner-non-cacheable)
| (PTEInner-non-cacheable & PTEInner-write-back)
assert empty InnerCacheability-conflict as Invalid-Inner-Cacheability
let PTEOuter-write-back = try PTEOuter-write-back with emptyset
let PTEOuter-write-through = try PTEOuter-write-through with emptyset
let PTEOuter-non-cacheable = try PTEOuter-non-cacheable with emptyset
let OuterCacheability-conflict = (PTEOuter-write-back & PTEOuter-write-through)
| (PTEOuter-write-through & PTEOuter-non-cacheable)
| (PTEOuter-non-cacheable & PTEOuter-write-back)
assert empty OuterCacheability-conflict as Invalid-Outer-Cacheability
let PTENormal = try PTENormal with emptyset
let PTETaggedNormal = try PTETaggedNormal with emptyset
let PTEXS = try PTEXS with emptyset
let MemoryType-conflict = PTENormal & PTEDevice
assert empty MemoryType-conflict as Invalid-Memory-Type
let PTEMemAttr = try PTEMemAttr with emptyset
let PTEAll-Valid-Mem-Attr = PTENormal | PTETaggedNormal
| PTENon-shareable | PTEInner-shareable | PTEOuter-shareable
| PTEInner-write-back | PTEInner-write-through | PTEInner-non-cacheable
| PTEOuter-write-back | PTEOuter-write-through | PTEOuter-non-cacheable
| PTEDevice
| PTEDevice-GRE | PTEDevice-nGRE | PTEDevice-nGnRE | PTEDevice-nGnRnE | PTEXS
let Invalid-Memory-Attr = PTEMemAttr \ (PTEAll-Valid-Mem-Attr)
assert empty Invalid-Memory-Attr as Invalid-Memory-Attribute
let PTEInner-shareable = PTEInner-shareable
| (PTE \ (PTEDevice | PTENon-shareable | PTEOuter-shareable))
let PTEInner-write-back = PTEInner-write-back
| (PTE \ (PTEDevice | PTEInner-write-through | PTEInner-non-cacheable))
let PTEOuter-write-back = PTEOuter-write-back
| (PTE \ (PTEDevice | PTEOuter-write-through | PTEOuter-non-cacheable))
let ISH-WB = PTEInner-shareable & PTEInner-write-back & PTEOuter-write-back
let PTETaggedNormal = PTETaggedNormal | (if "memtag" then ISH-WB else 0)
let PTENormal = PTENormal
| PTENon-shareable | PTEInner-shareable | PTEOuter-shareable
| PTEInner-write-back | PTEInner-write-through | PTEInner-non-cacheable
| PTEOuter-write-back | PTEOuter-write-through | PTEOuter-non-cacheable
let PTENormal = if "memtag" then PTENormal \ ISH-WB else PTENormal