Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert the empty set without using a special case #32

Open
MarcoCostantini opened this issue May 13, 2020 · 0 comments
Open

convert the empty set without using a special case #32

MarcoCostantini opened this issue May 13, 2020 · 0 comments

Comments

@MarcoCostantini
Copy link

The empty set is converted from Python to OpenMath as
<OMS cdbase="http://www.openmath.org/cd" name="emptyset" cd="set1"/>
which is correct but not the best choice. It would be better to convert it as
<OMA><OMS cdbase=\"http://www.openmath.org/cd\" cd=\"set1\" name=\"set\"/></OMA>
it such way, the empty set is handled as a set and not as a special case.

About this, please consider what is said in
http://www.catb.org/~esr/writings/taoup/html/ch01s06.html , which is
especially relevant for OpenMath, which is intended to be used by
computers:

For robustness, designing in tolerance for unusual or extremely bulky
inputs is also important. Bearing in mind the Rule of Composition helps;
input generated by other programs is notorious for stress-testing software
(e.g., the original Unix C compiler
reportedly needed small upgrades to cope well with Yacc output). The forms
involved often seem useless to humans. For example, accepting empty
lists/strings/etc., even in places where a human would seldom or never
supply an empty string, avoids having to
special-case such situations when generating the input mechanically.
-- Henry Spencer
One very important tactic for being robust under odd inputs is to avoid
having special cases in your code. Bugs often lurk in the code for
handling special cases, and in the interactions among parts of the code
intended to handle different special cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant