Yet another great video exposition of Prolog. Thank You! However, I am confused concerning the use of "disequality" over "inequality". If I'm honest, I don't really understand the distinction. Help?
@ThePowerOfProlog5 жыл бұрын
Thank you so much for your kind words! "Disequality" denotes the negation of equality, whereas the relations "less/greater than" and "less/greater than or equal to" are called "inequalities".
@simonsaville99625 жыл бұрын
@@ThePowerOfProlog Thanks for the explanation, quite simple really.
@RenanNespolo9 ай бұрын
man, I would like to learn plot the tree like in minute 1:14, did you have a vídeo of configuration of make trees?
@ThePowerOfProlog9 ай бұрын
Thank you a lot for your interest! Please see the following descriptions in the "tools" directory of Scryer Prolog: github.com/mthom/scryer-prolog/tree/master/tools I hope this helps!
@brianchuquiruna69593 жыл бұрын
Is CLP a library for prolog? How I can install it?
@neomika923 жыл бұрын
Just go to 6:00 ...
@alamagordoingordo30473 жыл бұрын
Why to me don't work? with n_factorial(N,F). the result is F = 1. N = 0 ? an then if i press ; yes and stop, no other solutions. P.S. I use GNU prolog.
@ThePowerOfProlog3 жыл бұрын
You can debug the program decelaratively by removing goals, making the program more general. For example, the following goal alone already fails in GNU Prolog: F #= A*B. Therefore, every specialization (i.e., additional constraints) fails too. I recommend to try it for example with Scryer or SICStus Prolog, which are also conforming to the ISO standard and support multiplication more generally.
@alamagordoingordo30473 жыл бұрын
@@ThePowerOfProlog Scryer unlike SICStus is free?
@ThePowerOfProlog3 жыл бұрын
@@alamagordoingordo3047 Yes, Scryer is free.
@alamagordoingordo30473 жыл бұрын
@@ThePowerOfProlog Install Scryer is so difficult, i'm not a docker fan...
@marceloslacerda5 жыл бұрын
Expressing the example presented I get an unexpected answer: ?- (Chicken * 2) + (Cow * 4) #= 74, Chicken + Cow #= 30. Chicken+Cow#=30, Chicken+2*Cow#=37. While it is correct, it's weird that prolog decided to evaluate to another expression rather than saying the values of the free terms.
@ThePowerOfProlog5 жыл бұрын
You are almost there! The challenge is to state explicitly everything you know about the task. Thank you for your interest!
@marceloslacerda5 жыл бұрын
When I constrain the expression to Chicken #> 0 and Cow #> 0 I get the correct results, but I don't understand, in this problem shouldn't there be only one answer even without the new constraints?
@ThePowerOfProlog5 жыл бұрын
Try to use the Prolog system to see whether that is indeed the case, i.e., if there are no solutions where these additional constraints are not satisfied, but the others are satisfied!
@marceloslacerda5 жыл бұрын
@@ThePowerOfProlog Ah I see now. Thanks!
@panjak3232 ай бұрын
Why not "is" instead of #=
@ThePowerOfProlog2 ай бұрын
(is)/2 works only if the right-hand side is ground. For example, we get: ?- X is Y + 3. error(instantiation_error,(is)/2). Whereas (#=)/2 can be used in all situations, and is therefore a lot more general and easier to use. For example: ?- #X #= #Y + 3. clpz:(#Y+3#=#X).
@panjak3232 ай бұрын
@@ThePowerOfProlog yeah right, but isn't there also other syntax for numeric evaluation equality? Never seen #= in university course, as they forbidden usage of any modules anyways.
@derekfrost89914 жыл бұрын
I really like your videos, but sometimes I have to listen at 0.75 speed to understand it all.. :)
@ThePowerOfProlog4 жыл бұрын
Thank you a lot, this is one of the nicest compliments I have heard about these videos, at least regarding the information content!
@none_of_your_business2 жыл бұрын
I have defined the following predicate: n_factorial(0, 1). n_factorial(N,F) :- N #> 0, F #= N*F1, N1 #= N - 1, n_factorial(N1, F1). Yet for some reason when I try to query all possible solutions in gprolog I get the first solution: 0! = 1, then if i press ";" It just says "no" and it returns me to the ?- prompt, any idea why? | ?- ['fact']. compiling /home/obsrwr/work/fact.pl for byte code... /home/obsrwr/work/fact.pl compiled, 7 lines read - 837 bytes written, 6 ms yes | ?- n_factorial(N,F). F = 1 N = 0 ? ; no