Question: ATTENTION!!: I have asked this question 2 times before. Both times I have gotten wrong answers. I am looking for the complete ASP program as

ATTENTION!!: I have asked this question 2 times before. Both times I have gotten wrong answers. I am looking for the complete ASP program as the full answer. This means, the program should:
1. Run if i copy-paste it in CLINGO (I am using online compiler: POTASSCO)
2. Give me the expected output for the exercise
Both answers I have gotten, consist of code that has errors, does not run, or gives me the wrong output.
For example lets look at this answer that i got by an expert:
cleanable(A, B) :- road(A, B), not blocked(A, B).
reachable(A, B) :- cleanable(A, B).
1{ in_route(A, B) : reachable(A, B)}1 :- reachable(A, B).
:- cleanable(A, B), not in_route(A, B).
visited(X) :- start(X).
visited(Y) :- in_route(X, Y), visited(X).
:- cleanable(X,_), not visited(X).
:- cleanable(_, X), not visited(X).
:- start(S), not visited(S).
#minimize {1, in_route(A, B) : reachable(A, B)}.
This is wrong. Because if i use: #show visited/1 i can see that it does not go back to the start, which is something required by the exercise.
Also, for some test cases, the output is wrong, since the program mistakenly uses the blocked roads for its route, even though as per the exercise, that should not happen (blocked roads are inaccessible)
If you are not an ASP expert please do not answer this question.
If you are not willing test your code extensively in CLINGO to see that it runs and the output is correct for multiple test cases, please do not answer this question.
Thank you for your understanding
PROBLEM:
The city of Tokyo, the most technologically advanced city in the world, wants to test an automated robot sweeper designed for cleaning its streets. The sweeper is mounted on a vehicle, and its operation is simple: it always has its cleaning function activated, and to clean a street, it must move from the beginning to the end of that street. The task is to develop an ASP program that will determine the daily route for the sweeper, which must satisfy the following conditions:
All streets in the city that are accessible to the robot sweeper must be cleaned. In other words, the route must guarantee that the sweeper will pass through all accessible streets.
Some streets are inaccessible, and the program is provided with a list of these blocked streets. Naturally, the robot sweeper cannot pass through these streets, so they should not be included in the route.
The robot sweeper cannot teleport, so the sequence of streets in the route must correspond to neighboring streets.
The route should minimize the number of streets that are cleaned more than once. It is understood that the sweeper must respect traffic directions. For simplicity, we assume that if the sweeper passes through a street in any direction, that street is considered cleaned. The sweeper starts at a specific point on the map (its storage location), and at the end of the route, it must return to the same point. The problem can be modeled by representing the streets as a directed graph, where the challenge is to traverse all the edges (i.e., streets) at least once, while minimizing the number of streets that are cleaned more than once. The direction of an edge represents the correct traffic direction for that street.
The input consists of a set of road(A,B) predicates for one-way streets directed from A to B, a set of blocked(A,B) predicates for streets that are inaccessible, and a given start(A) predicate for the starting point of the sweeper (which is also the point it must return to).
ATTENTION!!: I have asked this question 2 times

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!