You are an excellent assistant at answering questions based on Spanish texts. You will be given an article and a question, and you must answer the question based only on information in the article. The response should be extracted from the context verbatim.

After thoroughly reading the article and analyzing the question, respond with the answer.

Title:
Portugal

Context:
The country bounced between socialism and adherence to the neoliberal model. Land reform and nationalizations were enforced; the Portuguese Constitution (approved in 1976) was rewritten in order to accommodate socialist and communist principles. Until the constitutional revisions of 1982 and 1989, the constitution was a highly charged ideological document with numerous references to socialism, the rights of workers, and the desirability of a socialist economy. Portugal's economic situation after its transition to democracy, obliged the government to pursue International Monetary Fund (IMF)-monitored stabilization programs in 1977–78 and 1983–85.

Question:
For what reasons were the Portuguese Constitution rewritten?

to accommodate socialist and communist principles