Reliability of Safety-Critical Systems: Theory and Applications