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

Built-in get-type fails on a simple data construction #238

Open
ngeiswei opened this issue Jan 23, 2025 · 0 comments
Open

Built-in get-type fails on a simple data construction #238

ngeiswei opened this issue Jan 23, 2025 · 0 comments
Labels
bug Issues that represent errors in the code

Comments

@ngeiswei
Copy link
Contributor

ngeiswei commented Jan 23, 2025

What is the problem?

The built-in get-type does not work on a simple user defined type.

How to reproduce your problem?

Run the following program with MeTTaLog

(: Shape Type)
(: Box Shape)
(: Attribute Type)
(: MkShapeAttribute (-> Shape Attribute))
!(get-type (MkShapeAttribute Box))

What do you get?

[error [error [existence_error procedure [ / non_arg_violation_each 3 ]] [context [ / args_conform 4 ] $260]] [file /home/nilg/Work/SingularityNET/ai-dsl/experimental/ai-service-composition/english-to-chinese-song/bug.metta] (get-type (MkShapeAttribute Box))][

What would you normally expect?

[Attribute]

What else do you have to say?

The get-type calls on terms individually works, that is

!(get-type Shape)
!(get-type Box)
!(get-type Attribute)
!(get-type MkShapeAttribute)

properly outputs

[Type]
[Shape]
[Type]
[(-> Shape Attribute)]

It only fails when get-type is called on (MkShapeAttribute Box).

@ngeiswei ngeiswei added the bug Issues that represent errors in the code label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that represent errors in the code
Projects
None yet
Development

No branches or pull requests

1 participant