Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Roqc/test-suite/modules/   (Beweissystem des Inria Version 9.1.0©)  Datei vom 15.8.2025 mit Größe 1 kB image not shown  

Quelle  polymorphism.v   Sprache: Coq

 
Set Universe Polymorphism.

(** Tests for module subtyping of polymorphic terms *)

Module Type S.

Section Foo.

Universes i j.
Constraint i <= j.

Parameter foo : Type@{i} -> Type@{j}.

End Foo.

End S.

(** Same constraints *)

Module OK_1.

Definition foo@{i j} (A : Type@{i}) : Type@{j} := A.

End OK_1.

Module OK_1_Test : S := OK_1.

(** More general constraints *)

Module OK_2.

Inductive X@{i} : Type@{i} :=.
Definition foo@{i j} (A : Type@{i}) : Type@{j} := X@{j}.

End OK_2.

Module OK_2_Test : S := OK_2.

(** Wrong instance length *)

Module KO_1.

Definition foo@{i} (A : Type@{i}) : Type@{i} := A.

End KO_1.

Fail Module KO_Test_1 : S := KO_1.

(** Less general constraints *)

Module KO_2.

Section Foo.

Universe i j.
Constraint i < j.

Definition foo (A : Type@{i}) : Type@{j} := A.

End Foo.

End KO_2.

Fail Module KO_Test_2 : S := KO_2.

(** Less general constraints *)

Module KO_3.

Section Foo.

Universe i j.
Constraint i = j.

Definition foo (A : Type@{i}) : Type@{j} := A.

End Foo.

End KO_3.

Fail Module KO_Test_3 : S := KO_3.

100%


¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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 ist noch experimentell.