Questions tagged [turbo-prolog]

Turbo Prolog is a very fast old Prolog system that only works with MS-DOS. It does not comply with the Edinborough Standard.

41 questions
0
votes
0 answers

PROGRAM ERROR 1040

I have this code DOMAINS s = symbol. sList = symbol*. PREDICATES nondeterm link(s, s,integer). nondeterm depth_first_search(s, s, sList,integer). CLAUSES link("Erbil","Koysinjaq",12). link("Erbil","Kirkuk",15). …
rabar kareem
  • 630
  • 9
  • 28
0
votes
1 answer

String parsing [Turbo Prolog]

Have a list of users. Need to enter a character and find all users whose name starts with this character. !!! The following tasks embedded predicates conversion symbols and lines are not used.
HSB
  • 1
0
votes
1 answer

clauses for the same predicate should be grouped

Here I want to make a prolog implementation that will generate the list of permutations of n,n+1,...2*n-1, having the absolute difference between 2 consecutive values <=2. Ex: for n=4 the list on which I make the permutations would be [4,5,6,7] , a…
user3043278
  • 174
  • 1
  • 3
  • 15
0
votes
1 answer

Difference between 2 consecutive elements in Prolog

So my problem sounds like this: Given a list of integer numbers, generate the list of permutations with the property that the absolute value of the difference between 2 consecutive values from the permutation is <=3. For example : L=[2,7,5] ==>…
user3043278
  • 174
  • 1
  • 3
  • 15
0
votes
2 answers

Prolog - removing elements from sublists

Problem statement: You're given a list containing integers and lists of integers. You must remove from each sublist, the 1st, 2n, 4th, 8th.. etc, element. My solution domains list=integer* elem=i(integer);l(list) …
rares.urdea
  • 650
  • 3
  • 16
  • 26
0
votes
0 answers

Divided number in prolog

How can using dividing between two numbers by using subtraction instead of (/). This is my code to calculate mod by using subtraction: predicates div(integer,integer,integer) clauses div(X,Y,Z):-X>Y,X1=X-1,div(X1,Y,Z),!. …
eleen
  • 191
  • 1
  • 4
  • 11
0
votes
1 answer

Prolog program with lists and sublists

Hi I have to solve a problem in Prolog, that sounds like this: deletes all the sublists of a list that are increasing. For example the list [1,[2],[3,4],6] becomes [1,6]. So far I have tried this but it's not working. Any help please ? domains …
jojuk
  • 127
  • 1
  • 3
  • 14
0
votes
2 answers

Prolog program with lists

I have to solve as a homework the following problem in turbo prolog: "Determine the product of a number represented as digits in a list to a given digit. E.g.: [1 9 3 5 9 9] * 2 --> [3 8 7 1 9 8] " . My line of thinking into solving this problem…
0
votes
1 answer

Error in PROLOG program

In the code below, i'm getting error in sister function that "Illegal character" in ** Blockquote Person \= P1** (\= is for not equal to) Blockquote DOMAINS Person = SYMBOL PREDICATES parent(Person,Person) female(Person) …
0
votes
1 answer

Newbie: Unable to trace Free variable in expression error. Prolog Programming

Just started programming in Prolog. I wrote a couple of…
Naved Alam
  • 827
  • 9
  • 25
0
votes
1 answer

Understanding a prolog predicate

I'm having some troubles in understanding the following prolog predicate , I can understand that it concatenate some chars , also produces the possible lists (first & second goal ) , but I can't understand how it do this ? how it executes …
xsari3x
  • 442
  • 2
  • 12
  • 36
1 2
3