Subject: Maxima error when having strings in terms
From: Matthew Gwynne
Date: Mon, 26 Apr 2010 09:47:40 +0100
On Fri, Apr 23, 2010 at 7:38 AM, Robert Dodier <robert.dodier at gmail.com> wrote:
> On 4/22/10, Matthew Gwynne <mathew.gwynne at gmail.com> wrote:
>
>> I'm working on the analysis of boolean functions (usually only
>> partially specified, so we deal with different extensions of these),
>> different representations of these functions, and then algorithms and
>> their complexities for generating such representations.
>>
>> When dealing with the boolean variables in these problems, they come
>> from specific pre-existing datasets with string names, but the idea is
>> to have reasonably generic analysis tools to get a basic summary of a
>> particular function before investigating further, and so being able to
>> treat variable names in the same way as Oliver is suggesting rather
>> than converting them into maxima terms is attractive. One might also
>> want new variables, and then certain parameters can be added to these
>> functional terms.
>
> Thanks, that sounds interesting. Can you post some examples of
> operations you want to carry out? I am working on a bug fix and it
> would be extremely helpful to have additional examples to test.
Well at the moment, we have say
declare(gv, noun)$
declare(gv, posfun)$
vars : map(gv, ["Via", "DisT", "SymA", "CSup", "DiagF", "ProgF",
"Rep", "Res", "Ri", "Re"])$
and then these variables are treated as variables in CNF (conjunctive
normal form) or DNF (disjunctive normal form) clause-set. So we have
sets of sets of these variables, where they may be possibly negated
(the variables or their negations are literals). We then have
variables helped functions which may need to convert a literal to a
variable (so we can work with the underlying literals or ensure we
have the negated form or whatever, depending on the particular
problem), and we do this by taking the absolute value or the literal,
hence the need to check for instance
is(gv("Res") > 0);
At present due to the bug, I am simply converting these strings to
variables names using parse_string but this isn't ideal as, as I
stated we will likely want to add additional parameters for annotation
of the variables, and we also may want to get the string back out for
later postprocessing which is then "hacky" if these strings are
bundled into the variables name itself (not the mention the issues
with conflicting variable names).
Is this enough or do you need some kind of example run of a larger program?
Hope this helps!
>
> Thanks for your help,
>
> Robert Dodier
>
Thanks a lot
Matthew