1 % switching definition.
4 p(C,o1,OP) :- not ab(C), switching(C), c(C,i4,0), OP = 0, #int(OP).
5 p(C,o2,OP) :- not ab(C), switching(C), c(C,i4,0), p(C,i6,I6), OP = I6, #int(OP).
7 % system accumilation mode
8 p(C,o1,OP) :- not ab(C), switching(C), c(C,i4,1), OP = 0, #int(OP).
9 p(C,o2,OP) :- not ab(C), switching(C), c(C,i4,1), p(C,i1,I1), p(C,i2,I2), p(C,i3,I3), p(C,i6,I6), T1 = I1 + I2, T2 = I3 + I6, OP = T1 + T2, #int(OP).
12 p(C,o1,OP) :- not ab(C), switching(C), c(C,i4,2), c(C,i5,I5), p(C,i6,I6), I6 >= I5, OP = I5, #int(OP).
13 p(C,o2,OP) :- not ab(C), switching(C), c(C,i4,2), c(C,i5,I5), p(C,i6,I6), I6 >= I5, OP = I6 - I5, #int(OP).
15 % system charge mode over MAX
16 p(C,o1,OP) :- not ab(C), switching(C), c(C,i4,2), c(C,i5,I5), p(C,i6,I6), I6 < I5, OP = I6, #int(OP).
17 p(C,o2,OP) :- not ab(C), switching(C), c(C,i4,2), c(C,i5,I5), p(C,i6,I6), I6 < I5, OP = 0, #int(OP).