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 - 2)x + y(y - 1)}{yx - (y - 1)(x - 2)} = 0}

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

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

Confidence: 0

Mathematica

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

Information

Sub Equations

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

Free variables

  • x
  • y

Tests

Symbolic

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

ERROR:

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

SymPy

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

Information

Sub Equations

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

Free variables

  • x
  • y

Tests

Symbolic
Numeric

Maple

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

Information

Sub Equations

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

Free variables

  • x
  • y

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • example
  • three-point equation

Complete translation information:

{
  "id" : "FORMULA_c3fbecf52bbe45e029d2f8ca3b4034d1",
  "formula" : "\\frac{(x - 2)x + y(y - 1)}{yx - (y - 1)(x - 2)} = 0",
  "semanticFormula" : "\\frac{(x - 2)x + y(y - 1)}{yx - (y - 1)(x - 2)} = 0",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "Divide[(x - 2)*x + y*(y - 1),y*x -(y - 1)*(x - 2)] == 0",
      "translationInformation" : {
        "subEquations" : [ "Divide[(x - 2)*x + y*(y - 1),y*x -(y - 1)*(x - 2)] = 0" ],
        "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 - 2)*x + y*(y - 1),y*x -(y - 1)*(x - 2)]",
          "rhs" : "0",
          "testExpression" : "(Divide[(x - 2)*x + y*(y - 1),y*x -(y - 1)*(x - 2)])-(0)",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "((x - 2)*x + y*(y - 1))/(y*x -(y - 1)*(x - 2)) == 0",
      "translationInformation" : {
        "subEquations" : [ "((x - 2)*x + y*(y - 1))/(y*x -(y - 1)*(x - 2)) = 0" ],
        "freeVariables" : [ "x", "y" ]
      }
    },
    "Maple" : {
      "translation" : "((x - 2)*x + y*(y - 1))/(y*x -(y - 1)*(x - 2)) = 0",
      "translationInformation" : {
        "subEquations" : [ "((x - 2)*x + y*(y - 1))/(y*x -(y - 1)*(x - 2)) = 0" ],
        "freeVariables" : [ "x", "y" ]
      }
    }
  },
  "positions" : [ {
    "section" : 30,
    "sentence" : 1,
    "word" : 10
  } ],
  "includes" : [ "= 0", "y", "x", "y(x)" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "example",
    "score" : 0.7125985104912714
  }, {
    "definition" : "three-point equation",
    "score" : 0.7125985104912714
  } ]
}

Specify your own input