wish helps you There are a couple of things to mention with respect to the question posting.

code :

```
COBOL, 1960
PASCAL, 1971
C, 1971
```

```
language('COBOL', 1960).
language('PASCAL', 1971).
language('C', 1971).
```

```
lang_precedes_decade(Lp, L) :-
( language(Lp, X),
language(L, Y),
((X-Y) > 9) )
; ((X-Y) < -9).
```

```
lang_precedes_decade(Lp, L) :-
language(Lp, X),
language(L, Y),
( ((X-Y) > 9); ((X-Y) < -9) ).
```

```
| ?- lang_precedes_decade(Lp, L).
L = 'PASCAL'
Lp = 'COBOL' ? ;
L = 'C'
Lp = 'COBOL' ? ;
L = 'COBOL'
Lp = 'PASCAL' ? ;
L = 'COBOL'
Lp = 'C' ? ;
no
```

```
lang_precedes_decade(Lp, L) :-
language(Lp, YearLp),
language(L, YearL),
(YearL-YearLp) > 9. % Lp precedes L
```

```
| ?- lang_precedes_decade(Lp, L).
L = 'PASCAL'
Lp = 'COBOL' ? a
L = 'C'
Lp = 'COBOL'
no
| ?-
```