Certain provisions of law are of such a character that the parties can not prevent the application of such legal principles by any contractual provisions.1 Other provisions of law are binding upon the parties in the absence of inconsistent provisions in the contract, but if the parties indicate clearly that they intend to fix their rights by their agreement rather than by the rules of law which apply in the absence of an agreement, full effect will be given to their intention.2 The rule that the law is to be regarded as a part of a contract is much more imperative in the case of a rule of law which the parties can not set aside by the terms of their contract, than it is in the case of a rule of law which applies in the absence of contract, but which the parties may avoid if they so wish. In the former case the contract must be treated as invalid if it is inconsistent with the law,3 and accordingly the rule that a contract must be upheld by construction, if possible,4 requires the court to construe the contract so as to render it consistent with such rules of law. In such cases provisions which are apparently contrary to the law which is in force will be construed, if possible, so as to be consistent with the law.5

If the intention of the parties to violate the law is so plain that the court can not extract a legal intention from the language which is used, the result will be that the contract is in part or in whole invalid.6

If the rule of law is one which the parties may avoid by the terms of their contract, the court is not given the choice between construing the contract in accordance with the rule of law or of declaring the contract to be invalid; and accordingly the courts do not feel bound to exercise as much ingenuity in reconciling the contract with the provisions of the law as they do in cases in which a failure to reconcile the contract with the provisions of the law will result in declaring the contract invalid.