Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement substitute for monoids #598

Closed
williamstein opened this issue Sep 6, 2007 · 6 comments
Closed

implement substitute for monoids #598

williamstein opened this issue Sep 6, 2007 · 6 comments

Comments

@williamstein
Copy link
Contributor

On 9/5/07, Joel B. Mohler <[email protected]> wrote:
\> Yes, so I found FreeMonoid after sending my first e-mail and was testing it
> out.  I think I may have found something that is not implemented:
> 
> sage: a=FreeMonoid(1,'a').0
> sage: a*a
> a^2
> sage: a.substitute(5)
> a  # should be 5?
> sage: a.substitute(a=5)
> a  # should be 5?
> 
> I would have expected those last two results to be 5 -- am I missing
> something? 

The whole "substitute" architecture was implemented in SAGE
long after monoids were implemented.  So you'll have to implement
monoid substitution. 

> I guess substituting isn't an entirely common operation for free
> monoids, but it seems to be a sensibly defined operation.  Then again, maybe
> not:
> 
> sage: M.<x,y> = FreeMonoid(2)
> sage: (x*y).substitute(x=1)
> x*y  # I would think that this is 1*y
> 



> I find that result unsatisfactory as well, but I sure don't have a good idea
> about what ring (?) the result '1*y' would be a part of.

Just do the arithmetic.    All monoids have a 1 by definition, so 1*y is just "y"
in that monoid.

William

Component: basic arithmetic

Author: Mike Hansen

Reviewer: Paul Zimmermann

Merged: sage-4.4.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/598

@mwhansen
Copy link
Contributor

Attachment: trac_598.patch.gz

@mwhansen
Copy link
Contributor

Author: Mike Hansen

@zimmermann6
Copy link

comment:4

A positive review for me.

Note: I did all doctests, and got exactly 22 Segfaults, as with vanilla 4.3.3 (see #7773).
Thus if a new failure occurred within one of those 22 doctests, I couldn't see it.

@zimmermann6
Copy link

Reviewer: Paul Zimmermann

@jhpalmieri
Copy link
Member

Merged: sage-4.4.alpha0

@jhpalmieri
Copy link
Member

comment:5

Merged in 4.4.alpha0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants