Parse and generate unified diffs from Prolog