Download presentation
Presentation is loading. Please wait.
Published byFranklin Griffin Modified over 9 years ago
1
CS182 Intelligent Machines: Reasoning, Actions and Plans Section 4
2
Reminder -- CSP for course requirements (1) Alby-Bach University (ABU) wants to start a new degree program: B.S in Judgment Day Prevention (JDP). Suppose the degree program is associated with the following courses: 15-211 Fundamental Data Structures and Algorithms 15-212 Principles of Programming 15-381 Artificial Intelligence: Representation and Problem-Solving 15-681 Machine Learning 80-310 Logic and Computation 21-484 Graph Theory 70-122 Accounting 70-311 Organizational Behavior 19-601 Information Warfare
3
CSP for course requirements (2) In order to graduate from the degree program, one must complete the following four requirements: Algorithms Requirement: (15-211 AND 15-212) OR (15- 211 AND 15-381) OR (15-681 AND 21-484) Machine Learning Requirement: 15-381 OR 15-681 OR 80-310 Communications Requirement: 21-484 OR 70-311 OR 70- 122 Information Warfare Requirement: 15-381 OR 19-601
4
CSP for course requirements (3) In addition, the department imposes the following restrictions: Information Aggressiveness Restriction: So that they can’t make their programs TOO smart, students can take only one class from the set 15-381, 15-681, and 19-601. Basic Arithmetic Restriction: Students can’t take both 15-211 and 70-122. Organization Restriction: Students can’t take both 21-484 and 70-311. Finally, courses cannot be used to count towards multiple graduation requirements - so if you use 15-381 to fulfill part of the Algorithms requirement it can’t count towards either the Machine Learning Requirement or the Information Warfare Requirement.
5
Model the problem as CSP (1) What are the variables? – AR_1 – AR_2 – MLR – CR – IWR
6
Model the problem as CSP (2) What are the domains? – AR_1: 15-211, 15-212, 15-381, 15-681, 21-484 – AR_2: 15-211, 15-212, 15-381, 15-681, 21-484 – MLR: 15-381, 15-681, 80-310 – CR: 21-484, 70-122, 70-311 – IWR: 15-381, 19-601
7
Model the problem as CSP (3) What are the constraints? – IAR: 1 of 15-381, 15-681, and 19-601 can be assigned to the 5 variables. – BAR: 1 of 15-211 and 70-122 can be assigned to the 5 variables – OR: 1 of 21-484 and 70-311 can be assigned to the 5 variables – No double counting: if a variable is assigned to one variable it can’t be assigned to another variable – Hidden constraint between AR_1 and AR_2
8
Depth-First Search for CSP AR_1 = 15-211 AR_2 = 15-212 MLR = 15-381MLR = 15-681MLR = 80-310 CR = 21-484CR = 70-122CR = 70-311CR = 21-484CR = 70-122CR = 70-311CR = 21-484 IWR= 15-381 IWR= 19-601 IWR= 15-381 IWR= 19-601 IWR= 15-381 IWR= 19-601 IWR= 15-381 IWR= 19-601 IWR= 15-381 AR_1: 15-211, 15-212, 15-381, 15-681, 21-484 AR_2: 15-211, 15-212, 15-381, 15-681, 21-484 MLR: 15-381, 15-681, 80-310 CR: 21-484, 70-122, 70-311 IWR: 15-381, 19-601 AR: (15-211 & 15-212) |(15-211 & 15-381) |(15-681 &21-484) MLR: : 15-381 OR 15-681 OR 80-310 CR: 21-484 OR 70-311 OR 70-122 IWR: 15-381 OR 19-601 Only one of 15-381, 15-681, and 19-601; Only one of 15-211 and 70-122; Only one of 21-484 and 70-311 No double credit
9
Depth-First Search + Forward Checking AR_1 = 15-211 AR_2 = 15-212 MLR = 15-381MLR = 15-681 AR_1: 15-211, 15-212, 15-381, 15-681, 21-484 AR_2: 15-211, 15-212, 15-381, 15-681, 21-484 MLR: 15-381, 15-681, 80-310 CR: 21-484, 70-122, 70-311 IWR: 15-381, 19-601 Backtrack here! … AR: (15-211 & 15-212) |(15-211 & 15-381) |(15-681 &21-484) MLR: : 15-381 OR 15-681 OR 80-310 CR: 21-484 OR 70-311 OR 70-122 IWR: 15-381 OR 19-601 Only one of 15-381, 15-681, and 19-601; Only one of 15-211 and 70-122; Only one of 21-484 and 70-311 No double credit
10
Course Scheduling with Propositional Logic A simplified version of course scheduling (in natural language): Communications Requirement: 21-484 OR 70-311 OR 70-122 Information Warfare Requirement: 15-381 OR 19- 601 Students can graduate as long as both requirements are satisfied
11
Representation in Propositional Logic
12
Theorem Proving A student took 70-311 and 15-381 but not 19- 601, prove that this student can graduate
13
A Resolution Algorithm
14
Theorem Proving with Resolution
15
Step 1: Convert into CNF
16
Step 2: Apply Resolution Rules CR IWR {} Graduate
17
WalkSAT (Clauses, max_flips, p) Choose a random model m (random assignment to each variable) If m satisfies constraints – Return m Else, while num_flips < max_flips – With probability p choose a variable to “flip” randomly – With probability 1-p choose flip the variable that minimizes number of unsatisfied constraints Return null
18
“WalkSAT” for course scheduling What does it mean to “flip”? What are the input clauses? Example: – Assume our random assignment is just the first value from the domain for each: AR_1: 15-211,AR_2: 15-211, MLR: 15-381, CR: 21-484, IWR: 15-381 – If we draw random<p, we choose randomly on of these to flip (for example, flip 15-211 to 15-212 – If we draw random>p we need to find the change that will minimize the number of unsatisfied constraints (try at home)
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.