Skip to content

Latest commit

 

History

History
120 lines (75 loc) · 2.13 KB

doc.md

File metadata and controls

120 lines (75 loc) · 2.13 KB

Table of Contents

Elpi

Elpi-api This file provide a small api to communicate with elpi-worker to run lambda-prolog programs in the browser

Parameters

  • loggerCB
  • answerCB
  • path (optional, default "")

start

Starts the Elpi Worker

compile

Sends the query to the worker. The worker will then send successivley all the answers to that query.

Parameters

  • files

queryAll

Sends the query to the worker. The worker will then send successivley all the answers to that query.

Parameters

  • code string The code of the query. It must end by a dot. For example "plus 2 4 Res."

restart

Stop and restart the Elpi Worker

Elpi

The main class, handling the lifecycle of the Elpi Worker.

Parameters

  • loggerCB
  • answerCB
  • path string = "" The path of the directory containing the elpi-worker.js file. Must be "" or a path enfind by "\" like "some/path/". Defaults to "". (optional, default "")
  • The loggerCB callback used when the Worker asks for logging
  • The answerCB callback used when the Worker gives an answer

start

Starts the Elpi Worker

compile

Sends the query to the worker. The worker will then send successivley all the answers to that query.

Parameters

  • files

queryAll

Sends the query to the worker. The worker will then send successivley all the answers to that query.

Parameters

  • code string The code of the query. It must end by a dot. For example "plus 2 4 Res."

restart

Stop and restart the Elpi Worker