Verifying concurrent programs using contracts