25.07.2014 Views

pdf download - Software and Computer Technology - TU Delft

pdf download - Software and Computer Technology - TU Delft

pdf download - Software and Computer Technology - TU Delft

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C.2 Model of the Power Supply Example Lydia Models<br />

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /<br />

/ / D e f i n i t i o n Cable<br />

system Cable<br />

(<br />

bool p ,<br />

bool q<br />

) {<br />

/ / d e c l a r a t i o n h e a l t h v a r i a b l e<br />

bool h ;<br />

a t t r i b u t e h e a l t h ( h ) = t r u e ;<br />

a t t r i b u t e p r o b a b i l i t y ( h ) = h ? 0 . 9 2 : 0 . 0 8 ;<br />

}<br />

/ / d e f i n i t i o n b e h a v i o r<br />

h => ( q = p ) ;<br />

! h => ( q = f a l s e ) ; / / s t u c k −at −z e r o<br />

/ / D e f i n i t i o n Fuse<br />

system Fuse<br />

(<br />

bool p ,<br />

bool q<br />

) {<br />

/ / d e c l a r a t i o n h e a l t h v a r i a b l e<br />

bool h ;<br />

a t t r i b u t e h e a l t h ( h ) = t r u e ;<br />

a t t r i b u t e p r o b a b i l i t y ( h ) = h ? 0 . 9 0 : 0 . 1 0 ;<br />

}<br />

/ / d e f i n i t i o n b e h a v i o r<br />

h => ( q = p ) ;<br />

! h => ( q = f a l s e ) ; / / s t u c k −at −z e r o<br />

/ / D e f i n i t i o n Low V o l t a g e Power Supply<br />

system L o w v o l t a g e p o w e r s u p p l y<br />

(<br />

bool i n p u t ,<br />

bool out1 , out2<br />

) {<br />

/ / d e c l a r a t i o n h e a l t h v a r i a b l e<br />

bool h ;<br />

a t t r i b u t e h e a l t h ( h ) = t r u e ;<br />

a t t r i b u t e p r o b a b i l i t y ( h ) = h ? 0 . 9 6 : 0 . 0 4 ;<br />

98<br />

/ / d e f i n i t i o n b e h a v i o r<br />

h => ( ( out1 = i n p u t ) <strong>and</strong> ( o ut2 = i n p u t ) ) ;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!