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

MeTTaLog fails to run a simple metta program #197

Closed
ngeiswei opened this issue Nov 20, 2024 · 5 comments
Closed

MeTTaLog fails to run a simple metta program #197

ngeiswei opened this issue Nov 20, 2024 · 5 comments

Comments

@ngeiswei
Copy link
Contributor

What is your problem?

MeTTaLog fails to run and raises a number of errors on a simple metta program.

How to reproduce you problem?

Run the following with mettalog

;; Define foo
(= (foo $term)
   (if (== (get-metatype $term) Expression)
       (case $term
         ((($f $g) (if (== (foo $g) $g) $term $term))
          ($else $term)))
       $term))

;; Run foo
!(foo ((. $f) $g))

What is the expected output?

It should normally output

[((. $f) $g)]

What is the actual output?

(= (error  (type_error  integer ($_9178 $_9184)) $_9168)  
  (,  
    (eval_H  500 &self 
      (foo ((. $_3602) $_3620)) $_3468) 
    (,  
      (deterministic  $_3768) 
      (,  
        (xform_out  $_3468 $_3796) 
        (nb_setarg  1 
          (res  $_3206) $_3796)))))

followed by a large number of messages such as

^  Exit: (210) [system] sig_atomic(rtrace:restart_rtrace)
   Call: (211) [user] eval_H(500, '&self', [foo, [['.', _3602], _3620]], _3468)
   Unify: (211) [user] eval_H(500, '&self', [foo, [['.', _3602], _3620]], _3468)
^  Call: (212) [user] catch_metta_return(eval_args(=, _11880, 500, '&self', [foo, [['.', _3602], _3620]], _3468), _3468)
^  Unify: (212) [user] catch_metta_return(eval_args(=, _11880, 500, '&self', [foo, [['.', _3602], _3620]], _3468), _3468)
...
@ngeiswei
Copy link
Contributor Author

This issue has been tested with the latest revision of MeTTaLog f011f3e.

@TeamSPoon
Copy link
Collaborator

This should fix issue for now eval_until_unify/N already covers to the two cases I removed.

(I started one month letting as_tf/2 leak some exceptions so they could be verified to be ok or not. These ones were OK and meant to be repressed. And now happening in catch_err when they occur within eval_until_unify/N)

@TeamSPoon
Copy link
Collaborator

This issue reminds me.. we really gotta fix toplevel variable name reporting

@ngeiswei
Copy link
Contributor Author

After pulling the lastest changes from metta-wam, I'm getting a different error

(ugtrace  (error  (stream_error  (:  2279 (:  0 86060)) (syntax_error  unexpected_end_of_file "Unexpected end of file in list"))) $_18112)

%~ FIlE: /home/nilg/Work/TrueAGI/metta-wam/src/canary/stdlib_mettalog.metta:2279 

(ugtrace  (error  (stream_error  (:  2279 (:  0 86060)) (syntax_error  unexpected_end_of_file "Unexpected end of file in list"))) $_18112)


(on_mettalog_error  (error  (stream_error  (:  2279 (:  0 86060)) (syntax_error  unexpected_end_of_file "Unexpected end of file in list"))))


(ugtrace  (error  $aborted) $_715310)

%~ FILE: /home/nilg/Work/TrueAGI/metta-wam/src/canary/stdlib_mettalog.metta:2279 

(ugtrace  (error  $aborted) $_948)


(on_mettalog_error  (error  $aborted))


(ugtrace  (error  $aborted) $_1004)

%~ FIlE: user_input:24 

(ugtrace  (error  $aborted) $_1004)


(on_mettalog_error  (error  $aborted))

ERROR: /home/nilg/Work/TrueAGI/metta-wam/src/canary/metta_interp.pl:2225: Initialization goal raised exception:
ERROR: Execution Aborted
; DEBUG Exit code of METTA_CMD: 1

is it normal?

@ngeiswei
Copy link
Contributor Author

I just want to confirm that it now works as it should.

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

2 participants