Click here to Skip to main content
15,889,656 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can I solve this exercise?

What I have tried:

Un système expert est un logiciel de l’IA fournissant des résultats mêmes qu’un homme
expert dans son domaine. Un système expert est composé d’une base de connaissance et
un moteur d’inférence. La base de connaissance est constituée d’un ensemble des faits et
un ensemble des règles. Un moteur d’inférence permet de déduire des nouveaux faits à
partir des règles et des faits déjà existaient. Une règle est constituée de son nom, d’une liste
d’hypothèses et d’une liste de conclusions. La liste d’hypothèses et de conclusions sont
des faits. Chaque fait est représenté par son numéro et son contenu.
Questions
1. Proposer une structure de données qui représente les faits et les règles.
2. Ecrire la procédure AjouteFait(……) qui permet d’ajouter un fait à la liste des faits.
3. Ecrire la procédure AjouteRegle(…….) qui permet d’ajouter une règle à la liste des
règles.
4. Ecrire la procédure AficheFait(…) qui affiche la liste des faits.
5. Ecrire la procédure AficheRegle(…) qui affiche la liste des règles.
6. Ecrire une fonction Existe(N :integer) : qui indique si le fait N existe dans la liste des
faits.
7. Ecrire une fonction Applique(….) qui vérifie si la règle pointée s’applique, pour ajouter
les conclusion de cette règle à la liste des faits.
8. Ecrire la procédure ChainageAvant() ; qui à partir de la liste des faits et a liste des
règles ; on ajoute les conclusions des règles vérifiées.
Exemple
À partir des faits initiaux 1, 2, 3, 4, 5, et en appliquant les règles, on peut ajouter pour la règle
A dont l’hypothèse 3 est donnée comme fait initial, le fait conclusion 6. La règle B ne
s’applique pas, seule l’hypothèse 1 est vérifiée. La règle C ne s’applique pas, seule l’hypothèse
5 est vérifiée. La règle D s’applique, car les hypothèses 1 et 2 sont données comme faits
initiaux. Le fait 10 est ajouté à la liste de faits. Il faut refaire un parcours des règles et voir si,
suite à l’adjonction de nouveaux faits, de nouvelles règles ne sont pas vérifiées.


Translation:
An expert system is an AI software providing the same results as a human expert in his field.
expert in his field. An expert system is composed of a knowledge base and
an inference engine. The knowledge base consists of a set of facts and
a set of rules. An inference engine allows to deduce new facts from
from the existing rules and facts. A rule consists of its name, a list of hypotheses and a list of
of hypotheses and a list of conclusions. The list of assumptions and conclusions are
facts. Each fact is represented by its number and its content.
Questions
1. Propose a data structure that represents facts and rules.
2. Write the procedure AddFact(......) that adds a fact to the list of facts.
3. Write the procedure AddRule(.......) which allows to add a rule to the list of
rules.
4. Write the procedure AficheFait(...) which displays the list of facts.
5. Write the procedure AficheRegle(...) which displays the list of rules.
6. Write a function Exist(N :integer) : which indicates if the fact N exists in the list of
facts.
7. Write a function Apply(....) which checks if the pointed rule applies, to add
the conclusions of this rule to the list of facts.
8. Write the procedure ChainageAvant(); that from the list of facts and the list of rules
rules; adds the conclusions of the checked rules.
Example
From the initial facts 1, 2, 3, 4, 5, and by applying the rules, we can add for the rule
A whose hypothesis 3 is given as initial fact, the conclusion fact 6. Rule B does not apply
does not apply, only hypothesis 1 is verified. Rule C does not apply, only hypothesis
5 is verified. Rule D applies, because hypotheses 1 and 2 are given as initial facts.
initial facts. Fact 10 is added to the list of facts. We have to go through the rules again and see if,
following the addition of new facts, new rules are not verified.
Posted
Updated 25-Dec-21 9:52am
v2
Comments
Patrice T 25-Dec-21 17:57pm    
Creating an expert system is not something for absolute beginner.
If you come with nothing, you need to talk with your teacher.

There is an easy solution learn the language and solve the problem. Start with some Learn C++ tutorial.

Tip: use struct and use pointers to give the data structs into the functions.

Good luck with your efforts
 
Share this answer
 
Comments
Assala Maalmi 25-Dec-21 15:14pm    
Can you help me with the answer?
0x01AA 26-Dec-21 9:26am    
In c++: 'Tip: use struct and use pointers to give the data structs into the functions.'
Sure?
Quote:
Can you help me with the answer?
He did already.

While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900