Ampersand icon indicating copy to clipboard operation
Ampersand copied to clipboard

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

Open RieksJ opened this issue 5 months ago • 0 comments

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 avatar Sep 25 '24 10:09 RieksJ