user615297
user615297

Reputation: 11

Coq, true datatype

So I have this problem:

In environment n : nat The term "true" has type "Datatypes.bool" while it is expected to have type "bool".

I have no idea what does it mean. trying to prove: Theorem eqb_0_l : forall n:nat, 0 =? n = true -> n = 0.

Upvotes: 0

Views: 127

Answers (1)

M Soegtrop
M Soegtrop

Reputation: 1438

I guess you are working with Software Foundations - which has at least in the introductory chapters its own definition of bool. If you Require modules from both, Software Foundations and the Coq standard library, you easily end up with multiple definitions of bool, nat, ... .

The solution is to not Require anything from the Coq standard library in the introductory chapters from Software Foundations. Only Require modules which come with SF.

SF does this so because it explains how to define nat and bool and how to prove basic lemmas about these taypes. This can't be done without actually defining them, which leads to the mentioned problems.

Upvotes: 1

Related Questions