//
// Course: BU CAS CS 520, Fall 2010
// Instructor: Hongwei Xi (hwxi AT cs DOT bu DOT edu)
// Lecture on Tuesday, Oct 26, 2010
//

(* ****** ****** *)

(*
abst@ype T
abst@ype T1 = T
*)

(*
sta L0: addr
*)

(*
fun read (pf: T @ L0 | (*none*)): (T @ L0 | T)
fun write (pf: T @ L0 | x: T1): (T1 @ L0 | void)
*)

(*
fun read (pf: !T @ L0 | (*none*)): T
fun write (pf:!T @ L0 >> T1 @ L0 | x: T1): void
*)

(*
fun read {l:addr}
  (pf: !T @ l | p: ptr(l)): T
fun write {l:addr}
  (pf: !T @ l >> T1 @ l | p: ptr(l), x: T1): void
*)

(*
fun read {a:type} {l:addr}
  (pf: !a @ l | p: ptr l): a
fun write {a,a1:type} {l:addr}
  (pf: !a @ l >> a1 @ l | p: ptr(l), x: a1): void
*)

fun{a:t@ype}
read {l:addr} (pf: !a @ l | p: ptr l): a
(*
fun{a,a1:t@ype | sizeof(a) == sizeof(a1)}
write {l:addr} (pf: !a @ l >> a1 @ l | p: ptr l, x: a1): void
*)
fun{a:t@ype}
write {l:addr} (pf: !a @ l | p: ptr l, x: a): void

(* ****** ****** *)

(* end of [ptr.sats] *)