Class Full
- java.lang.Object
-
-
Field Summary
-
Fields inherited from class gprover.Poly
PRO_AREA, PRO_COLL, PRO_FULL, PRO_GB, PRO_GDD, PRO_MTIME, PRO_VEC, PRO_WU
-
Fields inherited from class gprover.Gib
A_180, A_30, A_360, A_45, A_60, A_90, A_TIME, all_as, all_ast, all_at, all_atn, all_cg, all_cgs, all_cir, all_ct, all_cts, all_ln, all_md, all_nd, all_ns, all_pg, all_pn, all_ra, all_rg, all_st, all_sts, all_tn, all_tr, allcns, allpts, C_ANGLE_BISECTOR, C_CCTANGENT, C_CENT, C_CIRCLE, C_CIRCUM, C_CONSTANT, C_EQ_TRI, C_EQANGLE, C_EQANGLE3P, C_EQDISTANCE, C_FOOT, C_I_AA, C_I_BA, C_I_BB, C_I_BC, C_I_BR, C_I_CC, C_I_CR, C_I_EQ, C_I_LA, C_I_LB, C_I_LC, C_I_LL, C_I_LP, C_I_LR, C_I_LS, C_I_LT, C_I_PA, C_I_PB, C_I_PC, C_I_PP, C_I_PR, C_I_PT, C_I_RR, C_I_SS, C_I_TA, C_I_TB, C_I_TC, C_I_TR, C_I_TT, C_ICENT, C_ICENT1, C_INVERSION, C_ISO_TRI, C_LC_TANGENT, C_LINE, C_LOZENGE, C_LRATIO, C_MIDPOINT, C_NETRIANGLE, C_NRATIO, C_NSQUARE, C_O_A, C_O_AB, C_O_B, C_O_C, C_O_D, C_O_L, C_O_P, C_O_R, C_O_S, C_O_T, C_ORTH, C_PARALLELOGRAM, C_PENTAGON, C_PETRIANGLE, C_POINT, C_POLYGON, C_PRATIO, C_PSQUARE, C_QUADRANGLE, C_R_TRAPEZOID, C_R_TRI, C_RATIO, C_RECTANGLE, C_REF, C_SANGLE, C_SQUARE, C_SYM, C_TRAPEZOID, C_TRATIO, C_TRIANGLE, ck_value, cns_no, CO_12, CO_ACONG, CO_ATNG, CO_COLL, CO_CONG, CO_CTRI, CO_CYCLIC, co_db, CO_EQ, CO_HARMONIC, CO_INCENT, CO_MIDP, CO_NANG, CO_NSEG, CO_ORTH, CO_PARA, CO_PBISECT, CO_PERP, CO_PET, CO_PETRI, CO_PROD, CO_RATIO, CO_STRI, CO_TANG, CO_TANGENT, co_xy, conc, cons_no, d_base, DEBUG, depth, EQ_TRI, FE_TYPE_ERROR, gno, gt, IN_AG_INSIDE, IN_AG_OUTSIDE, IN_BETWEEN, IN_OPP_SIDE, IN_PARA_INSIDE, IN_PG_CONVEX, IN_SAME_SIDE, IN_TRI_INSIDE, ISO_TRI, last_as, last_ast, last_at, last_atn, last_cg, last_cgs, last_cir, last_ct, last_cts, last_ln, last_md, last_nd, last_ns, last_pg, last_pn, last_ra, last_rg, last_st, last_sts, last_tn, last_tr, LOZENGE, NDG_ACONG, NDG_COLL, NDG_CONG, NDG_CYCLIC, NDG_NEQ, NDG_NON_ISOTROPIC, NDG_PARA, NDG_PERP, NDG_TRIPLEPI, P_STATUS, PARALLELOGRAM, PENTAGON, POLYGON, printype, pts_no, pts_pno, QUADRANGLE, R_AA_STRI, R_AAS, R_AG_ALL, R_AG_ATN, R_AG_BISECTOR_ATIO, R_AG_PP12, R_AG_PP13, R_AG_SPECIAL, R_AG_TT12, R_AG_TT13, R_AS_PLUS, R_ASRA_STRI, R_CR_AS2, R_CR_DM_MD, R_CR_DM_T, R_CR_INSCRIBE_AS, R_CR_OO_B, R_CR_P_EQARC, R_CR_TAN_AS, R_CTRI, R_ISO_3L, R_ISOCELES, R_MID_CONNECTION, R_MID_CONNECTION_TRAPZOID, R_P_COLL, R_P_RA, R_PARALLELOGRAM, R_PL_AS, R_PT_T, R_PYTH_THM, R_RA_ST_CT, R_RATIO, R_RTRI_MD_CY, R_SAS, R_SEARCH_ALL_LN, R_SSS, R_ST_RAAS, R_STRI, R_T_AT90, R_TRAPEZOID, R_TRI, R_TRI_ALL_AG_180, R_TRI_EQ, R_TT_CY, R_TT_MDCY, R_TT_PP, R_TTCG2_CT, RECTANGLE, RF_10, RF_12, RF_13, RF_14, RF_15, RF_16, RF_17, RF_18, RF_20, RF_21, RF_22, RF_26, RF_9, RF_ADDITION, RF_CY, RF_CY2, RF_DEFINITION, RF_DM_PERP, RF_DM2, RF_GIB, RF_INSCRIBE, RF_ISO, RF_MINUS, RF_ORTH, RF_PARA, RF_PERP, RF_PERP_SPLIT, RF_PPO, RF_TT, RF_TT2, RValue, show_detail, show_dtype, sout, SQUARE, test_c, test_ln, test_ra, test_ra1, TRAPEZOID, tri_type, TRIANGLE, vauxptf, vauxpts, ZERO
-
-
Constructor Summary
Constructors Constructor Description Full()Constructs a new Full object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd_coll_para(Cons cs, java.util.Vector v1)Creates and adds a collinearity constraint in parallel form based on a construction.voidadd_cons(int type, int a, int b, int c, int d, int e, int f, int g, NdgCs d1)Creates a new constraint with 7 points and adds it to the specified NDG constraint set.voidadd_cons(int type, int a, int b, int c, int d, NdgCs d1)Creates a new constraint with 4 points and adds it to the specified NDG constraint set.protected XTermadd_deduction(XTerm x)Performs angle deduction on the given XTerm.protected CNdgadd_n_coll(int a, int b, int c, java.util.Vector v1)Creates and adds a collinearity NDG constraint based on three points.protected CNdgadd_n_isotropic(int a, int b, java.util.Vector v1)Creates and adds a non-isotropic NDG constraint based on two points.voidadd_n_neq(int a, int b, java.util.Vector v1)Adds a non-equality NDG constraint for the given points.protected CNdgadd_n_pt(int type, int a, int b, int c, int d, java.util.Vector v1)Creates and adds an NDG constraint representing parallelism or perpendicularity.protected CNdgadd_ndg_coll(int a, int b, int c)Creates a collinearity NDG constraint from three points.protected CNdgadd_ndg_cong(int a, int b, int c, int d)Creates a congruency NDG constraint based on four points.protected CNdgadd_ndg_neq(int a, int b)Creates a non-equality NDG constraint for two points.protected CNdgadd_ndg_para(int a, int b, int c, int d)Creates a parallel NDG constraint based on four point indices.protected CNdgadd_ndg_para(Var v)Creates a parallel NDG constraint using the points of a given variable.protected CNdgadd_ndg_perp(int a, int b, int c, int d)Creates a perpendicular NDG constraint based on four point indices.protected CNdgadd_ndg_perp(Var v)Creates a perpendicular NDG constraint using the points of a given variable.protected CNdgadd_ndg_triplePI(Var v)Creates a Triple PI NDG constraint from the specified variable.protected voidadd_ndgs(CNdg d, java.util.Vector vlist)Adds an NDG constraint to the specified vector.protected voidadd_neqTo(int a, int b, java.util.Vector v4)Checks and adds a non-equality constraint between two points if not already present.voidaddConsToNdgcs(Cons c, NdgCs d)Adds the provided constraint to the given NDG constraint set.protected voidaddxtermndg(XTerm x, java.util.Vector v4)Converts an XTerm into an NDG constraint and adds its printed representation.voidangle_deduction(CNdg c, java.util.Vector v4)Deduces angle-based NDG constraints and processes them.protected XTermangle_deduction(XTerm p1)Performs angle deduction on the given XTerm.booleancanExpressedAsFullAngle()Returns true if a full angle proof is expressed.protected booleanck_allFree(CNdg d)Checks whether all points in the given CNdg constraint are free.booleanck_right(Cons c, NdgCs cs, int type)Checks whether the specified constraint is recursively valid with respect to the given NDG type.booleanck_right(NdgCs c, int type)Recursively checks constraints in an NDG constraint set for consistency.intcompare(CNdg d1, CNdg d2)Compares two NDG constraints based on their maximum integer values.booleanconstruct_related(int t)Determines whether a constraint type is considered related to construction operations.voidfconc_coll(int a, int b, int c)Processes the collinearity condition for full angle concatenation.booleanfconc_cong(int a, int b, int c, int d)Processes the congruence condition for full angle concatenation.protected voidfilter_ndg(java.util.Vector v4)Filters out redundant NDG constraints in the given vector.protected voidfilter_ndg(java.util.Vector v2, java.util.Vector v3)Filters and merges NDG constraints from vector v2 into vector v3.protected XTermfinal_deduction(XTerm p1)Applies a final deduction adjustment to an XTerm.booleanfreeCS(int t)Determines if the given construction type represents a free state.booleanfreeCSP(int index)Checks whether the point at the given index is free from constraints.voidget_ndgs(java.util.Vector v1, java.util.Vector v2, java.util.Vector v3, java.util.Vector v4)Populates the provided vectors with non-degenerate geometry constraints (NDGs) from constructions.protected voidget_ndgstr(CNdg d)Sets the string representation (sd) of the given NDG constraint (d) based on its type and associated points.NdgCsgetCS(CNdg d)Constructs and returns an NDG constraint set (NdgCs) associated with the given inequality constraint.intgetErrorType()Returns the error type encountered during proof processing.GrTermgetFullAngleProofHead()Retrieves the head of the full angle proof.voidinit_ndgs(java.util.Vector v1)Initializes non-degenerate geometry constraints (NDGs) from existing constructions.booleanisConstructionType(int type)Determines if a given type represents a valid construction.booleanisProvedTrue()Determines if the proof has been established as true.voidmyprint_p1(XTerm p1, boolean first)Prints an XTerm (mathematical expression) with its variable and coefficient.voidndg_deduction(java.util.Vector v3, java.util.Vector v4)Performs NDG (non-degeneracy) deduction on a set of NDG constraints.protected booleanndg_eq(CNdg n1, CNdg n2)Checks whether two NDG constraints are equal.protected booleanndg_less(CNdg n1, CNdg n2)Compares two NDG constraints to determine if the first is less significant than the second.XTermopt_tri(XTerm x)Optimizes the given XTerm by detecting and processing triangle configurations.NdgCsparse_neq(CNdg nd)Parses non-equality and non-isotropic NDG constraints by replacing point indices, reordering constraints, and invoking further parsing, cleanup, and optimization steps.voidparse_neq(java.util.Vector v4)Parses non-equality and non-isotropic NDG constraints from the given vector.booleanprint_prooftext()Prints the proof text.protected voidreorder22(CNdg n)Reorders two pairs of points in an NDG constraint so that each pair is in ascending order.protected voidreorder3(CNdg n)Reorders the points in an NDG constraint (with three points) into ascending order.static voidset_showdetai(boolean d)Sets the flag to show details.voidsortVector(java.util.Vector v4)Sorts a vector of NDG constraints in ascending order based on their significance.protected voidxterm_1term(XTerm x, java.util.Vector vlist)Processes an XTerm with one term to generate NDG constraints.protected voidxterm_2term(XTerm x, java.util.Vector vlist)Processes an XTerm with two terms to generate NDG constraints.protected voidxterm2ndg(XTerm x, java.util.Vector vlist)Converts an XTerm into NDG constraints and adds them to the provided list.-
Methods inherited from class gprover.GDDBc
add_as82, add_as82_t, add_as82t1, add_pred_4p_tang, add_pred_as, add_pred_at, add_pred_atn, add_pred_atn_atnas, add_pred_coll, add_pred_cr, add_pred_cyclic1, add_pred_para, add_pred_perp, add_pred_pntn, add_pred_tn13, add_rule_exag, add_rule_p_ag, add_rule_spag, add_rule_tag, check_tValid, find_tr_in_ls, gen_dbase_text, get_at2_v, get_cond_ln, getAll_as, getAll_at, getAll_atn, getAll_cg, getAll_cir, getAll_cts, getAll_ln, getAll_md, getAll_pn, getAll_ra, getAll_rg, getAll_sts, getAll_tn, getPVector, insertVector, list_sub, on_ln4, parse_llist, search_a_fact, search_ag_split, search_list_tn, search_p_list, search_t_list, show_ast, show_llist, show_llists, show_mnde
-
Methods inherited from class gprover.GDDAux
add_aux, ax_backward, ax_bk_mid, ax_cg, cal_ax_co, cal_ax_foot, cal_ax_ilc, cal_ax_ill, cal_ax_ilp, cal_ax_ipc, cal_ax_md, cal_ax_tn, fd_aux_name, time_over, time_start
-
Methods inherited from class gprover.GDD
add_ls_et, add_ls_node_sub, add_rule_eqag, add_stct_at, add_tri_tn_at, adj_as0, adj_at, adj_ct, adj_st, check_llatn, mcoll, mperp, ptdr, search_2cong1, search_as_ct, search_as_st, search_as_tn_as, search_at, search_at_as, search_at_ass, search_at_at, search_at_tn, search_at0, search_at1, search_atatn, search_atn, search_atn_as, search_atn_at, search_atn_atn, search_atnas, search_bk, search_bk_as, search_cg__plus_or_minus, search_cg_aas, search_cg_cg, search_cg_ct, search_cg_ct0, search_cg_md, search_cg_st0, search_cgs, search_cong_st, search_md_cong, search_ns, search_pn_cr, search_pn_pn, search_rg_at, search_st1, search_tn_at, search_tn_atn, search_tn_ats, search_tn_cg, search_tn_st
-
Methods inherited from class gprover.GDDBase
add_as, add_at, add_at, add_at0, add_atn, add_auxpt, add_cgs, add_cir_n, add_e_triangle, add_laratio, add_lozenge, add_nodes, add_nodes, add_parallelogram, add_pg_ln, add_r_trapezoid, add_ratio, add_rectangle, add_square, add_sts, add_sts1, add_tline_t, add_to_cg, add_to_sts, add_tr, adj_as_tn, adj_atn, cb_cgs, cb_sts, ch_lns, check_at_eq, check_atn_dr, check_ll_dr, collect_sts, cp_nodes, do_i_cons, do_pd, do_pred2, eq_list, eq_mnde, fadd_tr, fd_at, fd_at, fd_ln_lp, fd_ln1, fd_tr, fo_at, fo_atn, fo_atn, get_82l0, get_anti_pt, getAtv, getAtv, on_cgs, on_sts, on_sts1, sbase, search_as_tn1, search_only_exists_ln, search_only_exists_ln, search_only_exists_ln, search_only_exists_ln, setConc, setExample, x_list, xatcong, xatcong, xcir_n
-
Methods inherited from class gprover.Gib
addAngst, check_angle_ls_90, check_ateq, check_atn, check_eqangle, check_eqangle, check_eqangle_t, check_eqdistance, check_eqdistance, check_ratio, ck_4peq, ck_dr, collect_angst, exit, fd_ast, fd_pt, fd_pt, gerror, getAngleValue, getAngleValue, getAngleValue, getAngleValue_t, getDefaultCond, gexit, init_dbase, initRules, insertAngle, isPFull, length2, same_tri, setNoPrint, setValue, show_agll, x_inside
-
-
-
-
Method Detail
-
getErrorType
public int getErrorType()
Returns the error type encountered during proof processing.- Returns:
- the error type code.
-
fconc_coll
public void fconc_coll(int a, int b, int c)Processes the collinearity condition for full angle concatenation.- Parameters:
a- first geometric parameter.b- second geometric parameter.c- third geometric parameter.
-
fconc_cong
public boolean fconc_cong(int a, int b, int c, int d)Processes the congruence condition for full angle concatenation.- Parameters:
a- first geometric parameter.b- second geometric parameter.c- third geometric parameter.d- fourth geometric parameter.- Returns:
- true if the congruence condition was successfully processed; false otherwise.
-
canExpressedAsFullAngle
public boolean canExpressedAsFullAngle()
Returns true if a full angle proof is expressed.- Returns:
- true if the full angle proof head exists, false otherwise.
-
isProvedTrue
public boolean isProvedTrue()
Determines if the proof has been established as true.- Returns:
- true if last_pr is non-null and equals zero, false otherwise.
-
getFullAngleProofHead
public GrTerm getFullAngleProofHead()
Retrieves the head of the full angle proof. This method iterates through the proof elements while printing intermediate proof components. It processes both primary and linked elimination terms.- Returns:
- the first element in the full angle proof chain, or null if none exists.
-
print_prooftext
public boolean print_prooftext()
Prints the proof text. This method iterates through all proof terms and prints their associated elimination information. It assembles the printed proof text by processing both display and elimination terms.- Returns:
- true if proof text printing succeeds, false otherwise.
-
myprint_p1
public void myprint_p1(XTerm p1, boolean first)
Prints an XTerm (mathematical expression) with its variable and coefficient.Constant terms without an associated variable are printed in an angle-signed format. For non-constant terms, the method processes the polynomial parts recursively.
- Parameters:
p1- the XTerm to be printedfirst- true if this is the first term (affects sign formatting), false otherwise
-
set_showdetai
public static void set_showdetai(boolean d)
Sets the flag to show details.This static method controls whether detailed information should be displayed.
- Parameters:
d- the boolean value to set for showing details
-
isConstructionType
public boolean isConstructionType(int type)
Determines if a given type represents a valid construction.The type is considered valid if it falls within specific ranges and does not require freeCS.
- Parameters:
type- the construction type to check- Returns:
- true if the type is a construction type; false otherwise
-
get_ndgs
public void get_ndgs(java.util.Vector v1, java.util.Vector v2, java.util.Vector v3, java.util.Vector v4)Populates the provided vectors with non-degenerate geometry constraints (NDGs) from constructions.This method iterates through constructions, adds valid constructions to the first vector, initializes and filters NDGs, deduces additional constraints, and finally updates the provided vectors.
- Parameters:
v1- a vector for constructions used as NDG constraintsv2- a vector for initial NDGsv3- a vector for filtered NDGsv4- a vector for deduced NDGs
-
add_n_isotropic
protected CNdg add_n_isotropic(int a, int b, java.util.Vector v1)
Creates and adds a non-isotropic NDG constraint based on two points.This method checks that the points are different and valid. It creates a new CNdg for non-isotropic constraints and adds it to the provided vector.
- Parameters:
a- the first pointb- the second pointv1- the vector to which the NDG is added- Returns:
- the created CNdg object, or null if the points are identical or invalid
-
add_n_pt
protected CNdg add_n_pt(int type, int a, int b, int c, int d, java.util.Vector v1)
Creates and adds an NDG constraint representing parallelism or perpendicularity.This method reorders four points if needed and creates a corresponding NDG depending on the specified type. The resulting constraint is then added to the vector.
- Parameters:
type- the type of NDG (e.g. NDG_PARA for parallel or NDG_PERP for perpendicular)a- the first point of the first lineb- the second point of the first linec- the first point of the second lined- the second point of the second linev1- the vector to which the NDG is added- Returns:
- the created CNdg object
-
add_n_coll
protected CNdg add_n_coll(int a, int b, int c, java.util.Vector v1)
Creates and adds a collinearity NDG constraint based on three points.This method reorders the three points to ensure a proper order for establishing collinearity, then creates a new CNdg representing the collinearity constraint and adds it to the given vector.
- Parameters:
a- the first pointb- the second pointc- the third pointv1- the vector to which the NDG is added- Returns:
- the created CNdg object
-
init_ndgs
public void init_ndgs(java.util.Vector v1)
Initializes non-degenerate geometry constraints (NDGs) from existing constructions.This method iterates through all constructions, creates appropriate NDG constraints based on the type of each construction, and associates dependencies with the NDGs when modifications occur.
- Parameters:
v1- the vector to be populated with NDG constraints
-
add_n_neq
public void add_n_neq(int a, int b, java.util.Vector v1)Adds a non-equality NDG constraint for the given points.This method creates an NDG constraint of type NDG_NEQ (or equivalent) for points a and b, then adds it to the provided vector.
- Parameters:
a- the first point indexb- the second point indexv1- the vector to add the NDG constraint
-
add_coll_para
public void add_coll_para(Cons cs, java.util.Vector v1)
Creates and adds a collinearity constraint in parallel form based on a construction.This method determines the highest point value from the construction's point array, then selects the three remaining points to build a collinearity NDG constraint and adds it to vector v1.
- Parameters:
cs- the construction containing the pointsv1- the vector to add the NDG constraint
-
angle_deduction
public void angle_deduction(CNdg c, java.util.Vector v4)
Deduces angle-based NDG constraints and processes them.This method handles a given CNdg constraint by checking if all associated points are free. If so, it directly duplicates the constraint into vector v4; otherwise, it computes an XTerm deduction based on the NDG type and adds related non-equality constraints.
- Parameters:
c- the CNdg constraint to analyzev4- the vector in which the deduced NDG constraints are stored
-
add_neqTo
protected void add_neqTo(int a, int b, java.util.Vector v4)Checks and adds a non-equality constraint between two points if not already present.This method iterates over the vector v4 to determine if an equivalent NDG constraint exists. If none is found, a new NDG constraint (NDG_NEQ) for the pair of points is created and added.
- Parameters:
a- the first point indexb- the second point indexv4- the vector containing NDG constraints
-
ck_allFree
protected boolean ck_allFree(CNdg d)
Checks whether all points in the given CNdg constraint are free.This method iterates over the points associated with the constraint and calls freeCSP for each one. It returns false as soon as any point is not free.
- Parameters:
d- the CNdg constraint to check- Returns:
- true if all points are free; false otherwise
-
add_deduction
protected XTerm add_deduction(XTerm x)
Performs angle deduction on the given XTerm.If the XTerm has an associated variable, angle-based deduction is applied followed by a final deduction adjustment.
- Parameters:
x- the XTerm to deduct- Returns:
- the resulting XTerm after deduction
-
final_deduction
protected XTerm final_deduction(XTerm p1)
Applies a final deduction adjustment to an XTerm.If the factor computed by fcc is negative, the XTerm is multiplied by -1.
- Parameters:
p1- the XTerm to adjust- Returns:
- the adjusted XTerm
-
filter_ndg
protected void filter_ndg(java.util.Vector v4)
Filters out redundant NDG constraints in the given vector.This method compares each NDG constraint in the vector with the others and removes any that are equal or less significant than another constraint.
- Parameters:
v4- the vector containing NDG constraints to filter
-
filter_ndg
protected void filter_ndg(java.util.Vector v2, java.util.Vector v3)Filters and merges NDG constraints from vector v2 into vector v3.This method iterates over the constraints in v2 and checks against those in v3. If an equivalent or less significant constraint exists, it merges or sets an equivalence link.
- Parameters:
v2- the source vector of NDG constraintsv3- the target vector for filtered NDG constraints
-
add_ndgs
protected void add_ndgs(CNdg d, java.util.Vector vlist)
Adds an NDG constraint to the specified vector.This helper method ensures the NDG constraint is valid (non-null), initializes its string representation by calling get_ndgstr, and then adds it to the vector.
- Parameters:
d- the NDG constraint to addvlist- the vector where the NDG constraint is stored
-
ndg_less
protected boolean ndg_less(CNdg n1, CNdg n2)
Compares two NDG constraints to determine if the first is less significant than the second.For non-equality NDGs, if the second constraint is of type NDG_COLL and contains both points of the first constraint, the first is considered less significant.
- Parameters:
n1- the first NDG constraintn2- the second NDG constraint- Returns:
- true if n1 is less significant than n2; false otherwise
-
ndg_eq
protected boolean ndg_eq(CNdg n1, CNdg n2)
Checks whether two NDG constraints are equal.This method first compares their types (allowing for NDG_NEQ and NDG_NON_ISOTROPIC to be equivalent), then verifies that the number of points and the point values are identical.
- Parameters:
n1- the first NDG constraintn2- the second NDG constraint- Returns:
- true if the two constraints are equal; false otherwise
-
addxtermndg
protected void addxtermndg(XTerm x, java.util.Vector v4)
Converts an XTerm into an NDG constraint and adds its printed representation.This method first converts the XTerm into a corresponding NDG constraint via xterm2ndg, then updates its string representation using the printing methods.
- Parameters:
x- the XTerm to convert and addv4- the vector where the NDG information is stored
-
xterm2ndg
protected void xterm2ndg(XTerm x, java.util.Vector vlist)
Converts an XTerm into NDG constraints and adds them to the provided list.Depending on the term number of the XTerm, the method delegates to a helper method to generate the appropriate NDG constraints.
- Parameters:
x- the XTerm to convertvlist- the vector where the generated NDG constraints will be added
-
xterm_1term
protected void xterm_1term(XTerm x, java.util.Vector vlist)
Processes an XTerm with one term to generate NDG constraints.The method examines the factor computed by
fcc(x)and based on its value, creates and adds NDG constraints using parallel, perpendicular, or triple PI rules.- Parameters:
x- the XTerm to processvlist- the vector where the generated NDG constraints will be added
-
add_ndg_triplePI
protected CNdg add_ndg_triplePI(Var v)
Creates a Triple PI NDG constraint from the specified variable.It initializes the NDG using the points from the variable and reorders them, setting the number of points to 3.
- Parameters:
v- the variable containing the points for the NDG constraint- Returns:
- the constructed Triple PI NDG constraint
-
xterm_2term
protected void xterm_2term(XTerm x, java.util.Vector vlist)
Processes an XTerm with two terms to generate NDG constraints.The method examines the second term of the XTerm and creates congruency or collinearity NDGs based on the sign of the factor computed by
fccfor the second term.- Parameters:
x- the XTerm to processvlist- the vector where the generated NDG constraints will be added
-
reorder3
protected void reorder3(CNdg n)
Reorders the points in an NDG constraint (with three points) into ascending order.- Parameters:
n- the NDG constraint whose points are to be reordered
-
reorder22
protected void reorder22(CNdg n)
Reorders two pairs of points in an NDG constraint so that each pair is in ascending order.In addition, it ensures that the first pair is sorted relative to the second pair.
- Parameters:
n- the NDG constraint whose points are to be reordered
-
add_ndg_neq
protected CNdg add_ndg_neq(int a, int b)
Creates a non-equality NDG constraint for two points.Returns null if both points are identical.
- Parameters:
a- the first point indexb- the second point index- Returns:
- the NDG non-equality constraint, or null if the points are identical
-
freeCSP
public boolean freeCSP(int index)
Checks whether the point at the given index is free from constraints.It retrieves the associated point object and checks its construction type.
- Parameters:
index- the index of the point to check- Returns:
- true if the point is free; false otherwise
-
freeCS
public boolean freeCS(int t)
Determines if the given construction type represents a free state.A type is considered free if it matches one of the basic construction types.
- Parameters:
t- the construction type to check- Returns:
- true if the type is free; false otherwise
-
add_ndg_coll
protected CNdg add_ndg_coll(int a, int b, int c)
Creates a collinearity NDG constraint from three points.The points are reordered to ensure proper ordering. If redundant, then null is returned.
- Parameters:
a- the first point indexb- the second point indexc- the third point index- Returns:
- the NDG collinearity constraint, or null if the points are redundant
-
add_ndg_cong
protected CNdg add_ndg_cong(int a, int b, int c, int d)
Creates a congruency NDG constraint based on four points.The points are reordered; if the set of points is redundant, null is returned.
- Parameters:
a- the first point index of the first segmentb- the second point index of the first segmentc- the first point index of the second segmentd- the second point index of the second segment- Returns:
- the NDG congruency constraint, or null if the points are redundant
-
add_ndg_para
protected CNdg add_ndg_para(Var v)
Creates a parallel NDG constraint using the points of a given variable.- Parameters:
v- the variable containing the points for the constraint- Returns:
- the NDG parallel constraint
-
add_ndg_para
protected CNdg add_ndg_para(int a, int b, int c, int d)
Creates a parallel NDG constraint based on four point indices.The points are reordered to ascending order; if the set is redundant, an alternative collinearity constraint is constructed instead.
- Parameters:
a- the first point index of the first segmentb- the second point index of the first segmentc- the first point index of the second segmentd- the second point index of the second segment- Returns:
- the NDG parallel constraint, or an alternative NDG constraint if redundant
-
add_ndg_perp
protected CNdg add_ndg_perp(Var v)
Creates a perpendicular NDG constraint using the points of a given variable.- Parameters:
v- the variable containing the points for the constraint- Returns:
- the NDG perpendicular constraint
-
add_ndg_perp
protected CNdg add_ndg_perp(int a, int b, int c, int d)
Creates a perpendicular NDG constraint based on four point indices.If the two segments are identical, a non-isotropic NDG constraint is created instead.
- Parameters:
a- the first point index of the first segmentb- the second point index of the first segmentc- the first point index of the second segmentd- the second point index of the second segment- Returns:
- the NDG perpendicular constraint, or a non-isotropic constraint when applicable
-
get_ndgstr
protected void get_ndgstr(CNdg d)
Sets the string representation (sd) of the given NDG constraint (d) based on its type and associated points. Depending on the type, constructs a descriptive message.- Parameters:
d- the NDG constraint for which the string representation is set
-
angle_deduction
protected XTerm angle_deduction(XTerm p1)
Performs angle deduction on the given XTerm. This method initializes necessary properties and iteratively attempts to eliminate terms using various elimination methods. At the end, it optimizes the term based on triangle configurations.- Parameters:
p1- the XTerm on which angle deduction is performed- Returns:
- the resulting XTerm after angle deduction
-
opt_tri
public XTerm opt_tri(XTerm x)
Optimizes the given XTerm by detecting and processing triangle configurations. It compares factors from the current term and its subterm to determine if any adjustment such as scaling or subtraction should be applied.- Parameters:
x- the XTerm to be optimized- Returns:
- the optimized XTerm
-
ndg_deduction
public void ndg_deduction(java.util.Vector v3, java.util.Vector v4)Performs NDG (non-degeneracy) deduction on a set of NDG constraints. For each constraint in the source vector v3, if the constraint is marked as existing or if all its points are free, it is directly added or duplicated into the target vector v4. Otherwise, angle deduction is applied.- Parameters:
v3- the source vector of NDG constraintsv4- the target vector to store the deduced NDG constraints
-
compare
public int compare(CNdg d1, CNdg d2)
Compares two NDG constraints based on their maximum integer values.- Parameters:
d1- the first NDG constraintd2- the second NDG constraint- Returns:
- a positive value if d1 > d2, a negative value if d1 < d2, or zero if they are equal
-
sortVector
public void sortVector(java.util.Vector v4)
Sorts a vector of NDG constraints in ascending order based on their significance. It uses the compare method to insert each constraint into its correct position in the vector.- Parameters:
v4- the vector containing NDG constraints to be sorted
-
parse_neq
public void parse_neq(java.util.Vector v4)
Parses non-equality and non-isotropic NDG constraints from the given vector.This method sorts the input vector of NDG constraints, filters out those constraints that are non-equality (NDG_NEQ) or non-isotropic (NDG_NON_ISOTROPIC) and have both points free, and then processes the remaining constraints. The remaining constraints are added to a global NDG list after being updated.
- Parameters:
v4- the vector containing NDG constraints to be parsed
-
getCS
public NdgCs getCS(CNdg d)
Constructs and returns an NDG constraint set (NdgCs) associated with the given inequality constraint.The method iterates through existing constraints and gathers those related to the points of the provided constraint. The collected constraints are then added to a new NdgCs structure and updated.
- Parameters:
d- the NDG inequality constraint used as a basis for gathering related constraints- Returns:
- the constructed NDG constraint set (NdgCs)
-
addConsToNdgcs
public void addConsToNdgcs(Cons c, NdgCs d)
Adds the provided constraint to the given NDG constraint set.Based on the type of the constraint, it may clone the constraint or generate additional constraints.
- Parameters:
c- the constraint to be addedd- the NDG constraint set (NdgCs) that will include the constraint
-
add_cons
public void add_cons(int type, int a, int b, int c, int d, int e, int f, int g, NdgCs d1)Creates a new constraint with 7 points and adds it to the specified NDG constraint set.- Parameters:
type- the type of the new constrainta- the first point indexb- the second point indexc- the third point indexd- the fourth point indexe- the fifth point indexf- the sixth point indexg- the seventh point indexd1- the NDG constraint set (NdgCs) where the new constraint will be added
-
add_cons
public void add_cons(int type, int a, int b, int c, int d, NdgCs d1)Creates a new constraint with 4 points and adds it to the specified NDG constraint set.- Parameters:
type- the type of the new constrainta- the first point indexb- the second point indexc- the third point indexd- the fourth point indexd1- the NDG constraint set (NdgCs) where the new constraint will be added
-
ck_right
public boolean ck_right(Cons c, NdgCs cs, int type)
Checks whether the specified constraint is recursively valid with respect to the given NDG type.Depending on the type of the constraint, it recursively checks if related NDG constraints already exist.
- Parameters:
c- the constraint to checkcs- the NDG constraint set (NdgCs) in which the check is performedtype- the NDG type against which the constraint is validated- Returns:
- true if the constraint is valid; false otherwise
-
ck_right
public boolean ck_right(NdgCs c, int type)
Recursively checks constraints in an NDG constraint set for consistency. For leaf nodes, it verifies each constraint against its expected conditions; for non-leaf nodes, it cleans up inconsistent child sets.- Parameters:
c- the NDG constraint set to checktype- the type identifier for the check; usage depends on the context- Returns:
- true if the constraint set is consistent; false otherwise
-
parse_neq
public NdgCs parse_neq(CNdg nd)
Parses non-equality and non-isotropic NDG constraints by replacing point indices, reordering constraints, and invoking further parsing, cleanup, and optimization steps.- Parameters:
nd- the NDG constraint to be parsed- Returns:
- the updated NDG constraint set after parsing
-
construct_related
public boolean construct_related(int t)
Determines whether a constraint type is considered related to construction operations.The method returns false for fundamental geometric element types (e.g., point, triangle, etc.) and for types within a specific range, indicating that additional construction steps are not required.
- Parameters:
t- the constraint type identifier- Returns:
- true if the constraint type is construction-related; false otherwise
-
-