A Method for Expanding Predicates and Rules in Automated Geometry Reasoning System
Abstract
:1. Introduction
2. Knowledge Representation
3. Predicate Expansion
3.1. Algorithm for Generating Knowledge Tree
Algorithm 1 generateKT (G, PE) |
Input: geometry unit set G; predicate example PE Output: predicate tree KT 1: KT. root = PE.na 2: for do 3: guList = Regex. Matches (PE.ds, g) 4: for do 5: node = KT. root. addChild (gu) 6: for . points do 7: node. addChild (p) 8: end for 9: end for 10: end for 11: expr = Regex. Matches (PE.ds, [A-Za-z] |\*|/| [0-9] |\ (|\) |\+|\^|-) +) 12: node = KT. root. addChild (expr) 13: for me expr do 14: node. addChild ((me. ToString ()) 15: end for 16: return KT |
3.2. Algorithm for Generating Predicate Code
Algorithm 2 generatePredicateCode (KT, Ptemplate) |
Input: predicate Tree KT; predicate template Ptemplate Output: PCode 1: Ptemplate. className = KT.root 2: Ptemplate. funcName = KT. root 3: nodeList = KT. root. children 4: for do 5: Ptemplate. funcParams. addParams (node) 6: end for 7: Ptemplate. NormalizeFunc = Normalize (nodeList) 8: PCode = Ptemplate. generateCode () 9: return PCode |
3.3. Predicate Expansion Example
- Inputting the name (PE.na): Perpendicular;
- Inputting the description (PE.ds): segment AB is perpendicular to plane DEF.
- Obtaining “Perpendicular” and configuring it as root node;
- Finding formal representations of geometry units “segment AB” and “plane DEF” contained in PE.ds by traversing the geometry unit set of the system based on the formal representation; configuring formal representations of “segment AB” and “plane DEF”, i.e., “Segment (A,B)” and “Plane (D,E,F)”, as child nodes of the root node;
- Respectively obtaining point sets of geometry units “Segment (A,B)” and “Plane (D,E,F)”, and sequentially configuring points in the point set as leaf nodes;
- Generating a predicate knowledge tree, as shown in Figure 2.
- Obtaining the root node “Perpendicular” and configuring it as the name of a class and the name of a constructor;
- Obtaining child nodes “Segment (A,B)” and “Plane (D,E,F)” and configuring them as parameters;
- Performing normalization—since child nodes “Segment (A,B)” and “Plane (D,E,F)” are different types, there is no need for normalization;
- Generating executable predicate code as shown in Figure 3.
4. Rule Expansion
4.1. Algorithm for Generating a Knowledge Forest
Algorithm 3 generateKF (RE) |
Input: rule example RE Output: KF 1: match=Regex.Match(RE.rd, “if ([\s\S]+) then ([\s\S]+)”) 2: if match.Success == true 3: cons = separateCondition (RE.rd) 4: clus = separateConclusion (RE.rd) 5: end if 6: cdp = extractPredicate (cons) 7: ccp = extractPredicate (clus) 8: cdf = {} 9: for do 10: contionalTree=generateKT (G, con) 11: cdf. Add (conditionalTree) 12: end for 13: cdf = enCoding(cdf) 14: ccf = {} 15: for clu ccp do 16: conclusiveTree= generateKT (G, clu) 17: ccf. Add (conclusiveTree) 18: end for 19: KF. add (cdf, ccf) 20: return KF |
4.2. Algorithm for Generating Executable Rule Code
Algorithm 4 enCoding(cdf) |
Input: conditionForest cdf Output: conditioncodeForest 1: i = 0 2: for do 3: conditionTree. root. code = i 4: nodeList = conditionTree. root. children 5: j = 0 6: for do 7: node. Code = ij 8: k = 0 9: for do 10: nodeleaf. Code = ijk 11: k = k + 1 12: end for 13: j = j + 1 14: end for 15: i = i + 1 16: end for 17: conditioncodeForest = cdf 18: return conditioncodeForest |
Algorithm 5 generateruleCode(KF, Ruletemplate,RE) |
Input: rule forest KF; rule template Ruletemplate Output: RuleCode 1: Ruletemplate. RuleName = RE. rn 2: for do 3: Ruletemplate. RuleParams. addParams (kt. root) 4: end for 5: Ruletemplate. Judgementcondition = Judgement (KF. cdf) 6: Ruletemplate. GenerateNewKnowledge = generateConclusion (KF) 7: RuleCode = Ruletemplate 8: return RuleCode |
4.3. Rule Expansion Example
- Inputting the name (RE.na)—PyramidVolume;
- Inputting the description (RE.ds)—for a pyramid O, if the bottom area is S and the height is h, then the volume is 1/3∗S∗h.
- By invoking the Separate () method, separating “for a pyramid O, if the bottom area is S and the height is h, then the volume is 1/3∗S∗h” into a condition statement “for a pyramid O, if the bottom area is S and the height is h” and a conclusion statement “then the volume is 1/3∗S∗h”;
- By invoking the extractPredicate() method, extracting predicate examples, cdp, “bottom area is S”, and “height is h” from the condition statement, and the predicate example ccp “volume is 1/3∗S∗h” from the conclusion statement;
- Creating a condition forest, cdf, by generating knowledge trees with condition predicates in item ii, and creating a conclusion forest, ccf, by generating a conclusion tree with the conclusion predicate;
- Coding cdf, and integrating the two forests to form a rule knowledge forest, KF, as shown in Figure 5.
- Obtaining the “PyramidVolume” from RE.na and configuring it as the function name;
- Obtaining the root node of each knowledge tree from KF.cdf: “BottomArea” and “Height”, and configuring them as parameters;
- Generating executable code to confirm whether the pyramids are the same instance;
- Generating executable code for constructing the conclusion “new Volume (...)” by means of the coding number;
- Returning the whole executable rule code, as shown in Figure 6.
5. Implementation
6. Applications
- Point—A B C D E P;
- Pyramid (P,A,B,C,D);
- Right trapezoid (A,B,C,D);
- Perpendicular (Segment (A,B), Segment (A,D));
- Parallel (Segment (A,B), Segment (C,D);
- Perpendicular (Segment (P,C), Plane (A,B,C,D));
- Equal (Segment (A,D), Segment (C,D));
- Length (Segment (A,D),2);
- Length (Segment (A,B),4);
- Midpoint (E,P,B);
- Prove: Perpendicular (Plane (E,A,C), Plane (P,B,C)).
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Saracevic, M.; Selimi, A. Convex Polygon Triangulation based on Ballot problem and Planted Trivalent Binary Tree. Turk. J. Electr. Eng. Comput. 2019, 27, 346–361. [Google Scholar] [CrossRef] [Green Version]
- Temuer, C.L.; Pang, J. An algorithm for the complete symmetry classification of differential equations based on Wu’s method. J. Eng. Math. 2010, 66, 181–199. [Google Scholar]
- Wu, W.J. On the decision problem and the mechanization of theorem-proving in elementary geometry. Sci. China Ser. A 1978, 29, 117–138. [Google Scholar]
- Zhang, J.Z.; Chen, X.C.; Chen, M. Self-evident automated proving based on point geometry from the perspective of Wu’s method identity. J. Syst. Sci. Complex 2019, 32, 78–94. [Google Scholar] [CrossRef]
- Wu, W.J. Mathematics mechanization: Its origin, status, and prospect. J. Syst. Sci. Math. Sci. 2008, 28, 898–904. [Google Scholar]
- Lu, P.; Gong, R.; Jiang, S.B.; Qiu, L.; Liang, X.D.; Zhu, S.C. Inter-GPS: Interpretable geometry problem solving with formal language and symbolic reasoning. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics (ACL), Bangkok, Thailand, 1–6 August 2021. [Google Scholar]
- Sergiu, R. Algebraic methods versus map methods of solving Boolean equations. Int. J. Comput. Math. 2003, 80, 815–817. [Google Scholar]
- Deepak, K.; Sun, Y.; Wang, D.K. An efficient method for computing comprehensive Grobner base. J. Symb. Comput. 2013, 52, 124–142. [Google Scholar]
- Yengui, I. Dynamical Gröbner bases. J. Algebra 2006, 301, 447–458. [Google Scholar] [CrossRef] [Green Version]
- Lu, Y.; Hou, X.R. The sub-resultant method for automated theorem proving. J. Syst. Math. 1995, 15, 10–15. [Google Scholar]
- Zhang, J.Z.; Li, Y.B. Automatic theorem proving for three decades. J. Syst. Sci. Math. Sci. 2009, 29, 1155–1168. [Google Scholar]
- Chou, S.C.; Gao, X.S.; Zhang, J.Z. Automated Generation of Readable Proofs with Geometric Invariants I. Multiple and Shortest Proof Generation. J. Autom. Reason. 1996, 17, 325–347. [Google Scholar] [CrossRef]
- Janivci, P.; Narboux, J.; Quaresma, P. The Area Method: A Recapitulation. J. Autom. Reason. 2012, 48, 489–532. [Google Scholar]
- Chou, S.C.; Gao, X.S.; Zhang, J.Z. A Deductive Database Approach to Automated Geometry Theorem Proving and Discovering. J. Autom. Reason. 2000, 25, 219–246. [Google Scholar] [CrossRef]
- Zhang, J.Z.; Jiang, J.G. The automated geometry reasoning system based on Rete algorithm. Adv. Eng. Sci. 2006, 38, 135–139. [Google Scholar]
- Shi, S.M.; Wang, Y.H.; Lin, C.Y.; Liu, J.X.; Yong, R. Automatically solving number word problems by semantic parsing and reasoning. In Proceedings of the Conference on Empirical Methods for Natural Language Processing, Lisbon, Portugal, 17–21 September 2015; pp. 1132–1142. [Google Scholar]
- Wen, W.B.; Yu, X.G.; Zhang, T.; Wang, M.S. Automatically proving plane geometry theorems stated by text and diagram. Int. J. Pattern Recognit. Artif. Intell. 2019, 33, 1940003.1–1940003.26. [Google Scholar]
- Najib, S. Application of backward chaining method to computer forensic. In Proceedings of the 10th International-Business-Information-Management-Association Conference, Kuala Lumpur, Malaysia, 30 June–2 July 2008; pp. 303–307. [Google Scholar]
- Nevins, A.J. Plane geometry theorem proving using forward chaining. Artif. Intell. 1975, 6, 1–23. [Google Scholar] [CrossRef] [Green Version]
- Botana, F.; Hohenwarter, M.; Janičić, P.; Kovács, Z. Automated theorem proving in GeoGebra: Current achievements. J. Autom. Reason. 2015, 55, 39–59. [Google Scholar] [CrossRef]
- Zhang, J.Z.; Gao, X.S.; Zhou, X.Q. The geometry information search system by forward reasoning. Chin. J. Comput. 1996, 10, 721–727. [Google Scholar]
- Ye, Z.; Chou, S.C.; Gao, X.S. An Introduction to Java Geometry Expert. Automated Deduction in Geometry; Lecture Notes in Computer, Science; Sturm, T., Zengler, C., Eds.; Springer: Berlin/Heidelberg, Germany, 2011; Volume 6301, pp. 189–195. [Google Scholar]
- Xu, Z.T. Super Sketchpad: An Excellent Cognitive Platform for gaining experience in basic mathematics activities. J. Math. Educ. 2011, 3, 97–99. [Google Scholar]
- Wang, Y.; Rao, J.S.; Guan, H.; Zou, Y. NetPad: An online DGS for mathematics education. In Proceedings of the 2017 12th International Conference on Computer Science and Education (ICCSE), Houston, TX, USA, 22–25 August 2017. [Google Scholar]
- Guan, H.; Qin, X.L.; Rao, Y.S. Research and design of dynamic mathematical digital resources open platform. J. Harbin Inst. Technol. 2019, 51, 14–22. [Google Scholar]
- Guan, H.; Rao, Y.S.; Zhang, J.Z.; Cao, S.; Qin, X.L. Method for processing graph degeneracy in dynamic geometry based on domain design. J. Comput. Sci. Technol. 2021, 36, 910–921. [Google Scholar] [CrossRef]
- Wang, K.; Su, Z.D. Automated geometry theorem proving for human-readable proofs. In Proceedings of the Twenty-Fourth International Joint Conference on Artificial Intelligence, Buenos Aires, Argentina, 20–31 July 2015. [Google Scholar]
- Zheng, H.; Zhang, J.Z. Geometry automatic reasoning platform with sustainable development by user. J. Comput. Appl. 2011, 31, 2101–2107. [Google Scholar]
- Guo, S.W. The software of automated reasoning based on user adding rules. Comput. Appl. Softw. 2007, 24, 48–50. [Google Scholar]
- Guo, S.W. The software of automated reasoning based on user adding rules II. Comput. Inf. Technol. 2006, 8, 67–68. [Google Scholar]
- Fu, H.G.; Yu, L.; Zhong, X.Q. Semi-automatic construction of plane geometry ontology based-on WordNet and Wikipedia. J. Univ. Electron. Sci. Technol. China 2014, 43, 575–580. [Google Scholar]
- Wang, H. Research on the model of knowledge representation ontology based on framework in intelligent learning system. In Proceedings of the 2011 International Conference on Electrical and Control Engineering, Yichang, China, 16–18 September 2011; pp. 6757–6760. [Google Scholar]
- Nguyen, H.D.; Do, N.V.; Pham, V.T. A method for knowledge representation to design intelligent problems solver in mathematics based on Rela-Ops model. IEEE Access 2020, 8, 76991–77012. [Google Scholar] [CrossRef]
- Quaresma, P. Automated deduction and knowledge management in geometry. In Proceedings of the AISC 2018: Artificial Intelligence and Symbolic Computation, Suzhou, China, 16–19 September 2018; pp. 221–226. [Google Scholar]
- Zhong, X.Q.; Fu, H.G.; Yu, L.; Huang, B. Geometric knowledge acquisition and knowledge representation based on ontology. Chin. J. Comput. 2010, 33, 167–174. [Google Scholar] [CrossRef]
- Gan, W.B.; Yu, X.G.; Wang, M.S. Automatic understanding and formalization of plane geometry proving problems in natural language: A supervised approach. Int. J. Artif. Intell. Tools 2019, 28, 1940003. [Google Scholar] [CrossRef]
- Saracevic, M.; Stanimirovic, P.; Krtolica, P.; Masovic, S. Construction and Notation of Convex Polygon Triangulation based on ballot problem. Rom. J. Inf. Sci. Technol. 2014, 17, 237–251. [Google Scholar]
- Sutcliffe, G. The TPTP Problem Library and Associated Infrastructure. J. Autom. Reason. 2009, 43, 339–362. [Google Scholar] [CrossRef]
Examples | Descriptions |
---|---|
Point (A) | Point A |
Line (A,B) | Line AB |
Segment (A,B) | Segment AB |
Plane (A,B,C) | Plane ABC |
Triangle (A,B,C) | Triangle ABC |
Angle (A,B,C) | Angle ABC |
Circle (O,r) | Circle O with radius r |
Quadrilateral (A,B,C,D) | Quadrilateral ABCD |
Examples | Descriptions |
---|---|
Parallel (Segment (A,B), Segment (C,D)) | Segment AB is parallel to segment CD |
Perpendicular (Segment (E,F), Segment (G,H)) | Segment EF is perpendicular to segment GH |
Equal (Angle (A,B,C), Angle (A,C,B)) | Angle ABC is equal to angle ACB |
Collinear (Point(A), Point(B), Point(C)) | Point A, point B and point C are collinear |
Area (Triangle (A,B,C), 3) | Area of triangle ABC is 3 |
Value (Angle (A,B,C), pi) | Value of angle ABC is pi |
Rules | Examples | Descriptions |
---|---|---|
Transitive property of parallel segments | Parallel (Segment (A,B), Segment (C,D))∧Parallel (Segment (C,D), Segment (E,F))→Parallel (Segment (A,B), Segment (E,F)) | If segment AB is parallel to segment CD and segment CD is parallel to segment EF, then segment AB is parallel to segment EF |
Two sides of an angle of 90° are perpendicular to each other | Value (Angle (A,B,C), pi/2)→Perpendicular (Segment (A,B), Segment (B,C) | If angle ABC is 90°, then segment AB is perpendicular to segment BC |
A property of an equilateral triangle | Equilateral (Triangle(A,B,C))→Equal (Segment (A,B), Segment (B,C))∧Equal (Segment (A,C), Segment (B,C)) | For an equilateral triangle ABC, segment AB is equal to segment BC, and segment AC is equal to segment BC |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Rao, Y.; Xie, L.; Guan, H.; Li, J.; Zhou, Q. A Method for Expanding Predicates and Rules in Automated Geometry Reasoning System. Mathematics 2022, 10, 1177. https://doi.org/10.3390/math10071177
Rao Y, Xie L, Guan H, Li J, Zhou Q. A Method for Expanding Predicates and Rules in Automated Geometry Reasoning System. Mathematics. 2022; 10(7):1177. https://doi.org/10.3390/math10071177
Chicago/Turabian StyleRao, Yongsheng, Lanxing Xie, Hao Guan, Jing Li, and Qixin Zhou. 2022. "A Method for Expanding Predicates and Rules in Automated Geometry Reasoning System" Mathematics 10, no. 7: 1177. https://doi.org/10.3390/math10071177
APA StyleRao, Y., Xie, L., Guan, H., Li, J., & Zhou, Q. (2022). A Method for Expanding Predicates and Rules in Automated Geometry Reasoning System. Mathematics, 10(7), 1177. https://doi.org/10.3390/math10071177