Purchase Solution

Formal Specification Set Theory

Not what you're looking for?

Ask Custom Question

Hello, I need a help with working with set theory for pre, post conditions and logic conditions for a board game I wrote in Java. The Java part is easy, figuring out to express what I using set theory is difficult.

A brief set theory overview as it relates to documentation Java code would be helpful and specific explanation of these issues -

I.
An example is attached of practice problem. Could you explain the post condition step by step? I get the general idea the expression is showing a loop that ends when their is nothing left in the string then returns number of characters in the string, but I bit confused by the symbols and notations.

II.
Could you explain how I could use they same type of notation in the example above to write a complex logic case such as -

Write a function that searches a [n][n] matrix filled with x's,y's or blank to find if a location in the matrix exists that:

I. there is x or multiple x values with a blank on one side (left/right or top bottom) and a y on the other
II. there is a y or multiple y values with a blank on one side (left/right or top bottom) and a x on the other

Thank you for help, I am sure with a little guidance I can get the hang of this stuff.

Attachments
Purchase this Solution

Solution Summary

The formal specification set theories are determined.

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.