aimacode / aima-exercises

Exercises for the book Artificial Intelligence: A Modern Approach
Other
871 stars 522 forks source link

Request to get solution for Exercise 'ex_6' in '6-Constraint-Satisfaction-Problems' #157

Open notshobhit opened 4 years ago

notshobhit commented 4 years ago

Describe the issue/requirement in detail

Flecart commented 2 years ago

The ternary constraint is A + B = C, now to express the ternary constraint in binary, introduce a new variable AB. The domain of AB is the set of pairs of numbers from N, where N is the set of numbers.

The three binary constraints to express the ternary constraint to binary are as follows:

• One constraint is between A and AB according to which the value of A must be equal to the first element of the pair-value value of AB.

• Another constraint is between B and AB, according to which the value of B must be equal to second element of value of AB.

• The sum of the pair of numbers, which means the value of AB must be equal to the value of C.

The process of induction can be used to reduce the ternary constraint to binary constraints. Suppose, there is an n-ary constraint, then this constraint can be reduced to (n – 1) ary constraints through induction. Here, the 3-ary constraint is reduced to binary by reducing the variables A, B, C to binary constraints and then the variable D is added.