# Difference between two values

Hi, why do i see this error? The rule is:

``````minorenni(T,U) :-
dataUdienza(U,DU),
dataNascita(T,DT),
18 is @=<(DU-DT),
testimone(T).
``````

while the error is:

``````ERROR: c:/users/luigi/desktop/regole_ontologia_giuridica.pl:49:
ERROR:    Arithmetic: `@=<(_832-_854)' is not a function
``````

It is hard to tell exactly what you want because you did not explain it in words.

My best guess is that you want this form:

``````?- 18 =< 10 - 5.
false.
``````

More examples:

``````?- DU = 10, DT = 5, 18 =< DU - DT.
false.

?- DU = 40, DT = 5, 18 =< DU - DT.
DU = 40,
DT = 5.
``````

Since `=<` is also a General purpose arithmetic function it does not need is/2 but replaces it.

`@=<` is for sorting which I also don’t think is what you want.

sorry, you’re right. T is the result and D is the data to be entered, type:

``````?- minorenni(T,'http://www.semanticweb.org/luigi/ontologies/2020/2/untitled-ontology-11#Udienza1_2').
``````

T is the name of the underage witness.

This rule returns the date of the hearing:

``````dataUdienza(X,Y) :-
propertyAssertion('http://www.semanticweb.org/luigi/ontologies/2020/2/untitled-ontology-11#Data_Udienza',X,literal(type('http://www.w3.org/2001/XMLSchema#int',Y))).
``````

while, this rule return the date of the witness:

``````dataNascita(X,Y) :-
propertyAssertion('http://www.semanticweb.org/luigi/ontologies/2020/2/untitled-ontology-11#Data_nascita',X,literal(type('http://www.w3.org/2001/XMLSchema#int',Y))).
``````

For blocks of Prolog code, if you bookend the code with ````` it will format much nicer, e.g.

``````
functor(A,B) :-
query_1(A),
query_2(B).
```
```

renders as

``````functor(A,B) :-
query_1(A),
query_2(B).
``````