Please read the following instructions and make sure you can


Please read the following instructions and make sure you can finish it on time. And note the puzzles you choose in coding. And it must be tested in this way:

check :-
   solution(S), solve(S),
   aggregate_all(count, (solve(_T)), Count), format(“Found ~w solutions~n”, [Count]),
   Count=1. 

Overview

The “funniest” way I can think of to practice logic programming is to use it to solve a logic puzzle. A logic puzzle is typically presented as a mystery and list of clues that can be used to infer facts such as “who done it”.

For this assignment, we will use the Printable Logic Puzzles (Links to an external site.) website to find two puzzles to solve. One will be a “challenging” puzzle and the other will be a “Very Hard” puzzle.

For this assignment, you will write all of the clues as rules in a prolog program.

Your prolog file must obey the following format:

  1. The name of the prolog files must be ‘challenging.pl’ and ‘veryhard.pl’
  2. Your prolog file must provide a url/1 fact to get the URL of the puzzle being solced.
  3. Your prolog file must also provide a solution/1 fact with the correct solution hardcoded in. You will get the correct solution from the Printable Logic Puzzles (Links to an external site.) website.
  4. Your prolog file must provide a solve/1 rule that uses the clues to find one, and only one, table that is the solution.
  5. Your puzzle must have a series of clueX(T) rules that are satisfied whenever the solution in T is consistent with clue X.
  6. Your puzzle must include the check rule as follows:
check :- solution(S), solve(S), aggregate_all(count, (solve(_T)), Count), format("Found ~w solutions~n", [Count]), Count=1. 

To receive credit, your puzzle must find one, and only one, solution to the puzzle.

Your assignment will be checked by running swipl in the docker container as follows:

swipl -q -g check -g halt challenging.pl 

or

swipl -q -g check -g halt veryhard.pl 

which will use your solve and solution predicates to make sure you find exactly one solution and that it is the correct solution.

You can, of course, work on your solution using SWISH (Links to an external site.) in which case you may want to also use their table rendering plugin (Links to an external site.) to display your solution. Once you have a solution, however, you should confirm that it runs properly in the container. This may mean commenting out the part where you load the plugin.

Checking Your Solution

make check

or

make check-challenging
make check-veryhard

All of these MUST pass before you submit the assignment.

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Using your previously selected company (PA 1 assignment). Identify a

Using your previously selected company (PA 1 assignment). Identify a new CSR and discuss the following: Clearly identify and define the new CSR initiative Assess the sustainability of the initiative. What are the immediate actions required to implement the initiative? What are the barriers to implementation?  What actions would you

The rise and impact of the 3rd estate in the French Revolution.

 Analyze the rise and impact of the 3rd estate in the French Revolution. In case you need a prompt for your thinking, try this on for size. Did you see The Dark Knight Rises? Director Christopher Nolan said openly that he turned to the French Revolution and the novel A

HA4120D – Management of Continuum Care Services Discussion 05: Providers

 HA4120D – Management of Continuum Care Services   Discussion 05: Providers of Long-Term Care   Chapters 3-7 focus on the providers of long-term care. Some of them are institutional in nature, some are non-institutional, and some are a combination of the two forms. One of the most enduring and difficult questions

Sixty-two–year-old James

The following is another student post to wish i have to react. Please add some other information. relate to the question but different from the student post. remember APA and similarity.   Sixty-two–year-old James White is accompanied to the clinic today by his wife and son. James has had increasing

The paper will require students review the following program guidelines for School Health Smoking Cessation published by the Center for

The paper will require students review the following program guidelines for School Health Smoking Cessation published by the Center for Disease Control (CDC) along with the CDC Smoking Cessation Best Practices document, utilizing the following links.Guidelines for School Health – Smoking Cessationhttp://www.cdc.gov/Mmwr/preview/mmwrhtml/00026213.htmBest practices – Smoking Cessationhttp://www.cdc.gov/tobacco/stateandcommunity/best_practices/pdfs/2014/sectiona-iii.pdfWrite a 3-5 page paper

The design blog is an essential part of this course.

The design blog is an essential part of this course. Your blog will be used to keep track of stylistic characteristics of designs that are covered in this class and that you observe, either in person or from images. For each style covered in the unit, find at least one

Learning Musical Instrument

Description Instructions Your Research Essay I is an informative essay, with supporting details from your own quality research reading. It should be in the APA format. Topic: • You are encouraged to choose an informative topic related to your own study programme/ major. The topic should be focused, interesting, and

3-1 J- SWOT Marketing Imagine the CDC has brought you

   3-1 J- SWOT Marketing Imagine the CDC has brought you on as a consultant to identify health communication gaps in your chosen campaign. You are asked to conduct a SWOT analysis. Review this video that briefly explains how to do a SWOT analysis on a product. Are there messages

   Discussion: Task Groups Group work is a commonly used method within

   Discussion: Task Groups Group work is a commonly used method within school settings. Because peer interaction is important in the emotional and social development of children, the task group can serve as a wonderful therapeutic setting and tool; however, many factors should be considered when implementing this type of

This prompt is based on your three authors for Week

This prompt is based on your three authors for Week 2:  Hesiod, Lucretius, and William Cullen Bryant.  Here it is:    Although each of these writers differs considerably in his message, each expands our idea of “nature” by commenting on the relationship between natural and spiritual (or supernatural).  The Ancient Greek

This is a benchmark assignment.

This is a benchmark assignment. View the three videos in the required readings in order to complete this assignment. After watching the videos, examine the example basic patient informed consent form for the common surgical procedure of gallbladder removal entitled “Gallbladder – Cholecystectomy With Common Duct Exploration (Laparoscopic) (Cholecystectomy With

Project Overview This course project requires you to select a country and develop a paper about that countrys health delivery

Project OverviewThis course project requires you to select a country and develop a paper about that countrys health delivery system. Your paper will include the following information:Demographic information and vital health statistics about the countryCurrent health status and brief history of the current healthcare systemCultural, religious, social, and political factors

In a 10 –12 page paper, identify and analyze the

In a 10 –12 page paper, identify and analyze the benefits and challenges that are associated with biometric evidence in the criminal justice system. Include at least 3 techniques in your paper, and use at least 2 case studies to support your position. Consider the following questions when drafting your