Some time ago we started to use a library called combinat::subClass. The goal is, from a combinatorial class to get a smaller classes without writting a new domain. This is a kind of functor of combinatorial classes. Buit there are some issue:

Assume that one wants to define a combinatorial class B as a subclass of an existing combinatorial class A (for example via combinat::subClass).

- Should B inherit from A?
- Should B inherit from the categories/axioms of A?
- Should the elements of B be typed differently than those of A?
- Should B be a facade domain?

The current concensus is no, no, no, yes. The problem is now to support "modular" programming!

I propose the following interface:

combinat::subClass(class, optional parameters);

the optional parameters are the following:

- Parameters = the extra parameters passed to the class (this is the replacement for the previous call). Or maybe just [ param1, param2 ]
- Parse = function that takes the arguments for count, list, generators...
and build the sequence of argument passed to class. This allows to specify
default values for the second argument.
Or maybe Mangle = , or getParameters
`, or ParseOptions`(like in IntegerListsLexClass) FlorentHivert = I like ParseOptions. InheritsWithParameters = [functions to inherits with the Parse front end] Defaults to? or always include? isA, count, list, generator, unrank, random. For the moment the arguments of InheritsWithParameters are of two type

- a string wich is the name of the function ("list")
- a pair [string, integer] where integer is the number of argument that a not given Parse and simply transmitted to the function (["isA", 1]).

The default value is then

[["isA", 1], "count", "list", "generator", ["unrank", 1]]

I've forgotten random and probably some more... Moreover if the function does not exists in class, no error is raised. The function is simply not inherited. I'm not sure this is the right way(tm).

- InheritsWithoutParameters = [functions to inherits Without the Parse front end]
- Size = proc : specify that the new subClass is graded subClass and gives the new grading.

Permutations of S3 (class with Ax::systemRep):

p3 := combinat::subClass(combinat::permutations, Parameters = 3):

Binary Trees of size 3 (class without Ax::systemRep, the subClass has the axiom):

t3 := combinat::subClass(combinat::binaryTrees, Parameters = 3):

Vectors of lenght 3 graded by the sum (monomials in 3 variables):

vl3 := combinat::subClass(combinat::integerVectors, Parse = ((z) -> (z, 3)), Size = (z -> _plus(op(z)))):

Vectors of sum 3 graded by the lenght:

vs3 := combinat::subClass(combinat::integerVectors, Parameters = 3, Size = (z -> nops(z))):

Page Execution took real: 10.645, user: 4.530, sys: 0.700 seconds |