Inductive word : nat -> Set :=
| WO : word O
| WS : bool -> forall n, word n -> word (S n). Fixpoint natToWord (sz n : nat) : word sz. Admitted.
Definition wzero sz := natToWord sz 0. Definition wtl sz (w : word (S sz)) : word sz. Admitted.
Fixpoint combine (sz1 : nat) (w : word sz1) : forall sz2, word sz2 -> word (sz1 + sz2) := match w in word sz1 returnforall sz2, word sz2 -> word (sz1 + sz2) with
| WO => fun _ w' => w'
| WS b w' => fun _ w'' => WS b (combine w' w'') end. Fixpoint split2 (sz1 sz2 : nat) : word (sz1 + sz2) -> word sz2. exact (match sz1 with
| O => fun w => w
| S sz1' => fun w => split2 sz1' sz2 (wtl w) end). Defined.
Definition wrshift (sz : nat) (w : word sz) (n : nat) : word sz.
refine (split2 n sz _). rewrite Nat.add_comm. exact (combine w (wzero n)). Defined.
Theorem combine_n_0 : forall sz1 (w : word sz1) (v : word 0),
combine w v = eq_rect _ word w _ (plus_n_O sz1). Admitted.
Theorem wrshift_0 : forall sz (w : word sz), @wrshift sz w 0 = w. Proof. intros. unfold wrshift. simpl. rewrite combine_n_0.
eq_rect_simpl. reflexivity. Qed.
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.