24Freelance永不休眠的自由职业市场
关闭

Transfer from Turbo Prologa to Visual Prolog

759 浏览 0 回复#4940
项目状态
Closed
预算可协商
格式一次性项目无预付款
付款现金, 银行转账
接受的回复完成直到 23.02.2017
回复0类别平均: 0,3
视图759在14天内 33

项目描述

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'
软件开发 现金, 银行转账
24
二十 · 提示

如何写出被选中的回复

  • 以客户的任务开头,而不是讲述自己的故事。
  • 链接一到两个来自您作品集的类似作品。
  • 给出一个价格和截止日期——以及它们具体包括什么。
  • 问一个澄清问题:这可以开始对话。

回复 0

回复文本仅对客户可见。

同类类别

类似项目

该类别中的所有项目
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.

软件开发24.09.20260182
0回复
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.

软件开发24.09.20260180
0回复
值得注意
我该如何回应这个项目?

以自由职业者身份登录,描述您将如何解决任务,命名您的价格和截止日期。客户会阅读回复并与最佳的进行对话。

谁能看到我的回复?

只有发布项目的客户和您自己。其他自由职业者无法看到您的文本或价格。

我在哪里可以找到类似的工作?

在“软件开发”中每天都有新项目出现。 该类别中的所有项目

FOR CLIENTS · SAFE DEAL ESCROW

Need a similar project? Post your task for free in 30 seconds

Get competitive bids from verified freelancers and release payment only when you approve the work via Safe Deal.

Post a Task for Free →How Safe Deal Works
FOR FREELANCERS · PAYORA 1-CLICK

Pin your profile to the TOP of the category for $5 / week

Boost your profile and portfolio to #1 in the directory (1-click crypto & fiat checkout via Payora) to get 5× more direct orders.

Pin Profile to TOP ($5/wk)Top Up via Payora