Exhibit 10.4

LEASE AND SUBLEASE

TERMINATION AGREEMENT

THIS LEASE AND SUBLEASE TERMINATION AGREEMENT (this Agreement), dated for reference purposes only as of July 31, 2006, is made by
and between CARR NP PROPERTIES L.L.C., a Delaware limited liability company (successor in interest to CarrAmerica Realty Operating Partnership, L.P.) (Landlord), SCHLUMBERGER TECHNOLOGY CORPORATION, a Texas corporation
(successor in interest to Schlumberger Technology, Inc.) (Tenant) and CREDENCE SYSTEMS CORPORATION, a Delaware corporation (Credence).

R E C I T A L S:

A. Landlord and Tenant are parties to that certain Lease dated June 7, 1999,
as amended by that certain First Amendment to Lease dated January 5, 2000 (as amended, the Master Lease) for certain premises consisting of approximately 150,000 rentable square feet (the Premises), within
those certain Buildings A and C located at 150 and 160 Baytech Drive, San Jose, California, as more particularly described in the Master Lease.

B. Tenant subleased the entire Premises to NPTest, Inc., a Delaware corporation (NPTest) in accordance with a certain sublease (the Sublease) dated July 29, 2003.

C. Credence acquired NPTest Holding Corporation, the prior parent of NPTest (the Prior Parent) by merger of the Prior Parent into a
subsidiary of Credence. As a result of said merger, the Prior Parent became a wholly owned subsidiary of Credence. Subsequently, NPTest and the Prior Parent have been merged into Credence and, therefore, Credence is the current subtenant of the
entire Premises in accordance with the Sublease.

D. The term of the Master Lease and the Sublease are scheduled to expire on
October 31, 2009 (the Expiration Date).

E. Landlord, Tenant and Credence desire to terminate the Master Lease, the
Sublease and any other rights or interests that Tenant or Credence may have in the Premises prior to the Expiration Date, upon the terms and conditions set forth below.

A G R E E M E N T:

NOW, THEREFORE, in consideration of the respective promises and covenants of the
parties hereinafter set forth, and for other good and valuable consideration, the receipt and sufficiency of which are hereby acknowledged, the parties agree as follows:

1. Definitions; Incorporation of Recitals; Conflicts with Lease. Unless the context clearly requires otherwise, capitalized terms used in this Agreement which are not otherwise defined herein shall have the
meaning given such terms in the Master Lease. All of the Recitals above are hereby incorporated herein. In the event of any conflict between the Master Lease or the Sublease and this Agreement, the terms of this Agreement shall control.

2. Termination of Lease and Sublease. Landlord, Tenant and Credence hereby agree to terminate the Master Lease and the Sublease as of 11:59
p.m. on July 31, 2006 (the Termination Date).



---

3. Termination Payments. As a material inducement to Landlords agreement to terminate the
Lease before the Expiration Date,

(a) Tenant agrees that Landlord may retain the Security Deposit presently held by Landlord, in the amount
of Two Hundred Forty-Seven Thousand Five Hundred Dollars ($247,500.00);

(b) Credence agrees to pay to Landlord, (i) no later than
12:00 p.m. on August 1, 2006, the amount of Two Million Dollars ($2,000,000.00), by wire transfer or other immediately available funds; and (ii) in accordance with the terms of the promissory note attached hereto as Exhibit A, which
shall be delivered by Credence to Landlord concurrently with Tenants and Credences execution and delivery of this Agreement to Landlord, an additional amount equal to Five Million Nine Hundred Thirty-Nine Thousand Dollars
($5,939,000.00);

(c) Tenant, Credence, and Landlord recognize and agree that the transfers and payments made and to be made under this
Paragraph 3, and under the promissory note attached hereto as Exhibit A, are intended by the parties hereto to be contemporaneous exchanges for new value given by Landlord to Tenant and Credence, and in fact are substantially contemporaneous
exchanges; and

(d) Tenant, Credence, and Landlord recognize and agree that the transfers and payments made and to be made under this
Paragraph 3, and under the promissory note attached hereto as Exhibit A, are in payment of a debt incurred by Tenant and Credence in the ordinary course of business or financial affairs of Tenant, Credence and Landlord, and that such
transfers and payments are made in the ordinary course of business or financial affairs of Tenant, Credence and Landlord and/or are made according to ordinary business terms.

4. Surrender of Premises/Termination of Contracts and Agreements.

(a) Surrender of Premises. On or before the Termination Date, Credence shall vacate and surrender the Premises in accordance with the provisions of the Master Lease, including, without limitation,
Section 15 of the Master Lease; provided, however, that, notwithstanding any provision of the Master Lease or Sublease to the contrary, neither Credence nor Tenant shall have any obligation to remove any of the existing leasehold improvements
or furniture systems (Furniture Systems) located in the Premises, or restore the Premises to their condition prior to the installation or construction of such items. Furthermore, notwithstanding any provision of the Master Lease
or Sublease to the contrary, but without limiting all other obligations of Tenant and Credence contained in Section 15 of the Master Lease, including, without limitation, the removal of all personal property other than the Furniture Systems,
the replacement of any burned out or broken light bulbs or ballasts, etc., neither Tenant nor Credence shall have any obligation to make minor repairs to walls, prepare walls for paint, replace broken, marred or nonconforming acoustical ceiling
tiles, wash windows, clean floors or carpets (other than broom clean). Prior to the Termination Date, Credence shall deliver to Landlord records showing the HVAC system is in good working order.

(b) Furniture Systems. Credence hereby sells, transfers, assigns and conveys to Landlord title to the Furniture Systems, and agrees that Landlord
shall have the exclusive use and possession of the Furniture Systems from and after the Termination Date.



---

(c) Termination of Contracts and Agreements. On or prior to the Termination Date, Tenant and
Credence shall terminate, effective as of the Termination Date, all contracts and agreements to which Tenant and/or Credence is a party which concern the Premises.

5. Liability Under Lease and Sublease. After 11:59 p.m. on the Termination Date, (a) Tenant and Landlord shall have no further rights, obligations, or claims with respect to each other arising under the
Master Lease, except for any obligation of Tenant under the Master Lease which by their terms expressly survive termination, and any obligation arising under this Agreement; and (b) Tenant and Credence shall have no further rights, obligations,
or claims with respect to each other arising under the Sublease, except for any obligation of Credence under the Sublease which by their terms expressly survive termination, and any obligation arising under this Agreement.

6. Representations, Warranties, and Covenants of Tenant and Credence.

(a) Tenant Representations. Tenant represents, warrants and covenants to Landlord that (i) it has not assigned, encumbered or otherwise
transferred the Master Lease, or any interest under the Master Lease, or any claim, obligation, action or cause of action arising from the Master Lease, or sublet all or any part of the Premises except pursuant to the Sublease; (ii) nothing
will be (or, to Tenants knowledge, has been) done or suffered whereby any alterations, decorations, installations, additions or improvements in and to the Premises or any part thereof, have been or will be encumbered in any way whatsoever;
(iii) no proceeding has been commenced by or against Tenant which seeks to declare Tenant a bankrupt or an insolvent or to liquidate or dissolve Tenant, Tenant has made no general assignment of its assets for the benefit of its creditors, and
no corporate action has been taken by Tenant authorizing any such proceeding, assignment or action; (iv) Landlord is not in default under the Lease by reason of its failure to perform any obligations thereunder, and, to Tenants knowledge,
there is no circumstance, event, condition or state of facts which, by the passage of time or the giving notice, or both, could result in such a default; and (v) this Agreement constitutes a legal, valid and binding Agreement of Tenant
enforceable against Tenant in accordance with its terms.

(b) Credence Representations. Credence represents, warrants and covenants
to Landlord that (i) it has not assigned, encumbered or otherwise transferred the Sublease, or any interest under the Sublease, or any claim, obligation, action or cause of action arising from the Sublease, or further sublet all or any part of
the Premises; (ii) nothing will be (or, to Credences knowledge, has been) done or suffered whereby any alterations, decorations, installations, additions or improvements in and to the Premises or any part thereof, have been or will be
encumbered in any way whatsoever; (iii) no proceeding has been commenced by or against Credence which seeks to declare Credence a bankrupt or an insolvent or to liquidate or dissolve Credence, Credence has made no general assignment of its
assets for the benefit of its creditors, and no corporate action has been taken by Credence authorizing any such proceeding, assignment or action; (iv) to Credences knowledge, Landlord is not in default under the Master Lease by reason of
its failure to perform any obligations thereunder, nor is there any circumstance, event, condition or state of facts which, by the passage of time or the giving notice, or both, could result in such a default; and (v) this Agreement constitutes
a legal, valid and binding Agreement of Credence enforceable against Credence in accordance with its terms.



---

7. Miscellaneous.

(a) Time of the Essence. Time is of the essence for each and every obligation arising under this Agreement.

(b) Successors and Assigns. This Agreement shall be binding upon and inure to the benefit of the parties hereto and their respective successors and assigns.

(c) Survival. The covenants, representations and warranties and releases under this Agreement shall survive the termination of the Lease.

(d) Governing Laws. This Agreement shall be construed under and shall be governed by the laws of the State of California.

(e) Construction; Severability. This Agreement is the product of negotiations between the parties and shall not be construed
strictly for or against either party. If any provision of this Agreement shall be held to be invalid or unenforceable, it shall be adjusted rather than voided, if possible, in order to give effect to the intent of the parties, and all other
provisions of this Agreement shall continue in full force and effect to the extent permitted by law.

(f) Attorneys Fees. In
any arbitration, quasi-judicial or administrative proceedings or any action in any court of competent jurisdiction, brought by any party to enforce any covenant or any of such partys rights or remedies under this Agreement, including any
action for declaratory relief, or any action to collect any payments required under this Agreement or to quiet title against the other party, the prevailing party shall be entitled to reasonable attorneys fees and all costs, expenses and
disbursements in connection with such action, including the costs of reasonable investigation, preparation and professional or expert consultation, which sums may be included in any judgment or decree entered in such action in favor of the
prevailing party.

(g) Brokers/Finders. Each party represents and warrants to the other that no broker or finder has been engaged by
it in connection with the early termination of the Lease, except for Cornish & Carey Commercial (Broker), who shall be paid by Landlord a fee of $261,000 within fifteen (15) days following the Termination Date. In
the event any claim for brokers or finders fees or commissions is made by any party other than Broker in connection with the negotiation, execution or consummation of the transaction contemplated by this Agreement, then each party shall
indemnify, save harmless and defend the other parties from and against such claim and all losses, damages and costs, including reasonable attorneys fees and disbursements, if such claim is based upon any statement, representation or agreement
made or alleged to have been made by such party.

(h) Further Assurances. Landlord, Tenant and Credence agree without further
consideration to execute and deliver such other documents and to take such other action as may be necessary to consummate the purposes of this Agreement.

(i) Counterparts. This Agreement may be executed in three counterparts, each of which shall be deemed an original and all of which together shall constitute one and the same Agreement.

(j) Entire Agreement. This Agreement sets forth the entire understanding of the parties in connection with the subject matter hereof. None of the
parties hereto has made



---

any statement, representation or warranty in connection herewith except those expressly set forth herein, which has been
relied upon by the parties hereto or which has acted as inducement for the parties to enter into this Agreement.

(k) Faxed or PDF
Signatures. This Agreement may be executed by a partys signature transmitted by facsimile (fax) or by electronic mail in pdf format (pdf), and copies of this Agreement executed and delivered by means of faxed or pdf
signatures shall have the same force and effect as copies hereof executed and delivered with original signatures. All parties hereto may rely upon faxed or pdf signatures as if such signatures were originals. Any party executing and delivering this
Agreement by fax or pdf shall promptly thereafter deliver a counterpart of this Agreement containing said partys original signature. All parties hereto agree that a faxed or pdf signature page may be introduced into evidence in any proceeding
arising out of or related to this Agreement as if it were an original signature page.

IN WITNESS WHEREOF, the parties have executed this
Agreement as of the date first set forth above.



|                                                                                                                                          |  |                                                                                                                   |  |        |  | 
|----------------------------------------------------------------------------------------------------------------------------------------- |  | ----------------------------------------------------------------------------------------------------------------- |  | ------ |  | 
|LANDLORD:                                                                                                                                 |  | TENANT:                                                                                                          
|                                                                                                                                          | 
|CARR NP PROPERTIES L.L.C., a Delaware
limited liability company (successor in interest to CarrAmerica Realty Operating Partnership, L.P.) |  | SCHLUMBERGER TECHNOLOGY CORPORATION, a Texas corporation (successor in interest to Schlumberger Technology, Inc.)
|                                                                                                                                          |  |                                                                                                                   | 
|                                                                                                                                          |  |                                                                                                                   |  | By:    |  | 
|                                                                                                                                          |  |                                                                                                                   | 
|By:                                                                                                                                       |  |                                                                                                                   |  | Name:  |  | 
|                                                                                                                                          |  | Marshall Findley                                                                                                  |  |        |  | 
|                                                                                                                                          |  | Managing Director and Vice President                                                                              |  | Title: |  | 
|                                                                                                                                          |  |                                                                                                                  
|CREDENCE:                                                                                                                                 |  |                                                                                                                   |  |       
|                                                                                                                                          |  |                                                                                                                  
|CREDENCE SYSTEMS CORPORATION, a
Delaware corporation                                                                                      |  |                                                                                                                   |  |       
|                                                                                                                                          |  |                                                                                                                   | 
|By:                                                                                                                                       |  | /s/    JOHN C. BATTY                                                                                              |  |        |  | 
|                                                                                                                                          |  | John C. Batty                                                                                                     |  |        |  | 
|                                                                                                                                          |  | Chief Financial Officer                                                                                           |  |        |  | 



---

Exhibit A

PROMISSORY NOTE

See Attached



---

PROMISSORY NOTE



|           |  |                       
|---------- |  | ----------------------
|$5,939,000 |  | __________, __________
|           |  | July 31, 2006         

FOR VALUE RECEIVED ,the undersigned, CREDENCE SYSTEMS CORPORATION, a Delaware corporation
(the Payor), hereby promises to pay to the order of CARR NP PROPERTIES, L.L.C., a Delaware limited liability company (the Lender) the sum of Five Million Nine Hundred Thirty-Nine Thousand Dollars ($5,939,000)
(Principal) without interest except as herein provided. The Principal shall be due in four (4) payments in the amounts and on the dates set forth below (the Payment Dates), or on such earlier date as the Principal may
become due and payable by the terms of this Note.



|                 |  |              
|---------------- |  | -------------
|November 1, 2006 |  | $2,000,000.00
|August 1, 2007   |  | $1,313,000.00
|August 1, 2008   |  | $1,313,000.00
|August 1, 2009   |  | $1,313,000.00

The Principal shall be paid in the lawful currency of the United States of America at such address
as Lender may designate or, in the absence of such designation, at the address provided below for notice to Lender. This Promissory Note (Note) may be prepaid, without penalty, in whole or in part, at any time. All payments made
hereunder shall be first applied to reduce the Principal on this Note.

Each of the following events, acts, occurrences or conditions shall
constitute an event of default (Event of Default) under this Note:

(a) Payor shall fail to pay any amounts owed pursuant to
this Note on or before the respective Payment Dates.

(b) Payor shall fail to perform or observe any other material agreement, covenant or
obligation arising under this Note.

(c) Payor shall be in default under any material obligation for repayment of borrowed money from a
bank or other financial institution and such default shall continue beyond any applicable notice and cure period.

(d) (i) Payor shall
commence a voluntary case concerning itself under the Bankruptcy Code; (ii) an involuntary case is commenced against Payor and the petition is not controverted within fifteen (15) days or if timely controverted is not dismissed within
thirty (30) days, after commencement of the case; (iii) a custodian (as defined in the Bankruptcy Code) is appointed for, or takes charge of, all or substantially all of the property of Payor, or Payor commences any other proceedings under
any reorganization, arrangement, adjustment of debt, relief of debtors, dissolution, insolvency or liquidation or similar law of any jurisdiction whether now or hereafter in effect relating to Payor, or there is commenced against Payor any such
proceeding which remains active for a period of sixty (60) days; (iv) an order of relief or other order approving any such case or proceeding is entered; (v) Payor is adjudicated insolvent or bankrupt; (vi) Payor suffers any
appointment of any custodian or the like for it or any substantial part of its property to continue undischarged or unstayed for a period of thirty (30) days; (vii) Payor makes a general assignment for the benefit of creditors; or
(viii) Payor shall by any act or failure to act consent to, approve of or acquiesce in any of the foregoing.



---

Upon the occurrence of any Event of Default, all accrued Principal due under this Note shall become
immediately due and payable, without necessity of prior notice or demand. If this Note is not paid as required on the Payment Dates, or on such earlier date as all accrued Principal shall become due and payable, interest thereafter shall accrued at
the greater of (1) ten percent (10%) per annum, or (2) the Prime Rate plus five percent (5%) per annum, not to exceed the maximum rate permitted by law. As used herein, the term Prime Rate means the prime rate (or
base rate) reported in the Money Rates column or section of The Wall Street Journal as being the base rate on corporate loans at large U.S. money center commercial banks (whether or not such rate has actually been charged by any such bank) on the
first day on which The Wall Street Journal is published in the month preceding the month in which the subject sums are payable or incurred.

Payor shall pay to Lender all reasonable costs and expenses, including, without limitation, the fees and expenses of counsel and court costs, incurred in connection with any Event of Default or the enforcement by the Lender of any of its
rights or remedies with respect thereto.

Any written notice hereunder shall be delivered to Payor or Lender at the address for notice to
such party set forth below, or to such other person at such other address as the parties may designate by notice to the other.

To Lender
as follows:

Carr NP Properties L.L.C.

1810 Gateway Drive, Suite 150

San Mateo, CA 94404

Attn: Market Officer

with a copy to:

Carr NP Properties L.L.C.

1850 K Street, N.W., Suite 500

Washington, D.C. 20006

Attn: Lease Administration

To Payor as follows:

Credence Systems Corporation

1421 California Circle

Milpitas, CA 95035

Attn: Chief Financial Officer

with a copy to:

Credence Systems Corporation

5975 NW Pinefarm Place

Hillsboro, OR 97124

Attn: Legal

Payor waives presentment, demand for payment, notice of nonpayment and all other defenses to the enforcement of this Note other than prior payment.



---

All agreements between Payor and Lender are expressly limited, so that in no event or contingency,
whether because of the advancement of the proceeds of this Note, acceleration of maturity of the unpaid principal balance, or otherwise, shall the amount paid or agreed to be paid to Lender for the use, forbearance, or retention of the money to be
advanced under this Note exceed the highest lawful rate permissible under applicable usury laws. If, under any circumstances, fulfillment of any provision of this Note or any other agreement pertaining to this Note, after timely performance of such
provision is due, shall involve exceeding the limit of validity prescribed by law that a court of competent jurisdiction deems applicable, then, ipso facto, the obligations to be fulfilled shall be reduced to the limit of such validity. If under any
circumstances, Lender shall ever receive as interest an amount that exceeds the highest lawful rate, the amount that would be excessive interest shall be applied to reduce the unpaid principal balance under this Note and not to pay interest, or, if
such excessive interest exceeds the unpaid principal balance under this Note, such excess shall be refunded to Payor. This provision shall control every other provision of all agreements between Payor and Lender.

Time is of the essence with respect to all obligations of Payor under this Note.

This Note shall be governed by and construed in accordance with the laws of the State of California without regard to the conflicts of law provisions of
the State of California or any other state. If any provision hereof is found to be invalid or unenforceable by a court of competent jurisdiction, the invalidity thereof shall not affect the enforceability of the remaining provisions of this Note.



CREDENCE SYSTEMS CORPORATION,a Delaware corporationBy:

/s/    JOHN C. BATTYJohn C. BattyChief Financial Officer