Collecting Type Constraints
main() {
var x, y, z;
x = 10; // {〚x〛= 〚10〛, 〚10〛= int}
y = alloc 8; // {〚y〛= 〚alloc 8〛, 〚alloc 8〛= ↑〚8〛, 〚8〛= int}
*y = x; // {〚y〛= ↑〚x〛}
z = *y; // {〚z〛= 〚*y〛, 〚y〛= ↑〚*y〛}
return x;
}
Construct |
Rule |
X = E |
〚X〛= 〚E〛 |
10 |
〚10〛= int |
alloc E |
〚alloc E〛= ↑〚E〛 |
*E1 = E2 |
〚E1〛= ↑〚E2〛 |
*E |
〚E〛= ↑〚*E〛 |