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} {\partial x} F_3(a_1,a_2,b_1,b_2,c; x,y) = \frac {a_1 b_1} {c} F_3(a_1+1,a_2,b_1+1,b_2,c+1; x,y) }

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

Semantic latex: \deriv [1]{ }{x} F_3(a_1 , a_2 , b_1 , b_2 , c ; x , y) = \frac {a_1 b_1} {c} F_3(a_1 + 1 , a_2 , b_1 + 1 , b_2 , c + 1 ; x , y)

Confidence: 0

Mathematica

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

Information

Sub Equations

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

Free variables

  • Subscript[a, 1]
  • Subscript[a, 2]
  • Subscript[b, 1]
  • Subscript[b, 2]
  • c
  • 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).

Tests

Symbolic
Numeric

SymPy

Translation: diff(Symbol('{F}_{3}')(Symbol('{a}_{1}'), Symbol('{a}_{2}'), Symbol('{b}_{1}'), Symbol('{b}_{2}'), c ; x , y), x, 1) == (Symbol('{a}_{1}')*Symbol('{b}_{1}'))/(c)*Symbol('{F}_{3}')(Symbol('{a}_{1}')+ 1 , Symbol('{a}_{2}'), Symbol('{b}_{1}')+ 1 , Symbol('{b}_{2}'), c + 1 ; x , y)

Information

Sub Equations

  • diff(Symbol('{F}_{3}')(Symbol('{a}_{1}'), Symbol('{a}_{2}'), Symbol('{b}_{1}'), Symbol('{b}_{2}'), c ; x , y), x, 1) = (Symbol('{a}_{1}')*Symbol('{b}_{1}'))/(c)*Symbol('{F}_{3}')(Symbol('{a}_{1}')+ 1 , Symbol('{a}_{2}'), Symbol('{b}_{1}')+ 1 , Symbol('{b}_{2}'), c + 1 ; x , y)

Free variables

  • Symbol('{a}_{1}')
  • Symbol('{a}_{2}')
  • Symbol('{b}_{1}')
  • Symbol('{b}_{2}')
  • c
  • 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 SymPy: https://docs.sympy.org/latest/tutorial/calculus.html#derivatives

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Maple

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

Information

Sub Equations

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

Free variables

  • a[1]
  • a[2]
  • b[1]
  • b[2]
  • c
  • 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).

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_3fab2417e142dea65d178231e4b11b51",
  "formula" : "\\frac {\\partial} {\\partial x} F_3(a_1,a_2,b_1,b_2,c; x,y) = \\frac {a_1 b_1} {c} F_3(a_1+1,a_2,b_1+1,b_2,c+1; x,y)",
  "semanticFormula" : "\\deriv [1]{ }{x} F_3(a_1 , a_2 , b_1 , b_2 , c ; x , y) = \\frac {a_1 b_1} {c} F_3(a_1 + 1 , a_2 , b_1 + 1 , b_2 , c + 1 ; x , y)",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "D[Subscript[F, 3][Subscript[a, 1], Subscript[a, 2], Subscript[b, 1], Subscript[b, 2], c ; x , y], {x, 1}] == Divide[Subscript[a, 1]*Subscript[b, 1],c]*Subscript[F, 3][Subscript[a, 1]+ 1 , Subscript[a, 2], Subscript[b, 1]+ 1 , Subscript[b, 2], c + 1 ; x , y]",
      "translationInformation" : {
        "subEquations" : [ "D[Subscript[F, 3][Subscript[a, 1], Subscript[a, 2], Subscript[b, 1], Subscript[b, 2], c ; x , y], {x, 1}] = Divide[Subscript[a, 1]*Subscript[b, 1],c]*Subscript[F, 3][Subscript[a, 1]+ 1 , Subscript[a, 2], Subscript[b, 1]+ 1 , Subscript[b, 2], c + 1 ; x , y]" ],
        "freeVariables" : [ "Subscript[a, 1]", "Subscript[a, 2]", "Subscript[b, 1]", "Subscript[b, 2]", "c", "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)."
        }
      },
      "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" : "diff(Symbol('{F}_{3}')(Symbol('{a}_{1}'), Symbol('{a}_{2}'), Symbol('{b}_{1}'), Symbol('{b}_{2}'), c ; x , y), x, 1) == (Symbol('{a}_{1}')*Symbol('{b}_{1}'))/(c)*Symbol('{F}_{3}')(Symbol('{a}_{1}')+ 1 , Symbol('{a}_{2}'), Symbol('{b}_{1}')+ 1 , Symbol('{b}_{2}'), c + 1 ; x , y)",
      "translationInformation" : {
        "subEquations" : [ "diff(Symbol('{F}_{3}')(Symbol('{a}_{1}'), Symbol('{a}_{2}'), Symbol('{b}_{1}'), Symbol('{b}_{2}'), c ; x , y), x, 1) = (Symbol('{a}_{1}')*Symbol('{b}_{1}'))/(c)*Symbol('{F}_{3}')(Symbol('{a}_{1}')+ 1 , Symbol('{a}_{2}'), Symbol('{b}_{1}')+ 1 , Symbol('{b}_{2}'), c + 1 ; x , y)" ],
        "freeVariables" : [ "Symbol('{a}_{1}')", "Symbol('{a}_{2}')", "Symbol('{b}_{1}')", "Symbol('{b}_{2}')", "c", "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\nSymPy: https://docs.sympy.org/latest/tutorial/calculus.html#derivatives",
          "F" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
        }
      },
      "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[3](a[1], a[2], b[1], b[2], c ; x , y), [x$(1)]) = (a[1]*b[1])/(c)*F[3](a[1]+ 1 , a[2], b[1]+ 1 , b[2], c + 1 ; x , y)",
      "translationInformation" : {
        "subEquations" : [ "diff(F[3](a[1], a[2], b[1], b[2], c ; x , y), [x$(1)]) = (a[1]*b[1])/(c)*F[3](a[1]+ 1 , a[2], b[1]+ 1 , b[2], c + 1 ; x , y)" ],
        "freeVariables" : [ "a[1]", "a[2]", "b[1]", "b[2]", "c", "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)."
        }
      },
      "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" : 68
  } ],
  "includes" : [ "F_{3}", "y", "x", "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