private bool IncludesConsistency(Dictionary <IPTAnalysisNode, AbstractValue> consis2) { bool includes = consistency.Count >= consis2.Count; if (includes) { foreach (IPTAnalysisNode n in consis2.Keys) { if (consistency.ContainsKey(n)) { AbstractValue c1 = consistency[n]; AbstractValue c2 = consis2[n]; if (!ConsistencyLattice.It.LowerThanOrEqual(c2, c1)) { return(false); } } else { return(false); } } } return(includes); }
public override void CopyLocVar(Variable v1, Variable v2) { AbstractValue consistencyForSource = ConsistencyFor(v2); base.CopyLocVar(v1, v2); this.AssignConsistency(v1, consistencyForSource); }
protected override bool AtMost(AbstractValue a, AbstractValue b) { AVal av = (AVal)a; AVal bv = (AVal)b; return(av.IsExposable || !bv.IsExposable); }
protected virtual AbstractValue ConsistencyFor(Variable v) { AbstractValue c1 = ConsistencyLattice.AVal.Bottom; Nodes locs = Values(v); c1 = ConsistencyFor(locs); return(c1); }
public override void ApplyLoadField(Variable v1, Variable v2, Field f, Label lb) { Nodes ns = Values(v2, f); AbstractValue consistencyForSource = ConsistencyFor(ns); base.ApplyLoadField(v1, v2, f, lb); AssignConsistency(v1, consistencyForSource); }
public void WeakUpdateNode(IPTAnalysisNode n, AbstractValue a) { if (consistency.ContainsKey(n)) { consistency[n] = ConsistencyLattice.It.Join(a, consistency[n]); } else { UpdateNode(n, a); } }
public void AssignConsistency(Nodes ns, AbstractValue a, bool strong) { foreach (IPTAnalysisNode n in ns) { if (!strong) { WeakUpdateNode(n, a); } else { UpdateNode(n, a); } } }
protected virtual AbstractValue ConsistencyFor(Set <IPTAnalysisNode> ns) { if (ns.Count == 0) { return(ConsistencyLattice.AVal.MaybeInconsistent); } AbstractValue c1 = ConsistencyLattice.AVal.Bottom; foreach (IPTAnalysisNode n in ns) { c1 = ConsistencyLattice.It.Join(c1, ConsistencyFor(n)); } return(c1); }
public void JoinConsistencyNodes(Dictionary <IPTAnalysisNode, AbstractValue> consis2) { foreach (IPTAnalysisNode n in consis2.Keys) { AbstractValue c2 = consis2[n]; if (consistency.ContainsKey(n)) { AbstractValue c1 = consistency[n]; if (!c1.Equals(c2)) { } AbstractValue c12 = ConsistencyLattice.It.Join(c1, c2); consistency[n] = c12; } else { consistency[n] = c2; } } }
public void AssignConsistency(Variable v, Field f, AbstractValue a, bool strong) { Nodes locs = Values(v, f); AssignConsistency(locs, a, strong); }
public void AssignConsistency(Variable v, AbstractValue a) { AssignConsistency(v, a, true); }
public void WeakUpdateNode(IPTAnalysisNode n, AbstractValue a) { if (consistency.ContainsKey(n)) consistency[n] = ConsistencyLattice.It.Join(a, consistency[n]); else UpdateNode(n, a); }
public override AbstractValue NontrivialJoin(AbstractValue a, AbstractValue b) { return AVal.Join((AVal)a, (AVal)b); }
public override AbstractValue NontrivialJoin(AbstractValue a, AbstractValue b) { return(AVal.Join((AVal)a, (AVal)b)); }
public void AssignConsistency(Nodes ns, AbstractValue a, bool strong) { foreach (IPTAnalysisNode n in ns) { if (!strong) WeakUpdateNode(n, a); else UpdateNode(n, a); } }
public void AssignConsistency(Variable v, Field f, AbstractValue a,bool strong) { Nodes locs = Values(v,f); AssignConsistency(locs, a, strong); }
public void UpdateNode(IPTAnalysisNode n, AbstractValue a) { consistency[n] = a; }
protected override bool AtMost(AbstractValue a, AbstractValue b) { AVal av = (AVal)a; AVal bv = (AVal)b; return (av.IsExposable || !bv.IsExposable); }