append
and reverse
.
書式 | append(?$L1, ?$L2, ?$L3) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
引数 |
| |||||||||
This is true when $L3 is the combined list of the elements in $L1 and $L2 in the original orders. | ||||||||||
> ?- append([1, 2, 3], [4, 5], X). X: < 1, 2, 3, 4, 5 > |
書式 | revappend(?$L1, ?$L2, ?$L3) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
引数 |
| |||||||||
This is true when $L3 is the combined list of the elements in $L1 and $L2, in the reversed order as to $L1 and in the original order as to $L2. | ||||||||||
> ?- revappend([1, 2, 3], [4, 5], X). X: < 3, 2, 1, 4, 5 > |
書式 | append_list(+$LL, -$L) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
This lets $L3 be the combined list of the elements in the elements in $LL. | |||||||
> ?- append_list([[1, 2], [3], [4, 5]],X). X: < 1, 2, 3, 4, 5 > |
書式 | delete(+$List1, +$Elem, -$List2) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
引数 |
| |||||||||
This removes elements $Elem from $List and returns to $List2. | ||||||||||
> ?- delete([1, 2, 2, 4, 5], 2, X). X: < 1, 4, 5 > |
書式 | reverse(?$L1, ?$L2) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
This is true when $L1 and $L2 have the same elements but in reversed orders each other. | |||||||
> ?- reverse([1, 2, 3, 4], X). X: < 4, 3, 2, 1 > |
書式 | last(?$L, ?$X) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
This lets $X be the last element in $L. | |||||||
> ?- last([1, 2, 3, 4], X). X: 4 |
書式 | member(?$X, +$L) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
This is true when $X is unified with an element in $L. | |||||||
> ?- member(X, [1, 2, 3]). X: 1 Enter ';' for more choices, otherwise press ENTER --> ; X: 2 Enter ';' for more choices, otherwise press ENTER --> ; X: 3 Enter ';' for more choices, otherwise press ENTER --> ; no |
書式 | member_e(?$X, +$L) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | member/2 | ||||||
This is true when $X is equivalent to an element in $L. |
書式 | member_i(?$X, +$L) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | member/2 | ||||||
This is true when $X is identical to an element in $L. |
書式 | member_s(?$X, +$L) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | member/2 | ||||||
This is true when $X subsumes an element in $L. |
書式 | member_sd(?$X, +$L) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | member/2 | ||||||
This is true when $X is subsumed by an element in $L. |
書式 | memberchk(+$X, +$L) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | member/2 | ||||||
This is true when $X is unified with an element in $L. This does not succeeds more than once. | |||||||
> ?- memberchk(X, [1, 2, 3, 4]). X: 1 |
書式 | memberchk_e(+$X, +$L) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | memberchk/2 | ||||||
This is true when $X is equivalent to an element in $L. This does not succeeds more than once. |
書式 | memberchk_i(+$X, +$L) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | memberchk/2 | ||||||
This is true when $X is identical to an element in $L. This does not succeed more than once. |
書式 | memberchk_s(+$X, +$L) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | memberchk/2 | ||||||
This is true when $X subsume an element in $L. This does not succeed more than once. |
書式 | memberchk_sd(+$X, +$L) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | memberchk/2 | ||||||
This is true when $X is subsumed by an element in $L. This does not succeed more than once. |
書式 | member_2(?$X1, +$L1, ?$X2, +$L2) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
引数 |
| ||||||||||||
関連項目 | member/2 | ||||||||||||
This is true when $X1 and $X2 are unified with an element in $L1 and $L2 respectively. Where $X1 and $X2 are from the heads of $L1 and $L2 must be the same. | |||||||||||||
> ?- member_2(X, [1, 2], Y, [4, 5]). X: 1 Y: 4 Enter ';' for more choices, otherwise press ENTER --> ; X: 2 Y: 5 Enter ';' for more choices, otherwise press ENTER --> ; no |
書式 | fast_member(+$L, ?$X) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | member/2 | ||||||
This is true when $X is unified with an element in $L. This is the same as 'member', but the order of the arguments is changed and this is faster. | |||||||
> ?- fast_member([1, 2, 3], X). X: 1 Enter ';' for more choices, otherwise press ENTER --> ; X: 2 Enter ';' for more choices, otherwise press ENTER --> ; X: 3 Enter ';' for more choices, otherwise press ENTER --> ; no |
書式 | fast_member_2(+$L1, ?$X1, +$L2, ?$X2) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
引数 |
| ||||||||||||
関連項目 | member_2/4 fast_member/2 | ||||||||||||
This is true when $X1 and $X2 are unified with elements in $L1 and $L2 respectively. Where $X1 and $X2 are from the heads of $L1 and $L2 must be the same. This is the same as 'member_2', but the order of the arguments is changed and this is faster. | |||||||||||||
> ?- fast_member_2([1, 2], X, [3, 4], Y). X: 1 Y: 3 Enter ';' for more choices, otherwise press ENTER --> ; X: 2 Y: 4 Enter ';' for more choices, otherwise press ENTER --> ; no |
書式 | assoc(+$X, +$L, -$Y) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
引数 |
| |||||||||
This lets $Y be the second element of the pair whose first element is unified with $X. The 2-element pair (',/2') is the first proper one in $L. This does not succeed more than once. | ||||||||||
> ?- assoc(1, [(1, "a"), (2, "b")], X). X: "a" |
書式 | assoc_e(+$X, +$L, -$Y) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
引数 |
| |||||||||
関連項目 | assoc/3 | |||||||||
This lets $Y be the second element of the pair whose first element is equivalent to $X. The 2-element pair (',/2') is the first proper one in $L. This does not succeed more than once. |
書式 | assoc_i(+$X, +$L, -$Y) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
引数 |
| |||||||||
関連項目 | assoc/3 | |||||||||
This lets $Y be the second element of the pair whose first element is identical to $X. The 2-element pair (',/2') is the first proper one in $L. This does not succeed more than once. |
書式 | remove_duplicates(+$L1, -$L2) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
This lets $L2 be the result of removing all equivalent duplicate elements in $L1. | |||||||
> ?- remove_duplicates([1, 2, 3, 2, 4], X). X: < 1, 3, 2, 4 > |
書式 | listcommon(+$L1, +$L2, -$L3) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
引数 |
| |||||||||
著者 | NISHIDA Kenji (nishiken@is.s.u-tokyo.ac.jp) | |||||||||
This lets $L3 be a list of all the elements that have equivalent elements both in $L1 and in $L2. | ||||||||||
> ?- listcommon([1, 2, 3, 4], [5, 4, 3], X). X: < 3, 4 > |
書式 | flatten_list(+$L1, -$L2) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
This lets $L2 be a flattened list of $L1. | |||||||
> ?- flatten_list([1, [2, [3, 4], 5]], X). X: < 1, 2, 3, 4, 5 > |
書式 | make_n_list(+$N, +$X, -$L) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
引数 |
| |||||||||
This lets $L be a list whose length is $N and all the elements are equivalent to $X. | ||||||||||
> ?- make_n_list(5, "hoge", X). X: < "hoge", "hoge", "hoge", "hoge", "hoge" > |
書式 | make_num_list(+$FROM, +$BEFORE, -$RESULT) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
引数 |
| |||||||||
This lets $RESULT be a list whose elements are the integers from $FROM before $BEFORE. | ||||||||||
> ?- make_num_list(2, 5, X). X: < 2, 3, 4 > |
書式 | length(+$L, -$N) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
This lets $N be the length of $L. | |||||||
> ?- length([3, 3, 3, 3], X). X: 4 |
書式 | nth_elem(+$LIST, +$N, -$ELEM) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
引数 |
| |||||||||
This returns $Nth element of the list $LIST as $ELEM. | ||||||||||
> ?- nth([2, 4, 6, 8], 2, X). X: 6 |
書式 | set_difference(+$Set1, +$Set2, -$Diff) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
This returns the elements of $Set1 not included in $Set2. | |||||||
> ?- set_difference([1, 2, 3, 4], [6, 4, 2], X). X: < 1, 3 > |
書式 | set_difference_e(+$Set1, +$Set2, -$Diff) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | set_difference/3 | ||||||
This returns the elements of $Set1 not included in $Set2. |
書式 | set_difference_i(+$Set1, +$Set2, -$Diff) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | set_difference/3 | ||||||
This returns the elements of $Set1 not included in $Set2. |
書式 | input_list(+$STRING, -$LIST) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | output_list/2 | ||||||
Lisp 形式のリストを LiLFeS 形式のリストへ変換する. |
書式 | output_list(+$LIST, -$STRING) | ||||||
---|---|---|---|---|---|---|---|
引数 |
| ||||||
関連項目 | lisp_to_lilfes/2 | ||||||
LiLFeS 形式のリストを Lisp 形式のリストに変換する. |
書式 | dlength(+Head, +Tail, -N) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
引数 |
| |||||||||
Returns the length of the difference list between Head and Tail. |
書式 | dmember(+LHead, +LTail, ?E) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
引数 |
| |||||||||
as with member, but searches in a difference list given by 'LHead' and 'LTail' |
書式 | dmember_2(+L1Head, +L1Tail, ?E1, +L2, ?E2) | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
引数 |
| |||||||||||||||
as 'fast_member_2', but the first list is considered a difference list It is not necessary to give the 2nd list as difference list as well, as both lists are processed in tandem. |