abau / co4

COmplexity COncerned COnstraint COmpiler
GNU General Public License v3.0
2 stars 3 forks source link

CO4 should allow empty tuple #46

Closed jwaldmann closed 10 years ago

jwaldmann commented 11 years ago

it seems that currently the type () is not supported

abau commented 11 years ago

data Unit = Unit works for me. But you might get a rather unintuitive output from CO4 when the unknown value is of type Unit:

data Bool = False | True
data Unit = Unit
constraint x = case x of
    Unit -> True

gives

Start producing CNF
Known result: valid
Abort due to known result
No solution found
Nothing

The second line states that the constraint is valid, i.e. it's satisfied for all x. As CO4 notes this during abstract evaluation, the SAT solver is not run, but gives the misleading message No solution found.