# Online Learning Resources

Here are some online learning resources for Artificial Intelligence: foundations of computational agents, second edition by David Poole and Alan Mackworth, Cambridge University Press, 2017. All material is copyright, and most is released under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License or under the GLP.

## Chapter 1: Artificial Intelligence and Agents

The AAAI AI Topics site provides a wealth of introductory material on AI.

## Chapter 2: Agent Architectures and Hierarchical Control

See AIPython for a Python implementation of the robot controllers.

The AIspace Robot Control Applet runs the examples from this chapter. Unfortunately, it isn't very user friendly, and a replacement applet is under development.

## Chapter 3: Searching for Solutions

See AIPython for a Python implementation of search algorithms.

The AIspace Graph Searching Tool can be used to explore various search algorithms. The following sample problems are available under "File" -> "Load Sample Problem":

- "Delivery Robot (acyclic)" is a representation of Figure 3.2, as used in Examples 3.4, 3.7, 3.10, 3.11, 3.12, and 3.15.
- "Delivery Robot (cyclic)" is a representation of Example 3.8 and Figure 3.6.
- "Misleading Heuristic Demo" is a representation of Figure 3.8 and is referred to in Examples 3.14 and 3.16.

## Chapter 4: Reasoning With Constraints

See AIPython for a Python implementation of the CSP algorithms.

The AIspace Consistency-Based CSP Solver Tool can be used to explore arc consistency and domain splitting for solving constraint satisfaction problems.

The AIspace Stochastic Local Search CSP Solver Tool can be used to explore (stochastic) local search for solving CSP problems.

Both solvers use the same representation for CSPs. The following sample CSPs are available under File -> Load Sample CSP:

- "Scheduling Problem 1" is the example described in Examples 4.8, 4.20, 4.25, 4.28 and shown in Figure 4.4.
- "Simple Problem 1" is the representation of Examples 4.13, 4.14, 4.15 and 4.19, and shown in Figure 4.2.
- "Simple Problem 2" is the representation of Example 4.21.
- "Crossword Problem 1" is a representation of Figure 4.13.
- "Crossword Problem 2" is a representation of the example on the last slide for Chapter 4, lecture 1.

## Chapter 5: Propositions and Inference

See AIPython for a Python implementation of the reasoners.

The following code runs in AILog2, a representation and reasoning system for definite clauses, with declarative debugging tools, assumbles, probabilities, etc.

- elect_prop.ail electrical wiring example; Example 5.5 from Section 5.2
- elect_ask.ail electrical wiring example with askables; Example 5.10 from Section 5.3.2
- elect_bug.ail the buggy electrical wiring knowledge base from Example 5.14 in Section 5.3.4
- elect_bug2.ail the buggy electrical wiring example from Exercise 5.6
- elect_bug3.ail a
buggy electrical wiring example, which fails to prove
`lit_l2`

, but should succeed - elect_cbd.ail electrical wiring example for consistency-based diagnosis; Example 5.20 in Section 5.4.3
- elect_naf.ail electrical wiring example with negation as failure; Example 5.26 in Section 5.5
- beach.ail default reasoning about swimming at beaches; Example 5.27 in Section 5.5.1
- bronchitis.ail diagnosis Example 5.30 in Section 5.6
- elect_abd.ail electrical wiring example with abduction; Example 5.31 in Section 5.6
- plumbing.ail plumbing domain from Exercise 5.2

## Chapter 6: Planning With Certainty

See AIPython for a Python implementation of all of the planners.

The STRIPS to CSP applet takes in a STRIPS representation of a planning problem, and outputs a CSP representation that can be used in the Consistency-Based CSP Solver or the Stochastic Local Search CSP Solver for various planning horizons.

- "Coffee Delivery" is a simplified coffee delivery domain with 3 locations, and two features.
- "Full Coffee Delivery" is a representation of the domain of Figure 8.1, described in Examples 8.1, 8.5, 8.6 and 8.7, 8.11, 8.12 and 8.13 (and with other representations or algorithms in Examples 8.2, 8.3, 8.4 and 8.14).
- "Elevator problem" is a simple problem of planning to get a passenger from the 1st floor to the 4th floor of a building.

## Chapter 7: Supervised Machine Learning

See AIPython for a Python implementation of learning algorithms.

The AIspace Decision Tree Learning Tool can be used to learn decision trees from data, and to make predictions on new cases.

The AIspace Neural Network Learning Tool can be used to learn linear models and feed-forward neural networks from data, and to make predictions on new cases.

These both use the same data representation. The following sample belief networks are available under File -> Load Sample Datasets:

- "Mail Reading" is the data in Figure 7.1, and also includes some test data. This data is used in Examples 7.5, 7.6, 7.7, 7.8, 7.10, 7.12, 7.18, 7.20
- "Marching Pennies" is the data from Example 7.9.
- "Holiday" is the data shown in Figure 7.9 and used in Examples 7.11, 7.15 and 7.16 and in Figures 7.11 and 7.13.
- "Boolean Example" gives data for exclusive-or (as well as "and" and "or" for the neural applet), as shown in Figure 7.8 and discussed in Example 7.14.
- "Likes TV" example from Figure 7.18 and Exercise 7.3

## Chapter 8: Reasoning With Uncertainty

See AIPython for a Python implementation of probabilistic inference algorithms.

The AIspace Belief and Decision Networks Tool can be used to represent belief networks and can explain the inference it uses. The following sample belief networks are available under File -> Load Sample Problem:

- The "Fire Alarm Belief Network" is the network of Figure 6.1, and used in Examples 6.10, 6.12, 6.13, 6.15, 6.20, 6.21, 6.23, 6.24, 6.26, and 6.27.
- The "Electrical Diagnosis Problem" is the network of Figure 6.2, and used in Examples 6.11.
- The "Simple Diagnostic Example" is the network shown in Figure 6.3 and described in Example 6.14.

The Bayesian Localization demo shows how the beliefs of an agent can be updated based on sequential observations, for the models of Figures 6.15 and 6.18 and the domain of Figure 6.16, and described in Examples 6.28 and 6.29.

## Chapter 9: Planning With Uncertainty

See AIPython for a Python implementation of planning with uncertainty algorithms.

The AIspace Belief and Decision Networks Tool can be used to represent single-stage and multiple-stage decision networks. The following sample decision networks are available under File -> Load Sample Problem:

- "Delivery Decision" is a representation of Figure 9.5, described in Examples 9.4, 9.5, 9.7, 9.8 and 9.9.
- "Simple Umbrella Decision" is a representation of Figure 9.7, described in Examples 9.11. 9.14, 9.16, 9.17, 9.19, 9.21.
- "Fire Alarm Decision Problem" is a representation of Figure 9.9, described in Example 9.13, 9.15, 9.18, 9.20, 9.22, 9.23, 9.24.

There is also an open-source Java applet for the decision processes:

- Value Iteration Applet shows how iteration works for the domain of Figure 9.13, as described in Example 9.25, 9.26, 9.27.

## Chapter 10: Learning With Uncertainty

See AIPython for a Python implementation of learning with uncertainty algorithms.

We have the following open-source applets:

The Beta distribution applet shows how a beta distribution is updated based on the number of positive and negative examples, as shown in Figure 7.15, and discussed in Examples 7.30 and 7.31.

## Chapter 11: Multiagent Systems

See AIPython for a Python implementation of multiagent planners.

The open-source applet MAS Learning shows the learning to coordinate algorithm of Figure 10.9 and described in Examples 10.17 and 10.18.

## Chapter 12: Learning to Act

See AIPython for a Python implementation of reinforcement learning algorithms.

We have the following open-source applets:

- Tiny game shows how Q-learning and SARSA work for the tiny game of Figure 11.8, and described in Example 11.7, 11.9, 11.10, 11.12.

The following applets all work for the domain of Figure 11.9, described in Examples 11.8, 11.11 and 11.12:

- A Simple Game with a rather simplistic rule-based controller that can be modified by students.
- Q-learning controller, as described in Section 11.3.3 and Figure 11.10
- Model-based reinforcement learning controller, as described in Section 11.3.8, and Figure 11.15
- Linear function controller -- SARSA with linear function approximation, as described in Section 11.3.9 and in Examples 11.14 and 11.15
- Adversary controller (Q-learning, but where an adversary chooses the prize location).

The following applets work for the for the grid world shown in Figure 9.13:

## Chapter 13: Individuals and Relations

The following code runs in AILog2:

- elect_relational.ail electrical wiring example from Section 12.3.2
- west.ail a knowledge base about rooms from Figure 12.2 in Section 12.3.3
- before.ail the
`before`

relation of Example 12.26 in Section 12.5 - trees.ail the tree code of Example 12.27 in Section 12.5
- cfg_simple.ail a simple context free grammar and associated dictionary from Figures 12.6 and 12.7 in Section 12.5 (also in Prolog)
- trans.ail generates canned English; from Figure 12.8 in Section 12.6.4 (also in Prolog)
- nl_numbera.ail a simple grammar that enforces number agreement and builds a parse tree; from Figure 12.9 in Section 12.6.5 (also in Prolog)
- nl_interface.ail a simple natural language interface to a database; from Figures 12.10 and 12.11 in Section 12.6.6 (also in Prolog)

## Chapter 14: Ontologies and Knowledge-based Systems

Some ontologies (in OWL functional syntax):

- http://artint.org/ontologies/lemon_computers.owl lemon computers
- http://artint.org/ontologies/apartment_building.owl apartment building

This code runs in AILog2:

- prove.ail a vanilla meta-interpreter (Figure 13.9), which can be used with elect_base.ail a base-level representation of the electrical domain (Figure 13.10).
- prove2.ail a vanilla meta-interpreter, with disjunctions and built-ins; Figure 13.11.
- bprove.ail a meta-interpreter for depth-bounded search; Figure 13.12.
- hprove.ail a meta-interpreter that builds a proof tree; Figure 13.13.
- dprove.ail a meta-interpreter that delays goals; Figure 13.16. This can be used with elect_delay.ail a base-level representation of the electrical domain, with ok delayed.

## Chapter 15: Relational Planning, Learning and Probabilistic Reasoning

- grades.xml AIspace Bayes representation of the grades example from the slides of Chapter 12, lecture 3. Try observing the values in the data given in the slides.

This code runs in AILog2:

- delrob_sitc.ail the delivery robot in the situation calculus, as described in Section 14.1.1.
- leaving.ail ICL representation of the belief network of Figure 6.1 and Example 6.10; this representation is from Example 14.19 in Section 14.3.
- movie.ailog ICL representation of a simple movie domain.
- addition.ail ICL representation of probabilistic diagnosis of students who makes addition errors; Example 14.20 in Section 14.3.

Last updated, 2017-03-21 David Poole