private static List<EdgeAggregator> InstantiateToDefinition(Triangle tri, CongruentSegments cs1, CongruentSegments cs2) { List<EdgeAggregator> newGrounded = new List<EdgeAggregator>(); // Do these congruences relate one common segment? Segment shared = cs1.SharedSegment(cs2); if (shared == null) return newGrounded; // // Do these congruences apply to this triangle? // if (!tri.HasSegment(cs1.cs1) || !tri.HasSegment(cs1.cs2)) return newGrounded; if (!tri.HasSegment(cs2.cs1) || !tri.HasSegment(cs2.cs2)) return newGrounded; // // These cannot be reflexive congruences. // if (cs1.IsReflexive() || cs2.IsReflexive()) return newGrounded; // // Are the non-shared segments unique? // Segment other1 = cs1.OtherSegment(shared); Segment other2 = cs2.OtherSegment(shared); if (other1.StructurallyEquals(other2)) return newGrounded; // // Generate the new equialteral clause // Strengthened newStrengthened = new Strengthened(tri, new EquilateralTriangle(tri)); List<GroundedClause> antecedent = new List<GroundedClause>(); antecedent.Add(cs1); antecedent.Add(cs2); antecedent.Add(tri); newGrounded.Add(new EdgeAggregator(antecedent, newStrengthened, annotation)); return newGrounded; }
private static List<EdgeAggregator> InstantiateToKite(Quadrilateral quad, CongruentSegments cs1, CongruentSegments cs2) { List<EdgeAggregator> newGrounded = new List<EdgeAggregator>(); // The congruences should not share a side. if (cs1.SharedSegment(cs2) != null) return newGrounded; // The congruent pairs should not also be congruent to each other if (cs1.cs1.CoordinateCongruent(cs2.cs1)) return newGrounded; // Does both set of congruent segments apply to the quadrilateral? if (!quad.HasAdjacentCongruentSides(cs1)) return newGrounded; if (!quad.HasAdjacentCongruentSides(cs2)) return newGrounded; // // Create the new Kite object // Strengthened newKite = new Strengthened(quad, new Kite(quad)); // For hypergraph List<GroundedClause> antecedent = new List<GroundedClause>(); antecedent.Add(quad); antecedent.Add(cs1); antecedent.Add(cs2); newGrounded.Add(new EdgeAggregator(antecedent, newKite, annotation)); return newGrounded; }
private static List<EdgeAggregator> InstantiateToRhombus(Quadrilateral quad, CongruentSegments cs1, CongruentSegments cs2, CongruentSegments cs3) { List<EdgeAggregator> newGrounded = new List<EdgeAggregator>(); // // The 3 congruent segments pairs must relate; one pair must link the two others. // Determine the link segments as well as the opposite sides. // CongruentSegments link = null; CongruentSegments opp1 = null; CongruentSegments opp2 = null; if (cs1.SharedSegment(cs2) != null && cs1.SharedSegment(cs3) != null) { link = cs1; opp1 = cs2; opp2 = cs3; } else if (cs2.SharedSegment(cs1) != null && cs2.SharedSegment(cs3) != null) { link = cs2; opp1 = cs1; opp2 = cs3; } else if (cs3.SharedSegment(cs1) != null && cs3.SharedSegment(cs2) != null) { link = cs3; opp1 = cs1; opp2 = cs2; } else return newGrounded; // Are the pairs on the opposite side of this quadrilateral? if (!quad.HasOppositeCongruentSides(opp1)) return newGrounded; if (!quad.HasOppositeCongruentSides(opp2)) return newGrounded; // // Create the new Rhombus object // Strengthened newRhombus = new Strengthened(quad, new Rhombus(quad)); // For hypergraph List<GroundedClause> antecedent = new List<GroundedClause>(); antecedent.Add(quad); antecedent.Add(cs1); antecedent.Add(cs2); antecedent.Add(cs3); newGrounded.Add(new EdgeAggregator(antecedent, newRhombus, annotation)); return newGrounded; }