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 |\log(z)|<2 \pi;s\neq 1,2,3,\dots; a\neq 0,-1,-2,\dots}

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

Semantic latex: |\log(z)|< 2 \cpi ; s \neq 1 , 2 , 3 , \dots ; a \neq 0 , - 1 , - 2 , \dots

Confidence: 0

Mathematica

Translation: Abs[Log[z]] < 2*Pi s \[NotEqual]1 , 2 , 3 , \[Ellipsis]; a \[NotEqual]0 , - 1 , - 2 , \[Ellipsis]

Information

Sub Equations

  • 2*Pi
s <> 1 , 2 , 3 , \[Ellipsis]; a

Free variables

  • a
  • s
  • z

Symbol info

  • Pi was translated to: Pi
  • Logarithm; Example: \log@@{z}

Will be translated to: Log[$0] Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E2 Mathematica: https://reference.wolfram.com/language/ref/Log.html

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

  • (LaTeX -> SymPy) No translation possible for given token: Unknown relation. Cannot translate: \neq [\neq]

Tests

Symbolic
Numeric

Maple

Translation: abs(log(z)) < 2*Pi; s <> 1 , 2 , 3 , .. ; a <> 0 , - 1 , - 2 , ..

Information

Sub Equations

  • 2*Pi; s <> 1 , 2 , 3 , .. ; a

Free variables

  • a
  • s
  • z

Symbol info

  • Pi was translated to: Pi
  • Logarithm; Example: \log@@{z}

Will be translated to: log($0) Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=log

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • digamma function
  • positive integer
  • series
  • n

Complete translation information:

{
  "id" : "FORMULA_da4212a136305409709df2885e51fee0",
  "formula" : "|\\log(z)|<2 \\pi;s\\neq 1,2,3,\\dots; a\\neq 0,-1,-2,\\dots",
  "semanticFormula" : "|\\log(z)|< 2 \\cpi ; s \\neq 1 , 2 , 3 , \\dots ; a \\neq 0 , - 1 , - 2 , \\dots",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "Abs[Log[z]] < 2*Pi\n s \\[NotEqual]1 , 2 , 3 , \\[Ellipsis]; a \\[NotEqual]0 , - 1 , - 2 , \\[Ellipsis]",
      "translationInformation" : {
        "subEquations" : [ "2*Pi\n s <> 1 , 2 , 3 , \\[Ellipsis]; a" ],
        "freeVariables" : [ "a", "s", "z" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "\\log" : "Logarithm; Example: \\log@@{z}\nWill be translated to: Log[$0]\nConstraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/4.2#E2\nMathematica:  https://reference.wolfram.com/language/ref/Log.html"
        }
      }
    },
    "SymPy" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) No translation possible for given token: Unknown relation. Cannot translate: \\neq [\\neq]"
        }
      }
    },
    "Maple" : {
      "translation" : "abs(log(z)) < 2*Pi; s <> 1 , 2 , 3 , .. ; a <> 0 , - 1 , - 2 , ..",
      "translationInformation" : {
        "subEquations" : [ "2*Pi; s <> 1 , 2 , 3 , .. ; a" ],
        "freeVariables" : [ "a", "s", "z" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "\\log" : "Logarithm; Example: \\log@@{z}\nWill be translated to: log($0)\nConstraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.2#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=log"
        }
      }
    }
  },
  "positions" : [ {
    "section" : 5,
    "sentence" : 5,
    "word" : 13
  } ],
  "includes" : [ "z", "s", "a" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "digamma function",
    "score" : 0.6859086196238077
  }, {
    "definition" : "positive integer",
    "score" : 0.6859086196238077
  }, {
    "definition" : "series",
    "score" : 0.6859086196238077
  }, {
    "definition" : "n",
    "score" : 0.6460746792928004
  } ]
}

Specify your own input