awergawerbawerawberbawer

问题描述 投票:1回答:1

awberabwerbawervawerawberavwerbawervawebrawevrbawerv

prolog predicate
1个回答
2
投票

您的常量以大写字母开头,因此Prolog认为它们是variables不是常量。

您应该重写它们以大写字母或带引号的原子开头:

station(al, [metropolitan]).
station(bg, [central]).
station(br, [victoria]).
station(bs, [metropolitan]).
station(cl, [central]).
station(ec, [bakerloo]).
station(em, [bakerloo,northern]).
station(eu, [northern]).
station(fp, [victoria]).
station(fr, [metropolitan]).
station(ke, [northern]).
station(kx, [metropolitan,victoria]).
station(lg, [central]).
station(ls, [central,metropolitan]).
station(nh, [central]).
station(oc, [bakerloo,central,victoria]).
station(pa, [bakerloo]).
station(tc, [central,northern]).
station(vi, [victoria]).
station(wa, [bakerloo]).
station(ws, [northern,victoria]).
© www.soinside.com 2019 - 2024. All rights reserved.