Automating recursive type definitions in higher order logic