# | Query | Codex | IF | SWI | YAP | B | GNU | SICStus 3 | SICStus | XSB | Ciao | ECLiPSe | Scryer | Trealla | Tau | Ichiban | X |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
# | Query, quads | Expected result according to [ standard ] [ draft prologue p.p.3 ] | IF V5.1B | SWI 6.3.7-13 | YAP 7.4.0 | B 7.5#5 | GNU 1.5.1 | SICStus 3.12.5 | SICStus 4.8.0β2 | XSB 3.3.6 | Ciao 1.13.0 | ECLiPSe 7.0#42 | Scryer 0.9.0 new | Trealla 1.22.41 new | Tau 0.3.2 new | Ichiban 0.10.0 new | X 1.0.63 |
a1 | atom_length(A,N). | instantiation_error. | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
a2 | atom_length(a,a). | type_error(integer,a). | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
a3 | atom_length(a,1.5). | type_error(integer,1.5). | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
a4 | atom_length(a,-1). | domain_error(not_less_than_zero,-1). | OK | false | OK new | OK | OK | OK | OK | OK | false | OK | OK | OK | OK | OK | OK |
a5 | atom_length(1,N). | type_error(atom,1). | OK | N = 1 | OK new | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
1 | length(L,N). | L=[],N=0 ; L=[_A],N=1 ; L=[_A,_B],N=2 ; ... . | in._e. * | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
2 | length(L,0). | L = []. | in._e. * | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
3 | length([_|L],0). | false. | in._e. * | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
4 | length(2,0). | false. | ty._e.(list,2) | ty._e.(list,2) | OK new | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
5 | length([_|2],0). | false. | ty._e.(list,[_213|2]) | ty._e.(list,[_|2]) new | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
6 | length([_|2],N). | false. | ty._e.(list,[_|2]) | ty._e.(list,[_|2]) | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
7 | length([_|2],2). | false. | ty._e.(list,[_213|2]) | ty._e.(list,[_|2]) new | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
8 | length(L,-1). | domain_error(not_less_than_zero,-1). | in._e. * | OK new | OK new | OK new | OK new | false | OK new | OK new | false | false | OK | OK | OK | OK | OK |
9 | length([],-1). | domain_error(not_less_than_zero,-1). | OK | OK new | OK new | OK new | OK new | false | OK new | OK new | false | false | OK | OK | OK | OK | OK |
10 | length(a,-1). | domain_error(not_less_than_zero,-1). | ty._e.(list,a) | OK new | OK new | OK new | OK new | false | OK new | OK new | false | false | OK | OK | OK | OK | OK |
11 | length([],-0.5). | type_error(integer,-0.5). | OK | OK new | OK new | OK new | OK | false | OK | OK new | false | false | OK | OK | OK | OK | OK |
12 | length(L,-0.5). | type_error(integer,-0.5). | in._e. * | OK | OK new | OK new | OK | false | OK | OK new | false | false | OK | OK | OK | OK | OK |
13 | length([a],1.0). | type_error(integer,1.0). | OK | OK new | OK new | OK new | OK | false | OK | OK new | false | false | OK | OK | OK | OK | OK |
14 | length(L,1.0). | type_error(integer,1.0). | in._e. * | OK new | OK new | OK new | OK | false | OK | OK new | false | false | OK | OK | OK | OK | OK |
15 | length(L,1.5). | type_error(integer,1.5). | in._e. * | OK | OK new | OK new | OK | false | OK | OK new | false | false | OK | OK | OK | OK | OK |
16 | length(L,1.0e99). | type_error(integer,1.0e99). | in._e. * | OK | OK new | OK new | OK | res._e. | OK | OK new | res._e. | false | OK | OK | OK | OK | OK |
17 | N is 2^52, length([], N). | false. | OK | OK | OK new | OK ** | OK | OK ** | OK | OK ** | OK | OK | OK | OK | OK | OK | OK |
18 | length([],0+0). | type_error(integer,0+0). | OK | OK new | OK new | OK new | OK | false | OK | OK new | false | false | OK | OK | OK | OK | OK |
19 | length([],-_). | type_error(integer,-_). | OK | OK new | OK new | OK new | OK | false | OK | OK new | false | false | OK | OK | OK | OK | OK |
20 | length([a],-_). | type_error(integer,-_). | OK | OK new | OK new | OK new | OK | in._e. | OK | OK new | in._e. | false | OK | OK | OK | OK | OK |
21 | length([a,b|X],X). | loops | ressource_error(Impd). | loops | false new | loops | loops | r._e.( finite_m.) new | loops | r._e.( m.) new | ty._e.(integer,[]) new | loops | g._t._o. | r._e.( finite_m.) | r._e.( finite_m.) | loops | r._e.( finite_m.) | loops |
22 | length(L,L). | loops | ressource_error(Impd). | loops | false | loops | loops | r._e.( finite_m.) new | loops | r._e.( m.) new | ty._e.(integer,[]) new | loops | g._t._o. | r._e.( finite_m.) | r._e.( finite_m.) | loops | r._e.( finite_m.) | loops |
23 | L = [_|_], length(L,L). | type_error(integer,[_|_]). | OK | OK | OK new | OK | OK | ty._e.(eval.,_) | OK | OK | ty._e.(eval.,_) | false | OK | OK | OK | OK | OK |
24 | L = [_], length(L,L). | type_error(integer,[_]). | OK | OK new | OK new | OK | OK | in._e. | OK | OK | ty._e.(eval.,_) | false | OK | OK | OK | OK | OK |
25 | L = [1], length(L,L). | type_error(integer,[1]). | OK | OK new | OK new | OK | OK | false | OK | OK | false | false | OK | OK | OK | OK | OK |
26 | L = [a|L], length(L,N). | sto,loops | sto,ressource_error(Impd). | loops | ty._e.(list,[a|...]) | false new | loops | loops | loops | r._e.( mem.) new | loops | loops | loops | r._e.( finite_m.) | r._e.( finite_m.) | L=[a,a],N=2 ;L=[a,a,_],N=3 ... | r._e.( finite_m.) | false |
27 | L = [a|L], length(L,0). | sto,false. | loops | ty._e.(list,[a|...])) new | false | false | false | false | false | false | false | false | false | false | false | false | false |
28 | L = [a|L], length(L,7). | sto,false. | loops | ty._e.(list,[a|...])) new | false | false | false | false | false | false | false | false | false | false | L=[a,a, _,_,_,_,_] | false | false |
29 | freeze(L,L=[]), length(L,L). | false. | |||||||||||||||
30 | freeze(L,L=[_|L]), length(L,N). | sto,loops | ressource_error(Impd). | |||||||||||||||
31 | freeze(L,L=[_|L]), N is 2^64, length(L,N). | false. |
* | ... using list_length in place of length |
new | ... progress after WG17 resolution Lexington 2011 |
length(?term, ?integer)
vs. length(?list, ?integer)