Write a C++ algorithm that can re-write an abstract syntax tree
$10-30 USD
Fermé
Publié il y a plus de 3 ans
$10-30 USD
Payé lors de la livraison
We have created a custom programming language to allow our customers to add custom logic to our application. Our customers are not software developers and thus they often times write poorly performing code. Our language has no side effects and thus we think it may be possible to write an optimizer that can re-order expressions to improve performance.
For example, if the customer wrote `If(A OR B) ...`, then `If(B OR A)` would be equivalent and would be preferable if B takes less to compute than A.
What we would like you to do is:
Construct an algorithm to create a score for each expression. For example, from above, A could be 10 and B could be 5.
Construct an algorithm that would re-order parts of the abstract syntax tree based on the scoring.
We would provide:
a sample project with the abstract syntax tree classes and parser
foundational rules for scoring
The expected outcome of this job is a C++ file which we will import back into our main solution. Prior to starting code, we will:
Expect an additional signed NDA
Share current source code.