My teacher gave me the following rule for implementing a logical not
in prolog:
not( X ) :- X, !, fail.
not( _ ).
I'm having a really hard time understanding it though. I somewhat get that !
means cut, but I'm baffled as to how this works in this scenario, as well as what the second line is trying to achieve. Can anybody please help me understand?