Log of /trunk/pg/lib/Parser/List.pm
Parent Directory
Revision
3466 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Aug 11 14:19:26 2005 UTC (7 years, 9 months ago) by
dpvc
File length: 7801 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, 10 months ago) by
dpvc
File length: 7684 byte(s)
Diff to
previous 3352
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
3352 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jul 5 01:38:19 2005 UTC (7 years, 10 months ago) by
dpvc
File length: 7679 byte(s)
Diff to
previous 3267
Modified the perl() method to make calles to Value:: directly rather
than to the main:: stubs for creating Value objects. This will make
it work better from within packages or when Parser.pl hasn't been
loaded.
A few things still won't work in this case; e.g., calls to Closed()
for intervals (these could be handled better using ->with()) and to
functions like Factorial and log10 that are defined in Parser.pl.
Finally, there should be better object-based control over what
routines are called to create these objects, so that subclasses of the
Value objects will be able to be generated correctly.
Revision
2800 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Sep 19 14:27:39 2004 UTC (8 years, 8 months ago) by
dpvc
File length: 7559 byte(s)
Diff to
previous 2796
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
2796 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Sep 19 01:15:03 2004 UTC (8 years, 8 months ago) by
dpvc
File length: 7414 byte(s)
Diff to
previous 2678
Added flags that control the reductions performed by
Formula()->reduce. Each reduction operation can be individually
enabled or disabled in the context, and in the reduce() call itself.
More complex reductions need to be developed.
Revision
2678 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Aug 23 23:55:37 2004 UTC (8 years, 8 months ago) by
dpvc
File length: 7314 byte(s)
Diff to
previous 2675
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
2626 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Aug 16 19:44:26 2004 UTC (8 years, 9 months ago) by
dpvc
File length: 7233 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, 9 months ago) by
dpvc
File length: 7132 byte(s)
Diff to
previous 2624
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
2624 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Aug 16 13:44:45 2004 UTC (8 years, 9 months ago) by
dpvc
File length: 7321 byte(s)
Diff to
previous 2594
Added support for unorderd list or formulas with partial credit.
Fixed type mismatch reporting in formula answer checker.
Fixed an error with Unions producing incorrect perl versions under
some circumstances.
Revision
2594 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Aug 12 20:17:18 2004 UTC (8 years, 9 months ago) by
dpvc
File length: 7042 byte(s)
Diff to
previous 2579
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
2579 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Aug 9 21:38:01 2004 UTC (8 years, 9 months ago) by
dpvc
File length: 6636 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.
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.