Hello and welcome to special discussion with Prime Minister the Honourable Alan Chastney as we look back at the achievements and challenges of 2019. This is the final part in a three-hour discussion with the Prime Minister looking at various key areas as stated in his 2019-2020 budget presentation. And so we are now down to the areas of citizen safety and later on we'll be discussing what's happening with infrastructure. But for citizen safety for St. Lucien's many considered to be a very dismal year dark and gloomy looking at the rising violent crime and homicide I think we may have ended the year at number 51 for 2019. Very very troubling and you've indicated several times that for you it is a very warring situation. So as you look at what your strategy has been over the last year and looking forward do you believe that all was done to create that sort of buffer between the perpetrators of crime and the low-abiding citizens of St. Lucien? So this unfortunately is a recurrent theme in that I have to make reference to what we inherited. So we inherited a situation in which radar system was not working, forensic lab was shut, there was no DPP, in fact the office itself had been depleted significantly, courthouses were shut, no ammunition, policemen's morale was very very very low, lots of problems. So again to say I'm going to push a button overnight and all of a sudden things are going to get resolved wasn't going to happen. So when I first came in and I got my first briefing I was just I mean speechless and I immediately moved security up very high. It was a high on the priority list but I said we're crisis point at this at this point and one of the critical things was we a thousand case backlog in criminal cases. Let's put that in perspective that would take two judges almost three years and cost about 13 and a half million dollars to just deal with that backlog and every year we're adding more on to it because of the backlog so it takes almost somewhere between four and six years for a case to be able to be heard. Are you really going to have an effective justice system and a criminal security system if in fact a person is arrested is either put on remand and waits in jail for that period of time or is let out on bail until their case is being heard. So the cry that crime doesn't pay was changed to crime does pay and so there was no fear of being caught. Forensic lab in terms of getting the evidence wasn't there. Courthouses so when you did in fact want to get your case heard that courthouses were inadequate were constantly having to be closed because of problems massive massive problems. So we've systematically looked to rebuild the police system from everywhere so we've gotten now three or four of the marine boats working the radar system is working the forensic lab is back up in operation and I'm very excited fingerprinting and DNA testing are now fingerprinting is already operational by later this year the DNA testing will be huge where DPP's office has been replenished and is functioning we're now working on the communication system so for instance policemen didn't have any ways of communicating with other other than using their own cell phones we now have a proper VHF system that's in place that people can walk around with walkie talkies there's access in your vehicles training for policemen adding new policemen so we've added 40 new recruits into the police and we have now 42 policemen in the city that are there are helping the city police the city police right added new vehicles new motorbikes so there's a lot of work that's taking place what I've said is one thing I know in life is that wherever there's effort eventually there's going to be results and speaking about all that work so we now want to share with our viewers how all of that was able to unfold over the last year and so we go to our special production there looking back at some of the events in citizen safety for 2019 high on the agenda for government in 2019 was citizen safety with a focus on tackling the root causes of issues in that area to ensure more boots on the ground especially in identified crime hotspot areas 80 new police officers were sworn into the Royals in Lucia police force with an additional 42 to the city police unit in addition to ensuring a larger police presence government also addressed the issue of failing equipment and transportation hindrances with the purchase of new vehicles motorbikes and communication equipment operation of coast guard vessels and radar equipment were restored after an extended period of in operation those interventions now ensure quicker response times and better communication between officers and units recognizing that accidents and crimes can happen without witnesses government undertook the task of installing 180 cc tv cameras with over 525 to be installed at a cost of 5.8 million dollars to date crimes have been solved and vehicular accident disputes resolved using this technology after two years of the forensic lab being closed government undertook much needed refurbishment of the building at a cost of seven hundred thousand dollars the lab is now reopened and functional with 13 staff members and the latest industry standard equipment necessary for solving crimes using dna and other technology the lab has given us solutions to at least two cases one at marisol will be elderly lady and one from jiffot young lady called sabi um so we have the forensic and that and it was found out that those individuals were the ones who committed the crime and this is the way we have to go forensic evidence is going to be the way forward we we can't rely on eyewitnesses or persons to come forward because as a small society we don't have the capacity for witness protection we'll just a small window of opportunity there so we have to rely rely on the forensic intent on clearing out the backlog of cases and ensuring swift adjust the government has fortified the office of the dpp by providing much needed resources additionally the number of magistrates and judges have been increased to ensure criminal and civil matters are brought to a close as quickly as possible community afterschool programs continued throughout 2019 in communities such as masha uge belvi moshi babano jackmel souffle and foreshaw to name a few this program keeps young persons meaningfully engaged in sports music dance and art the program also entails mandatory life and social skills training all helping to serve as a deterrent to the streets students are also served with meals during that time provided by the government the community afterschool program helps those young persons with self-development as well as building meaningful relationships and camaraderie programs such as this aim to tackle crime at the root so as we saw there we we looked at in the video we saw that the courts united we're opening up the naira court we spoke about the cctv which is massive investment for the government and most importantly we saw the recruits which we spoke about so beefing up the police and wanting as well to for more boots on the ground for the government as you begin to examine how it is that you could really tackle and because your aim is for 45 percent reduction of serious crimes by the end of 2022 and so some people looking back at 2019 would believe that we're just not on targets I think you know we're we're disappointed in the numbers but the fact is the effort is there and we're starting to see people starting to believe in the system so policemen had been given promises of new vehicles forever policemen had been given promises that we'd be fixing up their premises forever policemen were still suffering from the impacts situation and the lack of proper training and the equipment to be able to do their job so I think that everybody's starting to get the message that my government is committed and that when we make a promise to them that we're going to deliver on that promise we now meet on a weekly basis we've been doing that for almost over a year every single Monday before cabinet the minister of security the attorney general the delivery unit and senior members of the police force we meet and we go through the numbers so we're measuring 10 different serious levels of crime robbery burglaries car theft homicides a bunch of them that we look at and we're measuring them on a week by week basis trends as well as on a per annual basis and then compared to where we want the numbers to be able to get to uh so people now are getting custom that they have to answer to these ideas but as much as I'm putting those systems in there are some other projects that we're working on we're equally as important cause of the crime in the first place so one if you look at the number of homicides that happened late in the year the vast majority of them were what brothers fighting with brothers cousins fighting with cousins friends fighting with each other yeah stabbing each other shooting each other simply because they couldn't control their tempers all right big problem police can't stop that that's us as a society and people recognizing that things are building up and try to separate people because once somebody's life is lost they're lost they can't bring them back and so this is a societal problem that we have to be able to resolve so then the thinking how we think about crime when we look at personal responsibility uh where does each individual fit into the bigger picture of fighting crime you're saying that we need to have a sort of shift in the mindset of how the nation views all of those factors that's on homicide so we see if you take gang of violence as well as and combine it now with um uh personal conflict that makes up the vast majority of the homicides we've had the bigger one I'm concerned about really is robberies burglaries and car theft and I think that what happens it affects a lot of people and it chains their mindset in terms of what the overall safety and the capacity of the police to actually carry out a proper investigation so look I'm not telling any tales behind school I think that most of us who've been in that I have been robbed in the past policemen came in I have questioned how I see they're collecting the forensics the fingerprinting and and the DNA samples and how they inform me in terms of what they're doing it's not really left me with a warm fuzzy feeling that these crimes are going to be resolved so by improving the forensic lab now creating our own crime unit a dedicated crime unit that are actually the ones collecting this evidence um and the building of a database because to be fair if there isn't anything to match it up against then we're really in the losing battle correct and unfortunately I'm the one who was involved in that discussion I remember when we opened the forensic lab the first time and I said why you don't have any information in why don't we use the fingerprints from the ID cards now solutions have to think about that and have a real discussion about that I for one would like my fingerprint to be in it because if there's a crime I want to know that I'm not the one who committed the crime and if in fact it helps resolve crime and keeps me safer that's a positive thing but we have to weigh that up based everybody's civil rights and and those that's the discussion that will take place but I genuinely believe that we should be able to have access to the fingerprinting off ID cards we're not doing it right now but that's a discussion that needs to be able to take this here 100 correct I think getting the DNA lab here so for instance a lot of people who are having sex with younger girls we're now going to be able to provide the evidence as to whether they're doing that or not we've spoken to the policeman of traffic I think that solutions when they start seeing that we're dealing with some of the smaller crimes on a more consistent basis it builds confidence and starts changing people's overall attitude you know speeding cars that aren't really suitable to be on the road yeah all these are very very important things in terms of maintain loitering illegal activities which we just let go so who's making the decision so what somebody's acting of the judge every time to determine well this person can get away with it and this other person cannot we have to be consistent in terms of how we're going to be enforcing so there's a general attitudinal change that needs to take place and I think that we're starting to get the buy-in now of the police force to be able to do that I mean I'm I'm committed to this police force I absolutely feel for them in terms of what they've had to do and I was just saying in a meeting today you go to a police station the tiles are missing the drain is clogged there's no hot water the toilet seat is missing there's not proper towels the washer and dryer are not working the mattress hasn't been replaced in a long time the kitchen is a mess the furniture is falling apart and they've not walked off the job I'm gonna I would rather talk about the good things that these guys have done than everybody wants to focus on all the negative things and so my government has said let me help and that's where I'm really proud of the work that my wife is doing in terms of reinforcing in the policeman's mind that we want to celebrate them and that's why every year at the police ball we celebrate people who have retired and recognize the policemen police officers that are achieving great things and and to say to them we do care we do recognize what you're doing to be able to get the insurance and we're looking at duty-free vehicles for policemen because if a policeman is going to be on duty should he really have to be traveling in uniform on a public bus right but again these are things that have been outstanding for the longest amount of time and we're now getting through all of them so building the morale of the police force would result in better protection of the nation it's one of the things and that's what I'm saying to you it's there's not one thing by itself it's a multitude of programs and efforts that are being made in initiatives in order to strengthen our police force border control okay the computer terminals that you see in immigration there's nothing in them nothing in them no for years the company that provided the software went bankrupt never been replaced you know a simple thing that when I went into the immigration office at the airport and it was just piles of immigration cards and you could smell the ink and they had rats and it was horrible even as prime minister it took me six months to eventually get that to be moved there's just a malaise generally speaking and people are just become so despondent because the systems weren't working and it was everywhere Victoria hospital police stations in your schools on the roads government buildings so this attitudinal change that needed to take place and that's why I'm saying this Christmas was the first time I've seen in a long time people's confidence and hope was being restored and you can see people going out with smiles on their face I went to Asso square I went around the island I went into the shops and saw how packed it was and you can see that vibrancy that was starting to come back and I think you believe that they felt safe not just they felt safe people were just feeling better about the direction this country was going in and then you can see that they're becoming more comfortable with that and as more and more of the programs that we have been outlining that we're outlining today are starting to manifest themselves that will continue in my mind to contribute confidence it's the same thing with the police some of them are going to run out of excuses you have the communication systems we have the ability to collect the intelligence we knew who they were okay we're getting advanced notice so in fact if you're not doing your job then there must be a different reason and so holding them accountable would be far easier that's what I'm hearing you're saying one of the other pillars or what you call them 12 game changers within the citizen safety when your budget address you spoke very passionately about the rehabilitation and so that we can cut back on repeat offenders and so forth uh how far a scope of a program you're expecting this to be is something confined solely to the bodily correction of facility or you expect it to be something broader across the spectrum for uh low low enforcement so we're examining a multitude of different options so first of all increasing the number of social workers we have 12 we've added another three want to get to 30 yeah um and also to give them the resources so that again um potential uh I don't want to call them criminals okay but potential yes at risk individuals that we can address it early enough that they don't choose that path first time youth offenders even if it's a criminal case why don't we use technology they get convicted they get an ankle bracelet instead of me putting them in borderlay which I call linkedin meaning that they're developing now a new rolodex of contacts they're getting a free education in crime and they get a stigma associated to them and that it makes it very difficult for them to choose any other career other than crime um that they're now reporting to a counselor not even a parole officer a counselor who's now working with them to be able to get a proper job when they can start now going down a different road the public is safe because they have um this thing a young person now is not condemned to a life of crime and they're given a new opportunity and if they're in fact successful what they get now is they come off of the ankle bracelet and they now have to just report like on a parole basis do we even know how much it cost to maintain um a prisoner a borderlay so actually not having a borderlay or a minimized borderlay means with the same amount of money we might be able to implement a system like that so creating kind of a halfway system where they're still having to give up some of their rights because they have an ankle bracelet on them but at the same time they're being reintegrated and given a second chance in our society and again this is why I say as a small island what may apply as a good program in bigger countries doesn't necessarily work here so if I was in America and I got caught in Miami I can go to Orlando I can go to Jacksonville I can go to Georgia I can go to across the country I can go to Chicago yes I have a record but people don't know me where are you going to go in San Lucia right so we have to have a more compassionate country and address what the root cause of these problems are in the first place you're never going to be able to eliminate it entirely but malicious crimes and people who are deliberately threatening people's lives stealing people's assets we must do everything we can to rehabilitate if we cannot then that's where the traditional system will come in but these are the kinds of discussions that we're having in terms of looking at a medium-term and a long-term solution to the problems we have you know it's funny because I once had a conversation with a correct police officer and he asked me a question and said that in all of the years that we've had police in in San Lucia boots on the ground and all of those things police men come and go generation after generation in the hot spots we consider to be the crime hot spots what has changed and I had to pause and really think and he said everything remains the same it's just that you have a revolving door of police officers policing these hot spots and the social economic and the people but the socioeconomic status remains and so I had to really give that some thought as you spoke about changing mindsets in the environment that that came to mind that in those areas that's the constant the socioeconomic status of these hot spot areas the after-school program that's another thing that the government is passionate about being able again to create that intervention to engage young people are we broadening the scope again of this program we are it started off basically and it really is at the school at the schools itself as the school facilities and I mean we learned our very you know should have probably been more obvious we had to include food and so providing a meal for the kids went a very long way in encouraging participation in the program but this club system that we're proposing and building the facilities to be able to do that so so if you have a club and the club can have drama it can have sports in it you have primary level and secondary level and you have what we call senior leagues yeah so a club can have a multitude of different programs and it's in your community right and it's by providing resources so what we're saying is the money that currently goes into the lottery so we're basically what we're doing is taking and dividing the lottery taking the regulatory part of what the lottery does which is to provide the oversight of gaming and putting that into the gaming authority and now creating a new youth and sports authority and so that entity now will be putting together the programs so you can have different drama programs different film programs you can have dance programs all throughout the country after school so I can come home after school into my community I can go to dance class I can then go to football class yeah all in my same community we know that when people participate in these kinds of activities it helps them so it teaches interaction it teaches competition to become successful you must become disciplined to create the that desire to become successful is competition so the more competition there is and the higher the level of competition the more disciplined and the more work you have to be able to do and you build self esteem there and you build self esteem some will be concerned about the unattached youth so not at school young out of school in the community does that also encapsulate these individuals yeah so we have a special program for that so what happens is that we've talked about creating a social net is how we describe it so currently in the system people for the most part governments for the most part have believed that you can help vulnerable people through taxation I'm not going to put that on baby food or some of these products as if somehow you're going to help a poor person or we're subsidizing the cost of rice flour and sugar we're not only subsidizing it for the vulnerable person but we're subsidizing it for everybody else when we reduce the VAT on on we reducing it for everybody so we're saying we don't think that that's the best way so we're saying let us use technology where everybody's going to become registered they're going to have their insurance card they're going to have their proper ID card we're now going to keep track of who's working who's not working and what their status is by decentralizing government into the local government between elderly health care mental wellness and also sports as well as our social programs to maintain who these people are so your poverty list right now is not really a poverty list not everybody who deserves and deserves to be on the poverty list is poverty list is driven by what how much money has been put into the budget and so therefore the people who are on are happy people who are not on they tell you why is my government's not in government and this and that and and then the minister is getting involved because they're clearly being getting pressured by their constituents we said we have to create a system in which once you are deserving of it that you get it so some of these single mothers who don't have jobs don't have the capacity to get jobs with multiple kids right we need to be able to provide free education free bus transportation free food make sure that kids have more than one pair of shoes and also have their uniforms and have their schoolbooks or their e-book make sure they're getting a knock related all these things the state must become the father but the equally there are single fathers with multiple children right correct but and once they are deserving right and that they don't have the capacity to do it for themselves we have to be able to support that part of that is also providing them with the clothing and the ability to go these sports programs so this is why we're saying a minimum standard for everybody else it is when kids are discriminated against when all of a sudden they're kids who have and they have kids who have not that these kids have to psychologically grow up not feeling the same right and when I spoke to um some of the social workers some of these boys nobody's ever hugged them nobody said I love you who's going to their games with them we need that I can't imagine a day going by without me telling my son I love him can't imagine not hugging them yeah and sometimes I see myself like he pretends like he doesn't want it you know darn well that he does and this is why I say that to all of us as solutions we see the problem every day in our neighborhoods let's go back to the days when we used to help each other out because you ignore that problem that problem is going to come back and at some point it may confront you right we must have this love and this compassion for each other we must learn to give and there's some solutions who I just admire because they give above and beyond what they're supposed to but not all of us do and and we almost find a way to do that so the security problem is intertwined with a whole bunch of things it's not going to get resolved with any one no one thing but I want to make it very clear that we have not picked any one thing to solve the problem every aspect of it we're injecting money injecting resources and continuing to monitor it and that's why I say to you I am confident right I can't tell you when but I am confident that those efforts will pay off people will see it and the combination of everything that we're going to do is going to resolve this crime problem and it's a good time for us to take a break and when we come back we'll be focusing on infrastructure lots of big exciting prospects there for Saint Lucian stay with us see you on the other side of the break see it reported if you see me please help me call the TIP hotline and welcome back to our discussion with Prime Minister the Honourable Alan Chastney as we look back at the year 2019 infrastructure Prime Minister and I see you already give that smile because again referring to the article for consultation for Saint Lucia I said that the projects that the government has in the pipelines capital projects certainly it would be a great jump start for the economy the expectation is that it is going to substantially boost growth between 2020 and 2022 so the focus for your government in the last financial year the rehabilitation of the millennium highway and the west coast road there's a reconstruction or rehabilitation of secondary roads and collector roads feeder roads and the redevelopment and expansion of the Hironora international airport we know that deserves a special attention so we're going to give it a do but the rehabilitation for the millennium highway that is I think a lot of people are in great anticipation because it's really that's become a great sort of connecting road between castries and the southern part of the island where are we at with that because some people want to be able to see that the tractors are going out and doing things you know with immediacy is it happening yeah so the the money's the funding for that project is coming from the diffid fund so when David Cameron was prime minister he committed something like 330 million pounds to caracom of which Saint Lucia's portion was somewhere between 30 and 40 million pounds the former government had allocated that money towards the north south highway we just felt that that was not even going to be sufficient and the time to spend that money would not have been able to we would not have been able to fulfill it we felt that the millennium highway and we felt the west coast road in particular were in dire need of reinforcement and so we've allocated the money so the project is managed by cdb and has to go through first of all a test which had passed to being qualified then it had to get a bidding process to find a designer so that was done last year the designer came on board the designer has completed the designs now of the project we've gotten them to agree to break the project into three parts the millennium highway and ancillary being the first part of sorry the ancillary bridge being the first part and the board of cdb is meeting or has met and hopefully approved the next phase which we'll be now putting it out to bid so once it goes out to bid that takes about anywhere between two and three months depending on how everything goes so work should be commencing in march or april of this year on that project the millennium highway which i call the roller coaster because i you know i'm surprised more people have not had accidents on that road so we're very excited that that's going to take place following on the heels of that was the shock bridge the sorry the cul-de-sac bridge which is being done by jaika the japanese sadly you know that was a project that was supposed to start much earlier when it was put out to bid the contractors did not come up with the prices that everybody had thought that they would have and so it had to go back out to bid again and this time reduce the the project to just being the the the bridge itself my understanding is that a japanese company has been identified they have visited here and we're hoping to hear that that the japanese government has approved now for that project to be able to to commence so that project has been scaled down the ravine plus a portion of it has been taken out and we're looking for other resources to do that bridge that's such a critical bridge that we have to be able to do um so i'm very excited about getting that road done in addition to the millennium highway and the ancillary bridge will also be labised there's a huge component of of strengthening of for for resilience so slope stabilization safety in terms of barriers all along the high of the road going down to sufer and you know that's obviously a very important road for us from a tourism perspective and then also for the livelihood of the people who live in ancillary and and canaries and also in sufer all right so the reconstruction for our secondary roads the collector roads uh we now have what is deemed to be the largest ever in the history of sinusha for road rehabilitation and funded by the government of the republic of china taiwan some 42 million dollars if memory serves me correct uh portions of that program i think have sort of unfolded and the pocket areas of communities when can we expect to see a really large scale of the project unfolded so it's already started i'm casin bar road um has been done um the uh uh forest air road has been completed um and some other roads in um babbino have been done uh we're piaz um saltibus road um the piaz is hopefully going to start just now uh there are a lot of roads back roads in the grozolet and castries north constituencies um so there are roads all throughout sinusha at length and breadth of sinusha in my own constituency the blasha road and the spring road the denry um town roads uh there's roads in in miku north that are going to be done so all throughout the length and breadth of this country um they're going to be started so we have been uh had agreed with the taiwanese to borrow approximately um 250 million u.s dollars 100 million dollars went towards the airport uh eight million went four million went to um housing four million u.s went to ministry of education and 40 42 million is going into into the road redevelopment because of the loan and the structure of the loan we have a five-year moratorium so we actually will be doing an additional um 10 or 12 million u.s dollars work of roads primarily in the grozolet and also um castries area uh so all those road works are starting right now uh the designs have been completed contract i mean contract subcontractors have been identified my understanding is all they're doing is finalizing the negotiation between oecc and themselves um to be able to proceed with the with that work program in addition to that we're doing the west coast road as well as the millennium highway the bridges that we're going to be doing and then we're also doing feeder roads so we have about 50 million ec dollars in helping uh rebuild and um and re-strengthen and and re redevelop feed roads so uh for my our farmers this is critical and with the emphasis that we're doing on bananas as well as in the diversification programs very very very important and and sadly in all of these things we're not getting to do everything that we need to do so you know in terms of feeder roads there should be about 80 million dollars or more of work to be done uh the roads that we're doing with the the taiwanese only represents one third of the total roads in selusia uh so but this is a beginning uh it's going to be a significant impact on selusia and i have to say to everybody that this does not include any new roads this is just rehabilitating the existing roads and that's why i'm saying is that the deterioration of the infrastructure of this country was just going unabated not enough money was being spent over the years unmentaining the existing roads and even after a period of time even if you're maintaining a road you're going to have to rehabilitate it um the other big project i'm sure you're going to bring up is uh the north south highway yes critical critical road so there was a feasibility that was done by cdb we are in discussions with the americans the canadians and with the taiwanese to look at the final putting in a final design for those for that road and coming up with a final costing but preliminary costs are around 300 million us dollars to be able to develop that road uh we have set aside 28 dollars off of the airport tax in order to be able to fund that road so as soon as we have been able to finalize everything we will assign 28 dollars to be able to do that once we've completed the airport and we think that if we see an increase in arrivals in excess of 500 000 that we can actually pay off the loan for the airport quicker and then now assign that money to be able to help us to complete that highway but i want to say that that probably is one of the most significant infrastructure projects that we would have to take this is the one project that really takes solution to the next level so when you go to barbados as an example think of barbados without the abc highway and that's exactly where we are and those people who are traveling between castries and grows away know exactly what i'm talking about how much of the traffic that wants to go up north doesn't need to come through castries how much of the land on the east coast we can't access because there's not a proper road there so if in fact now you have the container port in cul-de-sac you now have a proper millenium highway that's going to continue to denry with a tunnel through the bar de lille and then you have two industrial highways that are going north and south at that point that even the distribution of cargo and in commercial traffic now can go on that major highway and i think it's going to make a significant difference in the growth potential of solution all right you're giving yourself a timeline and within which this should be completed we would like we would like before our term completed this time to have secured the financing and finalized the designing if in fact we could start that would be a bonus but right now given the constraints we have because we don't have a limitless supply of monies we were able to create some space for ourselves by introducing the airport tax and by putting in the gas tax so that therefore these claims and allegations that the country is rudderless and that we have problems financially is not true we are seeing an improvement in tax collections which are continuing to pay to recurrent and recurrent expenditure but these new projects that we're bringing in have their own dedicated revenue streams and certainly every major project that we're bringing in we're trying to have some form of dedicated revenue stream and so the goal is not to burden the taxpayer not increase the national the tax the taxpayer is paying right because whether it's through a gas tax whether it's through an airport tax i mean the majority of the airport tax is being paid for by the by the tourists and all these things help now improve our overall our tourism product but there are people who try not to burden them by having to take loans to the government having to take it's not the burden it's not to burden the state um in the sense that we are running deficits so the the the most worrisome number that solutions should have been aware of under the previous government regime was the fact that we were spending 170 million ec dollars a year on interest in 2003 that number was 33 million right that's a lot of money to be paying in interest and so we need to be mindful of that and what we've been able to do is not allow that number to grow we've been able to do that by reducing the amount of short-term treasury bills we have by not borrowing as much money as we had before that's going to have to come out of the recurrent expenses all that 170 million it's coming out of the recurrent expenditure so the interest and the principal on these new loans are being paid for by these dedicated taxes the redevelopment of the hero nor international airport we did have an announcement uh in the midway through 2019 that the sort of first phase was beginning with that project some people would believe that false start um not really i mean you and i had this discussion um a while back when a project begins is not when you see the groundbreaking uh taking place there's so many things that have to go on behind the scenes so this is a very big project um a tremendous amount of soil testing uh eis uh designs all had to be done and in the midst of it we've been negotiation with the united states government to be able to have what we call a pre-clearance facility so it means that u.s passengers um leaving solution would actually clear u.s customs and emigration here and so there had to be adjustments in the design that we were going to be able to make we have been in negotiations with the taiwanese the oe cc um in terms of finalizing the loan we had to organize the other forms of the loan so the hundred million dollars from the taiwanese was not going to complete the project but the loan that we got from the taiwanese with the five-year moratorium gives us the ability to borrow additional money which we did so we borrowed 75 million dollars from a consortium of banks we've been to parliament twice with that particular bill and we're now just finalizing that term agreement so we can't start the heavy work until all of the loan agreements have been passed my understanding is is the final approvals are going to the uh uh slasper board on friday but meanwhile all the plans have been completed the preliminary uh master plan has been approved by planning the infrastructure for the uh the foundation which is going to require almost 2000 piles because the soil is very soft there all that has been completed and my my understanding is that they're very far advanced with their negotiations with the subcontractors in terms of allowing that project to proceed so we're expecting very shortly what people are expecting to see which is the physical part of it would have happened but we've been collecting the money a lot of laws have had to be changed a lot of things had to be done in order to be able to accommodate this project but i'm very excited as to the progress we've made it's a very difficult project and i really want to commend slasper and i want to again thank the government of taiwan for extending their hand and providing us with this concessional loan wonderful now as we are beginning to wrap up our discussion prime minister the unemployment rates and of course that will fall in line with all of those spending projects that we have because people of anticipation of jobs we're announcing that there's a fall from 25 percent to 17 percent the youth unemployment is also down 10 percent so we are from the 44 percent we're now at 34 percent and i do hear you say not necessarily comforting yeah again these are all things that tell us that we're moving in the right direction when you have even 17 percent of your population unemployed that's distressing you know but relative to where we came from it's it's a it's a substantial improvement and those numbers were numbers that we got in september so i have to imagine that we should be getting the next quarter numbers i i generally believe that those numbers are going to come down and certainly with the major project starting i think that our promise of getting to 15 percent in our first term that we're actually going to beat that that number and beat it quite significantly so unemployment is an important measure and as we see more people becoming employed and more people have money in their pockets and people start spending that money like we saw over the christmas period then it becomes effective meaning that more and more people now will start being employed and businesses hopefully continue to be confident moving forward before we get to your expectations for 2020 i want to give you some time to talk about your tenure as the chairman of the caribbean community caracom which has come to an end because we now have prime minister mia marty of barbados who has now assumed the chairmanship your uh experience detailed that for us if you can or encapsulate for us what that experience was like at a critical time because we did have the heads of government conference here lots of issues were on the table very pressing issues climate change being one of the the primary things as well as getting the caracom as an organization to function in such a way that it is more meaningful and delivers more meaningfully to caracom nationals um so look i'm very appreciative of the opportunity you've been chairman as i said to uh the chairmanship really means that you're the watch the night watchman because there's not really a lot that you're going to be able to accomplish in six months so it's whatever the critical issues that that come up it's your turn to be on night watchman so you're the first line of response to any of these issues so the situation in Haiti we had a very tense situation in Guyana that we were working through we had elections in dominica which required the rss forces to be able to go in and be able to help uh and then the continued work program that we have the blacklisting with the with uh some of the countries uh the climate change as you indicated was a real a real topic um csm e because that was a hot topic of discussion um when when we were here uh the improvements of a regional security system so lots of things to be able to keep your your your pulse on and correspondent banking correspondent yeah we had a we had a very important meeting in in uh washington dc i want to thank prime minister gaston brown um who leads that that segment uh we had also the opportunity of meeting with um prime minister trudeau uh late in the year i also had the opportunity of meeting prime minister boris johnson very late in the year and on both cases using the opportunity to push forward um the caracom initiative i know that we've been trying for some time to be able to get prime minister trudeau to come to a caracom heads of government meeting i'm really hopeful that he will come to the meeting in barbados um in in in february so i just want to say that you know with caracom it it doesn't stop there's a continual agenda that we have to be able to follow my government's position on regional organizations is they must achieve at least uh one of two things if not both one is to improve the quality of governance in our country so means that the quality of my health care the quality of my education system the quality of my security system ought to be enhanced by regional participation secondly that the cost of governance should come down so by sharing some of these things that the cost for me should come down but ideally what you want is both you want to see a reduction in cost and an improvement in the overall quality and i'm not so sure we're always getting that and i think that uh honestly that uh a lot of people have said this i'm not the first that the caracom is in in need of some structure reform itself sadly i was not able to make it to giana to meet with the staff and to be able to interact with them i was not able to spend any time looking at those structures because we were overwhelmed with both situations in silocia and also other issues within caracom haiti being a very big one again you know very early we were supposed to have a trip to haiti unfortunately things got much worse they've seemed to have settled down a little bit but that continues to remain a hot topic for for for us to be able to discuss although it's far from the public mind but as we say hello to 2020 mr prime minister and our remaining moments want to give you an opportunity to talk about your own expectations for yourself the government and where you see saint lucha go in within this new year we have 18 months left before elections i'm excited at the prospects because we've put a lot of hard work in i'm expecting that a lot of the the the the the results of that hard work will become visible this year both from an infrastructural perspective because people will actually physically see work taking place from a policy perspective our headquarters act the work that we're doing with the europeans in terms of making our financial sector secure that ought to be coming into fruition i i think that we're going to continue to see our tourism grow i'm very excited about the prospects of of coming with a major project with the cruise industry particularly for castries redevelopment as well as putting a port and view for it i think a a cruise ship port and view for it at a home port in particular are going to it's going to transform the south not just few fort but all the way to sufer and up to denry i'm excited about the work that's taking place in our culture i'm very excited about the work that's taking place in education i'm very pumped about the new recording studio and broadcasting unit that's going to be put at the old san lucia radio station and to be integrated into sir arthur lewis we've put a lot of work into thinking what we're going to do at sir arthur lewis so the new principle and where he comes from and what he's doing is exciting so there's a lot i'm looking forward to but it means that we just we need to remain extremely focused very easy for people because it's 18 months to start thinking about elections so my attitude is is that we're keeping our foot on the accelerator very hard this year and really i'd like to get to a point where maybe we can get into fixed dates for elections as well as spending less on elections i mean i see some countries our neighbor in the north america seems to be in perpetual election mode and the amount of money they spend whereas when i was i saw the canadian elections you wouldn't even know it it came and went i think england also has a very good system in terms of restriction how much advertising and everything else that can be done a lot more controls so i think it's important that people exercise their democratic rights but i think as a small country the amount of time that is attributed to it we have to be very we have to be very cautious i have ignored my party politically in many ways you know when i was in opposition it afforded me the opportunity to spend substantially more time in my constituency branches and dealing with the party and then you know you have a chairman of a party and you have a political leader of a party and it really is to continue to allow that to be nurtured so i think that now that we've been able to accomplish what we have from a government and it really required my full-time attention my family and my political party both i believe have suffered from the amount of time that i've had to focus on turning this thing around with with with the country i'm not so sure i could ever describe to people what we were confronted and how difficult it has been to achieve what we had to achieve the meetings with the real bank and the imf to build up their level of confidence to be able to attract investors i mean this year huge task ahead we have 700 million dollars of bonds that come due that we have to roll over and so it's about keeping the confidence of those people letting them understand and hopefully appreciate that we're on the right track so again in the sake of politics sometimes when we are prepared to demean the brand in the name of st lucha in the name of politics we sometimes forget how much damage that we're doing but unfortunately that's not just unique to st lucha that's unique everywhere and so as a government we have to continuously put ourselves in a position to be able to overcome that and let people know that they are things that are taking place that are very positive that we are a country that follows the rule of law and that we believe that the strategy we have is a very effective one so that's why when you hear about the reduction in unemployment what's happening to the debt to gdp what's happening with some of the the other projects these are important milestones in terms of continuing to build and keep people's confidence but i don't want solutions ever to believe for one minute that we as a government believe that that's what the final road is going to be not until all solutions and i do mean all solutions are taking care of in this country and are living what we consider to be a decent a decent living will we ever stop and it may not happen and be completed by time my term of office completes but i'm hoping that like many of the other leaders be for me particularly sir john that i would have made a con a significant contribution towards achieving that and solutions will be well on their way to live in their best life ever thank you so much prime minister the honorable adam chastney we know it has been a very busy time for you taking the time of the schedule to be able to sit with us and give us a further insight into what it is the government of sinusha has been doing in the last year because that brings us to the end of our special production the year in review for 2019 i've been your host mr joseph see you next time


So, if you recall from the previous class and the discussion towards end of the previous class, we started looking at how do we, now we type back in in the presence of the explicit type casting. Explicit type casting will be more of an issue at the time of 4th generation, but the implicit has to be done in 5th generation. So, we have got some kind of code where we have an expression of this form and type of x in i added. Now, the two issues here, one that I need to change the representation of. So, what I need to change the representation of y, because finally I want type expression to have some kind of type which is consistent for both these variables and for the expression I want is that I should be able to find out what is the type expression which is associated with this. So, it becomes very clear at least from whatever we know of programming languages that when I try to mix types of 20 points and integers, both will be converted into 20 points. So, that means basically internally you look at type what will happen is something like this. This kind of conversion will implicitly happen and once this conversion happens then I know that this type is floating point, this type is floating point and therefore type expression that is associated with both type expression which is of x plus i becomes floating point and this is the information I need to carry because finally if I say that I am going to say do an assignment of this form. So, before I do an assignment I should be able to find out what is type of x plus i and what is type of i d and whether this is consistent assignment or not. Remember that we had a rule like this when we said s is i d being assigned an expression and there I wrote the rule saying if i d type is e type then expression is valid otherwise it is a type. So, with this background let us look at what kind of would be that of generating and what are the things we need to worry about. So, if we take an expression like x plus i where x is of type real and i is of type real then I need to internally change the presentation of i making sure that it is compatible with real and because the operations which are going to be on the machines are really different and compiler has to convert both the same type. So, this operand is now being converted to this particular type and who defines it obviously the language is telling us that what kind of convergence are possible and what kind of convergence are not possible. So, type conversion normally the inversion when I have a situation like this conversion usually happens from this type to this type but there is a small category and that is that if I am trying to do this conversion which is possible that in certain conversions I am going to lose information. So, for example if this is of type in and this is of type real or float then I know that it is going to lead to truncation which is equivalent to loss of information I do not want that. So, implicit type conversion also puts a rider saying that I will not do a conversion if there is loss of information. So, usually it is going to be to the left hand side provided there is no loss of information. Now, is it possible that I still want to typecast the rear into integer but in that case I will say that compiler will not do it let the programmer decide whether they really want to lose information. So, you may have functions like round you may have ceiling flow and so on right. So, those kind those are kind of explicit functions and where I will not let the compiler do any conversion but I will let the user do the conversion. So, type checker is used to insert conversion operations like what I have inserted here. So, when I say x plus i what it is converted into is x and plus then becomes real plus and i becomes into real. And type conversion is also called implicit or coercion this is going to be done by compiler like in this case and this is only one of the two situations where is there is no loss of information. So, this point is very important that compiler does not want to take sort of responsibility for what programmer may have in mind. So, compiler will say I will only do conversion if it is only a matter of changing the representation and no change of information. If you want to explicitly change certain information do an explicit type casting but do not depend upon the compiler for doing that. So, conversions are explicit if programmer has to write something to cause a conversion. So, for example if this conversion has to be done then we are leaving it to the programmer and that is going to be now an explicit conversion. Implicit conversion will happen only when it is a matter of change of representation and no loss of information. Is this point clear? This is a general principle which is followed. So, now let us get deeper into the code. So, suppose I am just worried about this kind of expressions. So, if I now have to capture basically now I have both integer and real types and id type I know will be available in the symbol table. So, for this I know that e type is int and for this e type is real and for this e type is nothing but just saying that look for the table and whatever is the type. Interesting thing that happens is here and for the time being let us assume that I only have tight mixing between integers and real. Of course, you can expand it to whatever is defined by the language but assuming that at this point of time language only permits mixing of integer and real type and if I know even type and e to type I want to find out what is the type expression for e. So, how will I do that? What kind of code I will end up writing? So, earlier when I wrote this and we were not worried about type conversion what is the kind of code I wrote? Do we have a time when you guys can come to the class? I mean just look at the what is the time now? I mean this is a 15 minute class of which 10 minutes are gone which is 20 percent I mean why do you have to come? Is it necessary to come to the class? If you cannot come on time then why do you come to the class at all? You just need to schedule your activities. What activity did you have in gone? Did you have a class before this? Then why can you get a 10 minutes earlier plan to come here 10 minutes earlier? So, what kind of code I will now write for this? So, earlier when I just had no type mixing allowed then what was the code I wrote? So, there was no type conversion allowed then we said if both are of type integer then it was it and if both were of type float then it was float. But now with implicit type conversion what will happen is I will permit mixing of types of intent float and how many combinations are possible? So, both can be in both can be real first and second can be these are the four possibilities I have. So, now I will say that if both are in then this type is going to be in. Now I can write a very short notation that assuming that only types which are possible of e 1 and e 2 are either integer or real. So, I just need to write else real but I am not going to do that and what I will do is rather than just saying else real I will now say let me enumerate all possibilities and it will become evident why I am enumerating all possibilities. So, now I will say that if the first is in the second is real then this becomes real and if first is real and the second is in I think these colors are not very I will change it sorry about this this is finding that on display is not coming out very clearly and then it is real and if both are real then this is real. Now you can see that in these three cases because outcome is real I could have just eliminated this and could have put else real and that would have worked right ok. Now why I am doing this why I am enumerating everything here any reason for particular reason does it give me any additional information no. So, let us just come in look at this ok I mean even if it is not primitive how does it matter I am not even worried about that I am standing always my input from left to right. So, at some point of time I am going to integrate my code generator with the type check ok and when I integrate my code generator with the type check then at this point I will say that the first operand needs to be converted into real and therefore I will insert a small piece of code here saying that convert whatever this variable is into a real number and here I will have to insert the code. So, really what will happen is that no type conversion here but type isn't no type conversion here but type is real and in this cases all the type changes are this or this will have to be implicitly coerced. And therefore I will have to insert code for saying that insert this function which says into real either for the first operand or the second operand and therefore I want to integrate all the code options because as I said at some point of time this will get expanded and the code generator will become part of it. Otherwise if I am just doing type checking then I don't need to do anything else then I did not need to do anything else. So, this is not giving me any additional information. Now next issue we need to deal with is overloading of functions. Now what is overloading of functions? So, let me go back and let me look at this. Can you notice here that I started with x plus i but then when I was doing type checking I said this plus is a real plus. Now it is possible that if I am just saying i plus j where both i and j happen to be integers then my code or type checker will say this is i integer plus j. So, it is the same plus operator in one case this is a real plus in another case this is an integer. So, what I have done is I have overloaded this particular function and depending upon the context I am going to find out which is the real operator. This operator which is integer addition and real addition they may map on to different outputs. So, I need to at time of type checking I need to find out what real operator is but actually situation is far worse than this. So, there are some operators which by definition by mathematical definitions they can take multiplication. I can multiply two integers I can multiply combination of integers and floating point numbers I can multiply two floating point numbers and outputs are going to be different so my type checker needs to tell you. So, those are by nature but what happens when I overload the function that is permissible in certain languages. So, let us take a situation where I say that I am not only an operator it is possible but overloading of functions is possible and the language is like data which will permit you to overload functions you can take a standard function. So, I can take a standard function like plus and overload it with something else I can define a function plus and have a different operator for this in addition to the built-in operation and the question that will now come is that if I now write an expression like this what is the definition of the function I associate with this how do I figure that out how will I figure that out . . . . . So, I can have a function like this I can have let us say I can overload so let us take this function now normal prototype of this function is let us say there is a normal prototype but I can also have let us say I can overload this and say that now if I give two integers should I use this function or this function. So, left hand side I do not know but let us say it depends on the context the left hand side is actually restricting the context. So, what we want to do here is we want to see that if I have overloaded functions how do I know what is the kind of method I have which is going to help me resolve these overloaded functions. So, suppose I have overloaded this function so let us now look at a situation that I have overloaded a function in let us say A dot which is function star and these are the two prototypes which are available I like more prototypes for this and now I want to find out that which is the so what it is doing is that suppose I take two integers here it is going to return a complex number to me of the form A plus I B or this is just going to give me a multiplication of A B. Now in this case clearly outcome is integer in this case clearly outcome is a complex number now I need to look at the context so suppose I say that I have so let us look at a situation like this that I have let us say 2 and 3 and I apply this function here question I want to ask you what will be the type of 2 star 3 now just by looking at this sub expression I will not be able to find out what is the type of 2 star 3. So, suppose now I say that I put it in a context which where I say that 2 star 3 multiplied by let us say 5 and 5 also happens to be integer then I clearly know that what will be the definition of this particular function which prototype will apply this one right because you know that there is no operation which is defined on integer complex and integer that is invariant but suppose I have something like this where that happens to be a complex number then which prototype will I apply then obviously because again there is no operation which is defined on integer and complex and for this to be valid this must be complex so I may have to have add another prototype so let us go through this example first and then see how we will resolve these issues so overloaded symbols they have different meanings depending upon the context and the context is the one so it is not just the left hand side so therefore I use a general term that it is the context which determines and if addition is overloaded this is used for integer real complex matrices in fact yeah this is another interesting thing so there are languages where you may have data types like matrices if you take language like ATL where data type would be integer, protein point number, a vector, a matrix and if I want to do multiplication of two matrices all I need to say is a multiplied by b I do not have to write unless I do if I want to take two vectors and I want to do addition of two vectors I do not have to write a loop saying do an element by element addition all I need to do is say add vector a and b and the semantics of this operator is defined right there okay so ADAP now permits overloading which is used for arrays functions called type conversion and so on okay so if you look at brackets here so brackets are overloaded they can be used in many of these contexts but overloading is resolved when you find them there is a unique mean okay now what you have to understand here is and this last point is very important that to begin with when I just look at this okay I do not know what is the function which is being applied here but then I start looking into context okay and when I start looking at context I try to resolve it okay I keep on resolving till I find that there is a unique meaning which is associated with this now if at any point of time I come to a conclusion that there is no unique meaning associated I say this is an error because such a program should not be written because if it cannot be interpreted then we have a problem right so if we cannot interpret it obviously compile a camera but if I find a unique meaning then I associate that meaning with it and that is the function that we are going to get okay so let us look at a situation where we say that in Ada the standard interpretation of star is multiplication but it can be overloaded by having multiple types multiple arguments and return types so I can now have this and this is the kind of syntax it says that function star takes two integers and returns a complex and it can also take two complex numbers and return a complex number two so basically this is saying that I can take two integers and return a complex number which is of this form a plus i b or I can take two complex numbers and do multiplication a complex number now if that happens then the possible type expressions or the prototypes for star are these I can take integer cross integers it gives me integer I can take integer cross integer which gives me complex and I take complex cross complex and now if I so overloading suppose I say two three and five these are integers and Z is a complex variable then what will happen three star five is either integer or complex depending upon the context I have to determine the context there so if I say my context is like saying two star three star five then what is the context here context is that I am taking an integer here and therefore since I don't have a prototype it will say that integer cross integer multiplied by complex such a prototype is just not there then I say that this is only going to be an integer but if I have something like this then I know that this has to be complex but because again complex and integer multiplication are not allowed at least I don't have a complex problem now issue that comes is how do I do that in terms of writing the code so let me go back and remind you what is the code we had for function resolution and then we will try to modify that so I wrote something of this form where I said e1 e2 remember this is the kind of syntax we had and what is the code I wrote for this for type checking I wanted to find out e type and what was e type here remember the code for this so we said that if e1 is equal to a mapping from s to t and e2 type is s then t else this is what we have now what may happen here is that when I start applying see so I don't distinguish between function and operator I mean it is just a matter basically semantically what is happening exactly the same now what may happen here is that when I say e type e type if I say that I am taking the first function which is 3 star 5 then what could be e type what would be e type here well it be this type error or it will be t and if it is t then what will be value of t so I just look at only this so let's just take 2 star 3 here or just take 3 star 5 I am applying the function here so what will be type of 3 star 5 just go by this rule so what are the changes I made here do I need to make any change or I will just use it in the same manner so only change I need to make here is rather than saying t it will be a set all I am saying is that e1 type remember that I know e2 type e2 type in both cases is int but even type will say that int cross int matches to int and int cross int also maps on to complex so all I need to say here is this t instead of a single value will be now a set that's the only change that will happen really nothing else will change so this is the kind of thing we will do and now once we start doing this at some point of time I need to have a unique value so remember that this will occur now in certain context so when I started by saying that I will have this 3 star 5 at some point of time this 3 star 5 when this reduction happens to e this will occur in certain context and that context is going to be 2 star 3 star 5 so again I will do this and say that when this resolution happens again I will have a set of types but at some point of time I will know the complete context and at that point of time I need to say that only one type is possible and rest of the types will have to be discarded so I discard all those types so one way to look at this is that if I am building my expression tree and in expression tree if I have an expression tree like this so let's say I have an expression tree of this form then I start finding out type so if I say what is type of tree this is int and this is int and what is the type of this star this could either be value here could either be either inferior or complex and then I will say this is int I know that c is not defined here so this can only be int so I can come down and discard this and I have resolved okay so actually it's a 2 pass process where I first say that I start bottom up and start building all the types and find out the sets here rather than a unique value which was possible when I did not have overloading and then once I have reached the top at that point of time I must know that it must have a unique type and if it does not have a unique type that's a type error but if it has a unique type then I use that information and start traversing down one again and say that certain types will be discarded and I need to find a unique type because that's the only way I can generate code that's the only way I can call a function so let's look at an example of this so type resolution is that try all possible types for each overloaded function in some cases it may be possible but it's absolutely a brute force method we are not interested in those kind of situations so keep track of all possible types and this is what I'm doing I'll keep track of using these kind of rules all possible types and then discard all invariant possible so when I start traversing down I'll start discarding this kind of information and then at the end check if there is a single unique type for every operator I have if it's a single unique type I'm done if it is not then I say this is a type error so how do I rank code for this so overloading can be resolved in two passes so first pass is the bottom up compute set of all possible types for each expression and pop down this when I start narrowing down the set of possible types based on what could be used in an expression and that comes from the context right makes sense so this is precisely what we do that now my code will look something like this that when I say E prime goes to E I'll say that so let we first write the full code and then show you so basically what is happening here is that if I say 3 and 5 these are integers and this is star and if I have a type expression like this which says E goes to E star E then I know that types of star are I cross I going to I I cross I going to C and C cross C going to C these are the three overloaded types but since these are two Is then I know that third type is not possible but these two types are possible and my outcome is going to be Is and then I'll traverse down once I have resolved what is the unique type of this I'll traverse down and discard one of those types so suppose I come down and say in this context in the context this E occurs C is not possible then I'll say this is I and therefore this I cross I going to C will be discarded and only the first type will be used so basically what happens here is that if I look at these types I look up ID and now I say what is E type here this is a set T can we say that there exists some as in E2 types and S2T even types so I'll not say this is just T but it could have multiple values so rather than having a single value of T what you end up with is a set so if each operator has a unique type then how do we resolve something like 2 into 3 into 5 into 10 don't worry about what compiler does you tell me suppose you were to write such an expression how will you resolve it how will you interpret right most the first unique representation then we have to so first I mean make an expression for this an expression we say that I am going to it has certain rules that I have start reading it from left to right and start evaluating it from left to right so suppose I want to write 2 star 3 star 5 star z right this is what you are saying 2 star 3 2 star 3 is 5 this right okay let's make an expression free for this how is expression free for this look this is expression free right okay now if this is I and this is I then you know that it can be either I or C what about 5 5 is I okay now what are the types of this C right okay so if this is because if I take I star I C C and I combination will not be permitted but I know that if this is I and this is I I can still get I can see here okay and this is C okay now what about type of this C okay but what is C what C means that I can take now 2 inputs in complex and multiply it okay so as soon as you say this is because I and C are not permissible only C and C are permissible you will discard this does it resolve I already said that we have multiple passes don't worry about now passing technique although it can be done still in a single pass okay but doesn't matter if you have to do multiple passes here you have a bottom of pass and you have to talk about pass so I am not even trying to do it in single pass I am talking with lot of jugglery and moving about the rules it is possible to go into a pass okay but let's at that point of time let's not worry about whether I am doing it in one pass okay let's say that even if I have to have multiple passes I can do it and I will show you that so in 2 inputs you are still not here that's what I have okay so look at it this way that I say that if this is C then is if I say I and I okay then isn't it clear that what I am trying to get here is that I am taking here an integer value okay because remember that C and I combination is not permitted I don't have such a prototype okay so this C anyway is not allowed okay then I know that what I am doing here is I am starting with integer giving an integer taking another integer now giving a complex and then taking two complex and doing a multiplication okay so what happens here is so look at it this way that I will keep going up okay till I reach the last operator at the root and the root I say that now do I know the unique type if I do that's a type error but if I do then I use that information to come down and for each node I try to determine the unique type so what happens here is so look at it this way I try to determine the unique type if I am able to do that then I am successful if I am not able to determine that I flag a type error so it is possible that you can overload a function in a manner that I will never be able to resolve it okay and then I will have to give a type error because I don't know which function to use and in any case if I can use more than one function I am stuck so compiler is only implementing it look at it this way that if I cannot resolve it there is no way compiler can resolve it any more questions on this so this is what we do here that we keep on resolving these types so first thing that happens is rather than having a single value I will now have a set of values and how do I narrow down this set of values that this requires now programming language says that a complete expression must have a unique type anything else is not permitted anything else is a type error so what we do is given a unique type from the context we narrow down the type of choices for each of the expressions which are below in this and if this process does not present in a unique type for each of expression then we declare a type error okay so how do I write the rules now narrowing down the types so basically let me again okay let's have full code and see what happens here so what we have is when I say EID is so look at two kind of rules actually I could have color coded it but so okay so when I say that E goes to ID that time I just do a look so the assumption is that every variable has been declared as a type so if I say E goes to num then I know that E type is integer if E goes to num.num then E type is real and if E goes to ID then I just look at my single way okay and when I parse this particular rule which says that I have a function then I say that E types is so this is the rule we saw that E types is nothing but a set of types okay so forget about this part don't even read these four lines for the time this is what I mean okay now once I have constructed this then I say that now I say what is E prime type E prime type here when this is the start rule which says E prime goes to E prime types E prime types just takes the value of E types which is going to be a set now this is the start symbol and now I check whether this type is unique or not whether the ordinality of this set is one or not if it is not one then I have a problem but if it is one then we say that what is E unique that's a new variable I define and we say if E prime type is T then this is T otherwise type F so it must have only one type when I reach the start symbol by that it should have been resolved okay now if it gets resolved if it is not type error then we say now let's come down and that is where we start looking at last four lines okay and we say that here now I am trying to resolve type so here I will now define a new variable which says what is my E unique now E unique must be having a single member cannot have a set anymore okay because I have seen here because if E unique is not a single member then I give a type F now I say let me find out types of arguments okay so now I say that if S belongs to E2 type and S going to T belongs to E1 type then if E2 type is S then this is S otherwise type error and if E1 type is S then this is S going to T otherwise this is a type error okay so basically I mean just understand this code what I am doing here is that first I have reached here in fact I mean you pointed out example which you can just pass using this that when I reach here I check what is the type of this particular function okay this is unique so I am happy here this is not a type error but then I start coming down saying can I now narrow down earlier when I said I had I comma C here can I narrow down it by saying that only IC is not a valid combination only C and C is a valid combination and therefore this type is distorted and basically it becomes unique and I keep recursively coming down till I am able to narrow down type of each of the star signals and actually if you now see implementation of this okay you will again find I am using the same jugglery and which is that I am absorbing something which is an inherited attribute and something which is a synthesized attribute and the combination of this basically helps me in doing it in one pass but there is no guarantee that I will be able but basically okay the trick remains the same that have a two pass have multiple passes two passes keep on building types till you reach the root and at root if you find you do not have a unique type like a type error but if you find at root you have a unique type then keep coming down and keep resolving types of each of the descendant nodes and wherever you find that you are not able to resolve like a type error otherwise you are done clear questions anything so as I said right in the beginning we are not going to go for type resolution in functional languages or languages where types are not declared we are always assuming that I will always be able to find type of variable by looking at my symbol table okay now there are languages where such a declaration does not exist value of a type of an identifier could be determined only from the value of the sign so I can take a variable I can take something like basic I can take a variable start by assigning an integer value to this and subsequently I start a floating point value and then subsequently I assign a totally different type to this the functional languages operate in this manner and then lot of work actually goes on in type resolution but that is as I said is a separate course in fact you need to know more of lambda calculus in type resolution and type associations and so on just to do that and that becomes a very major issue for both functional languages as well as when we go into processing with languages like natural languages and so on but we keep out of that domain and we just have languages where you say everything is all variables are applied to declare the types are not and therefore this actually plays a major role which says that this lookup will always be able to give me a new type so this is where I want to close discussion on type checking and move on to code generation unless you have any question about what we have done in type checking is there till you move on to the next topic so let us move on to then the code generation so what we want to do is now we want to start generating code and if you recall once again what we did in our compiler structure we had a front end so let me just remind you of the structure we had we had a front end we had a back end and within back end I said that we are going to have at least two phases one which will give me the intermediate code and other which will give me finally the machine code and of course we had an optional optimization phase which we will introduce only towards the end after doing code generation because this part is optional at least we must know this box and this box to complete our compiler and if time permits we can see that how to improve code what are the techniques which are available to us for improving the quality of code so now what we want to do is we are here and we want to talk about this box and this box is saying that I have done type checking on the program now I know that this program is correct with respect to the specifications of the program language and once I have resolved that this is now correct I know the meaning of each and every symbol I have resolved all my operators I want to now convert that into some kind of code which is closer to the machine so I am not straight away generating machine code but I am saying I will do it in two steps and I want to move into two steps one where I will have some kind of notation which is not exactly the machine instruction it is not the concrete syntax but it is much closer to the machine resources so this is the final phase when I do machine code generation at that point of time I will convert this representation into a concrete syntax of the machine which will look exactly like what an SMG language language program is so exception at source level once again so this is again I have captured from the introduction and this point leads to the functional specifications of what we are trying to do that the exception we started with were identifier operator and at target level what I am having are again memory locations where you stress like op-votes addressing nodes and so on and code generation is going to be mapping from here and we want to take all the source level abstractions and we want to map them on to the target abstractions this is what my aim is and in this I am going to use first the intermediate code generation so front end translates source program into an intermediate presentation so normally what happens is logically we may say that I have a front end and I have this but actually what happens is that you can implementation wise fit all of this I am leaving the optimization out for the timing you can fit all of this actually into some kind of same physical code so you will see that when I talk about intermediate code generation I will still talk about syntax that will be translated that as I am passing time I will be able to not only type checking but I will be able to generate code straight away so back end generates target code target is now the target machine from the intermediate presentation so my back end really when I talk about my back end this generates code starting from the intermediate so you have to distinguish between the logical activities and the way I implement a compiler so logically I may have many activities but I am able to put them together into a single physical phase so what are the benefits of this model obviously re-targeting is possible and machine independent code optimization is also possible because remember that this phase is giving me some kind of intermediate representation which is independent of the machine but is closer to machine so I am not doing optimization at the machine level here and this is how my logical structure looks I have a front end I have intermediate code intermediate and I have machine code intermediate and what we have done so far is this part and this is where we are moving now and therefore first thing I must remember is that if I am talking about this box what is my input and what is my output so what is my input here logically I am not worried about all the implementation is done at this point of time what is my input to the intermediate code intermediate and extract syntax tree which has been completely resolved where I know the meaning of each of the operands and where I know the exact meaning of each of the operands and what is my output here output is going to be some intermediate representation which we do not know at this point of time so remember that we started talking about right in the beginning we started talking about some kind of universal intermediate representation which could then be targeted on to any machine so let us now start looking at what is the kind of intermediate representation that we are talking about so intermediate representation design becomes very important issue for us because this is really going to be the interface and it is not just interface between a machine code generator but it could be an interface to many machine code generators because I want to target different machines there and therefore this design has to be done very carefully now first thing that happens is unfortunately we are talking about science and principles and so on but science involved and what we are talking about is wizardry or artistry saying that how do I design intermediate representation it is almost like saying how do you write a good program do you have an ability for writing a good program you perhaps cannot even define what a good program is you may have certain guidelines but you cannot say that give me a program and I will be able to look at this program or I will have a tool which will look at this program and say there is a good program both the programs may achieve the same functionality but then I mean you look at a program and you say this program is very good very easy to understand fast to execute and so on and you look at some programs and then you say I do not want to test such programs I do not want to look at them similarly when you say IR design IR design basically comes from lot of experience lot of experience of the compiler I think so if you have been in the compiler project for 20 years when you have this talk of now inbuilt skill when you say this is a good IR because this is going to serve all kind of machines I am going to encounter this is going to help me in doing code generation this is going to help me in doing optimization and so on and I can design a very bad IR and you will suddenly find that you keep going back and forth here you are able to achieve all the functionality so first thing is that is an art really and each compiler uses multiple IRs multiple IRs so where are the multiple IRs if I look at this first IR what was the first IR we encountered stream of programs stream of programs and what was the next IR we encountered abstract syntax T which was not resolved we were also talking about parse T but as I said parse T is more of a notation which is really compiler does not worry about psychological notation and then we have another IR which was resolved syntax T so resolved syntax T is the one where all the operators have been resolved and then we look at other IRs now IR could be at multiple levels so we have one notation which is used this theory is what we know as HIR or high level intermediate representation where I say that I want to preserve all the loop structures and all the information now at this point of time it may not be clear so let us look at what are the other IRs we may have so another IR we may have is what we know as medium level intermediate representation or MIR you will find in short where which has a range of features which is basically close to the set of languages we have but still remains independent of the language and is also good for code generation for multiple machine and this is appropriate for large number of optimizations but what happens is then why I am talking about even this kind of IR there are certain optimizations you may want to do and therefore it becomes really an art where we say that I am designing an IR keeping overall compiler structure in mind keeping overall functionality I want to achieve in compiler so if you design an IR where lot of information is lost so let us take an example suppose I say that I have a loop in the program now how do you translate normally loops you will have a sequence of test results you have something like this for I let us say 1 2 n and i plus plus and then I have this set of statements now when I am doing this translation normally what will happen is that I am going to convert this into a sequence of test results so I will say that maybe I is stored in a variable which could be a register variable and then every time this loop has to be executed I will first check whether this is still within the bounds and then I will execute it I will come back I will implement it and I will keep on moving now many times suppose I want to do optimization right here I want to recognize that there is something a loop because remember that I can convert this into a sequence of test and jumps but not all sequences of test and jumps can be converted back so as I keep on moving from abstraction which is source level up to target level every time I do translation I am losing some information when I am losing information there is no point saying I will go back and start reconstructing that information because I have already put in effort and I have lost information which I may not be able to recover so many times when I want to do optimization at this level and suppose here I have now an array which is of this form so this is a very simple form where I say a is assigned b and for each element element of b is being assigned to a what is going to happen here is that once I convert this what is going to be the conversion here when I convert this into a language which is close to machine language what is the kind of conversion you can think of load and store load and store is a general technique when you load something from memory and then store it back no if you look at conversion that will happen is that I will say take the base address of b I know the base address of a and I will take the first element then I will increment i and if it takes 4 bytes to store an element then I will say that whatever is the base address I add 4 to that and keep on doing it for all the elements but suppose I want to do certain optimizations in analysis on i now take for example something like i plus 3 and I want to do this analysis on these index values then I lost that information out so what I will try to do therefore is I will try to preserve hir and once I have done this then I will be able to do this resolution for this optimization so depending upon the kind of things I want to do our other want to keep hir there or I want to go to mir depending upon the kind of optimization sample so this is we will stop our discussion today