aboutsummaryrefslogtreecommitdiffstats
path: root/cfrontend/Ctyping.v
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2007-08-05 13:41:45 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2007-08-05 13:41:45 +0000
commitc0bc146622528e3d52534909f5ae5cd2e375da8f (patch)
tree52c5f163a82b04d7ad56055b4bd5e852be168ae4 /cfrontend/Ctyping.v
parentadc9e990a0c338cef57ff1bd9717adcc781f283c (diff)
downloadcompcert-kvx-c0bc146622528e3d52534909f5ae5cd2e375da8f.tar.gz
compcert-kvx-c0bc146622528e3d52534909f5ae5cd2e375da8f.zip
Documentation
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@386 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend/Ctyping.v')
-rw-r--r--cfrontend/Ctyping.v12
1 files changed, 9 insertions, 3 deletions
diff --git a/cfrontend/Ctyping.v b/cfrontend/Ctyping.v
index 0795e1b2..cb572c09 100644
--- a/cfrontend/Ctyping.v
+++ b/cfrontend/Ctyping.v
@@ -1,4 +1,4 @@
-(** * Type well-formedness of C programs *)
+(** * Typing constraints on C programs *)
Require Import Coqlib.
Require Import Maps.
@@ -7,11 +7,14 @@ Require Import Csyntax.
(** ** Typing rules *)
-(** This ``type system'' is very coarse: we check only the typing properties
+(** We now define a simple, incomplete type system for the Clight language.
+ This ``type system'' is very coarse: we check only the typing properties
that matter for the translation to be correct. Essentially,
we need to check that the types attached to variable references
match the declaration types for those variables. *)
+(** A typing environment maps variable names to their types. *)
+
Definition typenv := PTree.t type.
Section TYPING.
@@ -165,7 +168,10 @@ Record wt_program (p: program) : Prop := mk_wt_program {
exists targs, type_of_fundef fd = Tfunction targs (Tint I32 Signed)
}.
-(** ** Type-checking algorithm *)
+(* ** Type-checking algorithm *)
+
+(** We now define and prove correct a type-checking algorithm
+ for the type system defined above. *)
Lemma eq_signedness: forall (s1 s2: signedness), {s1=s2} + {s1<>s2}.
Proof. decide equality. Qed.