Reputation: 5217
I wanted to divide two numbers in Coq because I was trying to implement my own custom Imp
language and had a statement:
match (aeval st a1) with
| Some n0 => Some (NDiv n0 (S n))
| None => None
however /
returns an error:
Unknown interpretation for notation "_ / _".
and so does NDiv
, error:
The reference NDiv was not found in the current environment.
what can I do so that I don't get this error?
How does one do something like the python "integer division" but with nats?
Upvotes: 2
Views: 1460
Reputation: 5217
Seems like:
Require Import Coq.Init.Nat.
works, but I wonder how I could have searched this more efficiently without having to resort to put this trivial Q on SO.
Upvotes: 2
Reputation: 33519
You can use the command Require Import Arith.
which will import, among other things, the function Nat.div
and the notation _ / _
for it.
Upvotes: 4