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

Error in the operator # #1460

Open
stefjoosten opened this issue Dec 26, 2023 · 0 comments
Open

Error in the operator # #1460

stefjoosten opened this issue Dec 26, 2023 · 0 comments

Comments

@stefjoosten
Copy link
Contributor

stefjoosten commented Dec 26, 2023

What happened

I noticed that

RELATION r[A*B]
ENFORCE r := I[A]#"foo"

has a different semantics than

RELATION r[A*B]
ENFORCE r := V[A*B]#"foo"

If I test this with the following population:

POPULATION A CONTAINS [ "1", "2", "3" ]
POPULATION B CONTAINS [ "foo", "bar", "gnu" ]

I see that the expression I[A]#"foo" yields [("1","foo"),("1","bar"),("1","gnu"),("2","foo"),("2","bar"),("2","gnu"),("3","foo"),("3","bar"),("3","gnu")].
Yet, the expression V[A*B]#"foo" yields [("1","foo"),("2","foo"),("3","foo")].

What I expected

I expected the result to be the same, i.e. [("1","foo"),("2","foo"),("3","foo")], in both cases to comply with the definition of #.

Version of ampersand that was used

I used a dockerfile FROM ampersandtarski/prototype-framework:v1.14

Steps to reproduce

  1. Run the script below as a prototype (e.g. in https://rap.cs.ou.nl) and observe the results for the term V[A*B]#"foo".
  2. Move the comment, rerun, and observe the results for the term I[A]#"foo".

Screenshot / Video

Context / Source of ampersand script

CONTEXT Issue1460

RELATION r[A*B]
-- ENFORCE r := I[A]#"foo"
ENFORCE r := V[A*B]#"foo"

POPULATION A CONTAINS [ "1", "2", "3" ]
POPULATION B CONTAINS [ "foo", "bar", "gnu" ]

INTERFACE ShowAll : "_SESSION";I[SESSION] BOX
 [ As : V[SESSION*A] BOX
       [ A : I
       , "B (r)" : r
       ]
 , Bs : V[SESSION*B] BOX
       [ B : I
       , "A (r~)" : r~
       ]
 ]

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

No branches or pull requests

1 participant