Enforce functional dependencies by using triggers in SQL99
An instead of trigger is exactly that; it won't perform an insert even if data satisfy the constraint, so it won't be appropriate.

I understand that yours is a contrived example and that in real life you'll use a unique constraint to enforce such a rule, but the exists predicate nevertheless might be more efficient:

BEGIN 
  IF EXISTS (
    SELECT 1 FROM R
    WHERE R.A = N.A AND R.B = N.B AND R. C &lt;&gt; N.C;
  )
    THEN raise_exception ('AB-&gt;C on R was violated');
END;