24FreelanceFreelance marketplace that never sleeps
Closed

Transfer from Turbo Prologa to Visual Prolog

764 views 0 responses#4940
Project status
Closed
BudgetNegotiable
FormatOne-time projectno prepayment
PaymentCash, Bank transfer
Responses acceptedFinisheduntil 23.02.2017
Responses0category average: 0.3
Views7644 in 14 days

Project description

There is an expert car troubleshooting system for the Turbo Prolog. The program asks questions, the person answers, and then we get the program's answer. What a problem is there in the car, according to its signs.
And there's a knowledge base.
The question is, help transfer the program to the Visual Prolog console. I'll pay a coin!

Program code on Turbo Prolog and knowledge base.

[HIGHLIGHT="prolog"]
DOMAINS
I=integer
S=stringing
C=char
Li=i*
Database - knowledge
Cond(i,s)
Rule(s,li)
DATABASE - dialog
Cond_is(i,c)
PREDICATES
Start starting.
Cars
Check(li)
Test_cond(i)
Update
Add_cond(li)
Print_cond(i,li,li)
Read_cond(c,li,li)
Ex_cond(i,li,li,i)
Wr_cond(c,i,li,li)
New_cond(i,li,li)
Read_true_char(c)
Test(c,c)
Clauses
Start:
consult("exp.DDB",knowledge),
nl,nl,nl,nl,write("*** Help cars ****"),nl,
write("Pomochnik obnaryzgenia nepoladki"),nl.
write("Ovetite na voprosi, a ya ykazgy ploblemy"),nl,
cars
retractall(_,dialog),
retractall(_,knowledge)
nl,nl,write (Mogy snova vam pomoch? (1 - da, 2 - net)",
read_true_char(C),
C='1',!, start.
Start:
nl,nl,write("****************** Vsego dobrogo!) Do novih vstrech",
readchar(_).
Cars:-
rule(X,L),
check(L),
nl,nl,write("********************* Expert sistema Help Cars"),nl,
write("* Opredelila nepoladku:",X),nl.
write("ya prav? (1 - da, 2 - net)",
read_true_char(C), C='1'!
Cars:-
nl,nl,write("************************ Ya ne znayu, chto eto za polomka"),nl,
nl,write("Davaite dobavim ee' v bazu znani"),nl,
update.
Update:-
nl,write("Vvedie nepoladky:"),
readln(S),
add_cond(L),
assert(rule(S,L),knowledge),
save("exp.ddb",knowledge).
Add_cond(L):-
cond_is(_,'1'),!
nl,nl,write("*************************** O nepoladki izvestni, prichina:"),
print_cond(1,[],L1),
nl,write("Izvestno li o nem esho chto-nibud?? (1 - da, 2 - net)",
read_true_char(C),
read_cond(C,L1,L).
Add_cond(L):-
read_cond('1',[],L).
Print_cond(H,L,L):-
not(cond(H,_),!
Print_cond(H,L,L1):-
cond_is(H,'1'),!
cond(H,T),
H1=H+1,
nl,write(T),
print_cond(H1,[H|L],L1).
Print_cond(H,L,L1):-
H1=H+1,
print_cond(H1,L,L1).
Read_cond('1',L,L2):-
ex_cond(1,L,L1,N),
new_cond(N,L1,L2)!
Read_cond(_,L,L):-!
Ex_cond(N,L,L,N):
not(cond(N,_),!
Ex_cond(N,L,L1,N2):-
cond_is(N,_),!
N1 = N+1,
ex_cond(N1,L,L1,N2).
Ex_cond(N,L,L1,N2):-
cond(N,S),
nl,write("Y nee",S"?? (1 - da, 2 - net)",
read_true_char(A),
wr_cond(A,N,L,L2),
N1 = N+1,
ex_cond(N1,L2,L1,N2).
Wr_cond('1',N,L,[N|L]):-!
Wr_cond('2',_,L,L):-!
New_cond(N,L,L1):-
nl,write("Est' esho prichini? (1 - da, 2 - net)",
read_true_char(A),
A='1'!,
nl,write("Ukaghite new svoistvo, polomki"),nl,
nl,write("New otlichintelinoe cvoistvo nepoladki '"), readln(S),
assertz(cond(N,S),
N1 = N+1,
new_cond(N1,[N|L],L1).
New_cond(_,L,L).
Check([H|T]):-
test_cond(H),
check(T).
Check([]).
Test_cond(H):-
cond_is(H,'1'),!
Test_cond(H):-
cond_is(H,'2'),!
fail.
test_cond(H):-
cond(H,S),
nl,nl,write("Y vas",S"??? (1 - da, 2 - net)",
read_true_char(A),
assert(cond_is(H,A),
test_cond(H).
Read_true_char(C):-
readchar(C1),
test(C1,C).
Test(C,C):-
'1'
Software development Cash, Bank transfer

SafeDeal Escrow Protection

Payora SafeDeal Astrina Shield Verified

Funds are locked in Payora USDT (TRC-20) escrow and released to the freelancer only after delivery approval.

24
Twenty · tip

How to write a response that gets picked

  • Open with the client’s task, not with a story about yourself.
  • Link one or two similar works from your portfolio.
  • Name a price and a deadline — and what exactly they include.
  • Ask one clarifying question: it starts the conversation.

Responses 0

Response texts are visible only to the client.

Same category

Similar projects

All projects in the category
Warehouse inventory app with barcode scanner

Warehouse inventory app with barcode scanner

Looking for a developer to build a mobile warehouse inventory app with barcode scanning, receiving, dispatch, stocktake and reports.

Software development24.09.20260236
0responses
Website accessibility audit against WCAG

Website accessibility audit against WCAG

We need an independent WCAG accessibility audit of our website: keyboard, contrast, screen readers and a clear report with fixes.

Software development24.09.20260236
0responses
Good to know
How do I respond to this project?

Log in as a freelancer, describe how you will solve the task, name your price and deadline. The client reads responses and starts a dialogue with the best ones.

Who can see my response?

Only the client who posted the project and you. Other freelancers do not see your text or price.

Where can I find similar work?

New projects in “Software development” appear every day. All projects in the category

What this page answers