A completeness theorem for dynamic logic