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 \operatorname{Si}(x) - \operatorname{si}(x) = \int_0^\infty\frac{\sin t}{t}\,dt = \frac{\pi}{2} \quad \text{ or } \quad \operatorname{Si}(x) = \frac{\pi}{2} + \operatorname{si}(x) ~.}

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

Semantic latex: \operatorname{Si}(x) - \operatorname{si}(x) = \int_0^\infty \frac{\sin t}{t} \diff{t} = \frac{\cpi}{2} \quad or \quad \operatorname{Si}(x) = \frac{\cpi}{2} + \operatorname{si}(x)

Confidence: 0

Mathematica

Translation: Si[x]- si[x] == Integrate[Divide[Sin[t],t], {t, 0, Infinity}, GenerateConditions->None] == Divide[Pi,2]

Information

Sub Equations

  • Si[x]- si[x] = Integrate[Divide[Sin[t],t], {t, 0, Infinity}, GenerateConditions->None]
  • Integrate[Divide[Sin[t],t], {t, 0, Infinity}, GenerateConditions->None] = Divide[Pi,2]

Free variables

  • o
  • r
  • x

Constraints

  • o*r*Si[x] == Divide[Pi,2]+ si[x]

Symbol info

  • Pi was translated to: Pi
  • Was interpreted as a function call because of a leading \operatorname.
  • Was interpreted as a function call because of a leading \operatorname.
  • Sine; Example: \sin@@{z}

Will be translated to: Sin[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.14#E1 Mathematica: https://reference.wolfram.com/language/ref/Sin.html

Tests

Symbolic

Test expression: (Si[x]- si[x])-(Integrate[Divide[Sin[t],t], {t, 0, Infinity}, GenerateConditions->None])

ERROR:

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

Test expression: (Integrate[Divide[Sin[t],t], {t, 0, Infinity}, GenerateConditions->None])-(Divide[Pi,2])

ERROR:

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

SymPy

Translation: Si(x)- si(x) == integrate((sin(t))/(t), (t, 0, oo)) == (pi)/(2)

Information

Sub Equations

  • Si(x)- si(x) = integrate((sin(t))/(t), (t, 0, oo))
  • integrate((sin(t))/(t), (t, 0, oo)) = (pi)/(2)

Free variables

  • o
  • r
  • x

Constraints

  • o*r*Si(x) == (pi)/(2)+ si(x)

Symbol info

  • Pi was translated to: pi
  • Was interpreted as a function call because of a leading \operatorname.
  • Was interpreted as a function call because of a leading \operatorname.
  • Sine; Example: \sin@@{z}

Will be translated to: sin($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.14#E1 SymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#sin

Tests

Symbolic
Numeric

Maple

Translation: Si(x)- si(x) = int((sin(t))/(t), t = 0..infinity) = (Pi)/(2)

Information

Sub Equations

  • Si(x)- si(x) = int((sin(t))/(t), t = 0..infinity)
  • int((sin(t))/(t), t = 0..infinity) = (Pi)/(2)

Free variables

  • o
  • r
  • x

Constraints

  • o*r*Si(x) = (Pi)/(2)+ si(x)

Symbol info

  • Pi was translated to: Pi
  • Was interpreted as a function call because of a leading \operatorname.
  • Was interpreted as a function call because of a leading \operatorname.
  • Sine; Example: \sin@@{z}

Will be translated to: sin($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.14#E1 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=sin

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_3719bd08e8536b9500f4a5bd384a3dda",
  "formula" : "\\operatorname{Si}(x) - \\operatorname{si}(x) = \\int_0^\\infty\\frac{\\sin t}{t}dt = \\frac{\\pi}{2} \\quad \\text{ or } \\quad \\operatorname{Si}(x) = \\frac{\\pi}{2} + \\operatorname{si}(x) ~",
  "semanticFormula" : "\\operatorname{Si}(x) - \\operatorname{si}(x) = \\int_0^\\infty \\frac{\\sin t}{t} \\diff{t} = \\frac{\\cpi}{2} \\quad or \\quad \\operatorname{Si}(x) = \\frac{\\cpi}{2} + \\operatorname{si}(x)",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "Si[x]- si[x] == Integrate[Divide[Sin[t],t], {t, 0, Infinity}, GenerateConditions->None] == Divide[Pi,2]",
      "translationInformation" : {
        "subEquations" : [ "Si[x]- si[x] = Integrate[Divide[Sin[t],t], {t, 0, Infinity}, GenerateConditions->None]", "Integrate[Divide[Sin[t],t], {t, 0, Infinity}, GenerateConditions->None] = Divide[Pi,2]" ],
        "freeVariables" : [ "o", "r", "x" ],
        "constraints" : [ "o*r*Si[x] == Divide[Pi,2]+ si[x]" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "Si" : "Was interpreted as a function call because of a leading \\operatorname.",
          "si" : "Was interpreted as a function call because of a leading \\operatorname.",
          "\\sin" : "Sine; Example: \\sin@@{z}\nWill be translated to: Sin[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/4.14#E1\nMathematica:  https://reference.wolfram.com/language/ref/Sin.html"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "ERROR",
        "numberOfTests" : 2,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 2,
        "crashed" : false,
        "testCalculationsGroup" : [ {
          "lhs" : "Si[x]- si[x]",
          "rhs" : "Integrate[Divide[Sin[t],t], {t, 0, Infinity}, GenerateConditions->None]",
          "testExpression" : "(Si[x]- si[x])-(Integrate[Divide[Sin[t],t], {t, 0, Infinity}, GenerateConditions->None])",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        }, {
          "lhs" : "Integrate[Divide[Sin[t],t], {t, 0, Infinity}, GenerateConditions->None]",
          "rhs" : "Divide[Pi,2]",
          "testExpression" : "(Integrate[Divide[Sin[t],t], {t, 0, Infinity}, GenerateConditions->None])-(Divide[Pi,2])",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "Si(x)- si(x) == integrate((sin(t))/(t), (t, 0, oo)) == (pi)/(2)",
      "translationInformation" : {
        "subEquations" : [ "Si(x)- si(x) = integrate((sin(t))/(t), (t, 0, oo))", "integrate((sin(t))/(t), (t, 0, oo)) = (pi)/(2)" ],
        "freeVariables" : [ "o", "r", "x" ],
        "constraints" : [ "o*r*Si(x) == (pi)/(2)+ si(x)" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: pi",
          "Si" : "Was interpreted as a function call because of a leading \\operatorname.",
          "si" : "Was interpreted as a function call because of a leading \\operatorname.",
          "\\sin" : "Sine; Example: \\sin@@{z}\nWill be translated to: sin($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.14#E1\nSymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#sin"
        }
      }
    },
    "Maple" : {
      "translation" : "Si(x)- si(x) = int((sin(t))/(t), t = 0..infinity) = (Pi)/(2)",
      "translationInformation" : {
        "subEquations" : [ "Si(x)- si(x) = int((sin(t))/(t), t = 0..infinity)", "int((sin(t))/(t), t = 0..infinity) = (Pi)/(2)" ],
        "freeVariables" : [ "o", "r", "x" ],
        "constraints" : [ "o*r*Si(x) = (Pi)/(2)+ si(x)" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "Si" : "Was interpreted as a function call because of a leading \\operatorname.",
          "si" : "Was interpreted as a function call because of a leading \\operatorname.",
          "\\sin" : "Sine; Example: \\sin@@{z}\nWill be translated to: sin($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.14#E1\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=sin"
        }
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "\\pi", "\\operatorname{Si}(x) - \\operatorname{si}(x) = \\int_0^\\infty\\frac{\\sin t}{t}\\,dt = \\frac{\\pi}{2} \\quad \\text{ or } \\quad \\operatorname{Si}(x) = \\frac{\\pi}{2} + \\operatorname{si}(x)", "si(x)", "Si", "x", "Si(x)" ],
  "isPartOf" : [ "\\operatorname{Si}(x) - \\operatorname{si}(x) = \\int_0^\\infty\\frac{\\sin t}{t}\\,dt = \\frac{\\pi}{2} \\quad \\text{ or } \\quad \\operatorname{Si}(x) = \\frac{\\pi}{2} + \\operatorname{si}(x)" ],
  "definiens" : [ ]
}

Specify your own input