Introduction
This tutorial is design to teach you how to "Think" wire and not "Build" wire. What I mean my this is that you should be able to create your own contraptions and code based on logic, rather than copying down instructions on how to build that turret you want.
This is a novice guide that will teach beginners how to use the most of your brain to build machines and devices on your own. Nevertheless, this is a good guide for anybody.
Definition
As defined by Wikipedia,
Logic is the study of the principles of valid demonstration and inference. Logic is a branch of philosophy, a part of the classical trivium.
In layman's terms, it is the process of thought that solves problems and make's us think to do before we act.
Terminology
Theorem: A statement that is true in all situations that pertain to it
Circularity: Another word's definition can not be used in a definition. (For Example,
Def. Chocolate Chip Cookie
can not be, a cookie with chocolate in it. It has to something like, a soft dough pastry that includes chocolate chips within it's structure.)
Statement: A logic sentence
Principles
Form ~ Almost all of logic is based in form. Structure is the key to logic and is pretty much required for it to work. There are some forms of non-formal logic that include Informal Logic, Symbol Logic, and Mathematical Logic (Which is pretty much Symbolic Logic)
Consistency ~ No Theorems have an effect on another Theorem
Soundness ~ All Statements are true
Completeness ~ No True statement can be used to prove a system. (Circularity)
Statements
Conditional
P is an action, like You live in San Diego.
Q is a consequence, like You like Mexican food.
With that said, it flows together like this.
Code:
If you live in San Diego, then you like Mexican food.
Converse
The same as a condition, but in reverse
Code:
If you like Mexican food, then you live in San Diego.
Even if the converse is true, it's result has no affect of whether the Conditional is true or false, but does ultimately prove the statement false.
*Remember, Conditional is not being referred to as the "Conditional Statement", but as a PART of the Statement. <- Clarification
In order for a statement to be true, both the Conditional and the Converse MUST be true.
Here's some advanced statements.
Contrapositive
Code:
If NOT P, Then NOT Q
With that said, it would look something like this
Code:
If you DON'T live in San Diego, you DON'T like Mexican food.
This too does not have to be true, it's just a way of thought.
Wiremod
Just about every bit of wiremod is made of, if not all, Logic.
Almost all of wire consists of this structure.
Code:
Take "A", Preform fuction "B":: Output "C"
In context, you take the Bearing of the target, add 30, then output (Bearing+30) to make an object circle around that target.
For use in most of the Indicator and Physics parts of wire, they use a On / Off function.
Code:
If A is equal to 1, Then the lamp will turn On.
Using what we learned before, we can conclude that,
Code:
If the lamp is On, Then A is equal to 1.
And using the Contrapostive, we can ultimately say that
Code:
If A DOES NOT equal 1, Then the Lamp WILL NOT be On.
Gates
Gates use a similar form of logic, that is not quite If, Then.
Gates use a form where you take Cookie "A", Do something to it to make it better, then output Cookie "B".
If you were to have an add chip, you would take the input of A, add it to Input B(And to how ever many you Input) , then outputs the total answer.
All gates (Except CPU and Expression) use this form.
Expression 1
Expression one uses this exact form of Logic, along with some other functions like Assignment.
Expression follows this form.
*-> is the same as Then.
Or using the example I used before.
Code:
I@ A
O@ LampOn
#This is the Conditional
If A == 1 -> LampOn = 1; #Remember to use a semicolon (;) to end your conditionals.
#This is the use of a Contrapositive to make sure the light is never on when A is not 1
If A != 1 -> LampOn = 0; # != means DOES NOT equal.
Expression 2
Expression 2 uses the same form of Logic as E1, but with a different Syntax. A Syntax is a form of writing, to say.
E2 uses the form of
The first part of if(A==1), that is essentially the same as P.
The later part of {B=C} is the same as Q.
So
Post Script
This tutorial is not complete and will be added too as time goes by. Feel free to post anything that you wish to be added, and I will work it in. Especially the Wiremod part. It is late and this is all I could come up with at the momemt.
Bookmarks