This morning I promptly implement the new_layer and bye_layer functions for CirSys.pm and later add the @assume and @end_assume directives to the CIR language. For simplicity, I didn't introduce an ad hoc module specially designed to deal with math model in the current version (0.07) of CirSys. I plan to move most of the code concerning equation and variable management in CirSys.pm into an independent module named Math::Model in the next version. The core of the CirSys library thus will be cleaned up.
Currently wire definitions and element declarations are prohibited within @assume blocks. For example, the following CIR code is considered invalid at this moment:
A, B: Vs2
Resistor R1, R2
B, C: R1, R2
However, this will eventually work in the next version of dc CirSys when I implement the ->destroy method for the Wire and Elem classes respectively. It can't be too difficult, I think.
With basic @assume support on hand, I'm able to get all the 60 test cases gleaned earlier working in my tester now. But I can't promise any further that subsequent circuit problems for Thevenin's Theorem will also work without complete support of assuming and backtracking.
There's no doubt that the CIR language is getting more and more mature.