Topology / ALM-Compiler

A Java implementation of the ALM language that compiles to the SPARC variant of Answer Set Programming (ASP).
Apache License 2.0
0 stars 1 forks source link

Add Complex Arithmetic Expressions #17

Open Topology opened 6 years ago

Topology commented 6 years ago

Need to support mathematical expressions, to be translated to SPARC. Normalize nested use of function and replace with variables.

  functionA(X) - functionB(Y) = 7

normalized to A - B = 7, A = functionA(X), B = functionB(Y)

Will this happen automatically in translation?

how to handle long sequences of operators?

  5 - 5 - 5 - 5

How does ANTLR handle this? re-parse when converting to ALMTerm?

Parenthetical override.

Eager execution? eval (5-5) before translation?

Topology commented 5 years ago

Current support: single binary infix operators on either side of term relation.

normalized?

Anything more complex than this needs research into sparc support and proper translation and testing.