Exemplo n.º 1
0
        private void ResolveState(State state, Tree.Embedding[] embeddings, Dictionary <State, List <Tree.Node> > mapping, Dictionary <State, Tree.Node> ret)
        {
            List <Tree.Node> instances;

            Tree.Node node = Tree.Node.Create(state);

            if (mapping.TryGetValue(state, out instances))
            {
                // Otherwise, merge all the embeddings into the equation
                instances.Sort(SortDeepestFirst);

                foreach (Tree.Node instance in instances)
                {
                    Tree.NodePath path = instance.Path;

                    if (path.Count == 0)
                    {
                        node = instance;
                        break;
                    }
                    else
                    {
                        node.Replace(path, instance);
                    }
                }
            }

            ret[state] = node;
        }
Exemplo n.º 2
0
 public NodePath(NodePath path) : base(path)
 {
 }
Exemplo n.º 3
0
 public Argument(NodePath path, uint index)
 {
     d_index = index;
     d_path  = path;
 }
Exemplo n.º 4
0
 private bool SameArguments(Node a, Node b, NodePath path)
 {
     return(SameArguments(a.FromPath(path), b.FromPath(path)));
 }
Exemplo n.º 5
0
 public void Replace(NodePath path, Node node)
 {
     Replace(path, node, false);
 }