Package gprover

Class GDDBase

  • Direct Known Subclasses:
    GDD

    public class GDDBase
    extends Gib
    Base class for geometric deduction database operations.
    • Constructor Detail

      • GDDBase

        public GDDBase()
    • Method Detail

      • ch_lns

        public void ch_lns​(LLine ln1)
        Processes and adjusts collections of lines. Iterates through sub-line relationships to update and merge lines as needed.
        Parameters:
        ln1 - the initial line to process and potentially replace with merged data
      • add_tline_t

        public void add_tline_t​(int lm,
                                int p1,
                                int p2,
                                int p3,
                                int p4)
        Adds a TLine in test mode using input point indices.
        Parameters:
        lm - the lemma (identifier) for the TLine
        p1 - the first point of the first LLine
        p2 - the second point of the first LLine
        p3 - the first point of the second LLine
        p4 - the second point of the second LLine
      • adj_as_tn

        public void adj_as_tn​(int m1,
                              int m2,
                              Angles as)
        Adjusts tangency relationships for the specified angles structure by comparing the tangency lines associated with its component lines using the given markers.
        Parameters:
        m1 - a marker or point identifier used for tangency adjustment
        m2 - a marker or point identifier used for tangency adjustment
        as - the angles structure whose tangency relationships are to be adjusted
      • search_as_tn1

        public void search_as_tn1​(TLine tn1,
                                  TLine tn2,
                                  Angles as)
        Searches and adjusts transversal angles based on the provided t-lines.
        Parameters:
        tn1 - the first transversal line
        tn2 - the second transversal line
        as - the angle set to update
      • get_82l0

        public LLine get_82l0​(LLine l1,
                              LLine l2,
                              LLine l3,
                              LLine l4)
        Retrieves a line that matches the endpoints of two given line pairs.
        Parameters:
        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
        Returns:
        the matching line if found; otherwise, null
      • sbase

        public boolean sbase()
        Processes and validates all conclusions.
        Returns:
        true if all conclusions are processed successfully
      • setExample

        public final void setExample​(GTerm tm)
        Sets the example context for the theorem by initializing various parameters.
        Parameters:
        tm - the geometric term containing the example information
      • setConc

        public final void setConc​(Cond tco)
        Sets the conclusion condition.
        Parameters:
        tco - the condition object containing conclusion data
      • do_i_cons

        public boolean do_i_cons​(int ptn)
        Processes the individual conclusion for the specified index.
        Parameters:
        ptn - the conclusion index
        Returns:
        true after processing the conclusion
      • do_pd

        public boolean do_pd​(int ptn,
                             int t,
                             int[] p)
        Processes the predicate for a given conclusion based on its type and parameters.
        Parameters:
        ptn - the conclusion index
        t - the type of predicate
        p - an array of parameters associated with the predicate
        Returns:
        true if the predicate is processed successfully; false otherwise
      • add_cir_n

        public void add_cir_n​(int[] p)
        Adds a circle defined by the provided parameters.
        Parameters:
        p - an array containing circle parameters; p[2] must be non-zero
      • add_laratio

        public void add_laratio​(int p1,
                                int p2,
                                int p3,
                                int p4,
                                int t1,
                                int t2)
        Adds a line angle ratio by drawing lines between the provided endpoints and establishing squared ratio relationships.
        Parameters:
        p1 - the first point index
        p2 - the second point index
        p3 - the third point index
        p4 - the fourth point index
        t1 - the first ratio value (to be squared)
        t2 - the second ratio value (to be squared)
      • add_ratio

        public void add_ratio​(int p1,
                              int p2,
                              int p3,
                              int p4,
                              int t1,
                              int t2)
        Adds a congruence relation between segments based on the provided endpoints and squared ratio values.
        Parameters:
        p1 - the first point index of the first segment
        p2 - the second point index of the first segment
        p3 - the first point index of the second segment
        p4 - the second point index of the second segment
        t1 - the first ratio value (to be squared)
        t2 - the second ratio value (to be squared)
      • add_pg_ln

        public void add_pg_ln​(int[] p)
        Adds a polygon line by connecting the series of points in a loop.
        Parameters:
        p - an array of point indices representing the polygon vertices; a zero value indicates termination
      • add_r_trapezoid

        public void add_r_trapezoid​(int[] p)
        Adds a trapezoid by drawing the primary lines for its shape.
        Parameters:
        p - an array of 4 vertex indices representing the trapezoid
      • add_parallelogram

        public void add_parallelogram​(int[] p)
        Adds a parallelogram by drawing its outline, congruencies, and structural elements.
        Parameters:
        p - an array of 4 vertex indices representing the parallelogram
      • add_lozenge

        public void add_lozenge​(int[] p)
        Adds a lozenge by drawing its lines and congruencies.
        Parameters:
        p - an array of 4 vertex indices representing the lozenge
      • add_rectangle

        public void add_rectangle​(int[] p)
        Adds a rectangle by drawing its outline, tangents, congruencies, and structural elements.
        Parameters:
        p - an array of 4 vertex indices representing the rectangle
      • add_square

        public void add_square​(int[] p)
        Adds a square by drawing its lines, tangents, congruencies, and angle structures.
        Parameters:
        p - an array of 4 vertex indices representing the square
      • add_auxpt

        public boolean add_auxpt​(ProPoint pt)
        Adds an auxiliary point based on the provided ProPoint type.
        Parameters:
        pt - the ProPoint object containing point and type information
        Returns:
        true if the auxiliary point is added successfully; false otherwise
      • do_pred2

        public boolean do_pred2​(int[] p1,
                                int mk,
                                int ptn)
        Performs a predicate operation based on the given type.
        Parameters:
        p1 - the array of points and parameters (first element is used as predicate target)
        mk - the predicate type code
        ptn - the predicate target (overwritten by the first element of p1)
        Returns:
        true if the predicate action is executed successfully, false otherwise
      • add_e_triangle

        public final void add_e_triangle​(int ptn,
                                         int[] ps)
        Adds an equilateral triangle using the specified points.
        Parameters:
        ptn - the identifier or index used for the triangle
        ps - an array containing the triangle's vertex points
      • on_sts1

        public final int on_sts1​(int a,
                                 int b,
                                 int c,
                                 STris st)
        Checks whether a triangle with vertices a, b, and c exists in the given STris, considering all permutations of the vertices.
        Parameters:
        a - first vertex
        b - second vertex
        c - third vertex
        st - the STris instance to search
        Returns:
        the index of the matching triangle if found; otherwise, -1
      • on_sts

        public final int on_sts​(int a,
                                int b,
                                int c,
                                STris st)
        Checks for the existence of a triangle with vertices a, b, and c, in the given order, within a STris.
        Parameters:
        a - first vertex
        b - second vertex
        c - third vertex
        st - the STris instance to search
        Returns:
        the index of the triangle if it exists; otherwise, -1
      • add_to_sts

        public final void add_to_sts​(int d,
                                     int a,
                                     int b,
                                     int c,
                                     STris st)
        Adds a triangle with vertices a, b, and c to the specified STris if it does not already exist.
        Parameters:
        d - a multiplier or descriptor value for the triangle
        a - first vertex
        b - second vertex
        c - third vertex
        st - the STris instance to which the triangle will be added
      • cb_sts

        public final void cb_sts​(STris s,
                                 STris s1,
                                 int t)
        Merges triangle data from the secondary STris into the primary one, based on a specified index.
        Parameters:
        s - the primary STris instance
        s1 - the secondary STris instance to merge from
        t - the index within the secondary STris used for merging
      • add_sts1

        public final boolean add_sts1​(SimTri t)
        Attempts to add a SimTri to an existing STris structure.
        Parameters:
        t - the SimTri object representing the triangle to be added
        Returns:
        true if the list was updated successfully, false otherwise
      • add_sts

        public final void add_sts​(SimTri st)
        Adds a SimTri object to the appropriate STris structure or creates a new STris if necessary.
        Parameters:
        st - the SimTri object representing the triangle to add
      • collect_sts

        public void collect_sts()
        Collects and organizes triangles from all SimTri objects into STris structures.
      • add_to_cg

        public void add_to_cg​(int p1,
                              int p2,
                              CSegs cg)
        Adds a connection between two points into the specified CSegs.
        Parameters:
        p1 - the first point
        p2 - the second point
        cg - the CSegs instance where the connection is added
      • cb_cgs

        public void cb_cgs​(CSegs cg,
                           CSegs cg1)
        Merges connections from one CSegs instance into another.
        Parameters:
        cg - the primary CSegs instance
        cg1 - the secondary CSegs instance to merge from
      • on_cgs

        public boolean on_cgs​(int p1,
                              int p2,
                              CSegs cgs)
        Checks whether a connection between two points exists within the given CSegs.
        Parameters:
        p1 - the first point
        p2 - the second point
        cgs - the CSegs instance to check
        Returns:
        true if the connection exists, false otherwise
      • add_cgs

        public void add_cgs​(int p1,
                            int p2,
                            int p3,
                            int p4)
        Adds a connection between two pairs of points, merging with existing connections if applicable.
        Parameters:
        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
      • fd_ln_lp

        public LLine fd_ln_lp​(LLine ln,
                              int p)
        Searches for an LLine that is a super-line of the given line and contains the specified additional point. The method expects the found LLine to match the required point count.
        Parameters:
        ln - the base LLine to be contained
        p - the additional point to be present in the super-line
        Returns:
        the matching LLine if found; otherwise, null
      • xcir_n

        public final boolean xcir_n​(int o,
                                    int a,
                                    int b,
                                    int c,
                                    int d,
                                    int e)
        Checks whether a circle defined by the given set of points exists. This method initializes test parameters using the provided points and verifies the existence of a corresponding circle.
        Parameters:
        o - a parameter for the circle (e.g. origin)
        a - the first point
        b - the second point
        c - the third point
        d - the fourth point
        e - the fifth point
        Returns:
        true if the circle exists; otherwise, false
      • fd_ln1

        public LLine fd_ln1​(int p1,
                            int p2)
        Searches for an LLine that exactly contains the two specified points and has exactly one segment.
        Parameters:
        p1 - the first point
        p2 - the second point
        Returns:
        the matching LLine if found; otherwise, null
      • add_as

        public Angles add_as​(int lm,
                             LLine l1,
                             LLine l2,
                             LLine l3,
                             LLine l4)
        Adds an Angles object from the provided lines based on the project state.
        Parameters:
        lm - the lemma identifier
        l1 - the first line
        l2 - the second line
        l3 - the third line
        l4 - the fourth line
        Returns:
        the added Angles object
      • get_anti_pt

        public int get_anti_pt​(LLine ln,
                               int p,
                               int p1)
        Returns the anti midpoint from a line, excluding the specified endpoints.
        Parameters:
        ln - the line to search
        p - one of the endpoints
        p1 - the other endpoint
        Returns:
        the internal point on the line between p and p1, or 0 if not found
      • add_at

        public AngleT add_at​(int lemma,
                             int a,
                             int b,
                             int c,
                             int v)
        Adds an angle (AngleT) by creating it from line segments corresponding to points a, b, and c.
        Parameters:
        lemma - the lemma identifier
        a - the first point of the angle
        b - the vertex point of the angle
        c - the third point of the angle
        v - the angle value
        Returns:
        the created AngleT object
      • add_at0

        public AngleT add_at0​(int lemma,
                              int a,
                              int b,
                              int c,
                              int v)
        Adds an angle (AngleT) by creating it using line segments looked up directly.
        Parameters:
        lemma - the lemma identifier
        a - the first point of the angle
        b - the vertex point of the angle
        c - the third point of the angle
        v - the angle value
        Returns:
        the created AngleT object
      • add_at

        public AngleT add_at​(int lemma,
                             LLine l1,
                             LLine l2,
                             int v)
        Creates and adds an AngleT instance with the given lemma, lines, and angle value. Returns the created AngleT if successful, or null otherwise.
        Parameters:
        lemma - the lemma identifier
        l1 - the first line
        l2 - the second line
        v - the angle value
        Returns:
        the created AngleT instance or null
      • xatcong

        public boolean xatcong​(int a,
                               int b,
                               int c,
                               int v)
        Checks whether the angle formed by points a, b, and c is congruent to the specified angle value.
        Parameters:
        a - the first point
        b - the second point
        c - the third point
        v - the angle value to compare
        Returns:
        true if the angle is congruent; false otherwise
      • xatcong

        public boolean xatcong​(LLine l1,
                               LLine l2)
        Determines if the angle formed by the two lines is congruent.
        Parameters:
        l1 - the first line
        l2 - the second line
        Returns:
        true if the lines form a congruent angle or are collinear; false otherwise
      • fd_at

        public AngleT fd_at​(int p1,
                            int p2,
                            int p3)
        Finds an existing AngleT instance based on three points, mapping these points to corresponding lines.
        Parameters:
        p1 - the first point
        p2 - the second point
        p3 - the third point
        Returns:
        the found AngleT instance, or null if none exists
      • fo_at

        public AngleT fo_at​(int p1,
                            int p2,
                            int p3)
        Searches for the first AngleT instance that matches the line segments determined by the given points.
        Parameters:
        p1 - the first point
        p2 - the second point
        p3 - the third point
        Returns:
        the found AngleT instance, or null if not found
      • fd_at

        public AngleT fd_at​(LLine l1,
                            LLine l2)
        Finds an AngleT instance defined by the two specified lines.
        Parameters:
        l1 - the first line
        l2 - the second line
        Returns:
        the found AngleT instance, or null if it does not exist
      • check_ll_dr

        public boolean check_ll_dr​(int p,
                                   LLine l1,
                                   LLine l2,
                                   int d)
        Checks if the angle between the two lines at a specific point approximates the given angle measure.
        Parameters:
        p - the vertex point
        l1 - the first line
        l2 - the second line
        d - the expected angle in degrees
        Returns:
        true if the measured angle is approximately equal to d degrees; false otherwise
      • check_at_eq

        public boolean check_at_eq​(int t1,
                                   int t2)
        Checks if two angle measures are equal or supplementary.
        Parameters:
        t1 - the first angle measure
        t2 - the second angle measure
        Returns:
        true if the angles are equal or differ by 180 degrees; false otherwise
      • fo_atn

        public AngTn fo_atn​(LLine l1,
                            LLine l2,
                            LLine l3,
                            LLine l4)
        Searches for an AngTn instance with the specified set of four lines. The search considers both direct and reverse orders.
        Parameters:
        l1 - the first line
        l2 - the second line
        l3 - the third line
        l4 - the fourth line
        Returns:
        the found AngTn instance, or null if not found
      • fo_atn

        public AngTn fo_atn​(int a,
                            int b,
                            int c,
                            int d,
                            int a1,
                            int b1,
                            int c1,
                            int d1)
        Searches for an AngTn instance matching the provided point-derived line parameters. Various order combinations are evaluated.
        Parameters:
        a - the first point of the first line
        b - the second point of the first line
        c - the first point of the second line
        d - the second point of the second line
        a1 - the first point of the third line
        b1 - the second point of the third line
        c1 - the first point of the fourth line
        d1 - the second point of the fourth line
        Returns:
        the matching AngTn instance, or null if not found
      • adj_atn

        public void adj_atn​(AngTn atn)
        Adjusts the given angle tangent node if necessary.
        Parameters:
        atn - the AngTn node to adjust
      • add_atn

        public AngTn add_atn​(int lemma,
                             LLine l1,
                             LLine l2,
                             LLine l3,
                             LLine l4)
        Adds a new angle tangent node using four line objects.
        Parameters:
        lemma - the lemma identifier
        l1 - the first line in the angle configuration
        l2 - the second line in the angle configuration
        l3 - the third line in the angle configuration
        l4 - the fourth line in the angle configuration
        Returns:
        the new AngTn object, or null if creation fails
      • check_atn_dr

        public int check_atn_dr​(int a,
                                int b,
                                int c,
                                int a1,
                                int b1,
                                int c1)
        Checks the directional relationship between two angles defined by three points each.
        Parameters:
        a - the first point of the first angle
        b - the vertex point of the first angle
        c - the second point of the first angle
        a1 - the first point of the second angle
        b1 - the vertex point of the second angle
        c1 - the second point of the second angle
        Returns:
        0, 1, 2, or 3 for specific directional configurations, or -1 if false
      • getAtv

        public int getAtv​(int a,
                          int b,
                          int c,
                          AngleT at)
        Retrieves the adjusted angle value based on an AngleT object.
        Parameters:
        a - the first point for angle calculation
        b - the vertex point for angle calculation
        c - the second point for angle calculation
        at - the AngleT object containing the original angle value
        Returns:
        the adjusted angle value
      • getAtv

        public int getAtv​(int a,
                          int b,
                          int c,
                          int v)
        Computes the adjusted angle value using a given angle value.
        Parameters:
        a - the first point for angle calculation
        b - the vertex point for angle calculation
        c - the second point for angle calculation
        v - the initial angle value
        Returns:
        the adjusted angle value, or 0 if no adjustment is needed
      • search_only_exists_ln

        public boolean search_only_exists_ln()
        Determines if only existing lines should be searched.
        Returns:
        true if only existing lines are considered, false otherwise
      • search_only_exists_ln

        public boolean search_only_exists_ln​(int a,
                                             int b,
                                             int c,
                                             int d)
        Checks whether lines defined by two pairs of points exist.
        Parameters:
        a - the first point of the first line
        b - the second point of the first line
        c - the first point of the second line
        d - the second point of the second line
        Returns:
        true if at least one corresponding line does not exist, false otherwise
      • search_only_exists_ln

        public boolean search_only_exists_ln​(int a,
                                             int b,
                                             int c,
                                             int d,
                                             int e,
                                             int f)
        Checks whether lines defined by three pairs of points exist.
        Parameters:
        a - the first point of the first line
        b - the second point of the first line
        c - the first point of the second line
        d - the second point of the second line
        e - the first point of the third line
        f - the second point of the third line
        Returns:
        true if at least one corresponding line does not exist, false otherwise
      • search_only_exists_ln

        public boolean search_only_exists_ln​(LLine l1,
                                             LLine l2,
                                             LLine l3,
                                             LLine l4)
        Checks if the set of four lines satisfies the search criteria based on intersections.
        Parameters:
        l1 - the first line
        l2 - the second line
        l3 - the third line
        l4 - the fourth line
        Returns:
        true if the lines meet the search criteria, false otherwise
      • add_nodes

        public void add_nodes​(int[] p)
        Processes an array of integers to add nodes for a conclusion. Each group of three integers represents properties of one node. If an extra integer exists after grouping, it is processed as a separate node.
        Parameters:
        p - the array of integers representing node properties (zero-terminated)
      • cp_nodes

        public LList cp_nodes​(LList ns)
        Creates and returns a copy of the given node list.
        Parameters:
        ns - the original node list to copy
        Returns:
        a new node list copied from the provided list
      • add_nodes

        public void add_nodes​(LList d)
        Adds the specified node list to the global node list if it is not already present.
        Parameters:
        d - the node list to add
      • x_list

        public boolean x_list​(LList ls)
        Checks whether an equivalent node list already exists in the collection.
        Parameters:
        ls - the node list to check
        Returns:
        true if an equivalent list exists; false otherwise
      • eq_list

        public boolean eq_list​(LList ls,
                               LList ls1)
        Compares two node lists for equality based on their node and factor arrays.
        Parameters:
        ls - the first node list
        ls1 - the second node list
        Returns:
        true if both lists are equal; false otherwise
      • eq_mnde

        public boolean eq_mnde​(Mnde m1,
                               Mnde m2)
        Determines if two Mnde objects are equivalent. Equivalence is based on the type value and, if present, the associated transformation.
        Parameters:
        m1 - the first Mnde object
        m2 - the second Mnde object
        Returns:
        true if both Mnde objects are considered equal; false otherwise
      • fadd_tr

        public AngTr fadd_tr​(int v,
                             int t1,
                             int t2,
                             LLine l1,
                             LLine l2)
        Retrieves an existing AngTr object matching the specified parameters, or creates a new one if none exists.
        Parameters:
        v - the angle value
        t1 - the first transformation parameter
        t2 - the second transformation parameter
        l1 - the first line
        l2 - the second line
        Returns:
        an existing or newly created AngTr object based on the parameters
      • add_tr

        public AngTr add_tr​(int v,
                            LLine l1,
                            LLine l2)
        Creates and returns a new AngTr object with the specified angle value and lines.
        Parameters:
        v - the angle value
        l1 - the first line
        l2 - the second line
        Returns:
        a new AngTr object initialized with the provided parameters
      • fd_tr

        public AngTr fd_tr​(int v,
                           LLine l1,
                           LLine l2)
        Searches for an existing AngTr object that matches the specified angle value and lines.
        Parameters:
        v - the angle value
        l1 - the first line
        l2 - the second line
        Returns:
        the matching AngTr object if found; otherwise, null