
386 Mass. 848 (1982)
438 N.E.2d 329
KAREN LEE HENNESSY
vs.
SUPERINTENDENT, MASSACHUSETTS CORRECTIONAL INSTITUTION, FRAMINGHAM, & another.[1]
Supreme Judicial Court of Massachusetts, Middlesex.
April 7, 1982.
July 23, 1982.
Present: HENNESSEY, C.J., LIACOS, ABRAMS, NOLAN, & LYNCH, JJ.
Linda G. Katz, Assistant Attorney General, for the respondents.
John P. Osler for the petitioner.
LYNCH, J.
The petitioner, Karen Lee Hennessy, was found guilty of assault and battery on a police officer. On October 30, 1980, she was sentenced to the Massachusetts Correctional Institution at Framingham (M.C.I., Framingham) for a term of two years, one year to be served and the *849 remainder suspended with probation to October 28, 1983. She began to serve her sentence on October 30, 1980.
By July, 1981, the petitioner had earned twenty-five days of program participation deductions under G.L.c. 127, § 129D, and was entitled to statutory good conduct deductions under G.L.c. 127, § 129. On August 20, 1981, the petitioner commenced this action by filing a petition for a writ of habeas corpus in the Superior Court in Middlesex County naming as respondents the superintendent of M.C.I., Framingham and the Commissioner of Correction. The petitioner alleged that the respondents had improperly failed to apply her good conduct and program participation credits to the committed portion of her partially suspended sentence and that she had been entitled to discharge on August 5, 1981, by virtue of these credits.
On August 24, 1981, the matter was heard by a Superior Court judge. The arguments at the hearing centered on the manner in which time credits are to be deducted from partially suspended sentences. The petitioner's position was that such credits should be deducted from the committed portion of the sentence. The respondents' view was that time credits should be deducted from the entire partially suspended sentence. At the close of the hearing, the judge ruled in favor of the petitioner and ordered that she be discharged from the sentence she was then serving at M.C.I., Framingham. The petitioner was then remanded to M.C.I., Framingham to serve an outstanding consecutive thirty-day sentence and was given credit against this sentence for the time she had served since August 5, 1981.[2] The judge summarized these orders in a memorandum dated August 28, 1981.
The parties then engaged in various procedural skirmishes over the issue whether the respondents could appeal the judge's orders. The respondents filed a notice of appeal *850 which the petitioner moved to strike. The judge denied this motion. The respondents then filed a "motion for entry of judgment" which was opposed by the petitioner for reasons outlined below. At the judge's request, both parties filed memoranda. On November 13, 1981, the judge denied the respondents' motion without opinion and this appeal followed. We turn first to several procedural issues raised by the parties.
1. Propriety of the Commonwealth's appeal.
The petitioner contends that this appeal should be dismissed because habeas corpus was a proper remedy and an appeal does not lie from the issuance of the writ. See Pina v. Superintendent, Mass. Correctional Inst., Walpole, 376 Mass. 659, 664 (1978); Wyeth v. Richardson, 10 Gray 240, 241 (1857). The respondents, on the other hand, argue that as a result of the 1979 amendment of G.L.c. 248, § 25 (see St. 1979, c. 344, § 12), habeas corpus is no longer available to those in the petitioner's position, and that the petitioner should have sought relief under Rule 30 (a) of the Massachusetts Rules of Criminal Procedure, 378 Mass. 900 (1979). If the case were treated as a rule 30 case, the Commonwealth would be entitled to appeal the Superior Court judge's order. See Mass. R. Crim. P. 30 (c) (8). Alternatively, the respondents urge that we treat the case as one seeking declaratory relief. See Pina v. Superintendent, Mass. Correctional Inst., Walpole, supra at 664-666. Finally, in the event we conclude that habeas corpus was available to the petitioner, the respondents ask us to abandon the rule prohibiting appeal from the grant of habeas corpus.
In Pina, which was decided before G.L.c. 248, § 25, was amended, this court had occasion to discuss the use of both habeas corpus and declaratory procedures to challenge the execution of prison sentences. The court said that a prisoner who could show an entitlement to immediate release could invoke a judge's discretionary power, under G.L.c. 248, § 25, to issue a writ of habeas corpus. Id. at 664-665. See Beaton, petitioner, 354 Mass. 670, 671 (1968); *851 Stearns, petitioner, 343 Mass. 53, 56-57 (1961). We noted further that when a prisoner was not entitled to immediate release and thus could not state a claim for a writ of habeas corpus, he could still avail himself of the declaratory judgment procedures set out in G.L.c. 231A to resolve a controversy which had arisen concerning the execution of his sentence. Pina, supra at 665-666. See Beaton, petitioner, supra at 672 n. 1; Woods v. State Bd. of Parole, 351 Mass. 556, 559 (1967).
The Pina case itself began as a petition for a writ of habeas corpus, although it appeared that the plaintiff would not have been entitled to immediate release even if he had prevailed on all his claims to good time and other deductions from his sentence. The plaintiff raised a question in this court with respect to the defendant's right to appeal from the judgment of the Superior Court judge ordering the recomputation of the plaintiff's discharge date. The court agreed with the defendant that the judge had, in effect, treated the claim as one for declaratory relief and had awarded relief that was declaratory in nature, making the defendant's appeal proper under G.L.c. 231A, § 4. The court, therefore, did not discuss the defendant's alternative suggestion that appeals from the grant of a petition for habeas corpus be allowed. Pina v. Superintendent, Mass. Correctional Inst., Walpole, supra at 664.
We conclude that the petitioner in this case, like the plaintiff in Pina, failed to state a claim for a writ of habeas corpus. Her petition alleged that under a proper application of statutory good time credits and other earned credits she "should have been discharged from the executed portion of her sentence on August 5, 1981." The judge agreed with this contention. Thus, when her petition was granted on August 24, 1981, the petitioner had served nineteen days in excess of the time she was required to serve on the partially suspended sentence. It is undisputed, however, that the petitioner was subject to an outstanding consecutive sentence of thirty days and that she would have time to serve on this sentence even after credit was given for the *852 nineteen days. The petitioner was therefore not eligible for immediate release from the respondents' custody when her habeas corpus petition was heard. In fact, after ordering the petitioner discharged from the sentence she was serving, the judge remanded her to the respondents' custody to complete service of that consecutive sentence. As in Pina, the relief granted by the judge was essentially declaratory in nature.
Contrary to the petitioner's contention, the result we reach does not amount to "a rule which preclude[s] habeas relief for prisoners who [owe] time to another institution or jurisdiction." All we hold is that a petitioner for a writ of habeas corpus must show that he or she is entitled to be released from restraint by the particular respondent or respondents named in the petition. The important point in this case is that the petitioner still "owed time" to the respondents when her petition was heard. She was entitled to a judicial declarations of her rights as against the respondents, but she was not entitled to immediate release. Our conclusion that the respondents' appeal is proper under G.L.c. 231A, § 4, makes it unnecessary for us to reach the parties' other contentions with respect to the availability of habeas corpus.[3] We turn to the substantive issue argued by the parties.
*853 2. Statutory good time deductions as applied to a partially suspended sentence.
Under G.L.c. 127, § 129, the relevant portion of which is set out in the margin,[4] a prisoner "whose term of imprisonment is four months or more" is entitled to certain deductions if his "record of conduct shows that he has faithfully observed all the rules of his place of confinement, and has not been subjected to punishment...." Specifically, such a prisoner "shall be entitled to have the term of his imprisonment reduced by a deduction from the maximum term for which he may be held under his sentence or sentences...." The petitioner in this case was given a partially suspended two-year sentence, one year to be served and the remainder suspended "with probation to October 28, 1983." See G.L.c. 279, § 1. The parties disagree on the proper application of the deductions provided in G.L.c. 127, § 129, to partially suspended sentences.[5] The petitioner argues that the committed portion of the sentence *854 should be credited with these deductions. The respondents' practice has been to credit the suspended portion of the sentence. We conclude that the petitioner's position is the correct one.
The language of § 129 clearly indicates that good conduct credits should be deducted from the committed portion of a partially suspended sentence. The reward for good conduct created by § 129 is the opportunity for a prisoner "to have the term of his imprisonment reduced by a deduction from the maximum term for which he may be held under his sentence or sentences...." The respondents suggest, in effect, that because a prisoner with a partially suspended sentence "may be held" for the entire term of his sentence if he violates his probation, good conduct credits earned by all prisoners with such sentences should be deducted from the suspended portion of the sentence.
Read as a whole, the statute does not support this interpretation. A prisoner eligible for good conduct deductions is one whose term of imprisonment "is" four months or more. This indicates that "term of imprisonment" refers to that term which is certain at the relevant point in time. In the petitioner's case, for example, her "term of imprisonment" was one year at the time of her original commitment. If, at some future date, she violated the conditions of her probation and was returned to prison, the term of her imprisonment under her sentence would be two years.
The respondents' reliance on the phrase "maximum term for which he may be held," in § 129, is misplaced. This language is addressed to the application of good conduct deductions to indeterminate sentences. See G.L.c. 279, §§ 24, 31, and 32. Under G.L.c. 127, § 129, good conduct deductions are to be applied to the maximum term of an indeterminate sentence, rather than to the minimum term of such a sentence. There is no "maximum" and "minimum" sentence in this sense when a sentence is partially suspended under G.L.c. 279, § 1. A prisoner with a partially suspended sentence has an absolute right to be released on probation after service of the committed portion of his *855 sentence. The "maximum term for which he may be held" is the committed portion of the sentence. If he is later returned to prison following a violation of the conditions of his probation, "the maximum term for which he may be held" is the entire sentence because that is the term which must be served.
The respondents' reading of the statute would make it virtually impossible for a prisoner with a partially suspended sentence to obtain the promised reduction in "the term of his imprisonment" as a reward for his good conduct while confined. Only the occasional prisoner whose good conduct deductions exceeded the suspended portion of his sentence, and prisoners who go on to violate the conditions of their probation, would benefit from the statutory good conduct deductions. Clearly this is not what the Legislature intended when it provided that "[e]very ... prisoner ... [who has a record of good conduct in prison] shall be entitled to have the term of his imprisonment reduced ..." (emphasis supplied).
The purpose of statutory good time credits is to encourage good behavior in prison. Pina v. Superintendent, Mass. Correctional Inst., Walpole, 376 Mass. 659, 667 (1978). Wood v. Commissioner of Correction, 363 Mass. 79, 83 (1973). This purpose "is clearly reflected in the language of § 129 which ties the granting and revocation of credit to time spent in confinement." Pina, supra. The respondents' proposal to credit good conduct deductions against the suspended portion of a partially suspended sentence would frustrate this legislative purpose. If a prisoner with such a sentence were not already inclined to obey prison rules, it is extremely unlikely that he would be induced to do so by the knowledge that good behavior would earn him a reduction in the suspended portion of his sentence. In the same way, the respondents' proposal would seriously impair the effectiveness of the deductions authorized by G.L.c. 127, § 129D, for prisoners with partially suspended sentences.
The respondents contend that their reading of § 129 is supported by the statutory method for determining the rate *856 of good conduct deductions. Under G.L.c. 127, § 129, the deduction "shall be determined as follows: Upon a sentence of not less than four months and less than one year, two and one-half days for each month; upon a sentence of not less than one year and less than two years, five days for each month; upon a sentence of not less than two years and less than three years, seven and one half days for each month ..." (emphasis supplied). The respondents argue that the use of the word "sentence" evidences a legislative intent to calculate the good conduct deduction based on both the committed and suspended portions of a partially suspended sentence, and then to apply the resulting deduction against the entire sentence. We disagree.
As we have noted above, good conduct credit under § 129 is granted only for time spent in confinement. It is a reward to a prisoner for "faithfully observ[ing] all the rules of his place of confinement." G.L.c. 127, § 129. Thus, for example, the statute provides that when a prisoner is released on parole and is never returned to prison for violation of his parole, he is entitled to a good conduct deduction "only for that period of the sentence ... during which he was actually confined...." Obviously the Legislature did not intend to grant good conduct deductions for time spent on probation under the suspended portion of a partially suspended sentence. Thus the "sentence" on the basis of which the number of good conduct credits are calculated includes only the executed portion of a partially suspended sentence.
The statute provides a good conduct deduction of five days per month upon a sentence of one year and a deduction of seven and one-half days per month upon a sentence of two years. The petitioner was entitled to have her one-year "term of imprisonment" reduced by sixty days for good conduct and by the twenty-five day deduction she had earned under G.L.c. 127, § 129D. If she is returned to prison for violation of the conditions of her probation, her good conduct deduction would be recalculated based on the rate applicable to a two-year sentence, because the entire sentence would then be served. Similar recalculations of good conduct *857 credit are made when a prisoner is released on parole, and when a prisoner is reincarcerated following revocation of parole. See Pina v. Superintendent, Mass. Correctional Inst., Walpole, 376 Mass. 659, 661-662 (1978).
In summary, we hold that a prisoner who is given a partially suspended sentence is entitled to a good conduct deduction calculated at the rate applicable to the executed portion of his or her sentence and that the resulting deduction should be applied to reduce the committed rather than the suspended portion of the sentence.[6] This result will ensure that all of those who are given partially suspended sentences obtain a reduction in their "term of imprisonment" by virtue of their good conduct while in prison and not merely those whose probation is subsequently revoked.
The case is remanded to the Superior Court for entry of a judgment declaring the petitioner's rights in accordance with the memorandum of the Superior Court judge and this opinion.
So ordered.
NOTES
[1]  The Commissioner of Correction.
[2]  The petitioner served the remainder of this second sentence and was subsequently released.
[3]  Although the point was not raised by the parties, we note that Part II, c. 6, art. 7, of the Constitution of the Commonwealth provides as follows: "The privilege and benefit of the writ of habeas corpus shall be enjoyed in this commonwealth in the most free, easy, cheap, expeditious and ample manner...." To the extent that St. 1979, c. 344, § 12, purports to eliminate completely a court's power "to issue a writ of habeas corpus ... for ... a person who is imprisoned or restrained of his liberty pursuant to a criminal conviction," it may run afoul of this provision of our Constitution. We note also that if an appeal by the respondent from the issuance a writ of habeas corpus were to be permitted, there is some question whether the petitioner could be required to serve the remainder of the sentence following an appellate decision for the respondent. See G.L.c. 248, § 24.
[4]  General Laws c. 127, § 129, as amended through St. 1967, c. 379 provides: "The officer in charge of each correctional institution or other place of confinement, except a defective delinquent department, shall keep a record of each prisoner in his custody whose term of imprisonment is four months or more. Every such prisoner whose record of conduct shows that he has faithfully observed all the rules of his place of confinement, and has not been subjected to punishment, shall be entitled to have the term of his imprisonment reduced by a deduction from the maximum term for which he may be held under his sentence or sentences, which shall be determined as follows: Upon a sentence of not less than four months and less than one year, two and one half days for each month; upon a sentence of not less than one year and less than two years, five days for each month; upon a sentence of not less than two years and less than three years, seven and one half days for each month; upon a sentence of not less than three years and less than four years, ten days each month; upon a sentence of four years or more, twelve and one half days for each month; ..."
[5]  The proper application of the "earned good time credit" provided by G.L.c. 127, § 129D, is also at issue in this appeal. We agree with the parties that because earned good time credits are simply added to statutory good time credits for the purpose of reducing the term of imprisonment (see G.L.c. 127, § 129D), the issue is the same for both types of credits.
[6]  Our holding applies only to partially suspended sentences. With respect to indeterminate sentences, it is clear that deductions under G.L.c. 127, § 129, are to be applied against the longer or "maximum" term of the sentence.
