diff options
author | 2013-05-08 18:03:54 +0200 | |
---|---|---|
committer | 2013-05-08 18:03:54 +0200 | |
commit | db38bb4ad9aff74576d3b7f00028d48f0447d5bd (patch) | |
tree | 09dafc3e5c7361d3a28e93677eadd2b7237d4f9f /theories/Strings/Ascii.v | |
parent | 6e34b272d789455a9be589e27ad3a998cf25496b (diff) | |
parent | 499a11a45b5711d4eaabe84a80f0ad3ae539d500 (diff) |
Merge branch 'experimental/upstream' into upstream
Diffstat (limited to 'theories/Strings/Ascii.v')
-rw-r--r-- | theories/Strings/Ascii.v | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/theories/Strings/Ascii.v b/theories/Strings/Ascii.v index 4204456f..a89b888e 100644 --- a/theories/Strings/Ascii.v +++ b/theories/Strings/Ascii.v @@ -1,14 +1,12 @@ (* -*- coding: utf-8 -*- *) (************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) -(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2011 *) +(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2012 *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) -(* $Id: Ascii.v 14641 2011-11-06 11:59:10Z herbelin $ *) - (** Contributed by Laurent Théry (INRIA); Adapted to Coq V8 by the Coq Development Team *) @@ -67,7 +65,7 @@ Definition ascii_of_N (n : N) := (** Same for [nat] *) -Definition ascii_of_nat (a : nat) := ascii_of_N (N_of_nat a). +Definition ascii_of_nat (a : nat) := ascii_of_N (N.of_nat a). (** The opposite functions *) @@ -83,7 +81,7 @@ Definition N_of_ascii (a : ascii) : N := let (a0,a1,a2,a3,a4,a5,a6,a7) := a in N_of_digits (a0::a1::a2::a3::a4::a5::a6::a7::nil). -Definition nat_of_ascii (a : ascii) : nat := nat_of_N (N_of_ascii a). +Definition nat_of_ascii (a : ascii) : nat := N.to_nat (N_of_ascii a). (** Proofs that we have indeed opposite function (below 256) *) @@ -113,10 +111,10 @@ Theorem nat_ascii_embedding : Proof. intros. unfold nat_of_ascii, ascii_of_nat. rewrite N_ascii_embedding. - apply nat_of_N_of_nat. - unfold Nlt. - change 256%N with (N_of_nat 256). - rewrite <- N_of_nat_compare. + apply Nat2N.id. + unfold N.lt. + change 256%N with (N.of_nat 256). + rewrite <- Nat2N.inj_compare. rewrite <- Compare_dec.nat_compare_lt. auto. Qed. @@ -139,7 +137,7 @@ Qed. which is typically not the case in coqide). *) -Open Local Scope char_scope. +Local Open Scope char_scope. Example Space := " ". Example DoubleQuote := """". |