Software Engineering Course: Algebra and Mathematical Logic

How people think we do math.

This'll be a sort of abridged summary of the topic, any more information you might need, I recommend you try the book (name in bottom of the post).


Like anything in science and engineering, there's a crucial component that binds it all together, yup Maths! Oh boy!

If your taking this course you should be well acquainted (hopefully) with some algebraic and logical terms.

The examples of the ones we use for this course are:

  • ∀ (For All) - applies to all
  • ∃ (There exists) - At the very least one exist
  • ⊂/⊆ (subset of/ subset or equal) - a set that is contained in a bigger set
  • ∈ (element of) - one element that can be found in a set

Let's make some examples just in case:

Example 1:

∀ x ⊂ Y: function(x) --> result
In English: For every x that is a subset of Y, then function of x will produce result 

Example 2:
∃ z ∈ Y: function(z) --> result
In English: There exists a z that is an element inside of Y, then function of z produces result


Now with these basics kind of covered we can enter a bit deeper into the chapter.

AXIOMS

When working on our domains in RSL, we need to preemptively try to work out some kinks, maybe some failsafes. To do these we make something called axioms.

Axioms are statements that are always, yes always true, no matter what. This is to set the parameters of how the domain will work, what will happen if invalid inputs are used, and what would happen if valid inputs are used.

When something goes wrong, like an invalid input we'd something do this:

axiom
    CalculatorSum(letter1 x letter2) -> chaos

chaos let's us know that the domain ends in well... chaos! It just won't work or will give us an unexpected.

Now when we have something that will actually work.

axiom
     ∀ x ∈ Numbers and ∀ y ∈ Numbers  : CalculatorSum(x, y) --> Sum
In English: For any x in Numbers and For any y in Numbers, CalculatorSum of x and y produce Sum.


Not really that hard, you just gotta think a bit more mathematically about it. (Needs a bit of getting used to!)

Book used for this topic: Dines Bjørner, Software Engineering, Vol 1, Springer, 2006. (short SE-V1)

Comments

Popular posts from this blog

JavaFX Snake Game (WIP)

Software Engineering: Documents

Where have I been?