1. Engineering
  2. Computer Science
  3. hello i saw multiple solutions here but they were all...

Question: hello i saw multiple solutions here but they were all...

Question details

Let U be the set of all strings . Let s be a string. The length/size of a string, denoted Isl, is the number of characters in s . Let s be a string, and i E N such that 0-i < |s|. We write sli] to represent the character of s at index i, where indexing starts at 0 (so s[0] is the first character, and sls|-1] is the last character) Using these definitions, we can represent interesting properties of strings in formal predicate logic. For example, here is how we could define a predicate over U to check whether a string contains the letter A For the following translations, you may use the notation for the size and indexing of a string, and the equals symbol to compare single letters. Do not use the symbol to compare entire strings. (a) Let s1 and s2 be strings. We say that s is a substring of s2 if s1 appears somewhere in s2 (in a contiguous block). For example, the string abc is a substring of zabcdef, but it is not a substring of abzdefc. Every string is a substring of itself, and the empty string is a substring of every string. Define a predicate HasCSC(s), which is true if and only if the string CSC is a substring of s (b) Define a predicate Substring(s1, 82), which is true if and only if s1 is a substring of s2 (c) Let s be a string. We say that s is a palindrome if and only if its reversal (the string obtained by taking the letters of s in reverse order) equals the original string. For example, the string abbcbba is a palindrome. The empty string and all strings of length 1 are palindromes Define a predicate Palindrome(s), which is true if and only if s is a palindrome (d) Consider the following statement in predicate logic: Ys1, s2EU, Substring(s1, s2) 1s11 1s21 Is this statement True or False? Briefly explain your answer; no formal proof is necessary

hello, i saw multiple solutions here but they were all wrong :(

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution