コード例 #1
0
ファイル: BaseProvider.cs プロジェクト: luckysunda/hice-dt
        public BaseState(GenericModel m, Model.CapturedState st)
        {
            this.st = st;
            this.m  = m;

            foreach (var v in st.AllVariables)
            {
                var e = st.TryGet(v);
                m.RegisterLocalValue(v, e);
                nodes.Add(new ElementNode(this, v, e));

                niceName[e] = v;
                foreach (var r in e.References)
                {
                    if (r.Args.Length == 1 && r.Args[0] == e)
                    {
                        if (!niceName.ContainsKey(e))
                        {
                            niceName[e] = r.Func.Name + "(" + v + ")";
                        }
                    }
                }
            }

            nodes.Add(new ContainerNode <Model.Func>("[Functions]", f => f.Arity == 0 ? null : Function(f), m.model.Functions));
            nodes.Add(new ContainerNode <Model.Func>("[Constants]", f => f.Arity != 0 ? null : new AppNode(this, f.Apps.First()), m.model.Functions));
        }
コード例 #2
0
ファイル: BaseProvider.cs プロジェクト: xrq-phys/dafny
        public StateNode(int i, BCTModel parent, Model.CapturedState s)
            : base(s, parent)
        {
            dm    = parent;
            state = s;
            index = i;

            SetupVars();
        }
コード例 #3
0
ファイル: DafnyProvider.cs プロジェクト: omaragb/tlp182
        public StateNode(int i, DafnyModel parent, Model.CapturedState s)
            : base(s, parent)
        {
            dm    = parent;
            state = s;
            index = i;

            skolems = new List <VariableNode>(SkolemVars());
            SetupVars();
        }
コード例 #4
0
        private static AssumeCmd DetermineConflictingAction(CallCounterexample CallCex, string RaceyState, string AccessHasOccurred, string AccessOffset)
        {
            AssumeCmd LastLogAssume   = null;
            string    LastOffsetValue = null;

            foreach (var b in CallCex.Trace)
            {
                bool finished = false;
                foreach (var c in b.Cmds.OfType <AssumeCmd>())
                {
                    string StateName = QKeyValue.FindStringAttribute(c.Attributes, "captureState");
                    if (StateName == null)
                    {
                        continue;
                    }
                    Model.CapturedState state = GetStateFromModel(StateName, CallCex.Model);
                    if (state == null || state.TryGet(AccessHasOccurred) is Model.Uninterpreted)
                    {
                        // Either the state was not recorded, or the state has nothing to do with the reported error, so do not
                        // analyse it further.
                        continue;
                    }

                    Model.Boolean   AHO_value = state.TryGet(AccessHasOccurred) as Model.Boolean;
                    Model.BitVector AO_value  =
                        (RaceInstrumentationUtil.RaceCheckingMethod == RaceCheckingMethod.ORIGINAL
            ? state.TryGet(AccessOffset)
            : CallCex.Model.TryGetFunc(AccessOffset).GetConstant()) as Model.BitVector;

                    if (!AHO_value.Value)
                    {
                        LastLogAssume   = null;
                        LastOffsetValue = null;
                    }
                    else if (LastLogAssume == null || !AO_value.Numeral.Equals(LastOffsetValue))
                    {
                        LastLogAssume   = c;
                        LastOffsetValue = AO_value.Numeral;
                    }
                    if (StateName.Equals(RaceyState))
                    {
                        finished = true;
                    }
                    break;
                }
                if (finished)
                {
                    break;
                }
            }

            Debug.Assert(LastLogAssume != null);
            return(LastLogAssume);
        }
コード例 #5
0
 private static Model.CapturedState GetStateFromModel(string stateName, Model m)
 {
     Model.CapturedState state = null;
     foreach (var s in m.States)
     {
         if (s.Name.Equals(stateName))
         {
             state = s;
             break;
         }
     }
     return(state);
 }
コード例 #6
0
ファイル: BaseProvider.cs プロジェクト: Chenguang-Zhu/ICE-C5
    public BaseState(GenericModel m, Model.CapturedState st)
    {
      this.st = st;
      this.m = m;

      foreach (var v in st.AllVariables) {
        var e = st.TryGet(v);
        m.RegisterLocalValue(v, e);
        nodes.Add(new ElementNode(this, v, e));

        niceName[e] = v;
        foreach (var r in e.References) {
          if (r.Args.Length == 1 && r.Args[0] == e) {
            if (!niceName.ContainsKey(e))
              niceName[e] = r.Func.Name + "(" + v + ")";
          }
        }
      }

      nodes.Add(new ContainerNode<Model.Func>("[Functions]", f => f.Arity == 0 ? null : Function(f), m.model.Functions));
      nodes.Add(new ContainerNode<Model.Func>("[Constants]", f => f.Arity != 0 ? null : new AppNode(this, f.Apps.First()), m.model.Functions));
    }
コード例 #7
0
        private LanguageModel langModel; // no point making it protected - they will need VccModel, DafnyModel

        public NamedState(Model.CapturedState s, LanguageModel lm)
        {
            this.state     = s;
            this.langModel = lm;
        }