-
Notifications
You must be signed in to change notification settings - Fork 0
/
highway_code.le
82 lines (69 loc) · 3.25 KB
/
highway_code.le
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
the target language is: prolog.
the templates are:
*an agent* should *an action*.
*an agent* must *an action*.
*an agent* can *an action*.
*an agent* must *an action* to *an agent*.
*an agent* should *an action* to *an agent*.
*an agent* sees *an item*.
*an agent* is at *a place*.
*an agent* is in *a place*.
*an agent* _is *a place*.
*an agent* cannot *an action*.
the knowledge base highway_code includes:
a vehicle must an action
if the vehicle must the action to an agent.
a vehicle should an action
if the vehicle should the action to an agent.
% Rule 170
% [...] give way to pedestrians crossing or waiting to cross a road into which or from which you are turning.
% If they have started to cross they have priority, so give way (see Rule H2)
a vehicle should give way to a pedestrian
if the vehicle is at a junction
and the pedestrian _is crossing
or the pedestrian _is waiting to cross.
% Rule 171
% You MUST stop behind the line at a junction with a ‘Stop’ sign and a solid white line across the road.
% Wait for a safe gap in the traffic before you move off.
a vehicle must stop behind the line at a junction
if the vehicle sees stop sign
and the vehicle sees solid white line across the road.
% Rule 172
% The approach to a junction may have a ‘Give Way’ sign or a triangle marked on the road.
% You MUST give way to traffic on the main road when emerging from a junction with broken white lines across the road.
a vehicle must give way to traffic
if the vehicle sees give way sign
or the vehicle sees triangle marked on the road
or the vehicle sees broken white lines across the road
and the vehicle sees traffic oncoming.
% Rule 173
% Dual carriageways. When crossing or turning right, first assess whether the central reservation is deep enough
% to protect the full length of your vehicle.
% If it is, then you should treat each half of the carriageway as a separate road. Wait in the central reservation
% until there is a safe gap in the traffic on the second half of the road.
% If the central reservation is too shallow for the length of your vehicle, wait until you can cross both carriageways in one go.
% Rule 174
% Box junctions. These have criss-cross yellow lines painted on the road (see ‘Road markings’).
% You MUST NOT enter the box until your exit road or lane is clear. However, you may enter the box
% and wait when you want to turn right, and are only stopped from doing so by oncoming traffic,
% or by other vehicles waiting to turn right. At signalled roundabouts you MUST NOT enter the box
% unless you can cross over it completely without stopping.
% Rule 175
% You MUST stop behind the white ‘Stop’ line across your side of the road unless the light is green.
% If the amber light appears you may go on only if you have already crossed the stop line
% or are so close to it that to stop might cause a collision.
a vehicle must stop behind the line at a junction
if the vehicle sees red light.
a vehicle can enter a junction
if the vehicle sees amber light
and the vehicle is in the junction
or the vehicle cannot stop safely.
scenario give_way is:
car1 is at junction1.
car1 sees give way sign.
car1 sees traffic oncoming.
pedestrian1 _is crossing.
query must is:
which vehicle must which action.
query should is:
which vehicle should which action.