Programming In Prolog Part 1 - Facts, Rules and Queries

Поділитися
Вставка
  • Опубліковано 18 вер 2024

КОМЕНТАРІ • 164

  • @eternal_psy
    @eternal_psy 9 років тому +16

    Best Prolog tutorial on UA-cam! 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.

  • @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.

  • @raiquiaarbiter7974
    @raiquiaarbiter7974 9 років тому +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 2 роки тому +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 6 років тому +123

    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 4 місяці тому

      @@reasonerenlightened2456 good detective work Captain Obvious

  • @TheSimpleEngineer
    @TheSimpleEngineer  9 років тому +29

    Thanks! Glad to have helped.

    • @CherryPauper
      @CherryPauper 9 років тому +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.

  • @zladsmusic8953
    @zladsmusic8953 2 роки тому +1

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

  • @Jombo1
    @Jombo1 7 років тому +53

    I can relate to Josh.

  • @ariffmarzuki8675
    @ariffmarzuki8675 9 років тому +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..

  • @AL-go2mv
    @AL-go2mv 6 років тому +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.

  • @clutchmadness
    @clutchmadness 4 роки тому

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

  • @blueisnotgreen7258
    @blueisnotgreen7258 7 років тому +7

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

  • @samqueen8337
    @samqueen8337 4 роки тому

    Best prolog video I've seen

  • @saifrehman2776
    @saifrehman2776 7 років тому

    this video deserves more upvotes

  • @bigavel165
    @bigavel165 9 років тому

    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

  • @TheSimpleEngineer
    @TheSimpleEngineer  9 років тому +8

    Song is Holiest by Glass Animals

  • @N7Martin
    @N7Martin 9 років тому

    The best tutorial on Prolog i saw, great work!

  • @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

  • @HassaanRaza
    @HassaanRaza 5 років тому

    very decent and good way of teaching!

  • @sumyatnoe1134
    @sumyatnoe1134 8 років тому

    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

  • @N.I.C.K-
    @N.I.C.K- 6 років тому

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

  • @ryansherman1946
    @ryansherman1946 7 років тому +2

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

  • @sahilverma9099
    @sahilverma9099 4 роки тому

    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.

  • @maharshpatel9243
    @maharshpatel9243 6 років тому +1

    Thanks a lot man. Amazing video. Really helpful

  • @NASHMVPMVP
    @NASHMVPMVP 9 років тому +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 9 років тому +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.

  • @dmitryponyatov2158
    @dmitryponyatov2158 4 роки тому +1

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

  • @samChakravartiSamrat
    @samChakravartiSamrat 3 роки тому

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

  • @bethwel9996
    @bethwel9996 11 місяців тому

    Very informative. Thank you

  • @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).

  • @ABCEE1000
    @ABCEE1000 8 років тому

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

  • @alexandrevalente9994
    @alexandrevalente9994 6 років тому

    Great video and clear explanation !

  • @oznurdogantimur8821
    @oznurdogantimur8821 9 років тому +1

    It was really helpful. I appreciate!

  • @funtrip6491
    @funtrip6491 7 років тому

    awesome and simple to follow !

  • @Merthalophor
    @Merthalophor 9 років тому +1

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

  • @ahmeddan7734
    @ahmeddan7734 8 років тому

    EXCELLENT JOB!

  • @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.

  • @maxx-er3fj
    @maxx-er3fj 2 роки тому

    Thanks, this helped a lot

  • @125saful
    @125saful 9 років тому

    Awesome tutorial mate. :D. Thanks again

  • @rafsanjanimuhammod309
    @rafsanjanimuhammod309 8 років тому

    Great Work, Sir !!!

  • @petersonjr8015
    @petersonjr8015 5 років тому

    Great tutorial...thanks..

  • @IvoirRienna
    @IvoirRienna 9 років тому +1

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

  • @hankzhou279
    @hankzhou279 8 років тому

    Thanks dude this is really helpful!

  • @jerryjerry9351
    @jerryjerry9351 5 років тому

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

  • @ayaosh1
    @ayaosh1 9 років тому +1

    Thanks very much.

  • @DavidSenna57
    @DavidSenna57 2 роки тому

    Thank you!

  • @kazbek_azirbayev
    @kazbek_azirbayev 7 років тому

    Thank you very much, guy!

  • @OsamaShakoor319
    @OsamaShakoor319 8 років тому

    Really helpful. Thanks

  • @sanabatool5573
    @sanabatool5573 3 роки тому

    Thank you so much sir

  • @japangly
    @japangly 5 років тому

    this man for the tutorial

  • @nawrin6636
    @nawrin6636 5 років тому

    Thank you so much

  • @sabiyashaikh7835
    @sabiyashaikh7835 8 років тому

    thank u soo much...very well explained

  • @enryu4060
    @enryu4060 2 роки тому

    bro, you saved me thank you !!

  • @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.

  • @itsurlord2425
    @itsurlord2425 8 років тому

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

  • @abdulsattarsuleman
    @abdulsattarsuleman 5 років тому +1

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

  • @gadeflorian886
    @gadeflorian886 7 років тому

    Good Job!

  • @julianperera4240
    @julianperera4240 7 років тому

    • 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.

  • @rychardguedes4118
    @rychardguedes4118 9 років тому

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

  • @NayanTiwariOfficial
    @NayanTiwariOfficial 9 років тому +1

    Bucky Roberts....!! :D

  • @afe5953
    @afe5953 3 роки тому

    thank you

  • @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! :/

  • @denisr.8248
    @denisr.8248 8 років тому

    TY for the Videos :)

  •  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!

  • @benjammin775
    @benjammin775 4 роки тому

    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 4 роки тому

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

  • @ayeshzahid240
    @ayeshzahid240 6 років тому

    thanks a lot Sir awesome

  • @FlexXDXDXD
    @FlexXDXDXD 8 років тому

    Thanks for help, bro)

  • @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.

  • @zeljkobekcic6713
    @zeljkobekcic6713 7 років тому +1

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

  • @milanewert4523
    @milanewert4523 5 років тому

    Johny has feelings too!

  • @abdulrahmanhamdy6157
    @abdulrahmanhamdy6157 8 років тому

    awesome!

  • @Inquire98
    @Inquire98 6 років тому +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 😎

  • @Developerorium
    @Developerorium 8 років тому

    thanks

  • @shahdhruvi96
    @shahdhruvi96 6 років тому

    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

  • @yuradanilkin7528
    @yuradanilkin7528 9 років тому

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

  • @johanmanuelbalceiro791
    @johanmanuelbalceiro791 2 роки тому

    nice thank you

  • @Angela-Gee
    @Angela-Gee 2 роки тому

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

  • @hinata2578
    @hinata2578 4 роки тому

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

  • @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

  • @meriemkh4382
    @meriemkh4382 5 років тому

    awsome tuto rlly dude thnx loooooot

  • @aceawan1562
    @aceawan1562 4 роки тому

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

  • @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.

  • @Rishiplays777
    @Rishiplays777 Рік тому

    What’s the song played in the intro?

  • @ercanu7398
    @ercanu7398 7 років тому

    Thanks for your video (y)

  • @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

  • @namansinghal3685
    @namansinghal3685 6 років тому

    What music played in the beginning?

  • @christianandersen8931
    @christianandersen8931 3 роки тому

    Why not just use the editor in SWI Prolog?

  • @NathanaelADavis
    @NathanaelADavis 3 роки тому

    what's the intro song called?

  • @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 :!

  • @Indiiyana
    @Indiiyana 7 років тому +1

    Josh got friend zoned. Sucks for him.

  • @nightcoremusic695
    @nightcoremusic695 4 роки тому

    great

  • @deveshbajaj8940
    @deveshbajaj8940 8 років тому

    What are the applications of this prolog language ???

  • @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.

  • @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 ?

  • @jettyjoker
    @jettyjoker 8 років тому

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

  • @johnnycasares8279
    @johnnycasares8279 2 роки тому

    nice

  • @neelkamdar5327
    @neelkamdar5327 2 роки тому

    Welcome the all person who comes after 7 year 😂.
    Love from India 🇮🇳

  • @M4SSDEBATER
    @M4SSDEBATER 3 роки тому

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

  • @teshomebekele5341
    @teshomebekele5341 6 років тому

    what is pl(user)?

  • @monyakroush
    @monyakroush 8 років тому

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