Thanks very much for these helpful remarks, I will implement the changes you suggest but here are a few initial thoughts:

On 19/07/16 03:52, Waldek Hebisch wrote:
> There were spelling fixes a probably also some other fixes to
> graph.spad in the trunk, but your version apparently does not
> contain them.

I guess that’s the classic issue of reconciling code changes from multiple authors. Although I use github I don't use it in the way its intended and so I don't reconcile changes in the trunk. I will reconcile code as a one-off for now and think about changing my way of working in the long term.

> You put URL-s into the files and apparently
> the ones you use now are different than old version.
> Since there are many trival differences I stopped looking
> at graph.spad -- first you should decide which changes you
> want.

Spaces appear to have been inserted either side of colons. So this:
http://www.euclideanspace.com/prog/scratchpad/mycode/discrete/graph/
appears to be converted into this:
http : //www.euclideanspace.com/prog/scratchpad/mycode/discrete/graph/
This means that firefox does not recognise it as a url.

It looks like some sort of script has been run on the code to try to impose a certain type of formatting on SPAD code but this has also been applied to tex and comments. I am fairly certain this was not done by me (if I did I cant remember doing it), could this have come from another source?

I have updated the urls but the ones I tried appeared to work correctly once the offending whitespace was removed.

> I looked a bit at groupPresentation.spad.  I must say that I
> do not like "equality" there: normally in math one can
> replace equal by equal, but "=" from GroupPresentation
> returns true for quite different groups.  The comment
> is misleading: if you really mean isomorphism, then
> the groups may be isomorphic even if "=" returns false.
> And of course the groups may fail to be isomorphic
> when it returns true.  Also, for group presentations
> we would rather use "identity mapping on generators
> extends to isomorphism" than plain isomorphism.

I wanted to implement SetCategory and so I needed some code for "=". The problem is that isomorphism is not computable and other forms of equality are not very useful.

I don't understand "identity mapping on generators extends to isomorphism"? Is this some level of equality that is both computable and useful for presentations? If so, where can I find out more?

> I also looked at 'genName'.  Using character codes
> here is bad style: it would be much better to
> use indexing into a string to produce letters.
> Your comment says that you want to skip over 'e'
> (to reserve it as unit), but you also skip over
> 'g'.  Your code returns 'e' even if the 'suffix'
> is nonzero, but IIUC you should produce letter
> with suffic in such case.  Loop at the beginning
> is doing division with remainder, we have a
> function for this.  Something like
>
>     (suffix, i) := divide(abs(i2), 25)
>
> should do.  Since you skip over one letter the
> correct divisor is 25.

Yes I should not have made the code dependent on 'ASCII' code I will update that. This requirement to assign unique variable names must be a more general issue in mathematics code like FriCAS does something like that already exist in FriCAS SPAD? If not, should I implement it so that it is not specific to this particular domain?

> Concerning 'removeGen2': the standard idiom with list
> processing is to build list in reverse order, than
> reverse it.  Like:
>
>    -- local function to remove generator 'val' from relations
>    removeGen2(rels1:List(List(Integer)),val:NNI):List(List(Integer)) ==
>      rels2:List(List(Integer)) := empty$List(List(Integer))
>      for rule in rels1 repeat
>        rule2 := remove(val::Integer,rule)
>        rule2 := remove(-val,rule2)
>        rels2 := cons(rule2, rels2)
>      reverse!(rels2)

I would be good to have a FriCAS SPAD 'cookbook' containing all these standard idioms.

> Or using list processing:
>
>    removeGen2(rels1:List(List(Integer)),val:NNI):List(List(Integer)) ==
>        [remove(-val, remove(val::Integer,rule)) for rule in rels1]

That's cleaver, I'll use that.

Thanks,

Martin

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to