且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将列表转换为 Prolog 中的术语

更新时间:2023-02-23 10:00:49

您需要使用 =.. 运算符,如下所示:

You need to use the =.. operator, like so:

list_to_term(List, Functor, Term) :-
    Term =.. [Functor | List].