Visual Prolog is a strongly-typed object-oriented extension of Prolog. Previous releases of Visual Prolog were known as Turbo Prolog (by Borland) and PDC Prolog. An interesting feature of the Visual Prolog is an ability to create applications with Microsoft Windows GUI. Recent versions introduced anonymous predicates and generics.
Questions tagged [visual-prolog]
64 questions
33
votes
2 answers
"Not equal" sign in Visual Prolog?
I can't find any documentation on "not equal" sign in Visual Prolog. Please provide the right solution of this problem:
class predicates
sister : (string Person, string Sister) nondeterm(o,o).
clauses
sister(Person, Sister) :-
…

Egor
- 39,695
- 10
- 113
- 130
6
votes
3 answers
Prolog type definition in swi-prolog
in visual prolog there is "domains" section in a prolog program in which you can define types. Is there any similar thing in swi-prolog?
In visual prolog a type is defined like:
domains
NewType = thing1; thing2

whoi
- 3,281
- 7
- 36
- 44
4
votes
1 answer
Prolog type is incompatible
Visual Prolog 8 throws error c504 : The expression has type '() -> ::char procedure', which is incompatible with the type '::char'.
main.pro
implement main
open core, console
class predicates
цикл : ().
print : ().
clauses
…

Maxim Dubovoi
- 53
- 6
3
votes
1 answer
Get extract value from fact
Im pretty new to prolog, and got stuck.
I need to store a variable with some string during calculations, I decided to do this by adding a "single fact" to the class I'm working with. Everything works well, the string is being stored, but when I try…

Nikita Vasin
- 125
- 1
- 11
3
votes
1 answer
Prolog: Count positive elems in list
i want to count positive elements in list (VIsual Prolog). So i wrote this function:
positiveCount([], C).
positiveCount([A], C) :- A > 0, C = C + 1.
positiveCount([H|T], C) :- H > 0,!,C = C+1,positiveCount(T,C); positiveCount(T,C).
Error:
The flow…

Src
- 5,252
- 5
- 28
- 56
3
votes
2 answers
Prolog list of atoms
How to convert this
fact( [a,b,c], [d,e,f], ..., [p, q, r] )
to a list of these elements?
Result:
[[a,b,c], [d,e,f], ..., [p, q, r]]

balping
- 7,518
- 3
- 21
- 35
3
votes
4 answers
Why is neccsary to add \n and \r when sending input to a running process?
I am trying to add a Java from to a Visual Prolog generated executable by running it as a process.
I have used this answer to implement the process interaction. My Visual Prolog expects a number from the command line, it even validates it (whether…

Kookoriko
- 322
- 1
- 3
- 11
3
votes
2 answers
turbo prolog on ubuntu
i am a complete noob to Prolog. I wish to install turbo prolog in ubuntu. How do i do that. I googled it but all in vain. Is there any other option to turbo prolog for ubuntu?

z22
- 10,013
- 17
- 70
- 126
2
votes
0 answers
Which Prolog implementation uses this syntax?
I have to study Prolog for the AI course at school. My teacher uses Visual Prolog which is only available on Windows. I use MacOS so I downloaded SWI-Prolog thinking it's similar. However, I noticed that the syntax is not the same. For example: the…
user11604836
2
votes
0 answers
Visual Prolog 5: unbound variables
Code as follows:
DOMAINS
name = valentin; leonid; valery; andrew; michael
faculty = physics; history; biology; geography
instrument = sax; piano; bass; drums
student = student(name, instrument, faculty)
PREDICATES
nondeterm student(name,…

Mothy
- 23
- 4
2
votes
1 answer
Prolog. Break integer in the amount of natural terms
My task is: Find the number of partitions of a positive integer in the amount of natural terms.
For example: N=5. Answer is 7, because 5: {1,1,1,1,1}, {2,1,1,1}, {2,2,1}, {3,1,1}, {3,2}, {4,1}, {5}
I wrote a solution on JS:
function pcount(number,…

HelterShelter
- 171
- 2
- 11
2
votes
5 answers
Sum of the first n numbers in prolog
Hello can anyone help me compute the sum of the first n numbers. For example n=4 => sum = 10.
So far I've wrote this
predicates
sum(integer,integer)
clauses
sum(0,0).
sum(N,R):-
N1=N-1,
sum(N1,R1),
R=R1+N.
This…

user3043278
- 174
- 1
- 3
- 15
2
votes
1 answer
separate number into digit into prolog
I want to separate number into list digits using prolog
like :
if number is "345"
separate to [3, 4, 5]
How can i do that ?
stringTokenizer("", []) :- !.
stringTokenizer(Sen, [H|T]) :-
frontToken(Sen, Token, Remd), H = Token,…

Mahmoud Emam
- 1,499
- 4
- 20
- 37
1
vote
1 answer
Prolog - ODBC interface
I have a requirement like inserting a large data from visual prolog end to the oracle database and also most importantly all the data needs to be injected through a single stored procedure call. I have tried them passing the data as string values,…

Cling
- 489
- 1
- 6
- 15
1
vote
1 answer
reading terms in Prolog
I have to do a small program to work with sets like A = {3,5,1,8}. A set like this can be made by the facts:
set(a,3)
set(a,5)
set(a,1)
set(a,8)
and I've got these domains and this fact:
domains
name=symbol
element=integer…

llKoull
- 335
- 3
- 14