* Example 6:
* Suppose that you intended a fault-tree with repeated nodes

ftree f_repeat
basic a exp(3.1)
basic b exp(4.2)
basic c exp(3.7)
basic d exp(7.2)
basic e exp(2)
basic f exp(1.2)
basic g exp(0.8)
basic x exp(3)
basic y exp(4)
transfer a1 a
transfer a2 a
transfer e1 e
or BE b e
and A a BE
kofn K1 2,3, a1 x y
kofn K2 3,4, g c d a2
or EG e1 g
or FC f c
and E EG FC
or top A K1 K2 E
end

loop t,0,1,.1
    expr value(t;f_repeat), tvalue (t;f_repeat)
    * The difference between value and tvalue should be noted.
    * For value, a symbolic computation of the time-to-failure 
    * distribution is carried out and then numerical evaluation is done.
    * For tvalue, direct numerical computation is done. The latter
    * is much more stable. 
end
expr mean(f_repeat)

* Now the same fault -tree is declared to have no repeated nodes.
* Perhaps this was an unintentional error on the part of the modeler.
* We can determine the error in the results.
* fault tree, no repeated nodes

ftree f_norepeat
basic a exp(3.1)
basic b exp(4.2)
basic c exp(3.7)
basic d exp(7.2)
basic e exp(2)
basic f exp(1.2)
basic g exp(0.8)
basic x exp(3)
basic y exp(4)
or BE b e
and A a BE
kofn K1 2,3, a x y
kofn K2 3,4, g c d a
or EG e g
or FC f c
and E EG FC
or top A K1 K2 E
end

loop t,0,1,.1
    expr tvalue (t;f_norepeat), value(t;f_norepeat)
end
end


