I am trying to use jpl to load the same swipl file into different modules. The reason I had to do this is because I want to have a module that I can assert new predicates to, while leave the other untouched. Problem is swipl seems forbidding this,
jpl.PrologException: PrologException: error(permission_error(load, source, 'load.pro'), context(/(load_files, 2), 'Non-module file already loaded into module stable; trying to load into to_mess'))
at jpl.Query.get1(Query.java:336)
at jpl.Query.hasMoreSolutions(Query.java:258)
at jpl.Query.oneSolution(Query.java:688)
at jpl.Query.hasSolution(Query.java:759)
I have tried to set redefine_module(true) for load_files, but still no go
val query = new Query(s"load_files(${m}:'${loader}', [redefine_module(true)])")
query.allSolutions()
I have been blocked by this for hours, but cannot find a solution online. Can anybody please help??