* Example 7:
* Another example of a fault tree with shared (or repeated) nodes
* thus node a1 below represents an event that is exactly the same
* event as node a. 

ftree fshared
basic a exp(1)
basic b exp(1)
basic c exp(1)
basic d exp(1)
basic e exp(1)
basic f exp(1)
basic g exp(1)
basic h exp(1)
transfer a1 a
transfer b1 b
transfer c1 c
transfer d1 d
transfer e1 e
transfer f1 f
transfer g1 g
transfer h1 h
transfer a2 a
transfer b2 b
transfer c2 c
transfer d2 d
and AB a e
and AC b f
and AD c g
and AE d h
and AF g1 b1
and AG h1 c1
and AH e1 d1
and AI f1 a1
and AJ a2 c2
and AK b2 d2
or top AB AC AD AE AF AG AH AI AJ AK
end
cdf(fshared)

* If we ignore the shared nodes and keep `the same' tree
* otherwise then answers are different. Make sure you use
* the right model for the problem!
ftree fnoshared
basic a exp(1)
basic b exp(1)
basic c exp(1)
basic d exp(1)
basic e exp(1)
basic f exp(1)
basic g exp(1)
basic h exp(1)
and AB a e
and AC b f
and AD c g
and AE d h
and AF g b
and AG h c
and AH e d
and AI f a
and AJ a c
and AK b d
or top AB AC AD AE AF AG AH AI AJ AK
end
cdf(fnoshared)


* Now compare the values
expr mean(fshared), mean(fnoshared)

loop t,1,10,1
expr tvalue(t;fshared), tvalue(t;fnoshared)
end
end

end

