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
4
votes
3 answers

i am using ancient turbo prolog . and continously facing error in following code :- mis-spelling or not declared predicate

domains A,B,C = symbol N,P = integer predicates tower(integer,symbol,symbol,symbol,integer) go clauses go :- clearwindow, write("enter value of N (For Transfering from A To B)"), readint(N), …
scholar
  • 41
  • 2
3
votes
1 answer

Turbo Prolog's 'save' analogue in SWI-Prolog

Is there any SWI's analogue for Turbo's save function, which saves into a file facts, previously loaded via consult and then appended via assert?
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
3
votes
2 answers

Explanation of a Prolog algorithm to append two lists together

This is an algorithm to append together two lists: Domains list= integer* Predicates nondeterm append(list, list, list) Clauses append([], List, List) :- !. append([H|L1], List2, [H|L3]) :- append(L1, List2, L3). Goal append([9,2,3,4],…
2
votes
2 answers

Problem in appending nested list in turbo prolog

I'm new in turbo prolog.I'm facing a problem in appending nested list. I want the goal like this- Goal: mega_append([[1,3],[2,4,6],[0]],X) Output should be X=[1,3,2,4,6,0] I used the following codes: domains list=integer* predicates …
Joyita
  • 21
  • 2
2
votes
1 answer

Turbo Prolog execution order

I'm trying to understand why am I getting the result that I am. Lets say that this is the code and result: Sorry if this is trivial, but there isn't too many sources online about this... If the output of d(3) makes sense to me, then e(3) doesn't at…
meta
  • 153
  • 12
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

Prolog replace element in a list with another list

*Hi, i am trying to replace an element from a list with another list and im stuck when turbo prolog gives me syntax error at the case where if C=A-> put in result list(L1) the list that replace the element. domains list=integer* …
2
votes
1 answer

How to correct predicate on Prolog?

I have the following prolog code: predicates like(string) clauses like(apple). like(girl). q :- like(A),write(A). goal q. How to get two solutions?
BILL
  • 4,711
  • 10
  • 57
  • 96
1
vote
2 answers

Want to print the path,but getting errors

domains list=symbol* predicates path(symbol,symbol) solve(symbol,symbol,list) insert(symbol,list,list) clauses path(a,b). path(b,c). path(c,d). path(d,e). path(a,d). path(c,e). solve(X, Z, P):- …
Zohaib
  • 363
  • 2
  • 4
  • 15
1
vote
2 answers

what is the syntax for char* in prolog

I want to know the syntax for char* in prolog which i want to use for a list of a characters. I have used list=integer* for a list of integers but i dont know sysntax for characters list in prolog.
Zohaib
  • 363
  • 2
  • 4
  • 15
1
vote
1 answer

what does <> mean in prolog?

example: PREDICATES nondeterm likes (symbol,symbol) CLAUSES likes (ali,football). likes (ali,tenis). likes (ahmad,tenis). likes (ahmad,handball). likes (samir,handball). likes (samir,swimming). likes (khaled,horseriding). GOAL % likes (Person,…
StreamsGit
  • 91
  • 1
  • 7
1
vote
2 answers

Circular buffer in Turbo Prolog 2.0

I need to write something like circular buffer in TurboProlog 2.0 for calculating average. I don't know what predicates i need to write, and have no idea how link them together.
Navin
  • 48
  • 4
1
vote
1 answer

How to use if then else condition in DOSBOX TurboProlog

Below is the given program to print if a list is palindrome or not but I am not able to use condition L1=L & L1<>L for printing "List is Palindrome!" & "List is not palindrome", By the way I almost tried every way available online for doing it but…
1
vote
1 answer

variable is only used once

I am using ancient Turbo Prolog since it is included in our curriculum. Why is this program not working? domains disease, indication = symbol Patient = string Fe,Ra,He,Ch,Vo,Ru = char predicates hypothesis(Patient,disease) …
TCM
  • 16,780
  • 43
  • 156
  • 254
1
2 3