0% found this document useful (0 votes)
0 views9 pages

Pract1 ExpertSystem AI

The document outlines the development of an Expert System using Rule-Based Systems aimed at facilitating simple decision-making. It covers key concepts such as knowledge representation through IF-THEN rules, the roles of team members involved in the development, and the structure of a rule-based expert system. Additionally, it provides an example implementation for a decision-making scenario regarding carrying an umbrella.

Uploaded by

yashhrajput007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
0 views9 pages

Pract1 ExpertSystem AI

The document outlines the development of an Expert System using Rule-Based Systems aimed at facilitating simple decision-making. It covers key concepts such as knowledge representation through IF-THEN rules, the roles of team members involved in the development, and the structure of a rule-based expert system. Additionally, it provides an example implementation for a decision-making scenario regarding carrying an umbrella.

Uploaded by

yashhrajput007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 9
Practical No. 1 Title: Expert System Using Rule-Based Systems in Al Problem Statement: Building an Expert System Using Rule-Based Systems ~ Objective: Develop an Expert System that provides simple decision-making Aim: Building an Expert System Using Rule-Based Systems Objective: Develop an Expert System that provides simple decision-making. Prerequisites: Python/Java/LISP/Prolog/OPS Programming. Learning Objectives: > To understand the concept of expert systems and Rule-Based Systems > To implement an expert system for simple decision-making, Outcomes: Understanding Expert System and Rule-Based Systems. Understanding Use of Expert System in Al. Understanding Decision-Making Process. Understand and Implement the Expert System concept for simple decision-making. <4 < Theory: What is knowledge? Knowledge is a theoretical or practical understanding of subject or a domain. It is also the sim of what is currently known, and apparently knowledge is power. Experts ‘Those who possess knowledge are called experts. Anyone can be considered a domain expert if he or she has deep knowledge and strong practical experience in a particular domain. The human mental process is internal, and it is too complex to be represented as an algorithm, However, most experts are capable of expressing their knowledge in the form of rules for problem solving. Example: IF the ‘traffic light’ is ‘green’ THEN the action is go IF the ‘traffic light’ is ‘red’ THEN the action is stop Rules as a Knowledge Representation Technique The term rule in Al, which is the most commonly used type of knowledge representation, can be defined as an IF-THEN structure that relates given information or facts in the IF part to some action in the THEN part. A rule provides some description of how to solve a problem. Rule are relatively easy to create and understand, Any rules consists of two parts: the IF part, called the antecedent (premise or condition) and the THEN part called the consequent (conclusion or action) IF THEN — rule can have multiple antecedents joined by the keywords AND (conjunction), OR (disjunction) or a combination of both, IF IF AND — OR antecedent 2> AND OR THEN THEN — The antecedent of a rule incorporates two parts: an Object (linguistic object) and its value. The object And its value are linked by an operator. The operator identifies the object and assigns the Value. Operators such as is, are, is not, are not are used to assign a symbolic value to a linguistic object. Expert systems can also used mathematical operators to define an object as numerical and assign it to the numerical value IF ‘age of the customer’ < 18 AND ‘cash withdrawal’ > 1000 THEN ‘signature of the parent’ is required Rules can represent: «Relation: IF the ‘fuel tank’ is empty THEN the ear is dead « Recommendation: IF the season is autumn AND the sky is cloudy AND the forecast is drizzle THEN the advice is ‘take an umbrella” © Directive: IF the car is dead AND the ‘fuel tank’ is empty THEN the action is “refuel the car” «Strategy: IF the car is dead THEN the action is ‘check the fuel tank’; step! complete i IF step! is complete AND the ‘fuel tank’ is full THEN the action is ‘check the battery’; step? is Complete «Heuristic: IF the spills liquid AND the ‘spill pH’< 6 AND the ‘spill smell’ is vinegar THEN the ‘spill material” is ‘acetic acid’ The main players in the development team There are five members of the expert system development team Domain expert Knowledge engineer Programmer Project manager End-user Expert System Development Team + Domain Expert: d le of solving problems in a specific area or i : sdgeable and skilled person capabl sae one is to be captured in the expert system. The person could be more than one dorian peer to an expert system. The expert must be able to communicate his or her knowledge, oe a ie expert system development and commit a substantial amount of time to the a ate et arene person in the expert system development team. project is + Knowledge Engineer: Fane is capable of designing, building and testing an expert system Kno wledae EDEInee ie cee cee so tied on ten particular problem is solved. Kira le Le deseoret eeaiiatrencerineieltodelReexoei aes to hae fee and rules and no lea Bee eae int Netexnettay ste Know ede Engineer chose core development oe Ce SES vrei shell, oF look at programming languages for encoding the knowleds, software or an exp: Knowledge Engineer responsible for testing. revising and integrating the expert system into the workplace. + Programme! edge in Programmer is the person responsible for the actual programming, describing the domain ao ects) oy terms that a computer can understand. Programmer needs to have the skills in symbolic program te such AI language such as Prolog, Programmer should also know conventional programming languaes C, Pascal, FORTRAN and Basic. + Project Manager: ible for keeping the project Project Manager is the leader of the expert system development team, respons met, interacts with the on track. Project Manager makes sure that all deliverables and milestones are n expert, knowledge engineer, Programmer and end-user. + End-user: End-user or user is a person who uses the expert system when it is developed. End-user must not only be confident in the expert system performance but also fee! comfortable using it. Structure of a rule-based expert system Roum miyCorte ay Ieee ory ona i Production Rule REASONING Conclusion Inearly 70s, Newell and Simon from Carnegie-Mellon University proposed a production system model, the foundation ofthe modem rule-based expert systems. The production model is bused on th idea that humans solve problems by applying their knowledge (expressed as production tules) toa fe problem represented by problem-specific information. The production rules are stored in the long-term memory and the problem-specific information or facts in the short-term memory Basic Structure of a rule-based expert system PPLE Fac ¢ Knowledge Base ii Rule: IF-THEN Inference Engine * Knowledge base contains the domain knowledge useful for problem solving, In rule-based expert system, the knowledge is represented asa set of rules. Each rule specifies a selon o recommendation, directive, strategy or heuristic and has the IF (condition) THEN (ac jon) structure. When the condition part of a rule is satisfied, the rule said to ite and the astion parti part is executed, + The database includes a set of facts used to match against the IF (condition) in the knowledge base. Parts of rules stored * The inference engineer carries out the reasoning whereby the expert system reaches a solution. It links. The rules given in the knowledge base with the facts provided in the database. = The explanation facilities enable the user to ask the expert system how a particular conclusion is reached and why a specific fact is needed. The user interface is the means of communication between a user seeking a solution to the problem and an expert system Conflict Resolution Let us consider two simple rules for crossing a road. And let us now add the third rule: Rule 1: IF the ‘traffic light’ is green THEN the action is go Rule IF the ‘traffic light’ is red THEN the action is stop Rule 3: IF the ‘traffic light’ is red THEN the action is go There are two rules, Rule 2 and Rule 3, with the same IF part. Thus both of them can be set to fire when the condition part is satisfied. These rules represent a conflict set. The inference engine must determine which rule to fire from such a set. ‘A method for choosing a rule to fire when more than one rule can be fired in a given cycle is called conflict resolu t resolution Methods used for con! + Fire the rule with the highest priority. In simple applications, the priority can be established by placing the rules in an appropriate order in the knowledge base. Usually this strategy works well for expert systems with around 100 rules. « Fire the most specific rule, This method is also known as the longest matching strategy. It is based On the assumption that a speeifie rule processes more Information than a general one, ‘ t recently entered in the database. Thi i i + Fire the rule that uses the data most E - This method relies on time tags attached to each fact in the database. In the conflict set, the expert system first fires the muletatiece antecedent uses the data most recently added to the database. Implementation in Program Example Use Case: "Should | carry an umbrella?” Step 1: Define Rules Rule 1: IF it is raining THEN carry an umbrella, Rule 2: IF it is cloudy AND you don’t have a jacket THEN carry an umbrella. Rule 3: OTHERWISE, no need to carry an umbrella. Step 2: Knowledge Base rules = [ {"conditions" raining’ umbrella"}, {"conditions": {"raining' "no"}, "decision": "Carry an umbrella i Step 3: Inference Engine (Simple Matching Logi def make_decision(fac for rule in rules if all(facts. rule ["condition: t if _name_ == " main() ama ini Working of the Program: Arrule-based system checks facts against predefined rules, This example helps users decide whether to carry an umbrella. It’s simple, interactive, and easy to extend (e.g., more weather conditions). Sample Output: Is it raining? (yes/no): no Is it cloudy? (yes/no): yes Do you have a jacket? (yesin Decision: Carry an umbrella Conclusion: An Expert System using Rule implemented and developed succe: # Define the rule base rules = [ "conditions": {"raining": "yes"}, "decision": "Carry an umbrella” if { i "conditions": {"raining": "no", "cloudy": "yes", "jacket": "no"}, "decision": "Carry an umbrella” } ] # Inference engine to process the rules def make_decision(facts, rules) for rule in rules: if allacts.get(key) == value for key, value in rule["conditions"}.items()): return rule["decision"] return "No need to carry an umbrella" # User interface for input/output def main() print('Simple Umbrella Decision Expert System") print('- -") # Collect input (facts) from user facts = { "raining": input("Is it raining? (yes/no): ").strip().lower(), input("Is it cloudy? (yes/no): ").strip().lower(), "Jacket input("Do you have a jacket? (yes/no): ").strip().lower() # Get decision based on rules decision = make_decision(facts, rules) # Output the decision print(f'\nDecision: {decision}") # Run the program if__name_ main()

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy