Example #1
0
        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));
        }
Example #2
0
    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));
    }