[seqfan] Re: metadata for Mathematica code

Charles Greathouse charles.greathouse at case.edu
Thu Nov 12 19:18:34 CET 2015


As Eric suggested, I'm very much in favor of doing something along these
lines. It has a number of different benefits: making it easier to see what
a program does, splitting consecutive programs by the same author, etc. But
more important than these, I think, is making it machine-readable. When the
intent of the program is defined unambiguously, it's possible to check
programs in lots of interesting ways:
* Does the n-th term match the program's TermFunction?
* Is the MembershipTestFunction true for all known terms?
* Is the MembershipTestFunction false for all terms strictly between
existing terms?
* Does the sequence have a MembershipTestFunction but is nonmonotonic?
* Does the TermListByMaximumFunction act sensibly (e.g.,
TermListByMaximumFunction[n] is a subset of TermListByMaximumFunction[n+1])?
* Do two programs of the same type give the same output?
etc. And it's not hard to imagine synthesizing new programs if desired,
just like we synthesize b-files:
* TermListByMaximumFunction can be defined on the basis of
MembershipTestFunction for monotone sequences
* TermListByIndexFunction can be defined on the basis of TermFunction
* MembershipTestFunction can be defined on the basis of TermFunction for
monotone sequences
and so on. Of course this would take O(number of languages) coding, but it
should be easy to cover the major languages.

I would like suggestions for different types of programs and on their
names, though. What else is useful? For example, I'd like to see a nullary
function which gives the numerical constant associated to a given cons
sequence, a row (and column?) function for tables, and a function which
takes a(n) and returns a(n+1). Maybe also an explicit label for auxiliary
sequences (that is, no defined meaning at all, but they can be called from
other programs).

Charles Greathouse
Analyst/Programmer
Case Western Reserve University

On Thu, Nov 12, 2015 at 12:52 PM, Neil Sloane <njasloane at gmail.com> wrote:

> Name for "is n a palindrome?" function - may I suggest that another
> good name would be ispalindrome (Maple style), or maybe IsPalindrome (Mma
> style),
> or both. (Or IsA002113.) To me that is more logical than the names Alonso
> mentioned.
>
> palindromicQ seems especially strange. Wouldn't the noun form, palindromeQ,
> be
> better than the adjective form, palindromicQ? But IsPalindrome would seem
> better,
> or IsA002113.
>
> By the way, is there an easy way to tell Gmail to trim the fat, don't
> include all the stuff that is concealed by the three dots at the bottom of
> the message? Or does one always have to do it by hand, as I just did here?
>
> Neil
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>



More information about the SeqFan mailing list