Axiom-types provides a Ruby library that allows one to define types with optional constraints. It can be used for logic programming.