Wow, this gets mighty complicated. It reminds me a bit of this memory model based on symbolic values. They are using a different algebra though.
One issue I think with your algebra is IIRC, arithmetic operations like multiplication become very complex on bit patterns. You very quickly end up in a situation where you need a SAT solver to test if two elements of the algebra are equal.
I hope we can find something less complicated.
What do you mean by "type"? A Rust type? I strongly believe that memory should be untyped. CompCert originally had typed memory but moved away from it. LLVM has untyped memory. C... is somewhat unclear, but it does allow type punning when "done right", and C with -fno-strict-aliasing
has untyped memory (I would argue).
I do. The one I described in the post is very simple:
pub struct Pointer {
pub alloc_id: AllocId,
pub offset: Size,
}