내가 이런 프롤로그 조건의 숫자가있는 경우의 목록 :인쇄 조건
if has(X,Y)
then need(X,Z).
나는이 모두 나열하는 명령을 쓸 수있는 방법은 없나요을?
미리 감사드립니다.
내가 이런 프롤로그 조건의 숫자가있는 경우의 목록 :인쇄 조건
if has(X,Y)
then need(X,Z).
나는이 모두 나열하는 명령을 쓸 수있는 방법은 없나요을?
미리 감사드립니다.
유효한 프롤로그 구문과 비슷하지 않습니다. 다음은 great website이며 Prolog의 기초를 익힐 수 있습니다.
Google 검색 (무료 전자 책, 샘플 코드 등)을 통해 온라인으로 볼 수있는 많은 다른 리소스가 있습니다. 또한 프롤로그에서 프로그래밍에 의해 윌리엄 F. Clocksin 나는 강력히 좋습니다 책이 있어요.
원래의 질문자의 의미입니까?
has(student, ambiguousquestion).
need(student, studymore).
need(student, doresearch).
need(student, reprasequestion).
need(student, helpustohelpyou).
?- has(X,Y), findall(Z, need(X,Z), Res), write(Res).
[studymore,doresearch,reprasequestion,helpustohelpyou]
X = student,
Y = ambiguousquestion,
Res = [studymore, doresearch, reprasequestion, helpustohelpyou].
코드 샘플이 유효한 프롤로그입니다. 당신이 갖고있는 것과 원하는 것을 더 분명히 말하십시오! – m09
Prolog 프롬프트에서'listing (need) .'을 입력 해보십시오. –