I try to implement simple expert system in SWI Prolog. This system reads input data from keyboard and finds the language. Here is my code:
/* Paradigms */
paradigm('Ada', 'Imperative').
paradigm('C', 'Imperative').
/* Typization */
typization('Ada', 'Statical').
typization('C', 'Explicit').
/* Compiler */
compiler('Ada', 'OpenSource').
compiler('C', 'DebugPosibility').
/* Memory */
memory('Ada', 'Stack').
memory('C', 'Pointer').
language(L, P, T, C, M) :- paradigm(L, P), typization(L, T), compiler(L, C), memory(L, M).
run :- write('\nChoose language paradigm:\n1. imperative\n2. object-oriented\n3. distributed\n4. reflexive\n5. declarative\n6. functional\n7. general programming\n'), read(P),
write('\n\nChoose typization:\n1. statical\n2. explicit\n3. polymorfism\n4. runtime type information\n5. dynamical\n6. implicit\n7. cast without data lose\n8. implicit cast without data lose\n9. argument output at method call\n'), read(T),
write('\n\nChoose compiler type:\n1. open-source\n2. debug posibility\n3. bootstrapping\n4. multithreading compilation\n5. conditional compilation\n6. command line interpreter\n'), read(C),
write('\n\nChoose memory management type:\n1. stack\n2. pointer\n3. manual memory management\n4. garbage collector\n'), read(M),
language(L, P, T, C, M),
write(L).
When I run this program I receive all languages all the time. But in my test case it is supposed to get only one language. Language is acceptable when all four predicates from language return true for the same language L. Where is my mistake and how can I fix it?
Thank you very much!