Skip to content

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

@sjvega0

Description

@sjvega0

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions