Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -387,43 +387,6 @@ Example results:
|
|
| 387 |
|
| 388 |
---
|
| 389 |
|
| 390 |
-
## Example
|
| 391 |
-
|
| 392 |
-
```
|
| 393 |
-
You are a train classifier who is observing trains that are traveling either east- or westbound. Each train is composed of one or more cars, and each car is characterized by a set of properties, represented as ground atoms over a fixed set of predicates. The direction (eastbound or westbound) of a train is to be determined from its composition. To describe the trains we define a set of predicates and grounding domains:
|
| 394 |
-
|
| 395 |
-
'has_car(Train, Car)': Specifies that 'Car' is part of the train 'Train'.
|
| 396 |
-
'car_num(Car, CarNumber)': Specifies the position of the car within its train. 'CarNumber' is a positive integer.
|
| 397 |
-
'car_color(Car, Color)': Specifies the color of the car. 'Color' can be 'red', 'blue', 'green', 'yellow', or 'white'.
|
| 398 |
-
'car_len(Car, Length)': Specifies the length of the car. 'Length' can be either 'short' or 'long'.
|
| 399 |
-
'has_wall(Car, WallType)': Specifies the wall type of a car. 'WallType' can be either 'full' or a 'railing'.
|
| 400 |
-
|
| 401 |
-
You are provided with positive and negative examples in the form of eastbound(t) or westbound(t) for each train t, together with background knowledge consisting of ground facts over the above predicates which describe its composition.
|
| 402 |
-
|
| 403 |
-
eastbound(train0).
|
| 404 |
-
has_car(train0, car0_1).
|
| 405 |
-
car_num(car0_1, 1).
|
| 406 |
-
car_color(car0_1, red).
|
| 407 |
-
car_len(car0_1, long).
|
| 408 |
-
has_wall(car0_1, railing).
|
| 409 |
-
|
| 410 |
-
westbound(train1).
|
| 411 |
-
has_car(train1, car1_1).
|
| 412 |
-
car_num(car1_1, 1).
|
| 413 |
-
car_color(car1_1, red).
|
| 414 |
-
car_len(car1_1, short).
|
| 415 |
-
has_wall(car1_1, railing).
|
| 416 |
-
|
| 417 |
-
Your task is to formulate a hypothesis, i.e. a prolog rule of the form 'eastbound(Train) :- Body.' that correctly distinguishes eastbound from westbound trains. The hypothesis must be true for all positive examples (i.e., eastbound trains) and false for all negative examples (i.e., westbound trains). Aim to find the shortest correct rule, that is, one that uses the fewest possible body literals subject to the prior constraints. Your rule must use only predicates defined above and must perfectly separate eastbound from westbound trains.
|
| 418 |
-
```
|
| 419 |
-
|
| 420 |
-
Solution:
|
| 421 |
-
```prolog
|
| 422 |
-
eastbound(Train) :- has_car(Train,Car), car_len(Car,long)
|
| 423 |
-
```
|
| 424 |
-
|
| 425 |
-
---
|
| 426 |
-
|
| 427 |
|
| 428 |
## Licensing Information
|
| 429 |
|
|
|
|
| 387 |
|
| 388 |
---
|
| 389 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 390 |
|
| 391 |
## Licensing Information
|
| 392 |
|