Skip to content

[ENVRNMNT8] error after update to clipspy v1.0.5 when calling Environment.assert_string() with ordered fact #73

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

Open
sjvega0 opened this issue May 18, 2025 · 0 comments

Comments

@sjvega0
Copy link

sjvega0 commented May 18, 2025

After finished updating from clipspy v1.0.4 to v1.0.5, I'm finding the error [ENVRNMNT8] Environment data not fully deallocated when running code that:

  • asserts an ordered fact by calling Environment.assert_string(), and
  • clears the environment with Environment.clear() at some point afterwards.

This error does not occur when using clipspy v1.0.4 .

Here's a sample script that reproduces the problem:

# FILE NAME: test_script.py

import clips

env = clips.Environment()

env.clear()

env.reset()

print("Asserting ordered fact...")

env.assert_string("(an ordered fact)")

print("Facts found:")
for fact in env.facts():
    print(f"\t{fact}")

env.clear()

print('End of script')

Notice that this error does not come up when running the code in the Python REPL, but does when running the above script on a standard terminal as:

>python -m test_script

Here is the full output:

Asserting ordered fact...
Facts found:
        (an ordered fact)
End of script

[ENVRNMNT8] Environment data not fully deallocated.

[ENVRNMNT8] MemoryAmount = 40.

[ENVRNMNT8] MemoryCalls = 1.

Worth mentioning that, after some testing, determined that this error does not occur:

  • if only template facts are asserted via Environment.assert_string(); or
  • if the call to Environment.clear() towards the end of the script is removed.
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

1 participant