[system] / trunk / pg / lib / Parser / Value.pm Repository:
ViewVC logotype

Log of /trunk/pg/lib/Parser/Value.pm

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 3466 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 11 14:19:26 2005 UTC (7 years, 10 months ago) by dpvc
File length: 3409 byte(s)
Diff to previous 3370
Added new Set object class to the Parser.  It implements a finite set
of real numbers, for use with unions and intervals.  E.g., (1,2) U {3}
or (1,2) U {3,4,5}.  You can created Set objects in your perl code via
the Set() command, e.g, Set(3,4,5) or Set("{1,2,3}").  You should set
the Context to Context("Interval") if you plan to use Set objects, as
this defined the braces to form sets (rather than using them as
parentheses, which is the default WW behavior).  Note that in Interval
context, you can NOT use braces as parentheses.

Current, Set objects are only allowed to be sets of numbers.  It would
be possible to extend that in the future.

Revision 3370 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 12 22:29:53 2005 UTC (7 years, 11 months ago) by dpvc
File length: 3273 byte(s)
Diff to previous 3369
A first pass at making parser error messages localizable.  The
Context()->{error}{msg} hash can be used to specify translations of
the standard messages.  For example,

    Context()->{error}{msg}{'Division by zero'} = "Don't divide by zero, dude!";
    Context()->{error}{msg}{'Function '%s' has too many inputs'} =
        "You passed too many arguments to '%s'";

(I didn't translate into another language, here, but you could do
that, too.)

The msg hash could also be used within answer checkers to make certain
answer messages more appropriate for the given type of expected answer.

Revision 3369 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 12 21:05:37 2005 UTC (7 years, 11 months ago) by dpvc
File length: 3272 byte(s)
Diff to previous 2800
Fixed various perl compiler warnings (due to extra "my", and so on).

Revision 2800 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Sep 19 14:27:39 2004 UTC (8 years, 9 months ago) by dpvc
File length: 3275 byte(s)
Diff to previous 2684
Added isZero and isOne checks for Parser::Value objects (i.e., for
constants within formulas).  These now correctly handle vector and
matrices, in particular.  The isOne and isZero checks are used in the
reduce() method to simplify formulas.

Revision 2684 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Aug 24 21:35:21 2004 UTC (8 years, 9 months ago) by dpvc
File length: 3399 byte(s)
Diff to previous 2678
Added the makeUnion call that was removed earlier.  The AnswerChecker
for formulas sometimes called it (when the student's answer is constant).

Revision 2678 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 23 23:55:37 2004 UTC (8 years, 9 months ago) by dpvc
File length: 3323 byte(s)
Diff to previous 2660
Modified the parser so that the classes for the various object
constructors are stored in the context table rather than hard-coded
into the parser.  That way, you can override the default classes with
your own.  This gives you even more complete control to modify the
parser.  (You had been able to replace the definitions of operators,
functions and list-like objects, but could not override the behaviour
of numbers, strings, variables, and so on.  Now you can.)

This effects most of the files, but only by changing the name of the
calls that create the various objects.

There are also a couple of other minor fixes.

Revision 2660 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 20 15:52:32 2004 UTC (8 years, 10 months ago) by dpvc
File length: 3176 byte(s)
Diff to previous 2626
A number of adjustments to get negative infinities to work better.
They used to be stored as separate Parser strings, but now they are
flagged versions of a single string.

All of the problems are really due to the fact that there is no
Infinity class in the Parser (only a Value version).  That should be
changed, but will require some work, and can be put off for now.

It would be best if the classes within the two packages would match up
nearly 1-to-1, but for historical reasons, they don't.  Since the
introduction of Real, String and Infinity classes to the Value
package, The Infinity class is the one main difference between the
two, and once that is fixed, everything needs to be looked over to
check for unnecessary complications due to the historical lack of classes
in one or the other package.

Revision 2626 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 16 19:44:26 2004 UTC (8 years, 10 months ago) by dpvc
File length: 3090 byte(s)
Diff to previous 2625
One more fix for handling intervals properly (I think it's really
right this time).  Also, named constants that end in numbers will
produce TeX output with the number as a subscript (this was already
true for variable names).

Revision 2625 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 16 18:35:12 2004 UTC (8 years, 10 months ago) by dpvc
File length: 2989 byte(s)
Diff to previous 2594
Added string comparison to all Value object classes (to compare the
string value of an object to another string).

Overloaded perl '.' operator to do dot product when the operands are
formulas returning vectors.  (Part of the auto-generation of
formulas).

A few improvements to real and complex class output results.

Made Union class slightly more robust and removed need for makeUnion
method other than in the Union itself.

Revision 2594 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 12 20:17:18 2004 UTC (8 years, 10 months ago) by dpvc
File length: 2989 byte(s)
Diff to previous 2592
Fixes for handling intervals better.  In particular, deal better with
ambiguous situations, like (1,2) that could be a point.

You can use [a,a] to specify the single point a.  I'd like to make {a}
represent this (and maybe even {a,b,c} to form finite sets), but this
would interfere with the use of { and } as alternative parentheses.
(Does anyone really use these?)

Do we need a cross product for intervals (and sets) as a means of
representing regions in R^2 (or higher)?

Revision 2592 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 12 16:40:47 2004 UTC (8 years, 10 months ago) by dpvc
File length: 2908 byte(s)
Diff to previous 2579
A number of small fixes.  Most were to fix minor bugs in string and
TeX output, particulary for the various list-based objects (like
vectors, intervals, etc.).  There were also some bug fixes in the
comparison routines.  Some additional checks were added for valid
intervals when the coordinates are formulas.

Revision 2579 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 9 21:38:01 2004 UTC (8 years, 10 months ago) by dpvc
File length: 2884 byte(s)
Diff to previous 2558
Significant update to new parser.

New features include:

  Better control over format of vector output (you can now
    specify ijk-format rather than <...> format)

  "Fuzzy" reals, where the relations like == return true when the
    two values are "close enough".  (This is controlable using
    parameters similar to those used in NUM_CMP).

  The fuzzy reals are now used in vectors/points/matrices/complexes/intervals
    and so on so that their relations will also be fuzzy.  E.g.,
    (1E-13,2) == (0,3) will be true, and norm(Vector(0,1E-13)) will
    equal 0.

  The two main portions of the parser (the Parser and Value packages)
    now share a common context object for configuration purposes.

Revision 2558 - (view) (download) (as text) (annotate) - [select for diffs]
Added Wed Jul 28 20:32:33 2004 UTC (8 years, 10 months ago) by sh002i
File length: 2851 byte(s)
merged changes from rel-2-1-a1 -- stop using that branch.

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9