Example #1
0
        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);
        }
Example #2
0
        public override void CopyLocVar(Variable v1, Variable v2)
        {
            AbstractValue consistencyForSource = ConsistencyFor(v2);

            base.CopyLocVar(v1, v2);
            this.AssignConsistency(v1, consistencyForSource);
        }
Example #3
0
            protected override bool AtMost(AbstractValue a, AbstractValue b)
            {
                AVal av = (AVal)a;
                AVal bv = (AVal)b;

                return(av.IsExposable || !bv.IsExposable);
            }
Example #4
0
        protected virtual AbstractValue ConsistencyFor(Variable v)
        {
            AbstractValue c1   = ConsistencyLattice.AVal.Bottom;
            Nodes         locs = Values(v);

            c1 = ConsistencyFor(locs);
            return(c1);
        }
Example #5
0
        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);
        }
Example #6
0
 public void WeakUpdateNode(IPTAnalysisNode n, AbstractValue a)
 {
     if (consistency.ContainsKey(n))
     {
         consistency[n] = ConsistencyLattice.It.Join(a, consistency[n]);
     }
     else
     {
         UpdateNode(n, a);
     }
 }
Example #7
0
 public void AssignConsistency(Nodes ns, AbstractValue a, bool strong)
 {
     foreach (IPTAnalysisNode n in ns)
     {
         if (!strong)
         {
             WeakUpdateNode(n, a);
         }
         else
         {
             UpdateNode(n, a);
         }
     }
 }
Example #8
0
        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);
        }
Example #9
0
        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;
                }
            }
        }
Example #10
0
        public void AssignConsistency(Variable v, Field f, AbstractValue a, bool strong)
        {
            Nodes locs = Values(v, f);

            AssignConsistency(locs, a, strong);
        }
Example #11
0
 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);
 }
Example #14
0
 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 AssignConsistency(Variable v, AbstractValue a)
 {
     AssignConsistency(v, a, true);
 }
Example #18
0
 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);
            }
 public void UpdateNode(IPTAnalysisNode n, AbstractValue a)
 {
     consistency[n] = a;
 }