phillipstanleymarbell / Noisy-lang-compiler

Noisy language compiler
MIT License
17 stars 1 forks source link

Signal derivation statement for multi axis signals is unclear and is parsed incorrectly #501

Open lvrgustafsson opened 4 years ago

lvrgustafsson commented 4 years ago

Description of the Problem

The derivation statement for multi axis signals such as that found on line 45 of ActivityClassifier.nt is unclear. This is because it may be taken as implying that acceleration is also a multi axis signal, which is not the case. Moreover, this derivation signal is parsed incorrectly as it does not appear to create instances of the Physics struct correctly for each index of the multi axis signal.

Proposed Solution

In order to clarify the syntax of the derivation statement, it is proposed to amend the derivation statement syntax in the case of line 45 of ActivityClassifier.nt to the following: derivation = acceleration;. This would make it clear that all of the indices of the multi axis signal here are acceleration signals. This would also remove the problem of incorrectly parsing these indices, as it would no longer be strictly necessary. The index of each of these acceleration signals would then be specified in the invariantDefinition parameterList. The terminology of index as relating to multi axis signals is confusing, and is discussed in the issue linked here. Furthermore, the notation/syntax for specifying the index is also confusing, and is discussed in the issued linked here.

KomaGR commented 4 years ago

I agree that this part of the grammar is not so clear.

For me something that would directly specify the axes would be more clear:

derivation = {acceleration, acceleration, acceleration}

This way you can specify different axis signals, too:

derivation = {distance, time}

A problem that arises is that the manual labor grows with the axes.