Questions tagged [logtalk]

Logtalk is an object-oriented logic programming language based on Prolog

Logtalk is an object-oriented logic programming languages based on Prolog.

27 questions
1
vote
1 answer

Save object to file in Logtalk

I've written a prolog project and now I have to change it to Logtalk file. In the code I can assert new facts to another prolog file with the code: :- dynamic(student/5). :- use_module(library(persistency)). :- persistent(student(id, name, surname,…
1
vote
1 answer

Integer as object_identifier in Logtalk

I have a protocol students: :- protocol(student). :- public([ name/1, surname/1, studies/1, marks/1 ]). :- end_protocol. Now I want to make an object which name is an ID (Integer), but when I'm trying to do…
1
vote
1 answer

Object name as variable in Logtalk

Is this possible to get the name of an object as a variable? I’m trying to make a database where each object represents each person. I’ve got objects with [name/1, surname/1], but when I ask e.g. X::name(john). it gives me an error. Ofc there is…
1
vote
1 answer

Logtalk : Load a file with camelcase naming on Windows

With logtalk 3.1.2, under OS X and Linux, no problem to load a file with a camelcase name, but an exception is thrown on Windows (ERROR : file does not exist). logtalk_load(mypath(myFileNameInCameCase)) What's wrong ?
Koryonik
  • 2,728
  • 3
  • 22
  • 27
1
vote
1 answer

Failed to load a library with logtalk_load using logtalk 3.0.0.1

I use SWI Prolog as a backed compiler(v 6.6.1). After installing logtalk 3.0.0.1 I started getting error when logtalk_load(library(types_loader), [source_data(on), report(on)]). % [ c:/users/dizqj373/documents/logtalk/library/termp.lgt loaded ] ! …
knopka
  • 11
  • 1
1
vote
2 answers

Prolog SWI : Logtalk, How do I load my own project files?

so this week consisted of me installing Logtalk, one of the extensions for Prolog. In this case I'm using Prolog SWI, and I've run into a little snag. I'm not sure how to actually consult my own projects using Logtalk. I have taken a look at the…
1
vote
1 answer

Logtalk - logtalk_load fails

I'm using swi prolog, and just installed logtalk. When I call logtalk_load with some of the example projects, it always returns false. % library(win_menu) compiled into win_menu 0.00 sec, 29 clauses % C:\Logtalk/configs/swi.pl compiled 0.02 sec,…
キキジキ
  • 1,443
  • 1
  • 25
  • 44
0
votes
1 answer

Logtalk test returning failed when it passes under SWI interpreter

I am having an issue in which a specific test returns false when I put it in a test suite and pass it through logtalk, but returns true (which is the desired behavior) when I run it through an interpreter using the same backend compiler…
0
votes
1 answer

Using Logtalk Timeout function for Testing SWI Prolog Files

This is follow up post associated with Using a Bash Script To Automate Testing of A Prolog File Now that I have testing effectively implemented, I wish to add timeout values to the tests, so that if a particular case takes too long, the program can…
0
votes
3 answers

Defining a rule that the user cannot query

How do I define a rule that the user cannot query? I only want the program itself to call this rule through another rule. Ex: rule1():- rule2(). rule2():- 1<5. ?-rule1(). true ?-rule2(). (I don't know what the answer will be, I just want this query…
Andre Viau
  • 275
  • 2
  • 5
  • 17
0
votes
1 answer

Use "univ" Prolog predicate with a Logtalk object method as parameter

How to use the 'Univ' ( =../2 ) prolog predicate with a Logtalk object method as parameter ? Consider this code : baz(foo(X)) :- write(predicate), write(X), nl. run :- Term =.. [baz, foo(testfoo)], write(Term), nl, Term,nl, …
Koryonik
  • 2,728
  • 3
  • 22
  • 27
-1
votes
1 answer

Check if object already exists?

i have : :- use_module(library(logtalk)). :- {buffer}. :- initialization(main). main :- create_object(env,[instantiates(buffer)],[],[]), it works but every time I re-consult the file it barks an error because the object already exists. Is…
sten
  • 7,028
  • 9
  • 41
  • 63
1
2