
Prolog
minghu9
这个作者很懒,什么都没留下…
展开
-
Prolog 备忘录
1.大写或下划线开头的词暗示变量,小写开头的词暗示原子量;查询时必须使用大写或下划线开头的词。2.noun(x1, x2) <=> x1 is the noun of x2 such as father(Jim, Jam) <=> Jim is the father of Jam 另外,一般地, type(x1, x2) <=> x1∈x2x_1 \in x_2原创 2017-02-16 09:18:11 · 764 阅读 · 0 评论 -
Swi-Prolog 数值约束
强调数值约束labeling参考这里 具体来讲,一个:- use_module(library(clpfd)).which_year(Y):- N in 1..100, labeling([min(N)],[N]), 11*(1+0.065)**N > 18*(1+0.02)**N, Y is N + 2016.查询最早中国GDP超过美国GDP的时间,2016年中原创 2017-04-07 19:58:09 · 789 阅读 · 0 评论