且构网

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

在 SWI-Prolog 中聚合谓词

更新时间:2022-06-27 01:05:23

使用存在量化的变量,就像使用 setof 一样:

Use an existentially quantified variable, as you would with setof:

?- aggregate(count, X^permutation([1,2,3,4], X), N).
N = 24.