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

Typechecker problems that I do not know what could possibly cause them. #1510

Open
RieksJ opened this issue Sep 25, 2024 · 2 comments
Open
Assignees
Labels
component:type checker question Indicates that an issue or pull request needs more information

Comments

@RieksJ
Copy link
Contributor

RieksJ commented Sep 25, 2024

What happened

A year or two ago, I made a prototype that simulated a bank. You could register/login, get a bankaccount, and then transfer funds from one account to another. It worked in TNO's SSI-lab.
I recently created a new, personal repo from the ampersand prototype template.
I copied the sources to its project-directory, and tried to compile it, which - of course - didn't work.

What I expected

I expected that I would not encounter any type-checker errors, because the stuff had been working before.

Version of ampersand that was used.

Ampersand-v4.7.7 [HEAD:2ec5b6d]. This was probably not the version I used 2 years ago, but that should not matter.

Steps to reproduce

  1. Clone https://github.com/RieksJ/banking-demo
  2. Go to the project directory.
  3. execute ampersand check .bank.adl

Screenshot / Video

image

Context / Analysis

As you can see from the image, the issue seems to be that the type-checker cannot match terms where one ends with the I_Am concept, and the other with the AorP concept.

I have tried to find out what the problem is - see the script z-bug.adl in the repo.

In this script, I have

  1. the definition of I_Am, which is similar to ONE, as follows:
CLASSIFY I_Am ISA Actor

RULE "There can only be one I_Am": V[I_Am] = I[I_Am]
POPULATION I_Am CONTAINS [ "I_Am" ] -- This is what I_Am
  1. the CLASSIFY statements around I_Am and AorP, which are as follows:
CLASSIFY NatuurlijkePersoon ISA Person
CLASSIFY Bank, Onderneming ISA Organization
CLASSIFY Person, Organization ISA Party
CLASSIFY Person, I_Am ISA Actor
CLASSIFY Party, Actor ISA AorP

but that doesn't produce any errors.
The question therefor is: what could the rest of the sources contain that would cause this error?
Anyone?

@RieksJ RieksJ added component:type checker question Indicates that an issue or pull request needs more information labels Sep 25, 2024
@hanjoosten
Copy link
Member

hanjoosten commented Oct 17, 2024

Your rule is misleading. It expresses that there can be at most one I_Am.

@RieksJ
Copy link
Contributor Author

RieksJ commented Oct 18, 2024

What is misleading about it?
The rule expresses precisely what is intended, i.e., that there can be at most one I_Am.
The population of I_Am says which one that is.
This is very similar to the ONE concept and the ONE atom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:type checker question Indicates that an issue or pull request needs more information
Projects
None yet
Development

No branches or pull requests

4 participants