Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
List 在prolog中对列表进行操作时,从不同的元素开始_List_Prolog - Fatal编程技术网

List 在prolog中对列表进行操作时,从不同的元素开始

List 在prolog中对列表进行操作时,从不同的元素开始,list,prolog,List,Prolog,在prolog中,可以从第n个元素而不是列表中的第一个元素开始 我有一个函数 checker([Ms,Fs|Ps] ) :- %%start from the beginning of the list when size is 2+ 这会得到一个包含n个列表的列表,像这样的[[1,2],[3],[4,5]是否可以从[3]开始操作而不是从开始?是否总是有效地跳过列表的第一个元素 我试过类似的方法 checker([[],Ms,Fs|Ps] ) :- %% + a few others lik

在prolog中,可以从第n个元素而不是列表中的第一个元素开始

我有一个函数

checker([Ms,Fs|Ps] ) :-  %%start from the beginning of the list when size is 2+
这会得到一个包含n个列表的列表,像这样的
[[1,2],[3],[4,5]
是否可以从
[3]
开始操作而不是从开始?是否总是有效地跳过列表的第一个元素

我试过类似的方法

checker([[],Ms,Fs|Ps] ) :- %% + a few others like this - no luck
基本上,我希望在开始操作时忽略列表中的第一个元素

干杯

已解决

我加了一个

check([]).
check([H|T]) :-
checker(T).

使用了一个符咒,现在我只叫Check。

你可能是指
检查器([[Ms,Fs]| Ps]):-
而不是…
Check
需要以小写字母开头才有效。