Fault-tolerant distributed algorithms encoded in a formal language