Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] (newbie) How to encode a set algebra

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] (newbie) How to encode a set algebra


chronological Thread 
  • From: Adam Chlipala <adamc AT csail.mit.edu>
  • To: Stijn Timbermont <stijn.timbermont AT gmail.com>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] (newbie) How to encode a set algebra
  • Date: Mon, 15 Aug 2011 10:04:07 -0400

Stijn Timbermont wrote:
Concretely, I want to encode something that on paper would be written as 
follows

A ::=  0  |  A1 U A2  |  X  |  [A]  |  A \ X

[...]

Then I tried using Ensembles, and prove the laws.
A is then defined as Ensemble Aelt, so I have to define the element type.
The problem then is the form [A].

Require Import Ensembles.

Definition X := nat.

Inductive Aelt : Type :=
  | e_single : X ->  Aelt
  | a_encap  : Ensemble Aelt ->  Aelt.

This last definition is rejected with "Non-strictly positive
occurrence of "Aelt" in "Ensemble Aelt ->  Aelt".

Can you explain why you need an inductive type of sets and elements? Why not assign different Coq types to X's, sets of X's, sets of sets of X's, and so on?



Archive powered by MhonArc 2.6.16.

Top of Page