Is there a form of the verb "have" (have/has/had) that is used as a helping verb (followed by a main verb) in the following sentences?

It might never have occurred to the girl what to do had she not met someone smaller and still curious about the world. There was a time when the girl would have known how to answer her. But not now.