Nexty's Proof of Foundation Algorithm