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

Change ClassicSolverFactory runtime libraries and :gui Application issue #499

Open
fmuratori opened this issue May 15, 2023 · 0 comments
Open

Comments

@fmuratori
Copy link

Platform:
This behaviour appears on a Kotlin/JS application.

How to reproduce the bug:
Here's the demo code for reproducing the bug:

// create a new SolverFactory with additional library IOLib
private val customSolverFactory: SolverFactory = ClassicSolverFactory
    .newBuilder()
    .withLibrary(IOLib) // open issue
    .toFactory()

// add new custom factory to :gui controller
var application: Application =
    TuPrologApplication.of(
        DefaultJsRunner(),
        customSolverFactory,
        Page.DEFAULT_TIMEOUT
    )

// create a new page (should use the custom factory)
application.newPage()

// handle page creation 
application.onPageCreated.bind { it:Event<Page> ->
  // problem here
  // page.solverBuilder doesn't have IOLib as a runtime library
}

Expected behaviour:
The solverBuilder of a newly created Page instance should also use IOLib as a runtime library

Workaround:
Add the library to the Page.solverBuilder instance as soon as the page is created

application.onPageCreated.bind { it:Event<Page> ->
  it.event.solverBuilder.withLibrary(IOLib)
}
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