Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      '// Internal Test: Context integrity after cloning
      Dim baseUc As New uCalc()
      baseUc.DefineVariable("x = 100")
      
      '// Clone the base instance and modify the variable in the clone
      Dim clonedUc = baseUc.Clone()
      clonedUc.Eval("x = 200")
      
      '// Parse an expression in the original base context
      Dim baseExpr = baseUc.Parse("x")
      
      '// 1. Verify the expression evaluates using its original context's value
      Console.WriteLine($"Base expression evaluates to: {baseExpr.Evaluate()}")
      
      '// 2. Get the parent and verify it is not the cloned instance
      Console.WriteLine($"Parent is not the clone: {baseExpr.uCalc.MemoryIndex <> clonedUc.MemoryIndex}")
   End Sub
End Module