Set Theory for Computing: From decision procedures to declarative programming with sets