Package gprover

Class GDDBc

  • Direct Known Subclasses:
    MathBase

    public class GDDBc
    extends GDDAux
    GDDBc class handles the geometric proof process and predicate management.
    • Constructor Detail

      • GDDBc

        public GDDBc()
        Constructs a new GDDBc instance initializing proof status, depth, and check value.
    • Method Detail

      • add_pred_coll

        public void add_pred_coll​(Cond pr,
                                  Cond pr1,
                                  Cond pr2)
        Adds a predicate for a collision based on the given conditions. Determines the appropriate collision predicate by checking common line intersections and adds a corresponding parallel predicate condition.
        Parameters:
        pr - the main condition to add to
        pr1 - the first sub-condition containing line information
        pr2 - the second sub-condition containing line information
      • add_pred_para

        public void add_pred_para​(Cond pr,
                                  Cond pr1,
                                  Cond pr2)
        Adds a predicate for parallelism based on the provided sub-conditions. Chooses the appropriate rule based on a lemma value and constructs the relevant predicate conditions using line or angle data.
        Parameters:
        pr - the main condition to add to
        pr1 - the first sub-condition providing primary predicate data
        pr2 - the second sub-condition providing supplementary predicate data
      • add_pred_perp

        public void add_pred_perp​(Cond pr,
                                  Cond pr1,
                                  Cond pr2)
        Adds a predicate for perpendicularity based on the given conditions. Selects the appropriate perpendicularity rule using a lemma value and established geometric relationships, then adds the resulting predicate condition.
        Parameters:
        pr - the main condition in which the predicate is to be added
        pr1 - the first sub-condition providing geometric entity information
        pr2 - the second sub-condition providing geometric entity information
      • add_pred_cr

        public void add_pred_cr​(Cond pr,
                                Cond pr1,
                                Cond pr2)
        Adds a predicate for cyclic configurations based on the given conditions. Extracts circle information from the sub-conditions and creates cyclic predicate conditions.
        Parameters:
        pr - the main condition to add to
        pr1 - the first sub-condition containing circle data
        pr2 - the second sub-condition containing circle data
      • add_pred_cyclic1

        public Cond add_pred_cyclic1​(Cond pr,
                                     ACir c1)
        Constructs a cyclic predicate condition from the given circle. Calculates a set of points on the circle and creates a cyclic predicate condition.
        Parameters:
        pr - the original condition used to reference predicate parameters
        c1 - the circle from which cyclic properties are derived
        Returns:
        a new predicate condition representing the cyclic property
      • add_pred_pntn

        public Cond add_pred_pntn​(int m,
                                  int n,
                                  int p1,
                                  int p2,
                                  LLine l1,
                                  int p3,
                                  int p4,
                                  LLine l2)
        Adds a predicate based on points and two lines. Determines appropriate points on the provided lines and constructs a predicate condition with the supplied parameters.
        Parameters:
        m - the mode or additional modifier for the predicate
        n - the predicate type identifier
        p1 - the first point reference
        p2 - the second point reference
        l1 - the first line for the predicate
        p3 - the third point reference
        p4 - the fourth point reference
        l2 - the second line for the predicate
        Returns:
        a new predicate condition based on the given point and line data
      • add_pred_tn13

        public Cond add_pred_tn13​(int m,
                                  int n,
                                  int p1,
                                  int p2,
                                  LLine l1,
                                  int p3,
                                  int p4,
                                  LLine l2)
        Adds a predicate based on tangent line intersections. Determines intersection points or valid points from the two lines and constructs a tangent rule predicate with the specified parameters.
        Parameters:
        m - the mode or modifier for the predicate
        n - the predicate type
        p1 - the first point candidate for line l1
        p2 - the second point candidate for line l1
        l1 - the first line used to determine the tangent condition
        p3 - the first point candidate for line l2
        p4 - the second point candidate for line l2
        l2 - the second line used to determine the tangent condition
        Returns:
        a new predicate condition representing the tangent rule
      • add_pred_atn

        public void add_pred_atn​(Cond pr,
                                 Cond pr1,
                                 Cond pr2)
        Adds a predicate for angle tangency based on the provided conditions. Uses geometric relationships from the sub-conditions to construct an angle tangency predicate.
        Parameters:
        pr - the main condition to which the predicate will be added
        pr1 - the first sub-condition containing angle information
        pr2 - the second sub-condition that may provide additional angle data
      • add_pred_atn_atnas

        public boolean add_pred_atn_atnas​(Cond pr,
                                          LLine l1,
                                          LLine l2,
                                          LLine l3,
                                          LLine l4,
                                          LLine s1,
                                          LLine s2,
                                          LLine s3,
                                          LLine s4)
        Adds predicates for angle tangency transformations based on paired line configurations. Compares the relationships between two sets of lines and constructs paired predicates to represent angle tangent conditions.
        Parameters:
        pr - the main condition to add the predicates to
        l1 - the first line of the first pair
        l2 - the second line of the first pair
        l3 - the first line of the second pair
        l4 - the second line of the second pair
        s1 - the first line of the complementary pair
        s2 - the second line of the complementary pair
        s3 - the third line used for additional tangent validation
        s4 - the fourth line used for additional tangent validation
        Returns:
        true if the appropriate tangent predicates were added; false otherwise
      • add_pred_at

        public void add_pred_at​(Cond pr,
                                Cond pr1,
                                Cond pr2)
        Adds an angle tangency predicate based on provided angle transformations. Analyzes the relationships between two angle-based conditions and constructs corresponding tangent predicates.
        Parameters:
        pr - the main condition to modify
        pr1 - the first sub-condition containing angle transformation data
        pr2 - the second sub-condition containing angle transformation data
      • add_pred_as

        public void add_pred_as​(Cond pr,
                                Cond pr1,
                                Cond pr2)
        Processes the provided conditions and angle structures to add angle predicates.
        Parameters:
        pr - the main condition to add predicates to
        pr1 - the first condition containing angle information
        pr2 - the second condition containing angle information
      • add_as82_t

        public void add_as82_t​(Cond pr,
                               Angles as1,
                               Angles as2)
        Creates angle predicates by comparing two angle structures and adds them to the condition.
        Parameters:
        pr - the target condition to add predicates to
        as1 - the first angle structure
        as2 - the second angle structure
      • add_as82t1

        public boolean add_as82t1​(Cond pr,
                                  LLine l1,
                                  LLine l2,
                                  LLine l3,
                                  LLine l4,
                                  LLine l5,
                                  LLine l6,
                                  LLine l7,
                                  LLine l8)
        Attempts to add angle congruence predicates using candidate lines from two angle structures.
        Parameters:
        pr - the condition containing predicate parameters
        l1 - the first line from the first structure
        l2 - the second line from the first structure
        l3 - the first line from the second structure
        l4 - the second line from the second structure
        l5 - a candidate line from the first structure of the second angle structure
        l6 - a candidate line from the first structure of the second angle structure
        l7 - a candidate line from the second structure of the second angle structure
        l8 - a candidate line from the second structure of the second angle structure
        Returns:
        true if predicates were successfully added; false otherwise
      • get_cond_ln

        public LLine[] get_cond_ln​(int[] p,
                                   LLine l1,
                                   LLine s1,
                                   LLine l2,
                                   LLine l3,
                                   LLine s2,
                                   LLine l4)
        Retrieves candidate lines if all predicate parameters lie on the specified lines.
        Parameters:
        p - the integer array of predicate parameters
        l1 - the first line to check
        s1 - the candidate line corresponding to l1
        l2 - the second line to check
        l3 - the third line to check
        s2 - the candidate line corresponding to l3
        l4 - the fourth line to check
        Returns:
        an array containing two candidate lines if conditions match; null otherwise
      • on_ln4

        public boolean on_ln4​(int[] p,
                              LLine l1,
                              LLine l2,
                              LLine l3,
                              LLine l4)
        Checks whether each pair of predicate parameters corresponds to a point on the given lines.
        Parameters:
        p - the integer array of predicate parameters
        l1 - the first line for verification
        l2 - the second line for verification
        l3 - the third line for verification
        l4 - the fourth line for verification
        Returns:
        true if each predicate parameter pair lies on the corresponding line; false otherwise
      • add_as82

        public void add_as82​(Cond pr,
                             Angles as1,
                             Angles as2)
        Processes angle structures to determine appropriate lines and add angle congruence predicates.
        Parameters:
        pr - the condition object holding predicate parameters
        as1 - the first angle structure
        as2 - the second angle structure
      • add_pred_4p_tang

        public Cond add_pred_4p_tang​(int m,
                                     int n,
                                     int p1,
                                     int p2,
                                     int p3,
                                     int p4,
                                     int p5)
        Creates a tangent predicate using four point parameters and an additional value.
        Parameters:
        m - a mode or flag for predicate creation
        n - a predicate type identifier
        p1 - the first point of the first pair
        p2 - the second point of the first pair
        p3 - the first point of the second pair
        p4 - the second point of the second pair
        p5 - an additional parameter influencing the tangent value
        Returns:
        a newly created condition representing a tangent predicate
      • get_at2_v

        public int get_at2_v​(int p1,
                             int p2,
                             int p3,
                             int p4,
                             AngleT at1,
                             AngleT at2)
        Determines the angle transformation value based on the provided points and angle transformation objects.
        Parameters:
        p1 - the first point for comparison
        p2 - the second point for comparison
        p3 - the third point for comparison
        p4 - the fourth point for comparison
        at1 - the first angle transformation object
        at2 - the second angle transformation object
        Returns:
        the computed angle value
      • gen_dbase_text

        public void gen_dbase_text()
        Generates textual representations for all geometric entities in the database. This includes midpoints, lines, points, circles, angles, and other conditions.
      • show_ast

        public void show_ast​(AngSt ast)
        Displays an angle statement from an angle statement object.
        Parameters:
        ast - the angle statement object to be displayed
      • insertVector

        public void insertVector​(CClass obj,
                                 java.util.Vector v)
        Inserts a CClass object into a sorted Vector based on its identifier.
        Parameters:
        obj - the CClass object to be inserted
        v - the Vector collection maintaining sorted CClass objects
      • getAll_md

        public java.util.Vector getAll_md()
        Returns a Vector containing all MidPt objects with a non-zero type.
        Returns:
        a Vector of valid MidPt objects
      • getAll_ln

        public java.util.Vector getAll_ln()
        Returns a Vector containing all LLine objects with a non-zero type and at least 2 points.
        Returns:
        a Vector of valid LLine objects
      • getAll_pn

        public java.util.Vector getAll_pn()
        Returns a Vector containing all PLine objects with a non-zero type.
        Returns:
        a Vector of valid PLine objects
      • getAll_tn

        public java.util.Vector getAll_tn()
        Returns a Vector containing all TLine objects with a non-zero type.
        Returns:
        a Vector of valid TLine objects
      • getAll_cir

        public java.util.Vector getAll_cir()
        Returns a Vector containing all ACir objects with a non-zero type and at least 2 points.
        Returns:
        a Vector of valid ACir objects
      • getAll_as

        public java.util.Vector getAll_as()
        Returns a Vector containing all AngSt objects with a non-zero type.
        Returns:
        a Vector of valid AngSt objects
      • getAll_at

        public java.util.Vector getAll_at()
        Returns a Vector containing all AngleT objects with a non-zero type.
        Returns:
        a Vector of valid AngleT objects
      • getAll_atn

        public java.util.Vector getAll_atn()
        Returns a Vector containing all AngTn objects with a non-zero type.
        Returns:
        a Vector of valid AngTn objects
      • getAll_cg

        public java.util.Vector getAll_cg()
        Returns a Vector containing all CSegs objects with a non-zero type.
        Returns:
        a Vector of valid CSegs objects
      • getAll_rg

        public java.util.Vector getAll_rg()
        Returns a Vector containing all CongSeg objects with a non-zero type.
        Returns:
        a Vector of valid CongSeg objects
      • getAll_ra

        public java.util.Vector getAll_ra()
        Returns a Vector containing all RatioSeg objects with a non-zero type.
        Returns:
        a Vector of valid RatioSeg objects
      • getAll_sts

        public java.util.Vector getAll_sts()
        Returns a Vector containing all STris objects with a non-zero type.
        Returns:
        a Vector of valid STris objects
      • getAll_cts

        public java.util.Vector getAll_cts()
        Returns a Vector containing all STris objects (alternate set) with a non-zero type.
        Returns:
        a Vector of valid alternate STris objects
      • search_a_fact

        public java.util.Vector search_a_fact​(int t,
                                              java.lang.String s1,
                                              java.lang.String s2,
                                              java.lang.String s3)
        Searches for a fact based on the specified type and string parameters.
        Parameters:
        t - the fact type selector
        s1 - the first string parameter
        s2 - the second string parameter
        s3 - the third string parameter
        Returns:
        a Vector containing the matching fact objects
      • check_tValid

        public boolean check_tValid​(Cond c)
        Checks if the given condition is valid. Validity depends on whether the predicate is CO_ACONG and specific point values satisfy the anti-angle criteria.
        Parameters:
        c - the condition to be validated
        Returns:
        true if the condition is valid; false otherwise
      • parse_llist

        public void parse_llist()
        Parses the global node list, processes sublists, and displays the list content using backup and preview mechanisms.
      • search_ag_split

        public void search_ag_split​(LList ls)
        Searches for angle splitting opportunities within the given node list and adds corresponding split rules.
        Parameters:
        ls - the node list to search for angle splits
      • search_t_list

        public void search_t_list​(LList ls)
        Searches the TLine list for applicable transformations and adds corresponding rules to the given node list.
        Parameters:
        ls - the node list to process for transformation rules
      • search_p_list

        public void search_p_list​(LList ls)
        Searches the node list for predicate rules based on angle properties and anti-point values, adding matching rules.
        Parameters:
        ls - the node list to search for predicate rules
      • search_list_tn

        public void search_list_tn​(LList ls,
                                   LLine l1,
                                   LLine l2,
                                   int v)
        Searches the node list for transformation matches based on the given lines and intersection value, and adds corresponding tag rules.
        Parameters:
        ls - the node list to search
        l1 - the first line for the search criteria
        l2 - the second line for the search criteria
        v - the intersection value used for matching
      • add_rule_tag

        public Rule add_rule_tag​(LLine l1,
                                 LLine l2)
        Creates and returns a tag rule for an angle based on the intersection of two lines.
        Parameters:
        l1 - the first line for the rule
        l2 - the second line for the rule
        Returns:
        a tag rule with angle relations configured
      • add_rule_spag

        public Rule add_rule_spag​(int v,
                                  LLine l1,
                                  LLine l2,
                                  LLine l3)
        Creates and returns a split-angle rule that partitions an angle into sub-angles using the given lines.
        Parameters:
        v - the angle value used for splitting
        l1 - the first line for the transformation
        l2 - the second line forming the angle vertex
        l3 - the third line completing the new angle configuration
        Returns:
        a split-angle rule containing the constructed transformations
      • add_rule_p_ag

        public Rule add_rule_p_ag​(AngTr t)
        Creates a P_ANGLE rule using the provided angle transformation.
        Parameters:
        t - the angle transformation containing the angle value and associated lines
        Returns:
        a new Rule object of type P_ANGLE
      • add_rule_exag

        public Rule add_rule_exag​(int v,
                                  LLine l1,
                                  LLine l2,
                                  LLine l3)
        Creates an EX_ANGLE rule based on three lines forming an angle.
        Parameters:
        v - the angle value
        l1 - the first line
        l2 - the second line
        l3 - the third line
        Returns:
        a new Rule object of type EX_ANGLE, or null if a valid intersection is not found
      • list_sub

        public void list_sub​(LList ls,
                             Rule r)
        Subtracts matching nodes from the provided node list using the specified rule.
        Parameters:
        ls - the original node list
        r - the rule to apply for subtracting matching nodes
      • getPVector

        public java.util.Vector getPVector()
        Retrieves a vector of node lists sorted by their point counts.
        Returns:
        a Vector containing sorted node lists
      • show_llist

        public void show_llist​(LList ls)
        Displays a single node list in a formatted manner.
        Parameters:
        ls - the node list to be displayed
      • show_llists

        public void show_llists​(java.util.Vector v)
        Displays all node lists contained in the provided vector.
        Parameters:
        v - a vector containing node lists to be displayed
      • show_mnde

        public void show_mnde​(Mnde m)
        Displays the Mnde object either by showing its transformation or its angle value.
        Parameters:
        m - the Mnde object to be displayed
      • find_tr_in_ls

        public AngTr find_tr_in_ls​(AngTr t,
                                   LList ls)
        Searches the node list for an angle transformation matching the specified transformation.
        Parameters:
        t - the target angle transformation to find
        ls - the node list to search for a matching transformation
        Returns:
        the matching AngTr object if found; otherwise, null