Halacha

הלכה א
הָאִשָׁה שֶׁאָמְרָה הֲרֵי עָלַי קֵן כְּשֶׁאֵלֵד זָכָר. יָלְדָה זָכָר מְבִיאָה אַרְבָּעָה עוֹפוֹת. שְׁנַיִם לְנִדְרָהּ וְהֵן עוֹלָה כְּמוֹ שֶׁבֵּאַרְנוּ. וּשְׁנַיִם לְחוֹבָתָהּ מִשּׁוּם לֵידָה וְהֵן אֶחָד עוֹלָה וְאֶחָד חַטָּאת. נִמְצֵאתָ לָמֵד שֶׁהַכֹּהֵן צָרִיךְ לַעֲשׂוֹת שָׁלֹשׁ פְּרֵדִין לְמַעְלָה. וּפְרֵדָה אַחַת לְמַטָּה. טָעָה וְעָשָׂה שְׁתַּיִם לְמַעְלָה וּשְׁתַּיִם לְמַטָּה וְלֹא נִמְלַךְ צְרִיכָה לְהָבִיא עוֹד פְּרֵדָה אַחַת וְיַקְרִיבֶנָּה לְמַעְלָה. בַּמֶּה דְּבָרִים אֲמוּרִים כְּשֶׁהֵבִיאָה הָאַרְבָּעָה מִמִּין אֶחָד כְּגוֹן שֶׁהָיוּ כֻּלָּן תּוֹרִין אוֹ בְּנֵי יוֹנָה. אֲבָל אִם הָיוּ שְׁתֵּי תּוֹרִין עִם שְׁנֵי בְּנֵי יוֹנָה וְעָשָׂה שְׁנַיִם לְמַעְלָה וּשְׁנַיִם לְמַטָּה. צְרִיכָה לְהָבִיא עוֹד תּוֹר וּבֶן יוֹנָה וְיַעֲשֶׂה שְׁתֵּיהֶן לְמַעְלָה כְּדֵי לָצֵאת יְדֵי חוֹבָתָהּ. שֶׁאִם עָשָׂה בַּתְּחִלָּה שְׁתֵּי הַתּוֹרִין לְמַטָּה צְרִיכָה תּוֹר לְמַעְלָה לְהַשְׁלִים חוֹבָתָהּ. וְאִם עָשָׂה שְׁנֵי בְּנֵי הַיּוֹנָה לְמַטָּה צְרִיכָה בֶּן יוֹנָה לְמַעְלָה לְהַשְׁלִים חוֹבָתָהּ. שֶׁאֵין אָדָם מֵבִיא חוֹבָתוֹ גּוֹזָל אֶחָד תּוֹר אַחַת אוֹ בֶּן יוֹנָה אֶלָּא אוֹ שְׁנֵיהֶן תּוֹרִין אוֹ שְׁנֵיהֶן בְּנֵי יוֹנָה:
כסף משנה
1.
When a woman says: "I pledge a pair of doves when I give birth to a male," when she gives birth to a male she must bring four doves: two because of her vow, they are burnt offerings, as we explained,1The commentaries note that there is no explicit source which states that the doves pledged by a woman should be offered as burnt-offerings. They do, however, point to Hilchot Ma'aseh HaKorbanot 1:14 which states that a fowl is never brought as a peace-offering. Hence, the only alternative is for them to be offered as burnt-offerings. and two which she is obligated to bring because of the birth,2I.e., when she is poor, as stated in Leviticus, ch. 14; Hilchot Mechusrei Kapparah 1:3. one, a burnt-offering and the other, a sin-offering. Therefore the priest must offer three doves on the upper portion of the altar and one dove on the lower portion.
If he erred and offered two on the upper portion and two on the lower portion,3As would be appropriate in most instances, for pairs of doves are generally required to be offered, one as a sin-offering and one as a burnt-offering. and he did not consult [with the woman],4If he did not consult with her, it is his prerogative to determine which dove should be offered as a sin-offering and which as a burnt-offering, as stated in Chapter 7, Halachah 8. she must bring another dove and offer it on the upper portion of the altar.5To fulfill her vow to bring a pair of doves as burnt-offerings.
When does the above apply? When she brought all four doves from one type; either they were all turtle doves or young doves. If, however, she brought two turtle doves and two young doves and two6I.e., of one type. were offered on the upper portion [of the altar] and two7Of the other type. on the lower portion,8This is speaking about a situation where the priest offering the sacrifice forgot which type he offered on the upper portion of the altar and which type on the lower portion [Ra'avad; the Rambam's Commentary to the Mishnah (Kinnim 3:5)]. Were he to know which type he had offered on which portion, it would be sufficient to bring only one more dove. she must bring one more turtle dove and one more young dove on the upper portion to fulfill her obligation.9I.e., to serve as the burnt-offering for the pair she was obligated to bring because of the birth, as the Rambam proceeds to explain. For if at the outset, two turtle doves were offered on the lower portion, another turtle dove must be brought on the upper portion to complete her obligation.10And the two young doves offered on the upper portion are considered as having been brought to fulfill her vow. [Or] if two young doves were offered on the lower portion, another young dove must be brought on the upper portion to complete her obligation. For a person should not bring a pair to fulfill his obligation that comprises one turtle dove and one young dove.11As the Kessef Mishneh states, it is not merely that it is unlikely for a person to do so, through Biblical exegesis, the Sifra derives that it is forbidden to do so. Instead, either they should both be turtle doves or both be young doves.

הלכה ב
פֵּרְשָׁה נִדְרָהּ וְאָמְרָה לַכֹּהֵן אֵלּוּ לְנִדְרִי וְאֵלּוּ לְחוֹבָתִי. וַעֲשָׂאָם הַכֹּהֵן שְׁתַּיִם לְמַעְלָה וּשְׁתַּיִם לְמַטָּה וְלֹא יָדַע אֵי זֶה מֵהֶן עָשָׂה לְמַעְלָה וְאֵי זֶה מֵהֶן עָשָׂה לְמַטָּה. צְרִיכָה לְהָבִיא שְׁלֹשָׁה עוֹפוֹת. שְׁנַיִם לְנִדְרָהּ וְאֶחָד לְהַשְׁלִים חוֹבָתָהּ. וְיֵעָשׂוּ הַשְּׁנַיִם לְמַעְלָה שֶׁהֲרֵי פֵּרְשָׁה נִדְרָהּ וְשֶׁמָּא שְׁנַיִם שֶׁל נִדְרָהּ נַעֲשָׂה לְמַטָּה שֶׁהֵם פְּסוּלוֹת. בַּמֶּה דְּבָרִים אֲמוּרִים בְּשֶׁהֵבִיאָה הָאַרְבָּעָה שֶׁפֵּרְשָׁה נִדְרָהּ בִּשְׁנַיִם מֵהֶן מִמִּין אֶחָד. אֲבָל אִם הָיוּ שְׁנֵי מִינִין תָּבִיא אַרְבָּעָה אֲחֵרִים. שְׁנַיִם מִמִּין שֶׁפֵּרְשָׁה בּוֹ נִדְרָהּ יֵעָשׂוּ לְנִדְרָהּ וּשְׁנַיִם מֵאֵי זֶה מִין שֶׁתִּרְצֶה יִהְיוּ לְחוֹבָתָהּ וְיֵעָשׂוּ אֶחָד לְמַעְלָה וְאֶחָד לְמַטָּה:
כסף משנה
2.
If she made her vow explicit, telling the priest: "These12I.e., this pair of doves. are for my vow and these are for my obligation," and the priest offered two on the upper portion and two on the lower portion without knowing which ones he offered on the upper portion and which ones he offered on the lower portion,13And thus he is unsure if he fulfilled the woman's instructions. she must bring three doves, two for her vow and one to complete her obligation.14In his Commentary to the Mishnah (loc. cit.), the Rambam explains that since it is possible that the two doves designated for her vow were offered on the lower portion of the altar (as sin-offerings instead of burnt-offerings), it is possible that her vow was not fulfilled and she must bring two other doves instead. Were that to have been the case, of the two offered on the upper portion of the altar, only one was acceptable and another dove must be brought as a sin-offering to fulfill her obligation.
The above explanations are based of Rav Kappach's edition of the Rambam's Commentary to the Mishnah. The initial version (preserved in the standard printed texts) reads differently, stating that this situation is considered like a burnt-offering that became intermingled with an unspecified group. See in Chapter 8, Halachah 4.
The two should be offered on the upper portion of the altar. [The rationale is that] she made her vow explicit and possibly the two brought because of her vow were offered on the lower portion, thus disqualifying them.15For they are burnt-offerings which must be offered on the upper portion of the altar.
When does the above apply? When she brought the four doves from which she explicitly defined two as being for her vow from one type. If, however, [she brought them from] two types, she must bring four other doves:16Here the difficulty is that since the woman specified that the doves for her vow should come from a specific type and the priest did not remember whether he in fact offered that pair of doves as a burnt-offering. In his Commentary to the Mishnah (Kinnim 3:5), the Rambam explains this law. In the original sacrifice, perhaps the two turtle doves that were intended as burnt-offerings were sacrificed on the lower portion of the altar and were thus disqualified. Thus her vow was not fulfilled and she must bring two turtle doves. The two young doves were offered on the upper portion of the altar as burnt-offerings. Hence it is necessary for another young dove to be offered on the lower portion as a sin-offering to fulfill her obligation.
It is, however, also possible that the two young doves were offered on the lower portion of the altar. In that instance, she would have to bring another young dove to be offered on the upper portion as a burnt-offer to fulfill her obligation. Hence she must bring a total of two turtle doves and two young doves.
the two from the type she designated explicitly for her vow should be offered for her vow and the other two may be from either type she desires for her obligation. One should be offered on the upper portion [of the altar] and one on the lower portion.

הלכה ג
קָבְעָה נִדְרָהּ וְאָמְרָה אִם אֵלֵד זָכָר הֲרֵי עָלַי שְׁתֵּי תּוֹרִים. וְיָלְדָה וְהֵבִיאָה אַרְבָּעָה עוֹפוֹת. שְׁנַיִם לְנִדְרָהּ וּשְׁנַיִם לְחוֹבָתָהּ. וְעָשָׂה שְׁנַיִם לְמַעְלָה וּשְׁנַיִם לְמַטָּה וְלֹא יָדַע אֵי זֶה נַעֲשָׂה לְמַעְלָה וְאֵי זֶה נַעֲשָׂה לְמַטָּה. וְגַם הִיא שָׁכְחָה וְלֹא יָדְעָה בְּאֵי זֶה מִין קָבְעָה נִדְרָהּ אִם בְּתוֹרִים אוֹ בִּבְנֵי הַיּוֹנָה. הֲרֵי זוֹ צְרִיכָה לְהָבִיא שְׁתֵּי תּוֹרִים עִם שְׁנֵי בְּנֵי יוֹנָה לְנִדְרָהּ וְיֵעָשׂוּ אַרְבַּעְתָּן לְמַעְלָה. וְתָבִיא גּוֹזָל אֶחָד לְהַשְׁלִים חוֹבָתָהּ וְיֵעָשֶׂה לְמַעְלָה. (שֶׁכְּבָר עָשָׂה שְׁנַיִם לְמַטָּה שֶׁהֵם חַטָּאת). בַּמֶּה דְּבָרִים אֲמוּרִים כְּשֶׁהֵבִיאָה הָאַרְבָּעָה תְּחִלָּה מִמִּין אֶחָד. אֲבָל אִם הָיוּ שְׁנֵי מִינִין צְרִיכָה לְהָבִיא שִׁשָּׁה עוֹפוֹת. שְׁתֵּי תּוֹרִים עִם שְׁנֵי בְּנֵי יוֹנָה לְנִדְרָהּ. וְתָבִיא לְחוֹבָתָהּ שְׁתֵּי תּוֹרִים אוֹ שְׁנֵי בְּנֵי יוֹנָה וְיֵעָשֶׂה אֶחָד לְמַעְלָה וְאֶחָד לְמַטָּה. וְכֵן אִם נְתָנָתַם לַכֹּהֵן וְשָׁכְחָה מַה נָּתְנָה לוֹ. וְהָלַךְ הַכֹּהֵן וְעָשָׂה וְאֵינוֹ יוֹדֵעַ הֵיכָן עָשָׂה אִם הַכּל לְמַעְלָה אוֹ הַכּל לְמַטָּה אוֹ מֶחֱצָה לְמַעְלָה וּמֶחֱצָה לְמַטָּה. הֲרֵי זוֹ תָּבִיא שְׁתֵּי תּוֹרִים עִם שְׁנֵי בְּנֵי יוֹנָה לְנִדְרָהּ. וְתָבִיא שְׁתֵּי תּוֹרִים אוֹ שְׁנֵי בְּנֵי יוֹנָה לְחוֹבָתָהּ:
כסף משנה
3.
[The following laws apply if a woman] defined17In his Commentary to the Mishnah (loc. cit.), the Rambam explains the difference between this instance and the one mentioned in the previous halachah. In the previous halachah, we are speaking about an instance where the woman defined which doves were to be offered for which sacrifice at the time she gave them to the priest to offer and the priest forgot how he had offered them. In this instance, in addition to defining them when giving them to the priest, she pledged to bring them from a specific type and then she forgot which type of doves she pledged to bring for each particular sacrifice. [which types of doves to be offered to fulfill] her vow, saying: "If I give birth to a male, I pledge two turtle doves," and she gave birth and brought four doves:18Of one type, as stated below. two for her vow and two for her obligation. The priest offered two on the upper portion [of the altar] and two on the lower portion, but did not know which were offered on the upper portion and which were offered on the lower portion and she also forgot and did not know the type of doves she had pledged for her vow, whether turtle doves or young doves. She should bring two turtle doves and two young doves for her vow.19The doves offered previously as a burnt-offering are of no consequence, because we are not certain that her vow was fulfilled. Because she is in doubt regarding which type she had specified in her vow, she must bring both types to fulfill it. [All] four should be offered on the upper portion of the altar. She should bring another dove to complete her obligation and it should be offered on the lower portion. 20In his Commentary to the Mishnah (loc. cit.), the Rambam explains that this follows the same rationale as above. One of the burnt-offerings is acceptable. Hence it is necessary to bring a sin-offering to complete her obligation. He continues explaining that this decision is somewhat of a leniency, because it is possible that she will be offering the sin-offering from a different type of dove than the burnt-offering. Nevertheless, since we do not know of which type the original four doves were, this leniency is granted.
The above explanations are based on Rav Kappach's edition of the Rambam's Commentary to the Mishnah. The initial version (preserved in the standard printed texts) reads differently. Similarly, this explanation requires - as suggested by the Kessef Mishneh - amending the standard printed text of the Mishneh Torah to read:
it should be offered on the upper portion, for two were already offered on the lower portion as sin-offerings.

When does the above apply? When originally she brought all of the four of one type. If, however, they were of two types, she must bring six other doves: two turtle doves and two young doves for her vow21To be offered as burnt-offerings, for as above, it is possible that the ones designated as her vow were not offered as burnt-offerings and she does not remember which type she specified. and for her obligation, she should bring either two turtle doves or two young doves22In contrast to the previous situations, she must bring two doves to fulfill her obligation. In this instance, one of those that were offered as a burnt-offering is not acceptable, because we know for certain that the offerings originally brought were of two types and we do not know which type of dove was brought as a burnt-offering so that a sin-offering could be brought from the same type of dove. Hence she must bring an entire pair to fulfill her obligation.
The Ra'avad differs with the Rambam's rulings based on his interpretation of the Mishnah in Kinnim (which is also supported by Rashi). Rav Yosef Corcus and the Kessef Mishneh explain the Rambam's understanding.
and offer one on the upper portion of the altar and one on the lower portion.
Similarly, if she gave them to the priest23Four doves. This is speaking about a situation where the woman designated two doves as a burnt-offering for her vow and two for her obligation, one as a burnt-offering and one as a sin-offering. She forgot which type of doves she vowed, which she brought to the priest, and how she designated them. and forgot what she gave him and the priest went and offered them, but was not aware where he offered all of the doves, whether he offered them all on the upper portion, all on the lower portion, or half above and half below, she should bring two turtle doves and two young doves for her vow24To be offered as burnt-offerings. It is necessary to bring these offerings, because it is possible that no burnt-offerings were offered or those designated as burnt-offerings were not offered for that purpose. It is necessary to bring both types, because the woman does not know which type she pledged as a burnt-offering. and two turtle doves or two young doves for her obligation.

הלכה ד
קָבְעָה חוֹבָתָהּ וְקָבְעָה נִדְרָהּ וְשָׁכְחָה בַּמֶּה קָּבְעָה. וְאֶפְשָׁר שֶׁחוֹבָתָהּ כֶּבֶשׂ לְעוֹלָה וּפְרֵדָה אַחַת תּוֹר אוֹ בֶּן יוֹנָה לְחַטָּאת. לְפִיכָךְ תָּבִיא שִׁשָּׁה פְּרֵדִין. אַרְבָּעָה לְנִדְרָהּ וּשְׁנַיִם לְחוֹבָתָהּ. וְעוֹד תָּבִיא חַטָּאת אֶחָד בֶּן יוֹנָה אוֹ תּוֹר עִם כֶּבֶשׂ. נִמְצֵאת שֶׁהֵבִיאָה שִׁבְעָה עוֹפוֹת [וְכֶבֶשׂ]:
כסף משנה
4.
If she defined [which type of offering25I.e., whether she would bring a lamb, the burnt-offering brought by a woman of means after childbirth, or a dove, the burnt-offering brought when one lacks adequate means. to be offered to fulfill] her obligation and [which types of doves to be offered to fulfill] her vow and forgot what she defined, it is [also] possible that her obligation was a lamb for a burnt-offering and a dove - either a turtle dove or a young dove - as a sin-offering. Therefore she must bring six doves - four for her vow26Two turtle doves and two young doves. This is necessary, because she forgot what type of dove she specified that she would bring to fulfill her vow. and two for her obligation.27Of one type, either young doves or turtle doves, for perhaps she intended to bring the sacrifice of a poor woman. And she must bring one sin-offering, either a young dove or a turtle dove, with a lamb.28In the event she intended to bring the sacrifice of a woman of means.
It must be noted that Kinnim 3:5, the source for the Rambam's ruling, does not mention a lamb at all. The Rambam mentions it, both here and in his Commentary to the Mishnah, because otherwise, there is no clear reason why an extra dove should be brought as a sin-offering (Kessef Mishneh).
Thus she will have brought seven doves and a lamb.

הלכה ה
וְכָל הַחַטָּאוֹת הָאֵלּוּ אֵינָן נֶאֱכָלוֹת מִפְּנֵי שֶׁהֵם סָפֵק:
כסף משנה
5.
None of these sin-offerings should be eaten, because they are all offered because of a doubt.29Instead, it should be burnt, as stated in Chapter 7, Halachah 10.

עבודה הלכות פסולי המוקדשין פרק י
Avodah Pesule HaMukdashim Chapter 10