Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Reasoning About Strings This homework explores a logic over strings of the symbols 0 and 1. We define strings as either the empty string c.

image text in transcribed

image text in transcribed

Reasoning About Strings This homework explores a logic over strings of the symbols 0 and 1. We define strings as either the empty string c. or as a (finite, but potentially arbitrarily long) series of Os and 1s. For example, the following are strings 0 0010 1111110100100010000 We can also concatenate strings. It w and w ale strings, we write their concatenation as w . For example: 010 101 010101 010 -010 01 0101 = 010101 101 - 101 To reason about strings, we have two atomic predicates. The first is string equality, written w = 1. For example, the following predicates hold: 1010 1010 10 10 1010 Www-w' In contrast, the following predicates do not hold: 1010 - 0101 0101 - 101 Www-ww . The predicate a 2 holds if 80 Our second atomic predicate is the substring predicate, written appears in order in vs. For example, the following predicates hold: 01 1010 101 C 101 Www In contrast, the following predicales do nol lold: 10 511 100000 Fr.-(w Ev (40 points) Give a predicate that eactly characterizes each of the following sets of strings. That is to say: your predicate should have a free variable (say w), and should hold if and only if w is instantiated to a string in the set. (al Strings containing both 101 and 010. (b) Strings that contain 101 if they contain 10. (c) Strings that contain the substring 11 in two different ways. (So 111 is includou, but 011 is not.) (d) Strings that contain at least four Is. Reasoning About Strings This homework explores a logic over strings of the symbols 0 and 1. We define strings as either the empty string c. or as a (finite, but potentially arbitrarily long) series of Os and 1s. For example, the following are strings 0 0010 1111110100100010000 We can also concatenate strings. It w and w ale strings, we write their concatenation as w . For example: 010 101 010101 010 -010 01 0101 = 010101 101 - 101 To reason about strings, we have two atomic predicates. The first is string equality, written w = 1. For example, the following predicates hold: 1010 1010 10 10 1010 Www-w' In contrast, the following predicates do not hold: 1010 - 0101 0101 - 101 Www-ww . The predicate a 2 holds if 80 Our second atomic predicate is the substring predicate, written appears in order in vs. For example, the following predicates hold: 01 1010 101 C 101 Www In contrast, the following predicales do nol lold: 10 511 100000 Fr.-(w Ev (40 points) Give a predicate that eactly characterizes each of the following sets of strings. That is to say: your predicate should have a free variable (say w), and should hold if and only if w is instantiated to a string in the set. (al Strings containing both 101 and 010. (b) Strings that contain 101 if they contain 10. (c) Strings that contain the substring 11 in two different ways. (So 111 is includou, but 011 is not.) (d) Strings that contain at least four Is

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Third International Conference Achids 2011 Daegu Korea April 2011 Proceedings Part 2 Lnai 6592

Authors: Ngoc Thanh Nguyen ,Chong-Gun Kim ,Adam Janiak

2011th Edition

3642200419, 978-3642200410

More Books

Students also viewed these Databases questions

Question

identify current issues relating to equal pay in organisations

Answered: 1 week ago