Predicate that checks deadlock
问题 I just want someone to help me in this, because I want a function that can check deadlock for the below code. So, by checking the deadlock we will get the execution order of the process. If its in safe state with no deadlock and if there is a deadlock, just print out false. But I could not do it in Prolog, so can someone help me out to modify the below code to make it print false if its having a deadlock? processes([1,2,3,4]). request(1,r1). request(3,r2). allocated(1,r2). allocated(2,r1).