#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

#define tf(IsTrue) ((IsTrue) ? "True" : "False")

int main() {
   uCalc uc;
   auto t = uc.ExpressionTransformer();

   // Enable RewindOnChange for all subsequently added rules
   t.DefaultRuleSet().RewindOnChange(true);

   // Define a chain of simple transformations
   t.FromTo("A", "B");
   t.FromTo("B", "C");
   t.FromTo("C", "D");

   // The transformer should apply all rules in sequence: A -> B -> C -> D
   auto result = t.Transform("A").Text();
   cout << "Transform('A') -> " << result << endl;
   cout << "Is correct: " << tf(result == "D") << endl;
}