
:- dynamic must_goal/0.

must(Goal, Msg) :-
	(  Goal
	-> true
	;   forall( retract(( must_goal :- _ )),
		    true ),
	    assert( must_goal :- Goal ),
	    format(user_error, 'must/2 failed, predicate "must_goal" has been (re)defined.~n', []),
	    throw(Msg)
	).
must(Goal) :-
	Goal =.. [F | _],
	must(Goal, failure_in_must(F)).
