31 Mar Please read the following instructions and make sure you can finish it o
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:
aggregate_all(count, (solve(_T)), Count), format("Found ~w solutions~n", [Count]),
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:
- The name of the prolog files must be 'challenging.pl' and 'veryhard.pl'
- Your prolog file must provide a
url/1fact to get the URL of the puzzle being solced.
- Your prolog file must also provide a
solution/1fact with the correct solution hardcoded in. You will get the correct solution from the Printable Logic Puzzles (Links to an external site.) website.
- Your prolog file must provide a
solve/1rule that uses the clues to find one, and only one, table that is the solution.
- Your puzzle must have a series of
clueX(T)rules that are satisfied whenever the solution in
Tis consistent with clue X.
- Your puzzle must include the
checkrule 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
swipl -q -g check -g halt veryhard.pl
which will use your
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
All of these MUST pass before you submit the assignment.
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Do you need help with this question?
Get assignment help from Aqhomework.com Paper Writing Website and forget about your problems.
Aqhomework provides custom & cheap essay writing 100% original, plagiarism free essays, assignments & dissertations.
With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Click Order now to access our order form, fill your paper details correctly, select your paper deadline and wait for our writers to send a perfectly written assignment.
Chat with us today! We are always waiting to answer all your questions.