products/sources/formale sprachen/Coq/test-suite/bugs/opened image not shown  

Quellcode-Bibliothek

© Kompilation durch diese Firma

[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]

Datei: bug_4701.v   Sprache: Coq

Original von: Coq©

(*Suppose we have*)

  Inductive my_if {A B} : bool -> Type :=
  | then_case (_ : A) : my_if true
  | else_case (_ : B) : my_if false.
  Notation "'If' b 'Then' A 'Else' B" := (@my_if A B b) (at level 10).

(*then here are three inductive type declarations that work:*)

  Inductive I1 :=
  | i1 (x : I1).
  Inductive I2 :=
  | i2 (x : nat).
  Inductive I3 :=
  | i3 (b : bool) (x : If b Then I3 Else nat).

(*and here is one that does not, despite being equivalent to [I3]:*)

  Fail Inductive I4 :=
  | i4 (b : bool) (x : if b then I4 else nat). (* Error: Non strictly positive occurrence of "I4" in
   "forall b : bool, (if b then I4 else nat) -> I4". *)


(*I think this one should work.  I believe this is a conservative extension over CIC: Since [match] statements returning types can always be re-encoded as inductive type families, the analysis should be independent of whether the constructor uses an inductive or a [match] statement.*)

¤ Dauer der Verarbeitung: 0.15 Sekunden  (vorverarbeitet)  ¤





Download des
Quellennavigators
Download des
sprechenden Kalenders

in der Quellcodebibliothek suchen




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.


Bot Zugriff