示例#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;
        }
示例#2
0
 public NodePath(NodePath path) : base(path)
 {
 }
示例#3
0
 public Argument(NodePath path, uint index)
 {
     d_index = index;
     d_path  = path;
 }
示例#4
0
 private bool SameArguments(Node a, Node b, NodePath path)
 {
     return(SameArguments(a.FromPath(path), b.FromPath(path)));
 }
示例#5
0
文件: Node.cs 项目: codyn-net/rawc
 public void Replace(NodePath path, Node node)
 {
     Replace(path, node, false);
 }