Questions tagged [tau-prolog]

Tau-Prolog is a JavaScript based Prolog system that runs within a browser's page.

Tau-Prolog is a JavaScript based Prolog system that runs within a browser's page.

For more details, see the official website.

21 questions
4
votes
1 answer

How to permanently save changes of dynamic predicates to .pl file? (Tau-Prolog)

Question - Asserted dynamic predicates don't save permanently, after creating new session they're missing. How to save them permanently? I'm using Tau Prolog: A Prolog interpreter in JavaScript. I'm loading prolog code from in html file because I…
intersect
  • 74
  • 8
3
votes
1 answer

Using await and async to make load an parse Tau-Prolog before anything else

my task is to load and parse Tau-Prolog code in the Browser before anything else will be executed. I tried this approach (webProlog.pl contains Tau-Prolog code): var session = pl.create(1000); async function init_prolog() { // load tau …
3
votes
1 answer

Tau-Prolog results visible in browser window

I'm fairly new to Tau-Prolog and Javascript. At the beginning I would like to show some results computed by the Tau-Prolog engine in a Browser. So far, all I want to show is some information contained in my Prolog-database: All robots in the…
DanielR
  • 55
  • 5
2
votes
0 answers

Loading tau-prolog.js-packages in runtime?

I am making an online-IDE for Prolog, using tau-prolog, and I need to be able to import external tau-prolog module-packages in js-form, so I can use the predicates in already defined modules. I'm having a bit of trouble with this, and I am getting…
2
votes
1 answer

Tau-Prolog Interpreter shows different behaviour than SWI-Prolog

I'm currently trying to implement some basic Prolog queries in Tau-Prolog. Although I have working queries in SWI-Prolog, I can't implement them to work in Tau-Prolog. I would like to return the name of all Robots that are in the database and have…
DanielR
  • 55
  • 5
1
vote
0 answers

Tesponse data must not be correct Tau-prolog.js

CODE PL I am using the prolog interpreter in javascript tau-prolog I see that there are not many references and clear examples of use. The problem is that it shows the response in an unexpected format :- use_module(library(lists)). % Hechos:…
Antrax Sec
  • 21
  • 1
1
vote
0 answers

How can I fix the error "tau_file_system is not defined" in tau-prolog?

I wanted to execute swi prolog code in a react/typescript component, where I got the error "tau_file_system is not defined". My code looks like this (the code is from the tau-prolog github page): import { Button } from "@mui/material"; import pl…
Relluuuu
  • 11
  • 3
1
vote
0 answers

How to escape a doublequote-sign inside a (tau) prolog string?

I guess there must be an easy answer to this, but I just haven't been able to find it - I want to include double-quote signs inside tau-prolog strings.. how to do it? When I try entering it into the Tau-Prolog sandbox…
1
vote
0 answers

How to query the amount of calculations for a successful query that didn't reach the limit

I use Tau-Prolog to calculate some stuff, I set the limit to 100 to test things out. I sometimes hit the limit, then I raise the limit. I was wondering, this limit measures the performance of the program, so is there a way to query the amount of…
eguneys
  • 6,028
  • 7
  • 31
  • 63
1
vote
1 answer

tau-prolog won't run a prolog code that I use CHR library in although it works on SWI-Prolog

I'm trying to use Tau Prolog to run a CHR code and it gives this error: throw(error(existence_error(procedure, '/'(color, 1)), '/'(top_level, 0))) although it works fine on SWI Prolog. This is the Prolog code: :- use_module(library(chr)). :-…
1
vote
0 answers

cannot output accumilated list of tau prolog answers

I am using the Tau Prolog library in my project and it has been working fine till I tried this. I am attempting to output multiple schedules and their corresponding extra hours (the context is not relevent here). Here is the output in the console…
Nadeen Amr
  • 11
  • 2
1
vote
1 answer

Using Tau-Prolog with React

I am trying to use Tau-Prolog with Node.js and React. At the step: session.consult(program); I get this error message: TypeError: fs.existsSync is not a function Here is the code to reproduce on the problem: index.js import React from…
yves
  • 11
  • 2
1
vote
1 answer

Using Tau-Prolog with Node.js

After downloading Tau-Prolog, I tried to run this example, but I was abruptly stopped: $ nodejs ./sample.js bread /home/stefan/Desktop/tau-prolog/tau-prolog.js:6117 pl.type.is_dom_object = function( obj ) { ^ TypeError: Cannot read…
repeat
  • 18,496
  • 4
  • 54
  • 166
0
votes
1 answer

Tau prolog cannot access value

If you ever worked with tau prolog and you're confused as to why, when you use answer.lookup("Id").id, it works but, for other values, it returns false.
0
votes
0 answers

I have issue with response by Tau-Prolog

I have a connect4 game implementation on the prolog. The get_next_board/2 predicate works fine in the prolog console. But when I want to get the result using the session, it just waits for a long time for a response that never comes. session.consult…
Liza
  • 33
  • 6
1
2