Created
December 4, 2014 04:50
-
-
Save tobynet/5c3f7ebaa70d1347e574 to your computer and use it in GitHub Desktop.
【スマートフォンではなく】パソコンが始める Prolog 【動作確認編】 ref: http://qiita.com/toby_net/items/86af78dce98bdfa6beee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% あなたとジャバ | |
ジャバ(あなた). | |
% わたしとジャバ | |
ジャバ(わたし). | |
% X とジャバならば、X は今すぐジャバをダウンロードすべきである | |
ジャバをダウンロード(X,今すぐ) :- ジャバ(X). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ swipl -f advent-example01.pro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?- ジャバをダウンロード(あなた,今すぐ). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?- ジャバをダウンロード(あなた,今すぐ). | |
true. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?- ジャバをダウンロード(X, 今すぐ). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?- ジャバをダウンロード(X, 今すぐ). | |
X = あなた |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?- ジャバをダウンロード(X, 今すぐ). | |
X = あなた; | |
X = わたし. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?- ジャバをダウンロード(X, Y). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?- forall(ジャバをダウンロード(X, 今すぐ), writeln(X)). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment