Programming In Prolog Part 1 - Facts, Rules and Queries

Поделиться
HTML-код
  • Опубликовано: 20 янв 2025

Комментарии • 164

  • @eternal_psy
    @eternal_psy 10 лет назад +15

    Best Prolog tutorial on RUclips! Period.

  • @chrisliauw4437
    @chrisliauw4437 9 лет назад +7

    Hi, I read and listened to dozens of tutorials and read some textbooks. You clearly explained the symbols :- ; and , which nobody else did. Once I saw those definitions, I understood immediately. Fantastic and unbelievable how badly some others try and teach it.

  • @raiquiaarbiter7974
    @raiquiaarbiter7974 10 лет назад +25

    Sir, I can't express how much I love this videos of yours, you know,my professor wants us to simulate this Prolog without teaching us. This helpsne a lot. Thank you very much

  • @muhammadhamdani2776
    @muhammadhamdani2776 3 года назад +2

    Thank you! Our lecturer expect us to make a single file simple prolog program for the end of semester without actually explaining to us the basic and this is really helpful to get me started! Hell, she doesn't even teach us which executable to use in Amzi.

  • @Chr0nalis
    @Chr0nalis 7 лет назад +124

    The friendship rule is more of a friendzone rule.

    • @reasonerenlightened2456
      @reasonerenlightened2456 3 года назад +2

      Why the programming languages are still not self-aware in the 21-st century !
      That should really trouble you all.
      The problem with Prolog is that the meaning is assigned by the human .
      d( [], X, X).
      d( [X | Y], Z, [X | W]) :- d( Y, Z, W).
      for Prolog is different than
      end( [], X, X).
      end( [X | Y], Z, [X | W]) :- end( Y, Z, W).
      but both are just the same as
      append( [], X, X).
      append( [X | Y], Z, [X | W]) :- append( Y, Z, W).
      Basically, the meaning remains in the head of the human and Prolog is completely void of capturing the meaning of the predicates, functors, atoms, etc.
      The same applies to any other programming language I am aware of. THEY ALL FAIL TO CAPTURE MEANING, AWARENESS, CONTEXT, etc. !
      Prolog was supposed to be the language of AI but it is still not self-aware.

    • @bigretard
      @bigretard 8 месяцев назад

      @@reasonerenlightened2456 good detective work Captain Obvious

  • @samuelets
    @samuelets 9 лет назад +25

    Hey very nice video! By the way, I would say that ':-' stands for back-implication not for "if and only if"... A :- B means B->A.

  • @clutchmadness
    @clutchmadness 4 года назад

    I wasn't expecting that intro, but I love it. As much as I love your videos... and you...

  • @TheSimpleEngineer
    @TheSimpleEngineer  10 лет назад +29

    Thanks! Glad to have helped.

    • @CherryPauper
      @CherryPauper 10 лет назад +14

      If I didn't find this, I'd be fucked because my professor sucks. Please continue these tutorials because they are really helpful. I have forwarded these tuts to my friends.

    • @Eilish1776
      @Eilish1776 9 лет назад

      Cherry Pauper We might have the same professor.

    • @RazorMureithi
      @RazorMureithi 9 лет назад

      +Kerry Adams Same here

    • @reasonerenlightened2456
      @reasonerenlightened2456 3 года назад

      Why the programming languages are still not self-aware in the 21-st century !
      That should really trouble you all.
      The problem with Prolog is that the meaning is assigned by the human .
      d( [], X, X).
      d( [X | Y], Z, [X | W]) :- d( Y, Z, W).
      for Prolog is different than
      end( [], X, X).
      end( [X | Y], Z, [X | W]) :- end( Y, Z, W).
      but both are just the same as
      append( [], X, X).
      append( [X | Y], Z, [X | W]) :- append( Y, Z, W).
      Basically, the meaning remains in the head of the human and Prolog is completely void of capturing the meaning of the predicates, functors, atoms, etc.
      The same applies to any other programming language I am aware of. THEY ALL FAIL TO CAPTURE MEANING, AWARENESS, CONTEXT, etc. !
      Prolog was supposed to be the language of AI but it is still not self-aware.

  • @domus_k
    @domus_k 3 года назад +1

    It's 2021 and still very helpful, thanks a lot dude

  • @saifrehman2776
    @saifrehman2776 7 лет назад

    this video deserves more upvotes

  • @ariffmarzuki8675
    @ariffmarzuki8675 10 лет назад +4

    thank you so much...this video made me love to study prolog after this....you explained such a way easy to me understand that..

  • @bigavel165
    @bigavel165 10 лет назад

    Dude thanks a lot i'm in the library watching your video and you teach this better than my professor at my college. I did not like this programming language but with your videos I am learning to appreciate Prolog. tomorrow its part 2 of your videos and so on and so on until i finish them all. i did not know of sublime text thanks again

  • @N7Martin
    @N7Martin 9 лет назад

    The best tutorial on Prolog i saw, great work!

  • @samqueen8337
    @samqueen8337 5 лет назад

    Best prolog video I've seen

  • @blueisnotgreen7258
    @blueisnotgreen7258 7 лет назад +7

    Facts: 2:06 Rules: 4:32 Queries: all throughout

  • @Jombo1
    @Jombo1 7 лет назад +52

    I can relate to Josh.

  • @AL-go2mv
    @AL-go2mv 7 лет назад +1

    I would recommend using SWISH for the Prolog IDE. It runs swi prolog under the hood and is much easier to use. You can also edit your text in SWISH. Also I recommend notepad ++ as an alternative. Both sublime and notepad++ are great.

  • @N.I.C.K-
    @N.I.C.K- 7 лет назад

    Awesome video! Clear spoken, to the point, excellent. Getting me through this paradigms class lol

  • @sumyatnoe1134
    @sumyatnoe1134 9 лет назад

    Thanks dude! Your video explanation is very good and I understand very clearly. Yours teaching method is better than our professor at my uni!! While I listening your video, I comprehend clearly Facts, rules and queries in SWI.exe

  • @TheSimpleEngineer
    @TheSimpleEngineer  10 лет назад +8

    Song is Holiest by Glass Animals

  • @samChakravartiSamrat
    @samChakravartiSamrat 3 года назад

    higly underrated channel!... full support from an indian. subscriber!

  • @HassaanRaza
    @HassaanRaza 5 лет назад

    very decent and good way of teaching!

  • @maharshpatel9243
    @maharshpatel9243 6 лет назад +1

    Thanks a lot man. Amazing video. Really helpful

  • @ryansherman1946
    @ryansherman1946 8 лет назад +2

    9:48 implementation of the "friendzone" in Prolog. I can't even.

  • @alexandrevalente9994
    @alexandrevalente9994 6 лет назад

    Great video and clear explanation !

  • @ABCEE1000
    @ABCEE1000 8 лет назад

    very very useful . thank you so much . i wish you continue uploading such tutorials

  • @majoro7251
    @majoro7251 9 лет назад +3

    Too bad Josh is friendzoned! XD
    This is some high quality educative stuff! Subbed! Totally gonna tell my friends about this. Our Lab tutor missed some stuff. Like now i know what :- actually means!

    • @chrisliauw4437
      @chrisliauw4437 9 лет назад +1

      Major O Yep, I think when they teach it they don't actually understand it themselves. Great tutorial

  • @sahilverma9099
    @sahilverma9099 5 лет назад

    tomorrow is my final practical and i don't know what is PROLOG but this is great I hope I have time to learn it, Nyc explanation bro.

  • @benjammin775
    @benjammin775 5 лет назад

    For some reason, SWI isn't recognizing my document when I try to open up. I tried every variation possible. Basically the step you get into at 9:55

    • @benjammin775
      @benjammin775 5 лет назад

      well I was able to get there by pressing the consult tab, nvm!

  • @dmitryponyatov2158
    @dmitryponyatov2158 5 лет назад +1

    Did you see the Picat language?
    I found it much much simpler then Prolog for the viewpoint of longtime imperative programmer, or beginner

  • @125saful
    @125saful 10 лет назад

    Awesome tutorial mate. :D. Thanks again

  • @rafsanjanimuhammod309
    @rafsanjanimuhammod309 8 лет назад

    Great Work, Sir !!!

  • @Angela-Gee
    @Angela-Gee 3 года назад

    DWIM could not correct goal.. how to fix this error?

  • @abdulsattarsuleman
    @abdulsattarsuleman 6 лет назад +1

    Many times I faced this problem "Last release gives the question" ?
    how to handle it?

  • @funtrip6491
    @funtrip6491 8 лет назад

    awesome and simple to follow !

  • @bethwel9996
    @bethwel9996 Год назад

    Very informative. Thank you

  • @oznurdogantimur8821
    @oznurdogantimur8821 9 лет назад +1

    It was really helpful. I appreciate!

  • @josevillegas5243
    @josevillegas5243 9 лет назад +2

    Is there a logic programming language that supports a third truth value 'unknown'? Prolog overloads 'unknown' with 'false'.
    For example, ~likes(dan, sally) is false
    while likes(blake, josh) is unknown, but Prolog doesn't differentiate between unknown and false.
    I guess a user can differentiate between unknown and false. A sentence is unknown if Prolog says the sentence and its negation is false. A sentence is false if Prolog says the sentence is false and its negation is true. But that's cumbersome.
    Try the following queries:
    likes(blake, josh).
    not likes(blake, josh).
    dating(josh, brittney).
    not dating(josh, brittney).

  • @aceawan1562
    @aceawan1562 5 лет назад

    When you open your compiler and run the .pl file. There was written 6 clauses. What is clause?

  • @ahmeddan7734
    @ahmeddan7734 8 лет назад

    EXCELLENT JOB!

  • @stephylala8418
    @stephylala8418 9 лет назад +1

    Hy, I am obviously the only one with the problem. I understood how it works and the video is great. But I have an error. The code is the same as yours but i keep getting "ERROR: toplevel: undefined procedure: friendship/2 (DWIM could not correct goal).
    help pls. i want to go on with tutorials! :/

  • @hankzhou279
    @hankzhou279 9 лет назад

    Thanks dude this is really helpful!

  • @hinata2578
    @hinata2578 4 года назад

    Why does it return true.( with a . at the end)Sometimes and true (with no .) at the end

  • @jerryjerry9351
    @jerryjerry9351 5 лет назад

    wow it was great . i really liked it thank you so much .

  • @neutron2058
    @neutron2058 7 лет назад

    how do you write 'not' in prolog? like X is not married to Y or something like that and there's already a fact for married.

  • @Anup4814
    @Anup4814 6 лет назад

    Do I've any mistakes in the code? screen.w3.ua/Apr18/8977561.jpg
    I've tallied mine code with the tutorial but the result is false. How? Any idea, plz reply.

  • @deveshbajaj8940
    @deveshbajaj8940 8 лет назад

    What are the applications of this prolog language ???

  • @IvoirRienna
    @IvoirRienna 10 лет назад +1

    WOW - So easy to understand, thank you so much!

  • @NASHMVPMVP
    @NASHMVPMVP 10 лет назад +1

    I have a big question! Your last query is friendship(josh, brittney). it outputs true, no doubts. However, if you hit , it will give you another solution, FALSE. Why is that? What does that mean?
    I did some google search, and it seems like prolog gives you multiple solutions if there exists more than one solution. To view the second or third solution, one presses . In other words, Josh and Brittney are friends and not friends? What? Please clarify. Need help!
    Many Thanks!

    • @MdAbdullahAlFahim
      @MdAbdullahAlFahim 10 лет назад +1

      I have the same question.

    • @jasonwilliam4157
      @jasonwilliam4157 9 лет назад +1

      If you want more solution you just hit " ; " until prolog responds False, which means it can not find more solution to the query. If you are done with the query, say prolog has returned the solution you want, but there are still more to return which are something you don't care, you can always hit " . " to stop the query.

    • @majoro7251
      @majoro7251 9 лет назад

      Jason William thanks for the dot notice man.
      Btw in recursion we append ",!." w/o quotes to prevent this unwanted "false" behavior.

  • @christianandersen8931
    @christianandersen8931 3 года назад

    Why not just use the editor in SWI Prolog?

  • @Rishiplays777
    @Rishiplays777 Год назад

    What’s the song played in the intro?

  • @julianperera4240
    @julianperera4240 8 лет назад

    • If it is a nice day and it is summer, then I go to the beach
    • If it is a nice day and it is winter, then I go to the canal boating resort
    • If it is not a nice day and it is summer, then I go to work
    • If it is not a nice day and it is winter, then I go to class
    • If I go to the beach, then I swim.
    • If I go to the canal boating resort , then I go boat riding
    • If I go boat riding or I swim, then I have fun.
    • If I go to work, then I make money.
    • If I go to class, then I learn something.
    How do i write this in prolog? I'm confused.

  • @paindeer
    @paindeer 6 лет назад

    Anyone want to commment on how likes is the predicate ? New to me somewhat, and I'm sure the author has it down, but I got confused thinking that Bobby might be the predicate there on #3?
    Could use some help as to why it's likes - vs bobby.
    In part the other two - the predicate was as the end, any thoughts would be great. Thanks

  • @shahdhruvi96
    @shahdhruvi96 7 лет назад

    i liked ur video and way of explanation.. but plz can tell me that prolog can help me in making a self learning chatbot?? .. waiting for ur ans

  • @namansinghal3685
    @namansinghal3685 6 лет назад

    What music played in the beginning?

  • @yuradanilkin7528
    @yuradanilkin7528 10 лет назад

    Does turbo prolog and prolog which you used are the same for mac?

  • @itsurlord2425
    @itsurlord2425 9 лет назад

    Could you plzz put up something regarding water jug problem using prolog,it would really be very helpful!!

  • @majoro7251
    @majoro7251 9 лет назад

    11111 views!
    This is a sign! I should finish up this series hehe.
    I'm really excited about it, we're taking Prolog in college but I wanna spend more time on understanding its fundamentals since I'm used to imperative languages more.

  • @Merthalophor
    @Merthalophor 9 лет назад +1

    wtf, this is crazy :D
    One day, I'll learn functional progrogramming.

  • @SuperNeowiz
    @SuperNeowiz 8 лет назад

    @The Simple Engineer
    Greetings, easy to understand.
    I have a question though, because the friendship rule will flag the guys who are dating too, how do you fix that?
    Thanks.

  • @petersonjr_y
    @petersonjr_y 5 лет назад

    Great tutorial...thanks..

  • @maxx-er3fj
    @maxx-er3fj 3 года назад

    Thanks, this helped a lot

  • @enryu4060
    @enryu4060 3 года назад

    bro, you saved me thank you !!

  • @sabiyashaikh7835
    @sabiyashaikh7835 8 лет назад

    thank u soo much...very well explained

  • @monyakroush
    @monyakroush 8 лет назад

    my midterm is on monday i have no idea what should i do :(

  • @japangly
    @japangly 6 лет назад

    this man for the tutorial

  • @felixwong5607
    @felixwong5607 3 года назад

    Would it be possible to run ?- dating(X, sally). Would it return X = dan ?

    • @Raging.Geekazoid
      @Raging.Geekazoid 3 года назад +1

      Yep. You can even make both people variables.
      likes(dan,sally).
      likes(sally,dan).
      dating(X,Y) :- likes(X,Y), likes(Y,X).
      ----------------------------------------------------
      ?- dating(X,Y).
      X = dan, Y = sally
      X = sally, Y = dan

  • @kazbek_azirbayev
    @kazbek_azirbayev 7 лет назад

    Thank you very much, guy!

  • @ishaniherath8661
    @ishaniherath8661 5 лет назад

    Great explanation. and i have one question. if addProduct/0 is a rule, what does that mean by '/0' ? if you have a tutorial please suggest me.

  • @teshomebekele5341
    @teshomebekele5341 6 лет назад

    what is pl(user)?

  • @OsamaShakoor319
    @OsamaShakoor319 9 лет назад

    Really helpful. Thanks

  • @oppositecube
    @oppositecube 6 лет назад

    why u have mac os??

  • @gadeflorian886
    @gadeflorian886 7 лет назад

    Good Job!

  • @ayaosh1
    @ayaosh1 10 лет назад +1

    Thanks very much.

  • @denisr.8248
    @denisr.8248 8 лет назад

    TY for the Videos :)

  • @FlexXDXDXD
    @FlexXDXDXD 8 лет назад

    Thanks for help, bro)

  • @rychardguedes4118
    @rychardguedes4118 9 лет назад

    Great video, congrats!! As looks like you're still recording it, do you know a good site or RUclips channel to learn more about Prolog?

  • @sanabatool5573
    @sanabatool5573 4 года назад

    Thank you so much sir

  • @zeljkobekcic6713
    @zeljkobekcic6713 7 лет назад +1

    SWI is NOT an IDE. It is just the interpreter with an REPL.

  • @kaunglwin7503
    @kaunglwin7503 10 лет назад

    what is the song for intro?

  • @DavidSenna57
    @DavidSenna57 2 года назад

    Thank you!

  • @RGawishable
    @RGawishable 9 лет назад +1

    dating (X,Y) :- likes(X,Y),likes(Y,X),YX.
    shouldn't we use (not equal) since we are using the same relation twice ?

    • @chemistrywaalla
      @chemistrywaalla 7 лет назад

      RGawishable Not equal to is denoted by X/=Y is guess :!

  • @milanewert4523
    @milanewert4523 5 лет назад

    Johny has feelings too!

  • @nawrin6636
    @nawrin6636 5 лет назад

    Thank you so much

  • @abdulrahmanhamdy6157
    @abdulrahmanhamdy6157 8 лет назад

    awesome!

  • @sanketbiswas2275
    @sanketbiswas2275 8 лет назад

    What is the name of the song?

  • @ayeshzahid240
    @ayeshzahid240 7 лет назад

    thanks a lot Sir awesome

  • @shahadalmubarak1469
    @shahadalmubarak1469 7 лет назад

    hello there, thank you so much for this helpful tutorial
    i have a homework on prolog that i couldn't solve and i couldn't understand
    would you please like to help ?

  • @Inquire98
    @Inquire98 7 лет назад +1

    "Thank You", thank you very much. I downloaded Visual Prolog, and wanted to know, if you could recommend a good book for beginners?
    Let me know. I look forward to hearing from you 😎

  • @jettyjoker
    @jettyjoker 8 лет назад

    this is not a database, it is called KB (knowledge base).

  • @meriemkh4382
    @meriemkh4382 6 лет назад

    awsome tuto rlly dude thnx loooooot

  •  9 лет назад

    yup. brilliant tutorials!. keep em commin` my man, and yup i will share you everywhere :D and think about DONATE button or something somewhere here :) i mean, you need to be motivated. and stuff you are doing is damn cool!

  • @ercanu7398
    @ercanu7398 8 лет назад

    Thanks for your video (y)

  • @MaroonParamore23
    @MaroonParamore23 9 лет назад

    thank you

  • @Indiiyana
    @Indiiyana 8 лет назад +1

    Josh got friend zoned. Sucks for him.

  • @conman2317
    @conman2317 9 лет назад

    compile doesn't work

  • @NayanTiwariOfficial
    @NayanTiwariOfficial 9 лет назад +1

    Bucky Roberts....!! :D

  • @johanmanuelbalceiro791
    @johanmanuelbalceiro791 3 года назад

    nice thank you

  • @AL-go2mv
    @AL-go2mv 7 лет назад

    Song? I think we like the same music haha.

  • @M4SSDEBATER
    @M4SSDEBATER 4 года назад

    Sometimes in the middle of the night it burns when I have to get up and pee