# Diagnosis in Tennis Serving Technique

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Some Introductory Notes about Rule-Based Expert Systems Based on Boolean Propositional Logic

**Definition**

**1**

- ${X}_{i}$ where ${X}_{i}$ is an atomic proposition
- $\neg B$ where B is a formula
- $B\wedge C$ where $B,C$ are formulae
- $B\vee C$ where $B,C$ are formulae
- $B\to C$ where $B,C$ are formulae.

**Definition**

**2**

**Remark**

**1.**

**Remark**

**2.**

**Definition**

**3**

**Definition**

**4**

**Input:**The input of a RBES is concerned with the information related to the environment of the RBES. This information is described by means of a finite number of different atomic propositions.

**Output:**: The output of a RBES is concerned with the information inferred by the RBES. It is also described by means of a finite number of atomic propositions.

**Knowledge-Base:**The knowledge-base of the RBES is concerned with the information contained in the system, which is used along with the input of the RBES to infer the output of the system. In a RBES based on propositional Boolean logic, this knowledge-base will be mostly represented by a finite set of rules which may require to define new atomic propositions. Consequently, the knowledge-base of the RBES is described by a finite set of formulae $\{{R}_{1},\dots ,{R}_{{n}^{\prime}}\}\subset \mathcal{C}$.

## 3. Organizing the Knowledge of the Tennis Hitting Technique RBES

- Facts – Block I (Generalities): kind of serve the player is executing and player’s level (variables ${x}_{i}$, ${y}_{i}$, ${z}_{i}$ are used in this block).
- Facts – Block II (Details): details of the execution of the serve, kinetic and coordination.
- Guards: intermediate conclusions—not visible for the user (variables ${g}_{i}$ are used for the guards).
- Output: conclusions about the way the player is serving (variables ${c}_{i}$ are used for the output).

#### 3.1. Facts—Block I (Generalities)

- in a flat serve the ball is not rotating,
- in the slice serve it rotates around a vertical axis (the trajectory is curved and bounces to one side),
- in the topspin serve the ball is rotating around an horizontal axis (the upper part of the ball moves forward and the lower part moves backwards): the aerodynamic effect is that the ball bounces closer and higher.

#### 3.2. Facts—Block II (Details)

- ${d}_{1}$ and ${d}_{2}$ are incompatible,
- ${t}_{1}$, ${t}_{2}$ and ${t}_{3}$ are mutually incompatible,
- ${l}_{1}$, ${l}_{2}$ and ${l}_{3}$ are mutually incompatible,
- ${a}_{1}$ and ${a}_{2}$ are incompatible.

#### 3.3. Guards

#### 3.4. Output

#### 3.5. Rules and Incompatibilities (Integrity Constraints)

- $R1:d1\to c2$
- $R2:d2\to g1$
- $R3:v1\to c2$
- $R4:\neg w1\to g1$
- $R5:t1\to g1$
- $R6:t3\to c1$
- $R7:l1\wedge \neg z0\wedge \neg x1\to g2\wedge c5$
- $R8:l2\wedge \neg z0\wedge \neg x2\to g2\wedge c5$
- $R9:l3\wedge \neg z0\wedge \neg x3\to g2\wedge c5$
- $R10:a1\to c3\phantom{\rule{4pt}{0ex}}xor\phantom{\rule{4pt}{0ex}}c4$
- $R11:a2\to g3$
- $R12:\neg m1\to c1$
- $R13:\neg e1\to c1\wedge c2$
- $R14:\neg e2\to g4$
- $R15:\neg k1\to c1\wedge c2$
- $R16:\neg k2\to c1\wedge c2$
- $R17:\neg k3\to c1\wedge c2$
- $R18:\neg k4\to c1\wedge c2$
- $R19:\neg k5\to c1\wedge c2$
- $R20:k6\to c2$
- $R21:\neg k7\wedge y1\to c2\wedge c5$
- $R22:\neg e1\to c1\wedge c2$

- $R23:g1\to c1\wedge c2$
- $R24:g2\to c1\wedge c2$
- $R25:g3\to c1$
- $R26:g4\to c1$

- $R7:l1\wedge \neg z0\wedge \neg x1\to g2\wedge c5$

- $R7a:l1\wedge \neg z0\wedge \neg x1\to g2$
- $R7b:l1\wedge \neg z0\wedge \neg x1\to c5$

- $R10n:a1\to c3\phantom{\rule{4pt}{0ex}}\vee \phantom{\rule{4pt}{0ex}}c4$
- $IC0:\neg (c3\wedge c4)$

- $IC1:\neg (x1\wedge x2)$
- $IC2:\neg (x2\wedge x3)$
- $IC3:\neg (x1\wedge x3)$
- $IC4:x1\vee x2\vee x3$
- $IC5:\neg (t1\wedge t2)$
- $IC6:\neg (t2\wedge t3)$
- $IC7:\neg (t1\wedge t3)$
- $IC8:t1\vee t2\vee t3$
- $IC9:\neg (l1\wedge l2)$
- $IC10:\neg (l2\wedge l3)$
- $IC11:\neg (l1\wedge l3)$
- $IC12:l1\vee l2\vee l3$

- $IC13:\neg (a1\wedge a2)$
- $IC14:\neg (d1\wedge d2)$

## 4. An Algebraic Model for RBES

**Notation**

**1**

**Definition**

**5**

- If $A\equiv {X}_{i}$, then $\phi \left(A\right)={x}_{i}$
- If $A\equiv \neg B$ where $B\in \mathcal{C}$, then $\phi \left(A\right)=NF(1+\phi (B),I)$
- If $A\equiv B\wedge C$ where $B,C\in \mathcal{C}$, then $\phi \left(A\right)=NF\left(\phi \right(B)\xb7\phi (C),I)$
- If $A\equiv B\vee C$ where $B,C\in \mathcal{C}$, then $\phi \left(A\right)=NF\left(\phi \right(B)+\phi (C)+\phi (B)\xb7\phi (C),I)$
- If $A\equiv B\to C$ where $B,C\in \mathcal{C}$, then $\phi \left(A\right)=NF(1+\phi (B)+\phi (B)\xb7\phi (C),I)$.

**Theorem**

**1.**

- (i)
- $\{{A}_{1},\dots ,{A}_{n}\}\vDash B\iff \phi (\neg B)\in \langle \phi (\neg {A}_{1}),\dots ,\phi (\neg {A}_{n})\rangle +I$
- (ii)
- $\{{A}_{1},\dots ,{A}_{n}\}$ is consistent $\iff 1\notin \langle \phi (\neg {A}_{1}),\dots ,\phi (\neg {A}_{n})\rangle +I$

## 5. Maple Implementation

`restart;``with(Groebner):``with(Ore_algebra):`

`SV`), are declared:

`SV:=x1,x2,x3,z0,y1,d1,d2,v1,w1,t1,t2,t3,l1,l2,l3,a1,a2,m1,e1,e2,``k1,k2,k3,k4,k5,k6,k7,o1,g1,g2,g3,g4,c1,c2,c3,c4,c5:``A:=poly_algebra(SV, characteristic=2):``Orde:=MonomialOrder(A,’plex’(SV)):`

`iI`), generated by the square of the polynomial variables minus themselves, is defined using the auxiliary function

`fu`:

`fu:=var->var^2-var:``iI:=map(fu, [SV]):`

`iI`in ring

`A`using the ordering

`OrdeiI`:

`NEG :=(m::algebraic) -> NormalForm(1+‘m‘,iI, Orde):``‘&AND‘ :=(m::algebraic, n::algebraic) ->``NormalForm(expand(m*n), iI, Orde):``‘&OR‘ :=(m::algebraic, n::algebraic) ->``NormalForm(expand(m+n+m*n), iI, Orde):``‘&IMP‘ :=(m::algebraic, n::algebraic) ->``NormalForm(expand(1+m+m*n), iI, Orde):``‘&XOR‘ :=(m::algebraic, n::algebraic) ->``(m &OR n) &AND NEG(m &AND n):`

`R1:= d1 &IMP c2:``R2:= d2 &IMP g1:``R3:= v1 &IMP c2:``R4:= NEG(w1) &IMP g1:``R5:= t1 &IMP g1:``R6:= t3 &IMP c1:``R7:= (l1 &AND NEG(z0) &AND NEG(x1)) &IMP (g2 &AND c5):``R8:= (l2 &AND NEG(z0) &AND NEG(x2)) &IMP (g2 &AND c5):``R9:= (l3 &AND NEG(z0) &AND NEG(x3)) &IMP (g2 &AND c5):``R10:= a1 &IMP (c3 &XOR c4):``R11:= a2 &IMP g3:``R12:= NEG(m1) &IMP c1:``R13:= NEG(e1) &IMP (c1 &AND c2):``R14:= NEG(e2) &IMP g4:``R15:= NEG(k1) &IMP (c1 &AND c2):``R16:= NEG(k2) &IMP (c1 &AND c2):``R17:= NEG(k3) &IMP (c1 &AND c2):``R18:= NEG(k4) &IMP (c1 &AND c2):``R19:= NEG(k5) &IMP (c1 &AND c2):``R20:= k6 &IMP c2:``R21:= (NEG(k7) &AND y1) &IMP (c2 &AND c5):``R22:= NEG(e1) &IMP (c1 &AND c2):``R23:= g1 &IMP (c1 &AND c2):``R24:= g2 &IMP (c1 &AND c2):``R25:= g3 &IMP c1:``R26:= g4 &IMP c1:``IC1:= NEG(x1 &AND x2):``IC2:= NEG(x2 &AND x3):``IC3:= NEG(x1 &AND x3):``IC4:= x1 &OR x2 &OR x3:``IC5:= NEG(t1 &AND t2):``IC6:= NEG(t2 &AND t3):``IC7:= NEG(t1 &AND t3):``IC8:= t1 &OR t2 &OR t3:``IC9:= NEG(l1 &AND l2):``IC10:= NEG(l2 &AND l3):``IC11:= NEG(l1 &AND l3):``IC12:= l1 &OR l2 &OR l3:``IC13:= NEG(a1 &AND a2):``IC14:= NEG(d1 &AND d2):`

`J:=[ NEG(R1), NEG(R2), NEG(R3), NEG(R4), NEG(R5), NEG(R6),``NEG(R7), NEG(R8), NEG(R9), NEG(R10),NEG(R11),NEG(R12),``NEG(R13), NEG(R14), NEG(R15), NEG(R16),NEG(R17),NEG(R18),``NEG(R19), NEG(R20), NEG(R21), NEG(R22),NEG(R23),NEG(R24),``NEG(R25), NEG(R26), NEG(IC1), NEG(IC2),NEG(IC3),NEG(IC4),``NEG(IC5), NEG(IC6), NEG(IC7), NEG(IC8),NEG(IC9),NEG(IC10),``NEG(IC11),NEG(IC12),NEG(IC13),NEG(IC14) ]:`

## 6. Examples

#### 6.1. A Correct Serve

`K`of facts will be:

`K:=[ NEG(x3),NEG(NEG(z0)),NEG(y1),NEG(NEG(d1)),NEG(NEG(d2)),``NEG(NEG(v1)),NEG(w1),NEG(t2),NEG(l3),NEG(NEG(a1)),``NEG(NEG(a2)),NEG(m1),NEG(e1),NEG(e2),NEG(k1),NEG(k2),``NEG(k3),NEG(k4),NEG(NEG(k6)),NEG(k7),NEG(o1) ]:`

`iI`in the Maple implementation) will be:

`time0:=time():``B:=Basis([op(iI),op(J),op(K)], Orde);``[c5^2+c5,...,x2,x1]``time()-time0;``0.296`

`time0:=time():``NormalForm(NEG(c1), B, Orde);``1 + c1``NormalForm(NEG(c2), B, Orde);``1 + c2``NormalForm(NEG(c3), B, Orde);``c3 + 1``NormalForm(NEG(c4), B, Orde);``1 + c4``NormalForm(NEG(c5), B, Orde);``c5 + 1``time()-time0;``0.078`

#### 6.2. An Incorrect Serve

`K`of facts will now be:

`K:=[ NEG(x3),NEG(NEG(z0)),NEG(y1),NEG(NEG(d1)),NEG(NEG(d2)),``NEG(NEG(v1)),NEG(w1),NEG(t2),NEG(l1),NEG(NEG(a1)),``NEG(NEG(a2)),NEG(m1),NEG(e1),NEG(e2),NEG(k1),NEG(k2),``NEG(k3),NEG(k4),NEG(NEG(k6)),NEG(k7),NEG(o1) ]:`

`time0:=time():``B:=Basis([op(iI),op(J),op(K)], Orde):``[c5+1,...,x2,x1]``time()-time0;``0.218`

`tiempo:=time():``NormalForm(NEG(c1), B, Orde);``0``NormalForm(NEG(c2), B, Orde);``0``NormalForm(NEG(c3), B, Orde);``c3 + 1``NormalForm(NEG(c4), B, Orde);``c4 + 1``NormalForm(NEG(c5), B, Orde);``0``time()-time0;``0.078`

- imprecision
- stroke too weak (lack of power)
- little spin.

#### 6.3. A Remark about Timings

- the base field of the polynomial ring is ${\mathbb{Z}}_{2}$ (it has characteristic 2, instead of 0),
- the degree in each variable is at most 1 for all polynomials,
- the total degree of all polynomials is less or equal to the number of variables

## 7. Conclusions

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## Abbreviations

MDPI | Multidisciplinary Digital Publishing Institute |

DOAJ | Directory of open access journals |

RBES | Rule Base Expert System |

## References

- Roanes-Lozano, E.; Sánchez, F. An Educational Application of Dynamic Geometry: Revisiting the “Recovery Position” in Tennis. Int. J. Tech. Math. Educ.
**2017**, 24, 171–178. [Google Scholar] - Crespo, M.; Miley, D. Advanced Coaches Manual; ITF Ltd.: London, UK, 1998. [Google Scholar]
- Forti, U. Curso de Tenis; Ed. de Vecchi: Barcelona, Spain, 1991. [Google Scholar]
- Forti, U. Curso Avanzado de Tenis; Ed. de Vecchi: Barcelona, Spain, 1992. [Google Scholar]
- Roanes-Lozano, E.; Laita, L.M.; Roanes-Macías, E. A Polynomial Model for Multivalued Logics with a Touch of Algebraic Geometry and Computer Algebra. Math. Comp. Simul.
**1998**, 45, 83–99. [Google Scholar] [CrossRef] - Hsiang, J. Refutational Theorem Proving using Term-Rewriting Systems. Art. Intell.
**1985**, 25, 255–300. [Google Scholar] [CrossRef] - Kapur, D.; Narendran, P. An Equational Approach to Theorem Proving in First-Order Predicate Calculus. In Proceedings of the 9th International Joint Conference on Artificial Intelligence (IJCAI-85), Los Angeles, CA, USA, 18–23 August 1985; Volume 2, pp. 1146–1153. [Google Scholar]
- Alonso, J.A.; Briales, E. Lógicas Polivalentes y Bases de Gröbner. In Actas del V Congreso de Lenguajes Naturales y Lenguajes Formales; Martin, C., Ed.; Universidad de Sevilla: Seville, Spain, 1995; pp. 307–315. [Google Scholar]
- Chazarain, J.; Riscos, A.; Alonso, J.A.; Briales, E. Multivalued Logic and Gröbner Bases with Applications to Modal Logic. J. Symb. Comput.
**1991**, 11, 181–194. [Google Scholar] [CrossRef] [Green Version] - Roanes-Lozano, E.; Laita, L.M.; Hernando, A.; Roanes-Macías, E. An Algebraic Approach to Rule Based Expert Systems. Rev. R. Acad. Cien. Ser. A Mat.
**2010**, 104, 19–40. [Google Scholar] [CrossRef] - Alonso-Jiménez, J.A.; Aranda-Corral, G.A.; Joaquín Borrego-Díaz, J.; Fernández-Lebrón, M.M.; Hidalgo-Doblado, M.J. A logic-algebraic tool for reasoning with Knowledge-Based Systems. J. Log. Algebr. Meth. Program.
**2018**, 101, 88–109. [Google Scholar] - Aranda-Corral, G.A.; Borrego-Díaz, J.; Fernández-Lebrón, M.M. Conservative Retractions of Propositional Logic Theories by Means of Boolean Derivatives: Theoretical Foundations. In Intelligent Computer Mathematics. CICM 2009; Carette, J., Dixon, L., Coen, C.S., Watt, S.M., Eds.; Lect. Notes Comput. Sci.; Springer: Berlin/Heidelberg, Germany, 2009; Volume 5625, pp. 45–58. [Google Scholar]
- Buchberger, B. Bruno Buchberger’s PhD thesis 1965: An algorithm for finding the basis elementals of the residue class ring of a zero dimensional polynomial ideal. J. Symb. Comput.
**2006**, 41, 475–511. [Google Scholar] [CrossRef] [Green Version] - Cox, D.A.; Little, J.; O’Shea, D. Ideals, Varieties, and Algorithms: An Introduction to Computational Algebraic Geometry and Commutative Algebra, 3rd ed.; Undergraduate Texts in Mathematics; Springer: Berlin/Heidelberg, Germany, 2007. [Google Scholar]
- Winkler, F. Polynomial Algorithms in Computer Algebra, Texts and Monographs in Symbolic Computation; Springer: Wien, Austria; New York, NY, USA, 1996. [Google Scholar]
- Laita, L.M.; Roanes-Lozano, E.; Maojo, V.; de Ledesma, L.; Laita, L. An Expert System for Managing Medical Appropriateness Criteria Based on Computer Algebra Techniques. Comp. Math. Appl.
**2000**, 51, 473–481. [Google Scholar] [CrossRef] - Lourdes Jimenez, M.L.; Santamaría, J.M.; Barchino, R.; Laura Laita, L.; Laita, L.M.; González, L.A.; Asenjo, A. Knowledge representation for diagnosis of care problems through an expert system: Model of the auto-care deficit situations. Exp. Syst. Appl.
**2008**, 34, 2847–2857. [Google Scholar] [CrossRef] - Pérez-Carretero, C.; Laita, L.M.; Roanes-Lozano, E.; Lázaro, L.; González-Cajal, J.; Laita, L. A Logic and Computer Algebra-Based Expert System for Diagnosis of Anorexia. Math. Comput. Simul.
**2002**, 58, 183–202. [Google Scholar] [CrossRef] - Roanes Lozano, E.; Galán-García, J.L.; Aguilera-Venegas, G. A Portable Knowledge Based System for Car Breakdown Evaluation. Appl. Math. Comput.
**2015**, 267, 758–770. [Google Scholar] [CrossRef] - Roanes Lozano, E.; Galán-García, J.L.; Aguilera-Venegas, G. A prototype of a RBES for personalized menus generation. Appl. Math. Comput.
**2017**, 315, 615–624. [Google Scholar] [CrossRef] - Rodríguez-Solano, C.; Laita, L.M.; Roanes-Lozano, E.; López-Corral, L.; Laita, L. A Computational System for Diagnosis of Depressive Situations. Exp. Syst. Appl.
**2006**, 31, 47–55. [Google Scholar] [CrossRef] - Roanes-Lozano, E.; Laita, L.M.; Roanes-Macías, E. A Groebner Bases Based Many-valued Modal Logic Implementation in Maple. In AISC/Calculemus/MKM 2008; Autexier, S., Campbell, J., Rubio, J., Sorge, V., Suzuki, M., Wiedijk, F., Eds.; Lecture Notes in Artificial Intelligence, 5144; Springer: Berlin/Heidelberg, Germany, 2008; pp. 170–183. [Google Scholar]
- Available online: http://polybori.sourceforge.net/ (accessed on 10 April 2020).
- Available online: http://minisat.se/ (accessed on 10 April 2020).
- Roanes-Lozano, E.; Hernando, A.; Laita, L.M.; Roanes-Macías, E. A Groebner bases-based approach to backward reasoning in rule based expert systems. Ann. Math. Art. Int.
**2009**, 56, 297–311. [Google Scholar] [CrossRef]

**Figure 1.**Some rules directly deduce output from the facts. Other rules lead to intermediate results (guards). And another rules obtain output from the guards. Therefore, the figure shows the hierarchy among input variables (facts), intermediate conclusions (guards) and final conclusions (output).

Description | Propositional |
---|---|

Variable | |

Kind of serve (choose exactly one): | |

You are executing a slice serve | ${x}_{1}$ |

You are executing a flat serve | ${x}_{2}$ |

You are executing a topspin serve | ${x}_{3}$ |

You are an expert player and you can serve in any of the | |

three ways (${x}_{1}$, ${x}_{2}$, ${x}_{3}$) tossing the ball the same place | ${z}_{0}$ |

You usually jump when executing this kind of serve | ${y}_{1}$ |

Description | Propositional |
---|---|

Variable | |

Feet initial position / distance (choose at most one): | |

Distance between feet too big | ${d}_{1}$ |

Distance between feet too small | ${d}_{2}$ |

Arms initial situation: | |

Arms initially not relaxed | ${v}_{1}$ |

Shoulders’ initial position (angle w.r.t. baseline) | |

close to right angle (or your usual position) | ${w}_{1}$ |

Tossing the ball—A (choose exactly one): | |

Too low toss | ${t}_{1}$ |

Normal height toss | ${t}_{2}$ |

Too high toss | ${t}_{3}$ |

Tossing the ball—B (choose exactly one): | |

A bit towards the arm holding the racket | ${l}_{1}$ |

On the middle | ${l}_{2}$ |

A bit towards the arm not holding the racket | ${l}_{3}$ |

Hitting the ball (choose at most one): | |

You are letting the ball drop too low | ${a}_{1}$ |

You are hitting the ball too high (upper part of the racket) | ${a}_{2}$ |

Looking at the ball: | |

You are keeping your eyes on the ball | ${m}_{1}$ |

Grip: | |

You are holding the grip firmly | ${e}_{1}$ |

This is your usual grip for this kind of serve | ${e}_{2}$ |

Description | Propositional |
---|---|

Variable | |

Kinetic: | |

You flex slightly your knees before hitting the ball | ${k}_{1}$ |

Your knees are straight when hitting the ball | ${k}_{2}$ |

You balance slightly backward and forward during the | |

execution of the serve and you move or tend to move forward | ${k}_{3}$ |

You feel your abdominals do work during the execution of the serve | ${k}_{4}$ |

Your racket begins the swing more or less behind your | |

head at its usual initial position | ${k}_{5}$ |

The swing of your racket finishes too early | ${k}_{6}$ |

You are hitting the ball with your feet on the air | ${k}_{7}$ |

Coordination: | |

You “feel coordinated” when serving today | ${o}_{1}$ |

Description | Propositional |
---|---|

Variable | |

Lack of balance (equilibrium of the body) | ${g}_{1}$ |

Physical difficulty or impossibility to execute the stroke that way | ${g}_{2}$ |

Acceleration w.r.t. normal rhythm or some parts | |

of the execution of the serve not on time | ${g}_{3}$ |

Incompatibility with the player’s own technique | ${g}_{4}$ |

Description | Propositional |
---|---|

Variable | |

Imprecision | ${c}_{1}$ |

Stroke too weak (lack of power) | ${c}_{2}$ |

Too low and/or too short | ${c}_{3}$ |

Too long | ${c}_{4}$ |

Little spin | ${c}_{5}$ |

© 2020 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 (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Roanes-Lozano, E.; Casella, E.A.; Sánchez, F.; Hernando, A.
Diagnosis in Tennis Serving Technique. *Algorithms* **2020**, *13*, 106.
https://doi.org/10.3390/a13050106

**AMA Style**

Roanes-Lozano E, Casella EA, Sánchez F, Hernando A.
Diagnosis in Tennis Serving Technique. *Algorithms*. 2020; 13(5):106.
https://doi.org/10.3390/a13050106

**Chicago/Turabian Style**

Roanes-Lozano, Eugenio, Eduardo A. Casella, Fernando Sánchez, and Antonio Hernando.
2020. "Diagnosis in Tennis Serving Technique" *Algorithms* 13, no. 5: 106.
https://doi.org/10.3390/a13050106