CS2710 / ISSP 2160: Homework 2

Search, Constraints, and Logic (Chapters 4-8)

Assigned: October 2, 2006

Due: October 11, 2006 (by beginning of class, via both dropbox (at least for non-graphical parts) and hardcopy). Please write your Pitt email alias on your hardcopies.

1. Hill Climbing Search, Constraint Representation (25 pts)

(a) Suppose you are the owner of a factory that builds custom appliances. Since the factory is state of the art, the appliances are built using robotic work cells. Each robotic work cell performs a different assembly operation. For example, one work cell might install wires while another might paint a part of the appliance. Each appliance requires a certain number of assembly operations and some of these operations might depend on one another. For example, a robotic cell cannot attach a power cord to an appliance until the wiring is complete.

Given a particular appliance, you want to arrange the robotic work cells to form an assembly line to perform all the required operations taking into consideration all the dependencies of the appliance construction process. The search space consists of the set of all permutations of work cells. If there are n work cells, then there are n! possible orderings of work cells. Suppose the successor function for this problem transforms a particular permutation by swapping two consecutive work cells. For example, if {1, 2, 3} is a possible permutation of 3 work cells, the possible children are {2, 1, 3} and {1, 3, 2}. In addition, let the value of a particular permutation correspond to the number of assembly operations that can be successfully performed using the sequence in the permutation, given the dependencies on assembly operations.

Discuss the possible problem(s) in using Hill-Climbing search for this problem. Can you think of a better way to set the value for each work permutation? Can you think of a better successor function? Please limit your response to half a page.

(b) Pitt's Cucina serves dinner Wednesday through Sunday. The restaurant is closed on Monday and Tuesday. Five entrees - veal parmesan, grilled swordfish, pan seared salmon, pork loin, and chicken parmesan are served as the special each week according to the following restrictions:

  • Something must be served every day
  • Grilled swordfish is never served on Friday.
  • Pork loin cannot be served the day after veal parmesan
  • Pan seared salmon and veal parmesan must be served on the weekend.
  • Chicken parmesan is always served within two days of grilled swordfish.

    Specify the problem of determining which meals can be served on which day as a CSP.

    2. Constraint Satisfaction Problems (25 pts)

    Federal Express needs to deliver five packages a,b,c,d, and e at one of four times, 1,2,3, or 4. Let A represent the time at which a is delivered, B represent the time at which b is delivered, etc. The initial possible values for each delivery is the set {1, 2, 3, 4}. The following constraints need to be met:

    (B &ne 3) ^ (C &ne 2) ^ (A &ne B) ^ (B &ne C) ^ (C < D) ^ (A = D)^ (E < A) ^ (E < B) ^ (E < C) ^ (E < D) ^ (B &ne D)

    (a) Apply backtracking search to the problem. Draw the search tree, labeling the nodes with current variable assignments and the order in which the nodes are visited. Consider the variables in the order A,B,C,D,E and the values in the order 1,2,3,4. Stop after 10 nodes have been added to the tree.

    (b) Give an example where the use of each of the following would have been beneficial:

  • Most constrained variable
  • Most constraining variable
  • Least constraining variable

    (c) Apply forward-checking search to the problem. Use the order mentioned in part (a). Fill in the table with the appropriate values:
    Current assignment being considered Domain A Domain B Domain C Domain D Domain E Domain F

    3. Adversarial Search (25 pts)

    Consider the A*Search problem from the last homework with a slight alteration. Consider a sliding block puzzle with the following initial configuration:
    WWEBB
    1 2 3 4 5
    There are two white checkers belonging to player 1, two black checkers belonging to player 2, and an empty cell. The game ends when a player moves all of his checkers to the opposite side of the board. Player 1 moves first. If player 1 wins, 1 point is awarded to player 1 and -1 points are awarded to player 2 and vice versa. The legal moves for a player are:

  • Move a tile to an adjacent empty cell
  • Hop over one or two other tiles into an empty cell

    If a player cannot make a move, the turn is forfeited and the other player may make another move. Player 1 can only move to the right and player 2 can only move to the left.

    (a) Draw the complete game tree with the following conventions:

  • Represent each state as a pair (x1x2, y1y2), where each xi is a position with a white checker and each yi is a position with a black checker (with the numbers used in the diagram above). Label the edges of the game tree with the player to makes the move.
  • Put terminal states in a thick, square box with the utility function value for player 1 inside.

    (b) Now label each node with its backed-up minimax value for player 1.

    4. Logic (25 pts)

    Knowledge Base:

  • Either (I have a sweet tooth and I like chocolate) or (I like chocolate and I like cake)

    Rules:

  • If I like cake, then I also like Danish.
  • If I like Danish, that implies I have a sweet tooth.
  • If I have a sweet tooth and I like chocolate, then I am a chocoholic.

    Goal: I am a chocoholic

    (a) Convert these sentences to propositional logic.

    (b) Put the resulting sentences into Conjunctive Normal Form.

    (c) Using proof by refutation and resolution as the single inference rule, show the resolution proof that proves or disproves the goal.

    (d) Now rewrite your sentences using the formalism of First Order Logic.

    (e) Suppose your world consists of food and people, and that the rules above were true of all people, not just me. Rewrite this variation using FOL.