Ampersand icon indicating copy to clipboard operation
Ampersand copied to clipboard

`CLASSIFY A IS B` should be interchangeable with `CLASSIFY A ISA B` and `CLASSIFY B ISA A`

Open stefjoosten opened this issue 2 years ago • 4 comments

What happened

I have two scripts: Script_ISA and Script_IS:

CONTEXT Script_ISA

RELATION r[X*A]
RELATION r[X*B]

CLASSIFY A ISA B
CLASSIFY B ISA A

RULE r;r~

ENDCONTEXT

Script_ISA compiles without errors. The following script doesn't:

CONTEXT Script_IS

RELATION r[X*A]
RELATION r[X*B]

CLASSIFY A IS B

RULE r;r~

ENDCONTEXT

Script_IS produces the following error message:

  Cannot disambiguate the relation: r
    Please add a signature (e.g. [A*B]) to the relation.
    Relations you may have intended:
    r [X*A] (/var/www/data/scripts/stefj/Script_52878b5e-ca3a-4465-9baf-6f60e4354a83/ScriptVersion_4f23d0c9-a5f2-4023-892c-99f9e26338f7/script.adl:3:1)
    r [X*B] (/var/www/data/scripts/stefj/Script_52878b5e-ca3a-4465-9baf-6f60e4354a83/ScriptVersion_4f23d0c9-a5f2-4023-892c-99f9e26338f7/script.adl:4:1)
  Note: Some cases are not disambiguated fully by design. You can read about
    this at https://github.com/AmpersandTarski/Ampersand/issues/980#issuecomment-508985676
ExitFailure 10

What I expected

I expected that both scripts would compile without errors. In the wake of the discussion in issue #1306, I hesitate to call this a feature or a bug. Since $A\subseteq B\wedge B\subseteq A\Rightarrow A=B$, I would expect that Script_ISA entails Script_IS. With this result, I'm not sure anymore about issue #1306... How do I explain this to students?

Version of Ampersand that was used

I did this on RAP, using Ampersand-v4.3.0 [32141f41cf2af837d59eb57bc73320f4ef48fa00:refs/heads/development], build time: 15-Aug-21 07:39:12 UTC

stefjoosten avatar Jul 23 '22 05:07 stefjoosten