In this paper we introduce a nondeterministic algorithm for translating hierarchical block diagrams (HBDs) into an abstract algebra of components with three basic composition operations (serial, parallel, and feedback) and with three constants (split, switch, and sink). We prove that despite its internal nondeterminism, the result of the algorithm is deterministic, meaning that all possible algebra expressions that can be generated from a given HBD are equivalent. Then, different determinizations of the algorithm result in different translation strategies which are all semantically equivalent, although each having its pros and cons with respect to various criteria (compositionality, readability, simplifiability, etc.). As an application of our framework, we show how two translation strategies for Simulink introduced in previous work can be formalized as determinizations of the abstract algorithm. We also prove these strategies equivalent, thus answering an open question raised in the earlier work. All results are formalized and proved in Isabelle.