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

Following a specific io syntax #140

Open
8hantanu opened this issue Mar 10, 2019 · 1 comment
Open

Following a specific io syntax #140

8hantanu opened this issue Mar 10, 2019 · 1 comment

Comments

@8hantanu
Copy link
Member

8hantanu commented Mar 10, 2019

To do:

  • Set a fixed syntax so there is no ambiguity while giving input.
  • Update the wiki by adding a page for input syntax and rules under User Manual section.
  • Output string (from the tokensToString() method) must also follow this syntax as it can be used again in an input.
  • Changes must be made in io/tokenize.py and io/checks.py accordingly.

Some examples:

  • Giving input as sin x is not allowed. The operand must always be contained in brackets like sin(x).
  • Should x^2y be interpretted as (x^2)*y or x^(2y) ?
  • Coefficient must be given before variables i.e 2xy is accepted xy2 is not.
  • Also use * when multiplying with expressions i.e. 2*(x+y) and (x+y)*(x-y) instead of 2(x+y) and (x+y)(x-y).
  • Always use a number before decimal point. Use 0.1 instead of .1 #113

You can list any examples of ambiguous inputs(or any changes if required to the current syntax) in the comments below.
Note: Some of the above examples might not have been implemented yet. Any examples can be suggested which might be helpful when implementing them in future.

@Alii-Khaled
Copy link
Contributor

Alii-Khaled commented Apr 5, 2019

These are Input forms I think VisMa should have.

- Spaces inside the input Expression are allowed but any space between the Trigonometric, Logarithmic, Exponential & hyperbolic functions are not allowed ( like: Si n(x) ).

- Any Trigonometric, Logarithmic, Exponential & hyperbolic functions must have at least 1 closing & 1 opening Bracket which contain the function's expression like: sin(x+4)

- Any Power must have at least a variable or a constant, and if it has more than one, it should be put between 2 Brackets. like: e^x ... e^(x+3) and should use ( ^ ) not ( ** ).

- Upper and lower cases are allowed.

- Constants or Variables which are positive shouldn't have ( + ) prefix for them, while negative should have a prefix ( - ) sign like: +X is not allowed.

- 1X or -1X will be directly changed into X & -X respectively.

- Equal sign should have at least one variable or constant on each side of it.

Whenever I found any other ambiguous input syntax I will add it in here.

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

No branches or pull requests

2 participants