#545: [with patch, needs review] polish the new symbolic logic code.
------------------------------+---------------------------------------------
 Reporter:  was               |        Owner:  chrisgorecki
     Type:  enhancement       |       Status:  new         
 Priority:  major             |    Milestone:  sage-3.2.1  
Component:  basic arithmetic  |   Resolution:              
 Keywords:  editor_wstein     |  
------------------------------+---------------------------------------------
Comment (by mvngu):

 For the patch '''logic.patch''', below are some possible fixes for
 improving its documentation. I was reviewing the plain text version of the
 diff, not the online version. This accounts for the number that precedes
 each line in the diffs below. In other words, such a number refers to the
 line number in the downloaded, plain text diff file, which should simplify
 the task of reviewing my suggestions.
 [[BR]][[BR]]
 1.
 {{{
 36 -    Evaluates the tree using the boolean values contained in dictinary
 36 +    Evaluates the tree using the boolean values contained in
 dictionary
 }}}

 2.
 {{{
 40 -        tree -- a list of three elements corrospsponding to a branch
 of a
 40 +        tree -- a list of three elements corresponding to a branch of
 a
 }}}

 3.
 {{{
 67 -        tree -- a list of three elements corrospsponding to a branch
 of a
 67 +        tree -- a list of three elements corresponding to a branch of
 a
 }}}

 4.
 {{{
 201 -    underscores and aplphanumerics.  Parentheses may be used to
 201 +    underscores and alphanumerics.  Parentheses may be used to
 }}}

 5.
 {{{
 320 -            tree -- a list continaing the parse tree of the
 expression.
 320 +            tree -- a list containing the parse tree of the
 expression.
 }}}

 6.
 {{{
 322 -                  with each variable occuring only once.
 322 +                  with each variable occurring only once.
 }}}

 7.
 {{{
 486 -        Returns two statements atatched by the -> operator.
 486 +        Returns two statements attached by the -> operator.
 }}}

 8.
 {{{
 494 -            ithen'ed together.
 494 +            ifthen'ed together.
 }}}

 9.
 {{{
 563 -            start -- an interger representing the row of the truth
 563 +            start -- an integer representing the row of the truth
 }}}

 10.
 {{{
 564 -                     table from which to start intilized to 0 which
 564 +                     table from which to start initialized to 0,
 which
 }}}

 11.
 {{{
 568 -                   to be created.  It is intilized to the last row of
 the
 568 +                   to be created.  It is initialized to the last row
 of the
 }}}

 12.
 {{{
 601 -            When sent with no start or end paramaters this is an
 601 +            When sent with no start or end parameters, this is an
 }}}

 13.
 {{{
 680 -        It does this by applying a set of rules that are gaurenteed
 to convert the
 680 +        It does this by applying a set of rules that are guaranteed
 to convert the
 }}}

 14.
 {{{
 700 -            is typically prefered, but results can vary.
 700 +            is typically preferred, but results can vary.
 }}}

 15.
 {{{
 718 -            A string representing the satformat represetatin of this
 object.
 718 +            A string representing the satformat representation of
 this object.
 }}}

 16.
 {{{
 881 -            Returns a new statement that is the first statement
 attatched to
 881 +            Returns a new statement that is the first statement
 attached to
 }}}

 17.
 {{{
 950 -        if-thens, and xor opperations to operations only involving
 and/or operations.
 950 +        if-then, and xor operations to operations only involving
 and/or operations.
 }}}

 18.
 {{{
 954 -            tree -- a list of three elements corrospsponding to a
 branch of a
 954 +            tree -- a list of three elements corresponding to a
 branch of a
 }}}

 19.
 {{{
 1068 -        This function converts the string expression asscociated
 with an instance
 1068 +        This function converts the string expression associated with
 an instance
 }}}

 20.
 {{{
 1902 -        # FUTHER REDUCE COVER WITH EPI
 1902 +        # FURTHER REDUCE COVER WITH EPI
 }}}

 21.
 {{{
 1948 -    An unforunate side affect of the Quine-McCluskey system is that
 x !=
 1948 +    An unfortunate side effect of the Quine-McCluskey system is that
 x !=
 }}}

 22.
 {{{
 1977 -Module that creates and modifys parse trees of well formed
 1977 +Module that creates and modifies parse trees of well formed
 }}}

 23.
 {{{
 2003 -    This function produces a parse tree from a boolen formula s.
 2003 +    This function produces a parse tree from a boolean formula s.
 }}}

 24.
 {{{
 2042 -        Returns a list of tokens corrosponding to s.
 2042 +        Returns a list of tokens corresponding to s.
 }}}

 25.
 {{{
 2137 -             are occuring.
 2137 +             are occurring.
 }}}

 26.
 {{{
 2267 -It is not an error to use nonsenical numeric inputs.
 2267 +It is not an error to use nonsensical numeric inputs.
 }}}

 27.
 {{{
 2326 -                  with each variable occuring only once.
 2326 +                  with each variable occurring only once.
 }}}

 28.
 {{{
 2370 -        Strange paramaters can lead to the table header with no
 body.
 2370 +        Strange parameters can lead to the table header with no
 body.
 }}}

 29.
 {{{
 2415 -        Strange paramaters can lead to the table header with no
 body.
 2415 +        Strange parameters can lead to a table header with no body.
 }}}

 30.
 {{{
 2478 -    Formulas consist of the operators &, |, ~, ^, ->, <->,
 corrosponding
 2478 +    Formulas consist of the operators &, |, ~, ^, ->, <->,
 corresponding
 }}}

 31.
 {{{
 2481 -    underscores and aplphanumerics.  Parentheses may be used to
 2481 +    underscores and alphanumerics.  Parentheses may be used to
 }}}

 32.
 {{{
 362 -        Returns a latex representation of this statement.
 362 +        Returns a LaTeX representation of this statement.
 }}}

 33.
 {{{
 368 -            Returns the latex representation of this statement.
 368 +            Returns the LaTeX representation of this statement.
 }}}

 34.
 {{{
 384 +            other --the left hand side statement.
 384 +            other -- the left hand side statement.
 }}}

 35.
 {{{
 404 +            other --the left hand side statement.
 404 +            other -- the left hand side statement.
 }}}

 36.
 {{{
 425 -            other --the left hand side statement.
 425 +            other -- the left hand side statement.
 }}}

 37.
 {{{
 446 -            other --the left hand side statement.
 446 +            other -- the left hand side statement.
 }}}

 38.
 {{{
 467 -            other --the left hand side statement.
 467 +            other -- the left hand side statement.
 }}}

 39.
 {{{
 490 -            other --the left hand side statement.
 490 +            other -- the left hand side statement.
 }}}

 40.
 {{{
 511 -            other --the left hand side statement.
 511 +            other -- the left hand side statement.
 }}}

 41.
 {{{
 533 -            other --the left hand side statement.
 533 +            other -- the left hand side statement.
 }}}

 42.
 {{{
 537 -            right hand side and false otherwise.
 537 +            right hand side, and false otherwise.
 }}}

 43.
 {{{
 558 -        start inclusive and end exclusive so a truthtable(0, 2) will
 include
 558 +        start inclusive and end exclusive so truthtable(0, 2) will
 include
 }}}

 44.
 {{{
 572 -            Returns the truthtable (a 2-d array with the creating
 statement
 572 +            Returns the truthtable (a 2-D array with the creating
 statement
 }}}

 45. Please carefully read through the following snippet from the original
 diff file:
 {{{
 590 +        We can now create truthtable of rows 1 to 5
 591 +            sage: s.truthtable(1, 5)
 592 +            a      b      c      value
 593 +            False  False  True   False
 594 +            False  True   False  True
 595 +            False  True   True   False
 596 +            True   False  False  False
 }}}
 Why "rows 1 to 5" when you're using the command {{{s.truthtable(1, 5)}}}?
 My understanding is that {{{s.truthtable(1, 5)}}} includes row 1 all the
 way up to but excluding row 5. In effect, that command actually creates 4
 rows, excluding the standard header row. Perhaps you might want to
 consider this diff:
 {{{
 590 -        We can now create truthtable of rows 1 to 5
 590 +        We can now create a truth table of rows 1 to 4, inclusive.
 }}}
 or this one:
 {{{
 590 -        We can now create truthtable of rows 1 to 5
 590 +        We can now create a truth table of rows 1 to 5, exclusive.
 }}}


 46.
 {{{
 637 -        It does this by examining the truthtable of the formula.
 637 +        It does this by examining the truth table of the formula.
 }}}

 47.
 {{{
 653 -            This method creates the cnf parse tree by examining the
 logic
 653 +            This method creates the CNF parse tree by examining the
 logic
 }}}

 48.
 {{{
 699 -            Unless a formula is already in (or close to) being in cnf
 convert_cnf()
 699 +            Unless a formula is already in (or close to) being in
 CNF, convert_cnf()
 }}}

 49. No tabs, please. This issue is especially important since we're using
 Python and most folks who program in Python use only spaces --- NOT tabs
 --- for their indentation. For official reasons why tabs are not used,
 please refer to [http://www.python.org/dev/peps/pep-0666/ PEP 666]. The
 [http://www.sagemath.org/doc/prog/prog.html Sage Developer's Guide]
 provides various general guidelines to be adhered to when writing code
 (and documentation) to be included within Sage itself. In particular, you
 might want to consult [http://www.sagemath.org/doc/prog/node6.html this
 section]. If you feel that my comment is unfair to you, please don't flame
 me. Instead, provide me with reasons why it's unfair (to you). If your
 reasons turn out to be valid and they show that I'm being unfair, I'd
 stand corrected and offer you my apology.
 {{{
 711 -       See www.cs.ubc.ca/~hoos/SATLIB/Benchmarks/SAT/satformat.ps for
 a
 711 +        See www.cs.ubc.ca/~hoos/SATLIB/Benchmarks/SAT/satformat.ps
 for a
 }}}

 50.
 {{{
 730 -            cnf form by a call to convert_cnf() or
 convert_cnf_recur()
 730 +            CNF form by a call to convert_cnf() or
 convert_cnf_recur(),
 }}}

 51.
 {{{
 806 -            cnf form by a call to convert_cnf() or
 convert_cnf_recur()
 806 +            CNF form by a call to convert_cnf() or
 convert_cnf_recur(),
 }}}

 52.
 {{{
 838 -        '~', operators.
 838 +        '~' operators.
 }}}

 53.
 {{{
 1117 -            The next operator in the string
 1117 +            The next operator in the string.
 }}}

 54.
 {{{
 1276 -        Will create a composite functor which will add 1, multiply
 by
 1276 +        will create a composite functor which will add 1, multiply
 by
 }}}

 55.
 {{{
 1343 -    is defined so that that tc(ast) returns the count of ts.  The
 1343 +    is defined so that tc(ast) returns the count of ts.  The
 }}}

 56.
 {{{
 1575 -    The exclusive-or operator, will turn into:
 1575 +    The exclusive-or operator will turn into:
 }}}

 57.
 {{{
 1945 -    DNF formulae generated from prepositional logic ASTs as
 described
 1945 +    DNF formulae generated from propositional logic ASTs as
 described
 }}}

 58.
 {{{
 2216 -A logic table is essentially a 2-d array that is created by the
 statement class
 2216 +A logic table is essentially a 2-D array that is created by the
 statement class
 }}}

 59.
 {{{
 2221 -For instance, with the variables A, B, and C the truthtable looks
 like:
 2221 +For instance, with the variables A, B, and C the truth table looks
 like:
 }}}

 60.
 {{{
 2233 -This is equivalent to counting in binary, where a table would appear
 thusly;
 2233 +This is equivalent to counting in binary, where a table would appear
 thus:
 }}}

 61.
 {{{
 2279 -If one argument is provided truthtable defaults to the end.
 2279 +If one argument is provided, truthtable defaults to the end.
 }}}

 62.
 {{{
 2291 -If the second argument is negative truthtable defaults to the end.
 2291 +If the second argument is negative, truthtable defaults to the end.
 }}}

 63.
 {{{
 2324 -            t -- a 2-d array containing the table values
 2324 +            t -- a 2-D array containing the table values.
 }}}

 64.
 {{{
 2396 -            self -- the calling object: not used
 2396 +            self -- the calling object: not used.
 }}}

 65.
 {{{
 2454 -            self -- the calling object: not used
 2454 +            self -- the calling object: not used.
 }}}

 66.
 {{{
 2592 -    Formula returns an instance if BooleanFormula if possible, and
 throws
 2592 +    Formula returns an instance of BooleanFormula if possible, and
 throws
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/545#comment:22>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to