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{(x - 1)^2}{2} + \frac{\left(y - \frac{1}{2}\right)^2}{\frac{1}{2}} = 1.}

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

Semantic latex: \frac{(x - 1)^2}{2} + \frac{(y - \frac{1}{2})^2}{\frac{1}{2}} = 1

Confidence: 0

Mathematica

Translation: Divide[(x - 1)^(2),2]+Divide[(y -Divide[1,2])^(2),Divide[1,2]] == 1

Information

Sub Equations

  • Divide[(x - 1)^(2),2]+Divide[(y -Divide[1,2])^(2),Divide[1,2]] = 1

Free variables

  • x
  • y

Tests

Symbolic

Test expression: (Divide[(x - 1)^(2),2]+Divide[(y -Divide[1,2])^(2),Divide[1,2]])-(1)

ERROR:

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

SymPy

Translation: ((x - 1)**(2))/(2)+((y -(1)/(2))**(2))/((1)/(2)) == 1

Information

Sub Equations

  • ((x - 1)**(2))/(2)+((y -(1)/(2))**(2))/((1)/(2)) = 1

Free variables

  • x
  • y

Tests

Symbolic
Numeric

Maple

Translation: ((x - 1)^(2))/(2)+((y -(1)/(2))^(2))/((1)/(2)) = 1

Information

Sub Equations

  • ((x - 1)^(2))/(2)+((y -(1)/(2))^(2))/((1)/(2)) = 1

Free variables

  • x
  • y

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • conversion
  • example
  • three-point form

Complete translation information:

{
  "id" : "FORMULA_04027c416bd9ca318a495cada3ab4f04",
  "formula" : "\\frac{(x - 1)^2}{2} + \\frac{\\left(y - \\frac{1}{2}\\right)^2}{\\frac{1}{2}} = 1",
  "semanticFormula" : "\\frac{(x - 1)^2}{2} + \\frac{(y - \\frac{1}{2})^2}{\\frac{1}{2}} = 1",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "Divide[(x - 1)^(2),2]+Divide[(y -Divide[1,2])^(2),Divide[1,2]] == 1",
      "translationInformation" : {
        "subEquations" : [ "Divide[(x - 1)^(2),2]+Divide[(y -Divide[1,2])^(2),Divide[1,2]] = 1" ],
        "freeVariables" : [ "x", "y" ]
      },
      "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" : "Divide[(x - 1)^(2),2]+Divide[(y -Divide[1,2])^(2),Divide[1,2]]",
          "rhs" : "1",
          "testExpression" : "(Divide[(x - 1)^(2),2]+Divide[(y -Divide[1,2])^(2),Divide[1,2]])-(1)",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "((x - 1)**(2))/(2)+((y -(1)/(2))**(2))/((1)/(2)) == 1",
      "translationInformation" : {
        "subEquations" : [ "((x - 1)**(2))/(2)+((y -(1)/(2))**(2))/((1)/(2)) = 1" ],
        "freeVariables" : [ "x", "y" ]
      }
    },
    "Maple" : {
      "translation" : "((x - 1)^(2))/(2)+((y -(1)/(2))^(2))/((1)/(2)) = 1",
      "translationInformation" : {
        "subEquations" : [ "((x - 1)^(2))/(2)+((y -(1)/(2))^(2))/((1)/(2)) = 1" ],
        "freeVariables" : [ "x", "y" ]
      }
    }
  },
  "positions" : [ {
    "section" : 33,
    "sentence" : 1,
    "word" : 16
  } ],
  "includes" : [ "= 1", "y", "x" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "conversion",
    "score" : 0.722
  }, {
    "definition" : "example",
    "score" : 0.6859086196238077
  }, {
    "definition" : "three-point form",
    "score" : 0.6859086196238077
  } ]
}

Specify your own input