Decidable functions: implementaiton and examples.