namespace a.b.c {
def b: Bool = true
def c: Char = 'a'
def f: Float = 1.23
def i: Int = 42
def s: Str = "string"
rel LitStm(r: Str, c: Int)
rel AddStm(r: Str, x: Str, y: Str)
rel DivStm(r: Str, x: Str, y: Str)
lat LocalVar(k: Str, v: Constant)
index LitStm{{r}, {r, c}}
enum Constant {
case Top,
case Cst(Int),
case Bot
}
def leq(e1: Constant, e2: Constant): Bool = match (e1, e2) with {
case (Constant.Bot, _) => true
case (Constant.Cst(n1), Constant.Cst(n2)) => n1 == n2
case (_, Constant.Top) => true
case _ => false
}
LocalVar(r, alpha(c)) :- LitStm(r, c).
LocalVar(r, sum(v1, v2)) :- AddStm(r, x, y),
LocalVar(x, v1),
LocalVar(y, v2).
}