Ampersand
Ampersand copied to clipboard
Typechecker problems that I do not know what could possibly cause them.
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
- Clone https://github.com/RieksJ/banking-demo
- Go to the
project
directory. - execute
ampersand check .bank.adl
Screenshot / Video
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
- the definition of
I_Am
, which is similar toONE
, 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
- the
CLASSIFY
statements aroundI_Am
andAorP
, 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?