Skip to content

Conversation

@olafklinke
Copy link

add instances
Decidable a => Decidable (Neg a)
(Decidable a, Decidable b) => Decidable (a -> b)
(Decidable a, Decidable b) => Decidable (Either a b)

add instances
`Decidable a => Decidable (Neg a)`
`(Decidable a, Decidable b) => Decidable (a -> b)`
`(Decidable a, Decidable b) => Decidable (Either a b)`
(Yes _, Yes b) -> Yes (const b)

-- | Disjunctions are decidable
instance forall a b. (Decidable a, Decidable b) => Decidable (Either a b) where
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not lawful instance as it prefers Left over right.

a should be a Proposition, i.e. the Yes answers should be unique.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is actually meant by the 'Yes' answers should be unique? Can you give an example how this breaks? (I don't know the use-case of this library so I can't think of why this instance is bad.) Preferring left over right corresponds to short-circuiting which is generally a welcome property in logic, no?

Decidability for `Neg a` is subsumed by decidability of implication. Avoid overlapping instances.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants