コード例 #1
0
ファイル: Pebbler.cs プロジェクト: wcatykid/GeoShader
        //
        // Use Dowling-Gallier pebbling technique to pebble using all given nodes
        //
        public void PebbleForwardForShading(List <int> figure, List <int> givens)
        {
            // Find all axiomatic, reflexive, and other obvious notions which may go both directions for solving problems.
            List <int> axiomaticNodes         = new List <int>();
            List <int> reflexiveNodes         = new List <int>();
            List <int> obviousDefinitionNodes = new List <int>();

            for (int v = 0; v < graph.Size(); v++)
            {
                ConcreteAST.GroundedClause node = graph.GetNode(v);

                if (node.IsAxiomatic())
                {
                    axiomaticNodes.Add(v);
                }
                if (node.IsReflexive())
                {
                    reflexiveNodes.Add(v);
                }
                if (node.IsClearDefinition())
                {
                    obviousDefinitionNodes.Add(v);
                }
            }

            // Forward pebble: it acquires the valid list of forward edges
            PebbleForward(figure, givens, axiomaticNodes);
        }
コード例 #2
0
ファイル: Problem.cs プロジェクト: wcatykid/GeoShader
 //
 // Determine which of the given nodes will be suppressed
 //
 public void DetermineSuppressedGivens(Hypergraph.Hypergraph <ConcreteAST.GroundedClause, Hypergraph.EdgeAnnotation> graph)
 {
     // Determine the suppressed nodes in the graph and break
     // the givens into those that must be explicitly stated to the user and those that are implicit.
     foreach (int g in givens)
     {
         ConcreteAST.GroundedClause clause = graph.vertices[g].data;
         if (clause.IsAxiomatic() || clause.IsIntrinsic() || !clause.IsAbleToBeASourceNode())
         {
             suppressedGivens.Add(g);
         }
     }
     suppressedGivens.ForEach(s => givens.Remove(s));
 }
コード例 #3
0
 //
 // Basic determination if the given node is in the hypergraph.
 //
 public bool QueryNodeInGraph(ConcreteAST.GroundedClause queryNode)
 {
     return(graph.HasNode(queryNode));
 }
コード例 #4
0
ファイル: EdgeAggregator.cs プロジェクト: wcatykid/GeoShader
 public EdgeAggregator(List <ConcreteAST.GroundedClause> antes, ConcreteAST.GroundedClause c, Hypergraph.EdgeAnnotation ann)
 {
     antecedent = new List <ConcreteAST.GroundedClause>(antes);
     consequent = c;
     annotation = ann;
 }