Modularity and part-whole compositionality for computing the state semantics of statecharts