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

Incorrect wording in the spec: "may not" vs. "shall not" #901

Closed
modelica-trac-importer opened this issue Nov 4, 2018 · 7 comments · Fixed by #2683
Closed

Incorrect wording in the spec: "may not" vs. "shall not" #901

modelica-trac-importer opened this issue Nov 4, 2018 · 7 comments · Fixed by #2683
Labels
bug Something isn't working

Comments

@modelica-trac-importer
Copy link
Collaborator

Reported by stefanv on 5 Nov 2012 20:09 UTC
This example is from section 12.2 of the Modelica 3.2rev1 specification, but there are similar examples throughout the document.

A function may not be used in connections, may have no equations, may have no initial algorithm, and can have at most one algorithm section, which, if present, is the body of the function.

Note that in a strict interpretation, the following is perfectly legal:

model Main
  function MayNot
    input Real x;
    ouput Real y;
  equation
    y = x;
  initial algorithm
    y := x;
  algorithm
    y := x^2;
  end MayNot;

  MayNot mn1, mn2;
equation
  connect(mn1,mn2);
end Main;

The phrase "may not" (and derivatives such as "may have no") means "is allowed not to". Thus, the quotation from the specification above really means:

A function is allowed to not be used in connections, is allowed to have no equations, is allowed to have no initial algorithm, and can have at most one algorithm section, which, if present, is the body of the function.

If all the occurrences of "may" in the original quotation were replaced by "shall" or "can", then the meaning would be as intended.

The word "may" should be reserved for the case where something is optional. In searching for such a case in the specification, I came across this in section 7.3.3 (with my comments added in braces):

  • an element declared as constant cannot {correct} be redeclared
  • an element declared as final may not {"cannot" or "shall not"} be modified, and thus not redeclared
  • Modelica {I wouldn't have guessed :)} does not allow a protected element to be redeclared as public, or a public element to be redeclared as protected.
  • Array dimensions may {correct} be redeclared.

The third one is just funny, since it appears in the middle of the Modelica specification. Better might be:

  • a protected element cannot be redeclared as public, or a public element as protected

Migrated-From: https://trac.modelica.org/Modelica/ticket/901

@modelica-trac-importer
Copy link
Collaborator Author

Comment by anonymous on 5 Nov 2012 20:33 UTC
I would agree that even though 95% of the readers would correctly interpret the intent, the wording could be misinterpreted. I would prefer the use of "shall" over "can", because "can" is also a term that is ambiguous in some contexts. Just because something "can" be, doesn't mean it "must" be. That is, "can" is usually synonomous with "may", so it doesn't help to avoid ambiguities. In my opinion, the "shall" phrasing is the probably safest way to avoid problems.

@modelica-trac-importer
Copy link
Collaborator Author

Comment by stefanv on 5 Nov 2012 20:46 UTC
I agree that "can" is almost synonymous with "may", and "can not" with "may not", but "cannot" is not synonymous with "may not".

And yes, I agree that in this example, 95% (or more) would get the intent, but there are probably cases in the specification where it's more ambiguous, or has the reversed meaning, and a standards document should be more precise. In one of the pieces of explanatory text, it says, "... the result is not unique and may not be what the user expects." Surely this doesn't mean that we have to produce unexpected results?

@modelica-trac-importer
Copy link
Collaborator Author

Comment by choeger on 6 Nov 2012 08:30 UTC
AFAIK the question here is, what we are actually negating (may not could mean "not to be allowed to ..." as well as "to be allowed not to" (and, additionally "might not" ?)). So it should be correct as it is, but ambiguous?

There are translations (at least into german) which support the current specification. See e.g.

http://dict.leo.org/ende?lp=ende&lang=en&searchLoc=0&cmpType=relaxed&sectHdr=on&spellToler=&search=may+not

There is probably some tricky rule when to use what, but since a specification should be easy to read, I would favor to use "must not" instead.

@modelica-trac-importer
Copy link
Collaborator Author

Comment by sjoelund.se on 6 Nov 2012 09:23 UTC
Replying to [comment:3 choeger]:

AFAIK the question here is, what we are actually negating (may not could mean "not to be allowed to ..." as well as "to be allowed not to" (and, additionally "might not" ?)). So it should be correct as it is, but ambiguous?

If it is ambiguous, it is not correct. In technical texts, one should avoid may not since it is equivalent to may or may not. Anyone with Word should probably search for other uses of may not in the text (I don't trust my pdf reader to find it for me).

@modelica-trac-importer
Copy link
Collaborator Author

Comment by jmattsson on 6 Nov 2012 09:51 UTC
As comparison, the C standard uses "shall".

From the "Definitions of Terms" section:
In this Standard, "shall" is to be interpreted as a requirement on an implementation or on a program; conversely, "shall not" is to be interpreted as a prohibition.

Such a definitions section would probably be a good idea for the Modelica specification as well.

@modelica-trac-importer
Copy link
Collaborator Author

Comment by dietmarw on 20 Dec 2012 13:47 UTC
Housekeeping, defaulting all new tickets to [milesstone:*undecided*] (is normally done automatically)

@thorade
Copy link
Contributor

thorade commented Jun 3, 2019

It might be helpful to go with RFC-2119 here to eliminate any ambiguity:
https://tools.ietf.org/html/rfc2119

Almost all occurences of "may not" would then have to be replaced with "must not" or "shall not".

@HansOlsson HansOlsson added this to the ModelicaSpec3.5 milestone Feb 13, 2020
HansOlsson added a commit to HansOlsson/ModelicaSpecification that referenced this issue Oct 9, 2020
And in some cases 'cannot',
and in one case rewrite it completely.
Closes modelica#901
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment