// Return the number of shared angles in both congruences public override int SharesNumClauses(Congruent thatCC) { CongruentAngles ccas = thatCC as CongruentAngles; if (ccas == null) { return(0); } int numShared = ca1.Equates(ccas.ca1) || ca1.Equates(ccas.ca2) ? 1 : 0; numShared += ca2.Equates(ccas.ca1) || ca2.Equates(ccas.ca2) ? 1 : 0; return(numShared); }
// Return the number of shared segments in both congruences public override int SharesNumClauses(Congruent thatCC) { CongruentSegments ccss = thatCC as CongruentSegments; if (ccss == null) { return(0); } int numShared = cs1.Equals(ccss.cs1) || cs1.Equals(ccss.cs2) ? 1 : 0; numShared += cs2.Equals(ccss.cs1) || cs2.Equals(ccss.cs2) ? 1 : 0; return(numShared); }
public static List <GenericInstantiator.EdgeAggregator> CreateTransitiveCongruence(Congruent congruent1, Congruent congruent2) { List <GenericInstantiator.EdgeAggregator> newGrounded = new List <GenericInstantiator.EdgeAggregator>(); // // Create the antecedent clauses // List <GroundedClause> antecedent = new List <GroundedClause>(); antecedent.Add(congruent1); antecedent.Add(congruent2); // // Create the consequent clause // Congruent newCC = null; if (congruent1 is CongruentSegments) { CongruentSegments css1 = congruent1 as CongruentSegments; CongruentSegments css2 = congruent2 as CongruentSegments; Segment shared = css1.SegmentShared(css2); newCC = new AlgebraicCongruentSegments(css1.OtherSegment(shared), css2.OtherSegment(shared)); } else if (congruent1 is CongruentAngles) { CongruentAngles cas1 = congruent1 as CongruentAngles; CongruentAngles cas2 = congruent2 as CongruentAngles; Angle shared = cas1.AngleShared(cas2); newCC = new AlgebraicCongruentAngles(cas1.OtherAngle(shared), cas2.OtherAngle(shared)); } if (newCC == null) { System.Diagnostics.Debug.WriteLine(""); throw new NullReferenceException("Unexpected Problem in Atomic substitution..."); } newGrounded.Add(new GenericInstantiator.EdgeAggregator(antecedent, newCC, annotation)); return(newGrounded); }
public static List<GenericInstantiator.EdgeAggregator> CreateTransitiveCongruence(Congruent congruent1, Congruent congruent2) { List<GenericInstantiator.EdgeAggregator> newGrounded = new List<GenericInstantiator.EdgeAggregator>(); // // Create the antecedent clauses // List<GroundedClause> antecedent = new List<GroundedClause>(); antecedent.Add(congruent1); antecedent.Add(congruent2); // // Create the consequent clause // Congruent newCC = null; if (congruent1 is CongruentSegments) { CongruentSegments css1 = congruent1 as CongruentSegments; CongruentSegments css2 = congruent2 as CongruentSegments; Segment shared = css1.SegmentShared(css2); newCC = new AlgebraicCongruentSegments(css1.OtherSegment(shared), css2.OtherSegment(shared)); } else if (congruent1 is CongruentAngles) { CongruentAngles cas1 = congruent1 as CongruentAngles; CongruentAngles cas2 = congruent2 as CongruentAngles; Angle shared = cas1.AngleShared(cas2); newCC = new AlgebraicCongruentAngles(cas1.OtherAngle(shared), cas2.OtherAngle(shared)); } if (newCC == null) { System.Diagnostics.Debug.WriteLine(""); throw new NullReferenceException("Unexpected Problem in Atomic substitution..."); } newGrounded.Add(new GenericInstantiator.EdgeAggregator(antecedent, newCC, annotation)); return newGrounded; }
public CongruenceConstraint(Congruent congruence) : base() { conConstraint = congruence; }
public virtual int SharesNumClauses(Congruent thatCC) { return(0); }
// Return the number of shared segments in both congruences public override int SharesNumClauses(Congruent thatCC) { CongruentSegments ccss = thatCC as CongruentSegments; if (ccss == null) return 0; int numShared = cs1.Equals(ccss.cs1) || cs1.Equals(ccss.cs2) ? 1 : 0; numShared += cs2.Equals(ccss.cs1) || cs2.Equals(ccss.cs2) ? 1 : 0; return numShared; }
public CongruenceConstraint(Congruent congruence) : base() { conConstraint = congruence; }
// Return the number of shared angles in both congruences public override int SharesNumClauses(Congruent thatCC) { CongruentAngles ccas = thatCC as CongruentAngles; if (ccas == null) return 0; int numShared = ca1.Equates(ccas.ca1) || ca1.Equates(ccas.ca2) ? 1 : 0; numShared += ca2.Equates(ccas.ca1) || ca2.Equates(ccas.ca2) ? 1 : 0; return numShared; }
public virtual int SharesNumClauses(Congruent thatCC) { return 0; }