
867 P.2d 463 (1994)
Benjamin F. CROCKETT and Norma Fay Crockett, Appellees,
v.
Faye F. McKENZIE, one and the same person as F.F. McKenzie, Ronald Louis Martin, Gary L. Martin, and the unknown successor of Louis H. Martin, a/k/a Lou H. Martin, Deceased, Appellants.
No. 73518.
Supreme Court of Oklahoma.
January 18, 1994.
Jack L. McNulty, Thomas M. Affeldt, Savage, O'Donnell, Scott, McNulty, Affeldt & Gentges, Tulsa, for appellees.
Thomas F. Birmingham, Hawley C. Kerr, Ungerman & Iola, Tulsa, for appellants.
*464 ALMA WILSON, Justice:
The appellees (Crocketts) sued the appellants (Martins) to quiet title to mineral interests and to obtain a money judgment for production proceeds. Although both parties originally moved for summary judgment, the Martins subsequently opposed the motion on grounds that certain instruments were ambiguous and extrinsic evidence was required to explain the intent of the parties. The trial court granted summary judgment and quieted title in the Crocketts to one-half of the minerals down to and including the Bartlesville Sand and all of the minerals below that formation. The court awarded the production proceeds from those formations subject to outstanding oil and gas leases.[1] The trial court quieted title in the Martins to the remaining one-half of the minerals down to and including the Bartlesville Sand. The trial court determined that the Martins had received $9,504.97 from the production of the minerals under valid oil and gas leases and awarded one-half that amount, that is, $4,752.50, to the Crocketts.
The Court of Appeals, with a strong dissent, reversed the trial court's grant of summary judgment, but rendered summary judgment on the quiet title claim in favor of the Crocketts, and on the claim for mineral proceeds in favor of the Martins. The Court of Appeals instructed the trial court to quiet title in all the minerals in the Crocketts and to award all the royalty proceeds from past production down to the Bartlesville Sand to the Martins. The issue on certiorari is whether summary judgment is proper. We hold it is not.
Summary judgment is proper where there is no dispute concerning any material facts, and reasonable persons would not reach different conclusions from those facts. The moving party has the burden of showing that there is no substantial controversy as to any material fact. All inferences in the evidence must be taken in favor of the party opposing the motion. Hargrave v. Canadian Valley Elec. Co-op., 792 P.2d 50, 55 (Okla. 1990).
In support of the motion for summary judgment, the Crocketts included thirteen instruments in the chain of title as exhibits to the trial court. The Martins submitted nine instruments in the chain of title, two of which were not found in the exhibits of the Crocketts. All parties and the trial court agreed that one of those instruments is ambiguous, *465 that is, an instrument titled "Mineral Deed" and dated March 14, 1977. This instrument is vital in the chain of title claimed by the Crocketts. Ambiguity in this instrument creates a substantial controversy as to a material fact rendering summary judgment inappropriate. Furthermore, serious problems of construction remain on other instruments in the chain of title, which problems the parties have addressed on appeal. As an aid to the trial court on remand, we shall address these problems as well.
Determining whether a conveyance is ambiguous is a matter of law. Messner v. Moorehead, 787 P.2d 1270, 1273 (Okla. 1990). When the court determines that a deed is ambiguous, the court has a duty to resolve the ambiguity by considering parol and extrinsic evidence, including the parties' admissions and construction, and other circumstances. Messner, 787 P.2d at 1273. When interpreting a conveyance, the court must give effect to the intent of the parties. Title 15 O.S. 1991, § 152 provides: "A contract must be so interpreted as to give effect to the mutual intention of the parties, as it existed at the time of contracting, so far as the same is ascertainable and lawful." Such a rule is basic to the law of contracts because a contract is an agreement. 15 O.S. 1991, § 1. Section 156 of the same title provides: "When through fraud, mistake, or accident, a written contract fails to express the real intention of the parties, such intention is to be regarded, and the erroneous parts of the writing disregarded." Sections 154 through 178 of title 15 provide rules for interpretation.
The instruments in the chain of title involved in this cause were prepared by persons without an appreciation for the legal meaning of terms of real property conveyance. General terms are used that have no specific meaning and no meaning can be ascertained by an examination of the instruments.[2] All but four of the fifteen instruments in the chain of title have members of the Martin family as either grantor, grantee, or both. Serious problems of intent arise from those instruments whose design was to convey some property interest between members of the Martin family. Many of the documents are so poorly drafted that discerning the intent of the document from its four corners is impossible.
A brief description of the fifteen documents in the chain of title follows:
August 16, 1961 This instrument was an assignment of 1908 and 1916 oil and gas leases from Richardson Supply Corporation to Louis Martin. This assignment included the leasehold interest down to and including the Bartlesville Sand. The actual leases were not included in the record.
November 10, 1964 This instrument was a special warranty deed in which Muskogee Production Credit Association conveyed the eighty acre tract of land in North Tulsa County to Louis and Mary Martin, husband and wife. The deed excepts the "presently existing oil and gas lease thereon which the Party of the Second Part is operating." Because the deed does not create a specific tenancy, the parties to this lawsuit agree that Louis and Mary were tenants in common.
January 1, 1966. This instrument is entitled "Quit-Claim Deed." In it Louis conveyed "All my undivided one-half interest in and to the following," and he subsequently described the eighty acre tract. He made this conveyance to Ronald Martin, his son, but reserved to himself "any and all rights to the oil and gas leasehold estate covering said tracts."
December 17, 1966 In this instrument Louis assigned "all of Assignor's right, title and interest in and to the following described oil and gas lease," to the Astro Corporation.
July 7, 1969 Mary quitclaimed her one-half interest in the eighty acre tract to Ronald.
July 15, 1974 Louis conveyed "1/2 of 1/8 R.I (. 0625000)" to Gary Martin, another son.
*466 May 1, 1976 Astro Corporation assigned 7/8ths working interest to Faye F. McKenzie.
October 16, 1967 Ronald assigned an overriding royalty interest to Gary, his brother. Although the printed form entitled "Assignment of Over-Riding Royalty" has a blank space to allow the drafter to indicate the percentage of undivided interest being assigned, the space was left blank. The typewritten paragraph grants "All rights above and including the Bartlesville Sand... ." The parties agree that Ronald had no working interest in the minerals.
February 1, 1977 In this quitclaim deed, Ronald conveyed all of his right, title and interest to 37.49 acres to Gary L. Martin and Joyce Sterling in their capacity as trustees. This document in not part of the lawsuit, but explains where a large part of the eighty acre estate was conveyed.
March 14, 1977 In a document entitled "Mineral Deed," Ronald conveyed to Gary "an undivided 1/2 of 1/8 R.I." in the "JENNIE MURRAY LEASE ... above and including the Bartlesville Sand. .. ." THE APPELLEES CONCEDED THAT THIS DOCUMENT IS AMBIGUOUS, AND THE TRIAL COURT AGREED. Nevertheless, it found the instrument granted a 1/2 interest in the oil, gas and other minerals above and including the "Bartlesville Sand."
December 1, 1980 Ronald mortgaged the subject forty acres to Union National Bank.
July 16, 1981 In a form entitled "Sale of Oil and Gas Royalty," Gary conveyed an undivided 3/4ths interest in and to all of the oil, gas and other minerals in the 80 acre tract to F.F. McKenzie.
February 2, 1983 Faye F. McKenzie assigned "The full seven-eighths (7/8) working interest" to Richard C. Barnett, J.R. Pravnan and Ronald L. Wadley, each an undivided one-third.
August 2, 1983 Bank foreclosed on Ronald's mortgage and gave Home Investments, Inc., a Sheriff's Deed.
August 29, 1983 Home Investments conveyed the forty acres by general warranty deed to the Crocketts.
Through two conveyances,[3] Louis Martin obtained first, the mineral lease to the eighty acre tract, and subsequently obtained the deed to the property, which he held with his wife as tenant in common. The first document containing an ambiguity is a quitclaim deed, dated January 1, 1966, from Louis to his son, Ronald Martin, in which Louis conveyed his one-half interest to the eighty acre tract, but reserved "any and all rights to the oil and gas leasehold estate covering said tracts." The Martins argue that Louis intended to reserve his mineral estate as well as his leasehold estate. The Crocketts answer that Louis reserved only the leasehold estate and recite that the instrument is "totally unambiguous in its terms." But what had Louis reserved? He stated that he was reserving all rights to the leasehold estate. Was he also reserving the rights of lessor? Was he reserving to himself the power to lease, the right to bonus, the right to delay rentals, the right to royalty, the right to shut-in royalty?[4] The Crocketts presume without support that Louis simply desired to reserve his leases as lessee. But his subsequent actions reveal otherwise. On December 17, 1966, he assigned "all of Assignor's right, title and interest in and to the following described oil and gas lease," to the Astro Corporation.[5] On July 15, 1974, in a printed form entitled "MINERAL DEED" Louis conveyed "1/2 of 1/8 R.I (. 0625000)" in the "Jennie Murray Lease" above and including the Bartlesville Sand to his son, Gary.[6] Based *467 on those two instruments, Louis appeared to believe that down to and including the Bartlesville Sand, he held both the leasehold and one-half of the mineral/royalty interests in the tract.[7]
On July 7, 1969, Mary Martin quitclaimed without reservation her one-half interest in the eighty acre tract to Ronald. The third document that the Martins allege is ambiguous is dated October 16, 1976. In that printed form entitled "ASSIGNMENT OF OVERRIDING ROYALTY," the blank space allowing the drafter to indicate the percentage of undivided interest being assigned is not filled in. A typewritten paragraph following the printed form that purported to "grant, bargain, sell, convey, transfer, assign and deliver" provides the conveyance of "All rights above and including the Bartlesville Sand at the approximate depth of 1,185 feet ..." covering a legal description of forty acres, and also conveys a larger tract covering all of the eighty acre estate, not limited by depth.
Hininger v. Kaiser, 738 P.2d 137, 140 (Okla. 1987) describes the attributes of an overriding royalty:
An "overriding royalty" generally arises through contracts between the lessee and a third person. It is a fractional interest in the gross production of oil and gas under a lease in addition to the royalty reserved to the land owner or lessor. Overriding royalties are not charged with the cost of development or production. Overriding royalties are not royalties payable to the lessor under Mason v. Ladd Petroleum Corporation, 630 P.2d 1283-84 (Okla. 1981), therefore, they cannot be charged as lifting costs against the working interest owners.
By this description, Ronald, who has no working interest under any construction of the instruments, cannot assign an overriding royalty to Gary. The Martins argue that Ronald intended for the instrument to assign all of his mineral interest to Gary. The Crocketts answer that the instrument conveyed nothing. But if neither Ronald nor Gary understood the difference between an overriding royalty and a royalty interest, they chose the wrong form to convey Ronald's interest. The document is ambiguous. Title 15 O.S. 1991, § 159 provides: "A contract must receive such an interpretation as will make it lawful, operative, definite, reasonable and capable of being carried into effect, if it can be done without violating the intention of the parties." An interpretation of a contract is favored that makes an agreement lawful and valid.[8] The statutes provide that a written contract may be reformed when through mistake the contract fails to express the real intention of the parties.[9]
*468 The parties agree and the trial court found that the instrument dated March 14, 1977, is ambiguous. The instrument has the same problems as the conveyance of July 15, 1974, discussed above. While it is entitled "Mineral Deed," it grants "an undivided 1/2 of 1/8 R.I." The two instruments mix terms that are technically incompatible. Obviously, the drafters of the documents had little appreciation of the legal effect of the words they chose. If the family is confusing royalty interest with mineral interest, then this document may have been intended to convey the mineral interests of Ronald, as the trial court found. Under certain circumstances, equity will grant relief where parties have made a mistake as to the legal meaning and operation of the terms of language employed in a writing. Hudson v. Smith, 171 Okla. 79, 41 P.2d 861, 864 (1935); Whittaker v. White, 169 Okla. 336, 37 P.2d 247, 250 (1934). Whittaker quotes Bagby v. Martin, 118 Okla. 244, 247 P. 404, 406 (1926):
[I]f parties who mutually agree on the terms of a contract choose and use legal phrases and terms in the contract, which, in legal effect, express a different meaning from that agreed upon, a court of equity will reform or cancel the contract according to the equities of the case.
Such a rule has resulted in a number of oil and gas cases where the term "royalty" has been treated as uncertain in meaning.[10] But the ambiguity in the July 15, 1974, and the March 14, 1977, instruments must be resolved after the presentation of evidence by the parties to the contract.[11]
We find ambiguity in the four instruments described above and conclude that summary judgment was improper. The opinion of the Court of Appeals is VACATED. The judgment of the trial court is REVERSED AND REMANDED with instructions to proceed to trial so that the ambiguities in the chain of title may be resolved in a manner consistent with this opinion.
OPALA, KAUGER, SUMMERS and WATT, JJ., concur.
SIMMS, J., concurs in result.
HODGES, C.J., LAVENDER, V.C.J., and HARGRAVE, J., dissent.
NOTES
[1]  The Bartlesville Sand is stated in the recorded instruments as being approximately 1,185 feet below the surface.
[2]  Title 15 O.S. 1991, § 155 provides: "When a contract is reduced to writing, the intention of the parties is to be ascertained from the writing alone, it possible, subject, however, to the other provisions of this article."
[3]  He received the assignment of the lease through the August 16, 1961, instrument, and the deed to eighty acre estate through the November 10, 1964, instrument.
[4]  This list of rights is found in R. Hemingway. The Law of Oil and Gas 37 (3rd ed. 1991).
[5]  He assigned both the 1908 and 1916 leases covering all rights above and including the Bartlesville Sand.
[6]  The 1908 lease was by and between James Murray, Guardian of Jennie Murray, a minor, as lessor, and Lucknow Oil Company, as lessee. The 1916 lease was by and between W.M. Morris, Guardian of Lizzie Murray, as lessor and Woherine Oil Company, as lessee. But the legal description of the "Mineral Deed" from Louis to Gary covers both the 1908 and 1916 leases. Even though the 1916 lease was for the production of minerals "above and including the Bartlesville Sand," the legal description in the deed to Gary does not provide the limiting language "above and including the Bartlesville Sand."
[7]  The July 15, 1974, instrument also presents ambiguities: Whether R.I. stands for royalty interest, and whether Louis Martin used royalty interest and mineral interest interchangeably, meaning mineral interest. These problems arise again in the March 14, 1977, instrument between Ronald Martin and Gary Martin.
[8]  Mussellem v. Magnolia Petroleum Co., 107 Okla. 183, 231 P. 526, 531 (1925). Corbin writes:

"The belief of the parties to an agreement that it would have a specific legal effect is not a sufficient reason for giving it that effect. They may believe, for example, that a written promise is enforceable, even though there is neither seal nor consideration. Such a belief and an intention to produce a legal effect, however, are not wholly irrelevant to the process of interpretation. The purpose of that process is to determine `meaning'; and meaning consists of concepts and ideas of some person or persons Those persons may have only vague ideas of `legal effects' of their words and acts; but under modern conditions of education and civilization the case must be rare in which the parties do not mingle ideas of legal effect with their ideas as to persons and things and performances that they try to express in words. It is this intermingled `meaning' that they try to express; and it would do gross injustice to overlook the fact in the process of interpretation. The court may not always be able to give to an agreement the legal effect that was expected by the parties; but it should do so unless there is good reason not to do so." (Footnotes omitted.)
3 A. Corbin, Corbin on Contracts, § 546 (1960).
[9]  15 O.S. 1991, § 156.
[10]  R. Hemingway, The Law of Oil and Gas 78-84 (3rd ed. 1991). Professor Hemingway criticizes the approach of the Oklahoma courts in attempting to determine the intent of the parties concerning the meaning of "royalty" by reference to the circumstances outside the instrument. But where the term is mixed with inconsistent terms so that the intent is still unclear after examination of the instrument according to the rules of construction found in title 15, the court has a duty to resolve the ambiguity by considering parol and extrinsic evidence. Messner v. Moorehead, 787 P.2d 1270, 1273 (Okla. 1990).
[11]  We express no opinion concerning the resolution of the ambiguities in the instruments discussed. Because identification of ambiguity is a matter of law, we have by this opinion corrected the legal error. We express no opinion concerning the resolution of the factual problems presented by the ambiguous instruments. These issues must be determined after remand to the trial court.
