Prolog Queries and Answers

  Рет қаралды 14,040

The Power of Prolog

The Power of Prolog

Күн бұрын

Пікірлер
@mwgkgk
@mwgkgk 4 жыл бұрын
Sir you're doing a fantastic job at tooling. Increasing Prolog spread by creating professionally tooled and performed videos is a noble use of intellect.
@ThePowerOfProlog
@ThePowerOfProlog 4 жыл бұрын
I'm so happy that you find this material useful, and I greatly appreciate that you have taken the time to write this, thank you a lot! Enjoy!
@Dezomm
@Dezomm 4 жыл бұрын
Fantastic videos, thank you so much for all you do.
@agymihai
@agymihai 5 жыл бұрын
It doesn't work quite like that for me. Here's the a Prolog interaction where I've defined color/1, tested the definition to see that it really was defined properly and then making a query. Welcome to SWI-Prolog (threaded, 64 bits, version 8.0.1) SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software. Please run ?- license. for legal details. 2 ?- color(red). true. 3 ?- color(blue). true. 4 ?- color(green). true. 5 ?- color(X). X = red ; X = blue . Where is the "green", damn it?
@stefankral1264
@stefankral1264 5 жыл бұрын
The devil is in the details: there's " ." at the alleged end of the answers. Notice the space character before the period? This indicates that there might be more answers, but Prolog has ended listing them all upon your request. Most likely you entered ';' followed by a newline which Prolog reads as "more solutions please" followed by "I have seen enough answers". Try the same queries again in a terminal window-you probably ran the shell within emacs without the right editor settings... HTH!
@hinata2578
@hinata2578 4 жыл бұрын
What program are you using to test your code. Are your queries truly returning "true." With a period at the end? Or are they returning "true" without a period at the end? Does it matter?
@ThePowerOfProlog
@ThePowerOfProlog 4 жыл бұрын
The toplevel is out of scope of the Prolog ISO standard, so the actual interaction you see in any system may differ from what I show here. However, in the ideal case, there is at least some way in which the system indicates the different cases, notably whether the query succeeds deterministically, or leaves a choice-point.
Prolog Integer Arithmetic
11:08
The Power of Prolog
Рет қаралды 6 М.
Logic
22:51
The Power of Prolog
Рет қаралды 10 М.
Ful Video ☝🏻☝🏻☝🏻
1:01
Arkeolog
Рет қаралды 14 МЛН
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
The Dome Paradox: A Loophole in Newton's Laws
22:59
Up and Atom
Рет қаралды 881 М.
Definite Clause Grammars (DCGs)
1:17:34
The Power of Prolog
Рет қаралды 9 М.
Programming with Math | The Lambda Calculus
21:48
Eyesomorphic
Рет қаралды 248 М.
Pondering Prolog
26:22
The Power of Prolog
Рет қаралды 2,7 М.
Writing Prolog Code
47:25
The Power of Prolog
Рет қаралды 10 М.
Dutch Language | Can English speakers understand it? | Part 1
27:41
Ecolinguist
Рет қаралды 1,1 МЛН
Prolog Instantiation and Backtracking
4:44
Computer Science Lessons
Рет қаралды 26 М.
Lisp in 100 Seconds
2:39
Fireship
Рет қаралды 488 М.
Стыдные вопросы про Китай / вДудь
3:07:50
вДудь
Рет қаралды 1,4 МЛН