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 \frac {\partial^n} {\partial x^n} F_1(a,b_1,b_2,c; x,y) = \frac {\left(a\right)_n \left(b_1\right)_n} {\left(c\right)_n} F_1(a+n,b_1+n,b_2,c+n; x,y) }

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

Semantic latex: \deriv [n]{ }{x} F_1(a , b_1 , b_2 , c ; x , y) = \frac{\Pochhammersym{a}{n} \Pochhammersym{b_1}{n}}{\Pochhammersym{c}{n}} F_1(a + n , b_1 + n , b_2 , c + n ; x , y)

Confidence: 0.6805

Mathematica

Translation: D[Subscript[F, 1][a , Subscript[b, 1], Subscript[b, 2], c ; x , y], {x, n}] == Divide[Pochhammer[a, n]*Pochhammer[Subscript[b, 1], n],Pochhammer[c, n]]*Subscript[F, 1][a + n , Subscript[b, 1]+ n , Subscript[b, 2], c + n ; x , y]

Information

Sub Equations

  • D[Subscript[F, 1][a , Subscript[b, 1], Subscript[b, 2], c ; x , y], {x, n}] = Divide[Pochhammer[a, n]*Pochhammer[Subscript[b, 1], n],Pochhammer[c, n]]*Subscript[F, 1][a + n , Subscript[b, 1]+ n , Subscript[b, 2], c + n ; x , y]

Free variables

  • Subscript[b, 1]
  • Subscript[b, 2]
  • a
  • c
  • n
  • x
  • y

Symbol info

  • Derivative; Example: \deriv[n]{f}{x}

Will be translated to: D[$1, {$2, $0}] Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.4#E4 Mathematica: https://reference.wolfram.com/language/ref/D.html

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Pochhammer symbol; Example: \Pochhammersym{a}{n}

Will be translated to: Pochhammer[$0, $1] Relevant links to definitions: DLMF: http://dlmf.nist.gov/5.2#iii Mathematica: https://reference.wolfram.com/language/ref/Pochhammer.html

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

  • (LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \Pochhammersym [\Pochhammersym]

Tests

Symbolic
Numeric

Maple

Translation: diff(F[1](a , b[1], b[2], c ; x , y), [x$(n)]) = (pochhammer(a, n)*pochhammer(b[1], n))/(pochhammer(c, n))*F[1](a + n , b[1]+ n , b[2], c + n ; x , y)

Information

Sub Equations

  • diff(F[1](a , b[1], b[2], c ; x , y), [x$(n)]) = (pochhammer(a, n)*pochhammer(b[1], n))/(pochhammer(c, n))*F[1](a + n , b[1]+ n , b[2], c + n ; x , y)

Free variables

  • a
  • b[1]
  • b[2]
  • c
  • n
  • x
  • y

Symbol info

  • Derivative; Example: \deriv[n]{f}{x}

Will be translated to: diff($1, [$2$($0)]) Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.4#E4 Maple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=diff

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Pochhammer symbol; Example: \Pochhammersym{a}{n}

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

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • A system
  • Appell
  • definition
  • partial differential equation
  • solution
  • system
  • derivative
  • derivative result from the definition
  • double series
  • system of differential equation
  • system of second-order differential equation

Complete translation information:

{
  "id" : "FORMULA_643bf463fce8338fc2008d85b46de117",
  "formula" : "\\frac {\\partial^n} {\\partial x^n} F_1(a,b_1,b_2,c; x,y) = \\frac {\\left(a\\right)_n \\left(b_1\\right)_n} {\\left(c\\right)_n} F_1(a+n,b_1+n,b_2,c+n; x,y)",
  "semanticFormula" : "\\deriv [n]{ }{x} F_1(a , b_1 , b_2 , c ; x , y) = \\frac{\\Pochhammersym{a}{n} \\Pochhammersym{b_1}{n}}{\\Pochhammersym{c}{n}} F_1(a + n , b_1 + n , b_2 , c + n ; x , y)",
  "confidence" : 0.6805,
  "translations" : {
    "Mathematica" : {
      "translation" : "D[Subscript[F, 1][a , Subscript[b, 1], Subscript[b, 2], c ; x , y], {x, n}] == Divide[Pochhammer[a, n]*Pochhammer[Subscript[b, 1], n],Pochhammer[c, n]]*Subscript[F, 1][a + n , Subscript[b, 1]+ n , Subscript[b, 2], c + n ; x , y]",
      "translationInformation" : {
        "subEquations" : [ "D[Subscript[F, 1][a , Subscript[b, 1], Subscript[b, 2], c ; x , y], {x, n}] = Divide[Pochhammer[a, n]*Pochhammer[Subscript[b, 1], n],Pochhammer[c, n]]*Subscript[F, 1][a + n , Subscript[b, 1]+ n , Subscript[b, 2], c + n ; x , y]" ],
        "freeVariables" : [ "Subscript[b, 1]", "Subscript[b, 2]", "a", "c", "n", "x", "y" ],
        "tokenTranslations" : {
          "\\deriv1" : "Derivative; Example: \\deriv[n]{f}{x}\nWill be translated to: D[$1, {$2, $0}]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/1.4#E4\nMathematica:  https://reference.wolfram.com/language/ref/D.html",
          "F" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\Pochhammersym" : "Pochhammer symbol; Example: \\Pochhammersym{a}{n}\nWill be translated to: Pochhammer[$0, $1]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/5.2#iii\nMathematica:  https://reference.wolfram.com/language/ref/Pochhammer.html"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "SymPy" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \\Pochhammersym [\\Pochhammersym]"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "Maple" : {
      "translation" : "diff(F[1](a , b[1], b[2], c ; x , y), [x$(n)]) = (pochhammer(a, n)*pochhammer(b[1], n))/(pochhammer(c, n))*F[1](a + n , b[1]+ n , b[2], c + n ; x , y)",
      "translationInformation" : {
        "subEquations" : [ "diff(F[1](a , b[1], b[2], c ; x , y), [x$(n)]) = (pochhammer(a, n)*pochhammer(b[1], n))/(pochhammer(c, n))*F[1](a + n , b[1]+ n , b[2], c + n ; x , y)" ],
        "freeVariables" : [ "a", "b[1]", "b[2]", "c", "n", "x", "y" ],
        "tokenTranslations" : {
          "\\deriv1" : "Derivative; Example: \\deriv[n]{f}{x}\nWill be translated to: diff($1, [$2$($0)])\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/1.4#E4\nMaple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=diff",
          "F" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\Pochhammersym" : "Pochhammer symbol; Example: \\Pochhammersym{a}{n}\nWill be translated to: pochhammer($0, $1)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/5.2#iii\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=pochhammer"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    }
  },
  "positions" : [ {
    "section" : 3,
    "sentence" : 0,
    "word" : 17
  } ],
  "includes" : [ "(q)_n", "y", "x", "F_{1}", "F" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "A system",
    "score" : 0.8426021531523621
  }, {
    "definition" : "Appell",
    "score" : 0.8426021531523621
  }, {
    "definition" : "definition",
    "score" : 0.8426021531523621
  }, {
    "definition" : "partial differential equation",
    "score" : 0.8426021531523621
  }, {
    "definition" : "solution",
    "score" : 0.8426021531523621
  }, {
    "definition" : "system",
    "score" : 0.8426021531523621
  }, {
    "definition" : "derivative",
    "score" : 0.6687181434333315
  }, {
    "definition" : "derivative result from the definition",
    "score" : 0.6687181434333315
  }, {
    "definition" : "double series",
    "score" : 0.6687181434333315
  }, {
    "definition" : "system of differential equation",
    "score" : 0.6687181434333315
  }, {
    "definition" : "system of second-order differential equation",
    "score" : 0.6687181434333315
  } ]
}

Specify your own input