CMT304 - Introduction of Logic Programming Paradigms Assignment

Download Solution Order New Solution

Assignment Task 

Consider the problem of solving Hitori puzzles. Hitori is played in an n × n grid of cells, where each cell contains a number j ∈ {1, . . . , n}. The objective is to remove cells (marked as black), so that the three following rules are satisfied.

  1. No number appears more than once in a row or

  2. The eliminated black cells cannot be horizontally or vertically

  3. The remaining numbered (white) cells must be connected to each other, e., any white cell is reachable from another white cell by vertical or horizontal movements through white cells.

Task 1

Write an ASP program (hitori.lp) that solves the puzzle for any instance. Your program will receive as input a set cell/3 of triples r, c, n such that the grid has number n in row r, column c. The output of your program is a set cellblack/2 of pairs r, c such that the cell at row r, column c is eliminated.

Document your code so the following is clear.

  1. What the approach to solving the problem In particular, you need to explain what each rule achieves and how the rule achieves it. Include your name and student id in the comments.

Task 2

Write a short report on answer set programming related to the problem:

  1. Provide, in up to words, two arguments for and two arguments against using answer set programming to solve this problem.

  2. Discuss, in up to words, whether the logic programming paradigm is suitable for this problem or whether another paradigm of your choice is more appropriate, based on your previous arguments.

The word limits are an upper limit, not a target length. Text longer than the word limit for each point may be ignored. Clearly mark each argument in your answer of the first point and indicate whether it is for or against. Only provide two arguments for and against; additional arguments will be ignored.

This CMT304 IT Computer Science has been solved by our PhD Experts at My Uni Paper.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.