LaTeX to CAS translator

Jump to navigation Jump to search

This mockup demonstrates the concept of TeX to Computer Algebra System (CAS) conversion.

The demo-application converts LaTeX functions which directly translate to CAS counterparts.

Functions without explicit CAS support are available for translation via a DRMF package (under development).

The following LaTeX input ...

{\displaystyle P_0^{(\alpha,\beta)}(z)= 1,}

... is translated to the CAS output ...

Semantic latex: \JacobipolyP{\alpha}{\beta}{0}@{z} = 1

Confidence: 0.70338171203013

Mathematica

Translation: JacobiP[0, \[Alpha], \[Beta], z] == 1

Information

Sub Equations

  • JacobiP[0, \[Alpha], \[Beta], z] = 1

Free variables

  • \[Alpha]
  • \[Beta]
  • z

Symbol info

  • Jacobi polynomial; Example: \JacobipolyP{\alpha}{\beta}{n}@{x}

Will be translated to: JacobiP[$2, $0, $1, $3] Relevant links to definitions: DLMF: http://dlmf.nist.gov/18.3#T1.t1.r2 Mathematica: https://reference.wolfram.com/language/ref/JacobiP.html?q=JacobiP

  • Could be the second Feigenbaum constant.

But this system doesn't know how to translate it as a constant. It was translated as a general letter.

Tests

Symbolic

Test expression: (JacobiP[0, \[Alpha], \[Beta], z])-(1)

ERROR:

{
    "result": "ERROR",
    "testTitle": "Simple",
    "testExpression": null,
    "resultExpression": null,
    "wasAborted": false,
    "conditionallySuccessful": false
}
Numeric

SymPy

Translation: jacobi(0, Symbol('alpha'), Symbol('beta'), z) == 1

Information

Sub Equations

  • jacobi(0, Symbol('alpha'), Symbol('beta'), z) = 1

Free variables

  • Symbol('alpha')
  • Symbol('beta')
  • z

Symbol info

  • Jacobi polynomial; Example: \JacobipolyP{\alpha}{\beta}{n}@{x}

Will be translated to: jacobi($2, $0, $1, $3) Relevant links to definitions: DLMF: http://dlmf.nist.gov/18.3#T1.t1.r2 SymPy: https://docs.sympy.org/latest/modules/functions/special.html#jacobi-polynomials

  • Could be the second Feigenbaum constant.

But this system doesn't know how to translate it as a constant. It was translated as a general letter.

Tests

Symbolic
Numeric

Maple

Translation: JacobiP(0, alpha, beta, z) = 1

Information

Sub Equations

  • JacobiP(0, alpha, beta, z) = 1

Free variables

  • alpha
  • beta
  • z

Symbol info

  • Jacobi polynomial; Example: \JacobipolyP{\alpha}{\beta}{n}@{x}

Will be translated to: JacobiP($2, $0, $1, $3) Relevant links to definitions: DLMF: http://dlmf.nist.gov/18.3#T1.t1.r2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=JacobiP

  • Could be the second Feigenbaum constant.

But this system doesn't know how to translate it as a constant. It was translated as a general letter.

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Complete translation information:

{
  "id" : "FORMULA_5a59d52ac2638a6e955a48d2dbf276db",
  "formula" : "P_0^{(\\alpha,\\beta)}(z)= 1",
  "semanticFormula" : "\\JacobipolyP{\\alpha}{\\beta}{0}@{z} = 1",
  "confidence" : 0.7033817120301267,
  "translations" : {
    "Mathematica" : {
      "translation" : "JacobiP[0, \\[Alpha], \\[Beta], z] == 1",
      "translationInformation" : {
        "subEquations" : [ "JacobiP[0, \\[Alpha], \\[Beta], z] = 1" ],
        "freeVariables" : [ "\\[Alpha]", "\\[Beta]", "z" ],
        "tokenTranslations" : {
          "\\JacobipolyP" : "Jacobi polynomial; Example: \\JacobipolyP{\\alpha}{\\beta}{n}@{x}\nWill be translated to: JacobiP[$2, $0, $1, $3]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/18.3#T1.t1.r2\nMathematica:  https://reference.wolfram.com/language/ref/JacobiP.html?q=JacobiP",
          "\\alpha" : "Could be the second Feigenbaum constant.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "ERROR",
        "numberOfTests" : 1,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 1,
        "crashed" : false,
        "testCalculationsGroup" : [ {
          "lhs" : "JacobiP[0, \\[Alpha], \\[Beta], z]",
          "rhs" : "1",
          "testExpression" : "(JacobiP[0, \\[Alpha], \\[Beta], z])-(1)",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "jacobi(0, Symbol('alpha'), Symbol('beta'), z) == 1",
      "translationInformation" : {
        "subEquations" : [ "jacobi(0, Symbol('alpha'), Symbol('beta'), z) = 1" ],
        "freeVariables" : [ "Symbol('alpha')", "Symbol('beta')", "z" ],
        "tokenTranslations" : {
          "\\JacobipolyP" : "Jacobi polynomial; Example: \\JacobipolyP{\\alpha}{\\beta}{n}@{x}\nWill be translated to: jacobi($2, $0, $1, $3)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/18.3#T1.t1.r2\nSymPy: https://docs.sympy.org/latest/modules/functions/special.html#jacobi-polynomials",
          "\\alpha" : "Could be the second Feigenbaum constant.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n"
        }
      }
    },
    "Maple" : {
      "translation" : "JacobiP(0, alpha, beta, z) = 1",
      "translationInformation" : {
        "subEquations" : [ "JacobiP(0, alpha, beta, z) = 1" ],
        "freeVariables" : [ "alpha", "beta", "z" ],
        "tokenTranslations" : {
          "\\JacobipolyP" : "Jacobi polynomial; Example: \\JacobipolyP{\\alpha}{\\beta}{n}@{x}\nWill be translated to: JacobiP($2, $0, $1, $3)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/18.3#T1.t1.r2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=JacobiP",
          "\\alpha" : "Could be the second Feigenbaum constant.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n"
        }
      }
    }
  },
  "positions" : [ {
    "section" : 4,
    "sentence" : 0,
    "word" : 0
  } ],
  "includes" : [ "P_{n}^{(\\alpha, \\beta)}(x)", "P_{n}^{(\\alpha, \\beta)}", "\\alpha,\\beta", "z" ],
  "isPartOf" : [ ],
  "definiens" : [ ]
}

Specify your own input