Feature #812
PPMonoid pseudo-ctor without explicit ordering
Description
Mario asked about having an easy way to create a PPMonoid
without specifying explicitly the ordering (or even the names of the indets). He notes that we do allow a PolyRing
to be created specifying just the number of indets: for instance PPM(NewPolyRing(ZZ,10))
will create a PPMonoid
with 10 indets using StdDegRevLex
.
He is hoping for something as simple as NewPPMonoidEv(10)
to create a PPMonoid
with 10 indets (called x[0]
to x[9]
) and with the default ordering StdDegRevLex
.
Discuss; implement if appropriate.
Related issues
History
#1 Updated by John Abbott over 8 years ago
I note that in issue #320 the main reason for rejection is that J and A disagreed about what symbol names should be used.
We could slightly modify Mario's request:
have new pseudo-ctors which do not need the ordering (the default ordering will be StdDegRevLex
), so one could write NewPPMonoidEv(SymbolRange("x",1,10))
or NewPPMonoidEv(NewSymbols(10))
. This is certainly longer than just NewPPMonoidEv(10)
, but it does make explicit the names of the indets.
What do you think?
#2 Updated by Anna Maria Bigatti over 8 years ago
John Abbott wrote:
We could slightly modify Mario's request:
have new pseudo-ctors which do not need the ordering (the default ordering will beStdDegRevLex
), so one could writeNewPPMonoidEv(SymbolRange("x",1,10))
orNewPPMonoidEv(NewSymbols(10))
. This is certainly longer than justNewPPMonoidEv(10)
, but it does make explicit the names of the indets.
Yes!
#3 Updated by John Abbott over 8 years ago
What about NewPPMonoid("x", 10)
as a shorthand for NewPPMonoid(SymbolRange("x",0,10-1), StdDegRevLex)
?
Or should it be NewPPMonoid(SymbolRange("x",1,10), StdDegRevLex)
?
Mario says that whatever we offer for NewPolyRing
, we should offer the equivalent for NewPPMonoid
. Indeed, one of Scott Meyers's videos implies more or less the same thing.
#4 Updated by Anna Maria Bigatti over 8 years ago
John Abbott wrote:
What about
NewPPMonoid("x", 10)
as a shorthand forNewPPMonoid(SymbolRange("x",0,10-1), StdDegRevLex)
?
Or should it beNewPPMonoid(SymbolRange("x",1,10), StdDegRevLex)
?
Indeed, I think NewPPMonoid("x", 10)
is ambiguous.
If we want this kind of syntax then it should be NewPPMonoid("x", from, to)
Mario says that whatever we offer for
NewPolyRing
, we should offer the equivalent forNewPPMonoid
. Indeed, one of Scott Meyers's videos implies more or less the same thing.
I believe he's right, but I didn't realize it wasn't already like that... ;-)
#5 Updated by John Abbott over 8 years ago
A (minor) disadvantage of having to pass in a vector of symbol
when creating a PPMonoid
is that the monoid is obliged to check that the symbols are distinct and compatible (fixed arity for a given head). This can become a bit costly when there are many (thousands) indets; nevertheless the cost was not prohibitive even when I created a poly ring with 1000000 indets.
#6 Updated by Anna Maria Bigatti over 8 years ago
John Abbott wrote:
A (minor) disadvantage of having to pass in a vector of
symbol
when creating aPPMonoid
is that the monoid is obliged to check that the symbols are distinct and compatible (fixed arity for a given head). This can become a bit costly when there are many (thousands) indets; nevertheless the cost was not prohibitive even when I created a poly ring with 1000000 indets.
with the syntax NewPPMonoid("x", from, to)
it would not need to check.