Question

A Palindrome is a word that is the same when written forwards and when written backwards. For example, the word "refer" is a Palindrome. The Dafny program ex3errors.dfy, which you will

find on the website, contains a method PalVerify that is supposed to verify whether a word is a Palindrome, where the word is represented as an array of characters. The method was written by a novice software engineer, and contains many errors. i Without changing the signature or the code in the while loop, fix the method so that it veriifes the code. Do not add any Dafny predicates or functions: keep the changes to a minimum. ii Write a tester method (you may call it anything you like) that verifies that the testcases refer, z and the empty string are Palindromes, and ry and 123421 are not. The tester should not generate any output.