1. sets for sequence.e?

First I'd like to say thanks to Jeremy for all his hard work on the standard
library. If there is room for a few more functions, I find the following useful,
and believe others would too. I suggest they would fit better in sequence.e
rather than math.e. They are quite general and IMHO are not really "math"
functions.

The first one is a type.

set ==> ensures that the variable is a sequence wherein

each of its members only occurs once in the sequence

union ==>         s = union (s, s)

returns the union of two given sets



intersection ==>  s = intersection (s, s)

returns the intersection of two given sets


diff ==>          s = diff (s, s)

returns the difference of the two given sets; i.e.,

the inverse of the union (with the intersection removed)



is_subset ==>     i = is_subset (s, s)

returns T (1) if the first set is a subset of the second


is_superset ==>   i = is_superset (s, s)

returns T (1) if the first set is a superset of the 2nd

These are all from Rod Jackson's "set.e". But I suggest one more (not included
in his library):

mk-set ==>  s = mk_set(s)
returns a sequence with duplicate elements removed, so
each of its members occurs only once in the sequence.

new topic     » topic index » view message » categorize

2. Re: sets for sequence.e?

Jules wrote:
> 
> First I'd like to say thanks to Jeremy for all his hard work on the standard
> library. If there is room for a few more functions, I find the following
> useful,
> and believe others would too. I suggest they would fit better in sequence.e
> rather than math.e. They are quite general and IMHO are not really "math"
> functions.
> 
> The first one is a type.
> 
> set ==> ensures that the variable is a sequence wherein
> 
> each of its members only occurs once in the sequence
> 
> union ==>         s = union (s, s)
> 
> returns the union of two given sets
> 
> 
> intersection ==>  s = intersection (s, s)
> 
> returns the intersection of two given sets
> 
> 
> diff ==>          s = diff (s, s)
> 
> returns the difference of the two given sets; i.e.,
> 
> the inverse of the union (with the intersection removed)
> 
> 
> is_subset ==>     i = is_subset (s, s)
> 
> returns T (1) if the first set is a subset of the second
> 
> 
> is_superset ==>   i = is_superset (s, s)
> 
> returns T (1) if the first set is a superset of the 2nd
> 
> These are all from Rod Jackson's "set.e". But I suggest one more (not included
> in his library):
> 
> mk-set ==>  s = mk_set(s)
> returns a sequence with duplicate elements removed, so
> each of its members occurs only once in the sequence.

There is also
http://oedoc.free.fr/Fichiers/ESL/sets.zip

It's quite more complete, as it handles maps between sets and composition laws.
It was laid out and documented for inclusion in the ESL framework. But, if there
is interest, I can edit the ESL stuff out.

CChris

new topic     » goto parent     » topic index » view message » categorize

3. Re: sets for sequence.e?

CChris wrote:
> 
> 
> There is also
> <a
> href="http://oedoc.free.fr/Fichiers/ESL/sets.zip">http://oedoc.free.fr/Fichiers/ESL/sets.zip</a>
> 
> It's quite more complete, as it handles maps between sets and composition
> laws.
> It was laid out and documented for inclusion in the ESL framework. But, if
> there
> is interest, I can edit the ESL stuff out.
> 

Chris,

If you would like to do that, thanks! Maybe it should be a new include, set.e
and not part of sequence.e

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

4. Re: sets for sequence.e?

Jeremy Cowgar wrote:
> 
> CChris wrote:
> > 
> > 
> > There is also
> > <a
> > href="http://oedoc.free.fr/Fichiers/ESL/sets.zip">http://oedoc.free.fr/Fichiers/ESL/sets.zip</a>
> > 
> > It's quite more complete, as it handles maps between sets and composition
> > laws.
> > It was laid out and documented for inclusion in the ESL framework. But, if
> > there
> > is interest, I can edit the ESL stuff out.
> > 
> 
> Chris,
> 
> If you would like to do that, thanks! Maybe it should be a new include, set.e
> and not part of sequence.e
> 
> --
> Jeremy Cowgar
> <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a>

Ok.
Also, I'll have to oduce a doc using the Eu sandards, since currently the
include is self-documenting using EuDoc by D. Newhall. I'll do this when win32lib
0.70.4a is released, like 10 days from now.

CChris

new topic     » goto parent     » topic index » view message » categorize

5. Re: sets for sequence.e?

Jeremy Cowgar wrote:
> 
> CChris wrote:
> > 
> > 
> > There is also
> > <a
> > href="http://oedoc.free.fr/Fichiers/ESL/sets.zip">http://oedoc.free.fr/Fichiers/ESL/sets.zip</a>
> > 
> > It's quite more complete, as it handles maps between sets and composition
> > laws.
> > It was laid out and documented for inclusion in the ESL framework. But, if
> > there
> > is interest, I can edit the ESL stuff out.
> > 
> 
> Chris,
> 
> If you would like to do that, thanks! Maybe it should be a new include, set.e
> and not part of sequence.e
> 
> --
> Jeremy Cowgar
> <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a>

Done, though I may wish to add a few more unit tests. As usual, the tests
themselves had way more problems than the code they tested.

There is no .htx documentation yet, but it is in sets.e and would simply need to
move from here to there with some format tags. I'm not sure I have time to do
that next week (53 entries).

What's best?

CChris

new topic     » goto parent     » topic index » view message » categorize

6. Re: sets for sequence.e?

CChris wrote:
> 
> 
> Done, though I may wish to add a few more unit tests. As usual, the tests
> themselves
> had way more problems than the code they tested.

That may be but it's vital that unit tests exist, for instance, it caught quite
a bit last change. One function was changed, and that function was tested with a
sample app and it worked. However, all the other functions that relied upon the
changed function began to fail.
 
> There is no .htx documentation yet, but it is in sets.e and would simply need
> to move from here to there with some format tags. I'm not sure I have time to
> do that next week (53 entries).

Really? 53 new functions?

> What's best?

Please put a 

-- TODO: document

At the beginning of each function that is a global and then commit. Before
functions go into SVN, they should be unit tested, however, not necessarily
documented. But, we must have an easy way to see which ones are not documented.
An undocumented function is one that does not exist to the public.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

7. Re: sets for sequence.e?

Jeremy Cowgar wrote:
> 
> CChris wrote:
> > 
> > 
> > There is no .htx documentation yet, but it is in sets.e and would simply
> > need
> > to move from here to there with some format tags. I'm not sure I have time
> > to
> > do that next week (53 entries).
> 
> Really? 53 new functions?
> 

Yep:
* binary search (1)
* sets:
** construction (2)
** elements (4)
** parts (4)
** basic operations (4)
* maps
** construction (3)
** properties (3)
** direct mapping (3)
** reverse mapping (3)
** operations (4)
* products (7)
* operations, ie binary ops:
** construction (2)
** properties(2)
** units (7)
** other (4)

If you downloaded stes.zip, the summary is in sets_spec.txt. I'll email it if
needed.

I thought graph handling would be better in a separate lib, which would clearly
use this one. Nothing written so fa about it.

CChris

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu