Everything Everywhere All at Once
Proposal due Wednesday Evening after fall break.
But you can hand it in before.
Why should we use abstractions when analysing code?
What is the advantage of Galoi connections?
Which cases are the Sign abstraction not able to catch?
At which cases do your static analysis outperform your dynamic?
Feedback
Is this still fun?
Breath-first!
is the abstractor
A partially ordered set
Integers in both directions
Sets
Signed
Partial orders ,
meet ,
join ,
and has a smallest and biggest element.
A Hasse diagram over the poset . By I, KSmrq, CC BY-SA 3.0 (with edits)
, , and

(A Galois Connection is a connection between two ordered sets, with a concretion and an abstraction function.)
A mathematical definition of one-sided information loss. If my abstraction finds a bug, is there a bug in the original domain?
A weak equality.
# Most of the time
parse(pretty(a)) == a
# Always
pretty(parse(pretty(a))) == pretty(a)
# Bonus for all strings s:
parse(pretty(parse(s))) == parse(s)@classmethod
def abstract(cls, items : set[int]):
signset = set()
if 0 in items:
signset.add("0")
...
return cls(signset)def __contains__(self, member : int):
if (member == 0 and "0" in self.signs):
return True
... from hypothesis import given
from hypothesis.strategies import integers, sets
@given(sets(integers()))
def test_valid_abstraction(xs):
s = SignSet.abstract(xs)
assert all(x in s for x in xs)@given(sets(integers()), sets(integers()))
def test_sign_adds(xs, ys):
assert (
SignSet.abstract({x + y for x in xs for y in ys})
<= SignSet.abstract(xs) + SignSet.abstract(ys)
)
if , then
Abstract Your Interpreter
Emit multiple states.
Start Small, Just One frame.
def step(state : AState) -> Iterable[AState | str]
...def many_step(state : dict[Pc, AState | str])
-> dict[Pc, AState | str]:
new_state = dict(state)
for k, v in state.items():
for s in step(v):
new_state[s.pc] |= s
return new_stateWhy should we use abstractions when analysing code?
What is the advantage of Galoi connections?
Which cases are the Sign abstraction not able to catch?
At which cases do your static analysis outperform your dynamic?