-
Notifications
You must be signed in to change notification settings - Fork 8
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
"Sinterklaas issue": Atoms mentioned in an expression should not populate the corresponding concept implicitly #166
Comments
I am in favour of this: I believe writing a rule/expression/etc should not influence the initial population. I do not agree that it would be easy to fix. Currently, singletons are used as atoms that cannot (or should not) be deleted. Of course, such an assumption should be made explicit through a rule:
or alternatively:
I am not sure how well these work if we delete atoms. I fear that the normalizer or the SQL-generator may assume that 'God' always exists. If both of the above examples already work, then I agree that it will be relatively easy to fix, and believe it should be fixed. We can still express your rule using the current semantics:
However, I really do not like the fact that a RULE can be used to populate concepts. Adding rule X to a script containing rule Y with has no violations, can cause rule Y to be violated. Or worse: adding an interface to a script might do the same. This is not desirable and the alternative, which is having to make it explicit (with a RULE) when you want an atom to always exist. |
Nevertheless, I also like the more fundamental aspect: Sinterklaas demonstrates clearly the contradictions we will suffer by populating scripts implicitly. It seems a convincing plea for requiring the Ampersand user to populate explicitly. |
There is a way out, of course. What about the original motivation for having implicit singleton definitions. Is it suddenly useless? |
I do not like the idea of distinguishing between positive and negative occurrences, but let's try to see if we can make it work: if Now for your way out.. say we only look at provably positive uses. In most cases, we can have the atom not exist while the rule is not violated, simply by creating an empty concept. The only rules for which this is not the case, are rules in which both types are ONE. So basically, rules that look like this:
Note that the following rule is satisfied if there are no Deities:
So how does this rule say that God exists? It doesn't. But the TOT constraint says there is at least one Diety, and god (the relation) refers to it.
So when writing the first rule, if our engine is smart enough, the atom will be inserted automatically. When writing the second, it would not. I fear this would make it impossible to predict whether I need that separate populate statement. So I am not in favor of this either. Another alternative could be: if an atom occurs with a type, e.g. The least exciting alternative, which I think is a good idea, would be to see some syntax sugar for the rule that an atom exists, and the corresponding POPULATE statement:
... or something like that. We can experiment with warnings in case |
The latter statement already exists, However, the syntax is
So we already have a way to specify the initial population, without the need to implicitly populate concepts with singletons used in expressions. |
No the latter statement would be equivalent to:
which, indeed, both exist (this is why it's syntax sugar) |
I confronted @stefjoosten with the consequences of the outcome of this discussion this morning. He seems to realize that this is a fundamental issue. A relevant question in this discussion, I remember, is: What should be the violation mentioned by the rule, when the atom does not exist. I tried that with the rule above given by @sjcjoosten:
The outcome is as I expect it to be:
Now please bring up the opinion of real Mathematicians... |
What about:
case 0If case 1If concept ExperimentThank you, @hanjoosten, for doing an experiment with this. The current implementation produces the following violation:
Because of this, the compiler generates no prototype. Explaination: the compiler "pre-populates" the concept What does this tell me?This example and the experiment seem to corroborate the opinion of @sjcjoosten (see above) when he says that we should not pre-populate concepts with atoms taken from singleton-expressions. |
Let's close this issue when the compiler has been corrected. |
The fix was premature, but has been fixed correctly on 20 mar. |
Reversed the fix for issue #166, after I had a talk with Stef about t…
Given that this issue has been referenced by quite a few others, indicating that users don't naturally think of the stuff in this issue, would it be useful, to extend the
|
Introducing new syntax isn't to be taken too lightly. New syntax adds complexity to the language. Modelers have to learn and understand the new construct, which can increase the cognitive load and make Ampersand harder to master. Over time, this could lead to a bloated language, where there are multiple ways to achieve the same result, causing confusion. In this case there is no need, for you can use the following:
|
Currently, if you have a singleton in an expression, it will be used to automatically fill the initial population. I think that is wrong.
I have uploaded a tiny example script.
@stefjoosten, Do you share my opinion? If so, it will be relative easy to fix. If not, please explain!
Hi @hanjoosten, Stef here. I agree. Let's abolish the practice to pre-populate concepts with atoms from singleton-expressions. For the reasons why, please read the following comments in this issue.
The text was updated successfully, but these errors were encountered: