Formalizing concurrency