-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlang_expert_system.pl
107 lines (67 loc) · 3.13 KB
/
lang_expert_system.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
notice:-
write('Explore about which language you should learn'),nl.
%hypothesises
find(Lang,hTML):-
prop(Lang," to be used in website"),
prop(Lang, "is to be used front end development").
find(Lang,mysql):-
prop(Lang," to be used for database purpose").
find(Lang,asp_net):-
prop(Lang,"to be used in website"),
prop(Lang," is to be used back end development").
prop(Lang," is to be backed by microsoft").
find(Lang,pHP):-
prop(Lang,"to be used in website"),
prop(Lang," is to be used back end development").
find(Lang,c):-
prop(Lang, "is used for conventional programming"),
prop(Lang," close to machine level"),
prop(Lang, "provide ease of learning").
find(Lang,android):-
prop(Lang, " to be used in app development"),
prop(Lang, " to be used on android phones").
find(Lang,c_sahrp):-
prop(Lang, " to be used in app development"),
prop(Lang, " to be used on windows phones").
find(Lang,swift):-
prop(Lang, " to be used in app development"),
prop(Lang, " to be used on apple devices").
find(Lang,cpp):-
prop(Lang,"is used for conventional programming"),
prop(Lang, "should support OOP"),
prop(Lang,"provide ease of learning").
find(Lang,python):-
prop(Lang," provide ease of learning"),
prop(Lang, "shuld be good for small project"),
prop(Lang," can be used as scripting language"),
prop(Lang, "should have rich library").
find(Lang,pHP):-
prop(Lang,"to be used in website"),
prop(Lang," is to be used back end development").
find(Lang,java):-
prop(Lang," support OOPS"),
prop(Lang, "learn but tough to lean"),
prop(Lang," good for big project").
find(Lang,mATLAB):-
prop(Lang, "is good for Graphical editing"),
prop(Lang, "support OOPS"),
prop(Lang,"mathematical manipulation").
find(Lang,javascript):-
prop(Lang,"is best language when it comes to popularity"),
prop(Lang, "provide ease of learning"),
prop(Lang," is a scripting language").
find(Lang,lISP):-
prop(Lang," is a functional programming"),
prop(Lang," provide ease of learning").
/*Ask rules*/
prop(P, Val):-ask('Does the Lang ',Val).
ask(Obj, Val):-known(Obj, Val, true),!.
ask(Obj, Val):-known(Obj, Val, false),!, fail.
ask(Obj, Val):-nl,write(Obj),write(' '),
write( Val) , write('?(y/n)'), read(Ans), !,
((Ans=y, assert(known(Obj, Val, true)));(assert(known(Obj, Val, false)),fail)).
diagnose:-nl,write('Finding proper language..........'),nl,find(prop,Find) ,!,nl,
write('That lang find could be '), write(Find).
diagnose:- nl, write('Sorry, couldn’t find!!').
start:-notice,repeat, abolish(known/3),dynamic(known/3), retractall(known/3), diagnose,nl,nl, write('Try again ? (y/n)'),read(Resp),\+ Resp=y,
nl,write('Bye ! Thanks for using this system'),abolish(known,3) .