Implemented funtion create_lock and the predicate create_lock. Implem…