Wednesday, August 18, 2010
Disagreement
I can't disagree with you unless you disagree with me. If it's rude to contradict someone, then whoever speaks first wins.
Labels:
short
Sunday, August 08, 2010
Monadic Predicate Logic
Suppose we restricted our thoughts to the concepts of something, everything, nothing, logical connectives like and, or, if...then or not, and monadic predicates, which are attributions of a property to an individual object, like "the sky is blue" or "tomorrow is Tuesday". (In the first statement, the sky is the object and blueness is its property. In the second statement, tomorrow is the object and being a Tuesday is its property. That's pretty restrictive, but it's enough to capture the logic behind such truths as the argument:
So why have I been explaining all this? Because I wrote a computer program that does just that. It's not the first to do so, and it only works for propositions that contain five or fewer predicates, but I spend a fair amount working on it, so I'm going to share it, anyway.
The Application
The application runs from the command line. It takes one or more text files as command-line arguments. When you execute it, it will read each file and try to interpret it as a statement of monadic predicate logic. If it can, it will decide whether the contents are necessarily true (valid), possibly true (valid only if additional premises were added), or self-contradictory (necessarily false).
So, if I had an input file that contains the following text:
The Language
mpl.exe recognizes a particular language of symbolic logic. The language uses only ASCII characters available on American English keyboard. Its elements resemble either elements of ordinary symbolic logic or C-style bitwise operators. My intent is for the language to be unoriginal enough for someone who knows symbolic logic to be able to use it without much trouble. I'm too lazy to give a precise definition of the language, so I'll give a brief synopsis. If anyone has questions, I'll be happy to answer them.
The elements of the language are as follows:
The Algorithm
I won't say much about the algorithm right now, but I will say it is based on "possible worlds" semantics for logic. I will also say that it runs in O(2^n^n) time, where n is the number of predicates mentioned in a statement; it does not scale well. On my computer, mpl.exe finishes instantaneously for statements with three or fewer predicates and finishes in about a second for a statement with four predicates. I haven't tried it, but I estimate it would take about a day to finish evaluating a statement with five predicates. I didn't bother to implement mpl.exe in such a way that it would support more than five predicates, considering how long it would take to do that.
The Download
Click here to download the application.
The Future
I plan on extending mpl.exe to handle identity and modal operators for possibility and necessity. Maybe soon.
Socrates is a man.Which can be restated in a way that makes its logic more obvious:
Man is mortal.
Therefore, Socrates is mortal.
If Socrates is a man and if something is a man then it is mortal, then Socrates is mortal.The validity of any proposition that can be constructed from only the above-mentioned concepts is decidable. By "validity" I mean the proposition is true independent of anything else. "If something is both large and round, then it is large" is true whether or not anything large and/or round actually exists. The above-mentioned proof of Socrates' mortality is valid, too. By "proposition" I mean the meaning of a declarative, true-or-false statement. By "decidable" I mean someone could write a computer program that would the determine any one of these proposition's validity, and it would work for any proposition.
So why have I been explaining all this? Because I wrote a computer program that does just that. It's not the first to do so, and it only works for propositions that contain five or fewer predicates, but I spend a fair amount working on it, so I'm going to share it, anyway.
The Application
The application runs from the command line. It takes one or more text files as command-line arguments. When you execute it, it will read each file and try to interpret it as a statement of monadic predicate logic. If it can, it will decide whether the contents are necessarily true (valid), possibly true (valid only if additional premises were added), or self-contradictory (necessarily false).
So, if I had an input file that contains the following text:
// All men are mortal.I would test it through the command prompt like this:
x,Hx->Mx
// Socrates is a man.
Hs
// Therefore,
->
// Socrates is mortal.
Ms
The Language
mpl.exe recognizes a particular language of symbolic logic. The language uses only ASCII characters available on American English keyboard. Its elements resemble either elements of ordinary symbolic logic or C-style bitwise operators. My intent is for the language to be unoriginal enough for someone who knows symbolic logic to be able to use it without much trouble. I'm too lazy to give a precise definition of the language, so I'll give a brief synopsis. If anyone has questions, I'll be happy to answer them.
The elements of the language are as follows:
- Ax - a predicate, A, predicated on one variable x. Predicates can be any character from A to Z. Variables can be any character from a to z. These are what represents attributions of a property to an object. mpl.exe will handle statements with an unlimited number of these, so long as they use no more than five different predicates.
- (,) - grouping by parentheses, just like in algebra.
- .,:,:., etc. - old school grouping, like in Mathematical Logic.
- x,... - universal quantification, i.e. "for all x, ... is true". The generalization extends to the end of the group it is in, e.g. "x,Ax&y,By->Cx" means the same as "(x,Ax&(y,By->Cx))", but not the same as "(x,Ax)&(y,By->Cx)".
- 3x,... - existential quantification, i.e. "there is an x such that ... is true". It also extends to the end of the group it is in.
- ~... - negation.
- ...&.. - logical AND.
- ...|... - logical OR.
- ...->... - material conditional, i.e. IF...THEN...
- ...<=>... - logical equivalence. &,|,-> and <=> all have the same precedence and are left-associative.
- // ... - comments; anything after them is ignored by mpl.exe.
((x,Hx->Mx)&Hs)->MsThis is the basic categorical syllogism. You can add comments by adding "//" and text behind it:
((x,Hx->Mx)&Hs)->Ms //the basic categorical syllogismmpl.exe will ignore anything behind "//" . If a line only contains a comment, mpl.exe will ignore it completely:
// the basic categorical syllogismA statement can be spread across multiple lines. mpl.exe treats separate lines as if they were separate operand in a logical conjunction, so
((x,Hx->Mx)&Hs)->Ms
means the same asAx|BxBx->CxCx
(Ax|Bx)&(Bx->Cx)&(Cx)If a binary operator is on a line by itself, every line before it is conjoined and treated as its left operand; everything after it is conjoined and treated as its right operand. So
x,H->Mxmeans the same as
Hs
->
Ms
This allows us to symbolize logical arguments and test their validity. Think of the first two lines in the text above as the premises of an argument and the last line as the conclusion. As with computer programs, comments can be helpful:((x,Hx->Mx)&Hs)->Ms
// All men are mortal.
x,Hx->Mx
// Socrates is a man.
Hs
// Therefore,
->
// Socrates is mortal.
Ms
The Algorithm
I won't say much about the algorithm right now, but I will say it is based on "possible worlds" semantics for logic. I will also say that it runs in O(2^n^n) time, where n is the number of predicates mentioned in a statement; it does not scale well. On my computer, mpl.exe finishes instantaneously for statements with three or fewer predicates and finishes in about a second for a statement with four predicates. I haven't tried it, but I estimate it would take about a day to finish evaluating a statement with five predicates. I didn't bother to implement mpl.exe in such a way that it would support more than five predicates, considering how long it would take to do that.
The Download
Click here to download the application.
The Future
I plan on extending mpl.exe to handle identity and modal operators for possibility and necessity. Maybe soon.
Sunday, May 02, 2010
Litany Writer
Here's an MS Excel spreadsheet that take scripture references, looks them up on Biblegateway.com and writes them to an MS Word document. I made it to help my dad write litanies, but it's also good for looking up several passages of scripture at once. To use it, you'll need MS Office and you'll need to enable macros in Excel.
Tuesday, March 16, 2010
Ancestors
For all my Cumingses: I've found images of the baptismal records of Isaac and John Cummin/Commen on-line. According to Isaac Cummings Family Association and my dad's research, they are the first two generations in our line to live in America. They emigrated from Essex in Southeast England in 1635.
The baptismal records are in registers photographed by Seax - Essex Archives Online. The register with Isaac's name is here and the register with John's name is here.
The following are images of the records themselves and my (hopefully mostly accurate) transcriptions of what they say:
Anno 1601
Aprill 5 Izecht Cummin the sonne of Jhon Cummin baptised
5. John Commen sonne of Izaack & Anne his wiffe was baptised on the 9th daye of May
The baptismal records are in registers photographed by Seax - Essex Archives Online. The register with Isaac's name is here and the register with John's name is here.
The following are images of the records themselves and my (hopefully mostly accurate) transcriptions of what they say:
Aprill 5 Izecht Cummin the sonne of Jhon Cummin baptised
Thursday, October 29, 2009
Calvinism, According to Custardy
I like this guy's explanation of TULIP: http://custardy.blogspot.com/2009/10/calvinism.html. Of the few who read my blog, I think the majority are Reformed. What do you all think of it?
Labels:
short
Saturday, August 08, 2009
Essays!
Here's some recommended reading; several essays, articles & such that I've read at one time or another and found to be especially illuminating or memorable:
The Problem With Music, by Steve Albini
An enlightening look at the relationship between new bands and record labels. I used to want to be a rock musician. This essay confirmed to me that I should be an indie rock musician, if anything. I eventually gave that up because there was no money in it and I didn't have the ability or motivation to write songs, but that's another thing.
I, Pencil, by Leonard E. Read
A testament to the creative power of free market economies.
Fern-Seed and Elephants, by C.S. Lewis
C.S. Lewis, as a literary critic, rips on the methods of some Biblical critics.
The Special Theory of Relativity, by Richard Feynman
This is best explanation of Special Relativity I've ever encountered. I think that is because 1. He starts with Newton's physics, which I understand, and compares it to Special Relativity, and 2.
He uses math. Math is hard and boring and scary, so some explanations try to avoid it, relying on imagination alone, and fail miserably. Maybe because modern physical theories are mathematical statements. Don't fight it! Give in to the algebra. Listen to the calculus.
Parkinson's Law, by C. Northcote Parkinson
On second reading, I think the title is immodest and the article is a bit tongue-in-cheek, but it's nonetheless convincing. I bet Parkinson's Law applies to corporate managers, but it's counteracted by the fact that laying off excess managerial staff is a good way to cut costs.
The Myth of Sisyphus, by Albert Camus
I generally like the famous existentialist writers, even though I disagree with them on some very basic things. Maybe it's because we ask the same questions, though we accept different answers. This essay has popped into my mind many times since I first read it years ago.
G.K. Chesterton
Chesterton gets his own section. He's sophistical at times, but his insight and his humor are priceless. These are a few of my favorites.
The Problem With Music, by Steve Albini
An enlightening look at the relationship between new bands and record labels. I used to want to be a rock musician. This essay confirmed to me that I should be an indie rock musician, if anything. I eventually gave that up because there was no money in it and I didn't have the ability or motivation to write songs, but that's another thing.
I, Pencil, by Leonard E. Read
A testament to the creative power of free market economies.
Fern-Seed and Elephants, by C.S. Lewis
C.S. Lewis, as a literary critic, rips on the methods of some Biblical critics.
The Special Theory of Relativity, by Richard Feynman
This is best explanation of Special Relativity I've ever encountered. I think that is because 1. He starts with Newton's physics, which I understand, and compares it to Special Relativity, and 2.
He uses math. Math is hard and boring and scary, so some explanations try to avoid it, relying on imagination alone, and fail miserably. Maybe because modern physical theories are mathematical statements. Don't fight it! Give in to the algebra. Listen to the calculus.
Parkinson's Law, by C. Northcote Parkinson
On second reading, I think the title is immodest and the article is a bit tongue-in-cheek, but it's nonetheless convincing. I bet Parkinson's Law applies to corporate managers, but it's counteracted by the fact that laying off excess managerial staff is a good way to cut costs.
The Myth of Sisyphus, by Albert Camus
I generally like the famous existentialist writers, even though I disagree with them on some very basic things. Maybe it's because we ask the same questions, though we accept different answers. This essay has popped into my mind many times since I first read it years ago.
G.K. Chesterton
Chesterton gets his own section. He's sophistical at times, but his insight and his humor are priceless. These are a few of my favorites.
Labels:
G.K. Chesterton,
philosophy,
recommended reading
Thursday, July 02, 2009
Alternative Hexadecimal Digits
I'm not complaining about the convention of using characters 0-9 and A-F as hexadecimal digits. It's a good system; it's easy to learn, since most of us in the Western World have known the meaning of 0-9 and the order of the alphabet since childhood. But what if we could start over with only practical concerns (apart from the value of keeping a well-recognized and heavily-used convention) to guide us?
I can think of a few desirable traits for a set of hexadecimal digits:
In handwritten form:
For LCD/LED displays:

Description of This Alternative
First off, the digits for zero and one are the same as in conventional binary, octal, and decimal.
Next, a definition: the binary composition of a number is the set of integral powers of 2 that add up to that number. For example, the binary composition of 76 is the set {64, 8, 4} or {26, 23, 22}, since its members are integral powers of 2 and they add to 76.
With this definition in mind, the following are true of the alternative digit for a given number 1-15:
Some Benefits of This Alternative
Because of these rules, if a hexadecimal digit is depicting a nibble of memory (e.g. in a hex dump program), one only has to look at a certain part of the digit to see if a particular bit is set to 1 or 0. Also, those of you who know about electronic logic gates can tell that the circuitry needed to take a four-bit input representing a number and light up the proper parts of an LED/LCD digit display would be a bit simpler these digits than with the conventional digits.
Update: I've been collaborating with Valdis Vītoliņš on a new set of alternative hexadecimal digits. They are an improvement on the digits described in this post. See this blog post.
I can think of a few desirable traits for a set of hexadecimal digits:
- They should be easy to learn.
- It should be easy to write them by hand quickly without them being ambiguous or difficult to read.
- They should be representable using the common LCD/LED displays used in clocks, calculators, etc.
- They should depict their binary counterparts somehow. In software, we must sometimes translate between hexadecimal and binary, e.g. to determine whether a given bit in a given word is 1 or 0. If the oneness or zero-ness of each bit in a nibble was visibly represented in its corresponding digit, this translation would be easier.
In handwritten form:
Description of This Alternative
First off, the digits for zero and one are the same as in conventional binary, octal, and decimal.
Next, a definition: the binary composition of a number is the set of integral powers of 2 that add up to that number. For example, the binary composition of 76 is the set {64, 8, 4} or {26, 23, 22}, since its members are integral powers of 2 and they add to 76.
With this definition in mind, the following are true of the alternative digit for a given number 1-15:
- If one is part of a number's binary decomposition, its digit faces right otherwise it faces left. Equivalently, the digits for even numbers face the same direction as 'e' and 'n', and the digits for odd numbers face the same direction as 'd'.
- The digit has a stroke across its base if and only if two is part of the number's binary composition.
- The digit has a stroke across its middle if and only if four is part of the number's binary composition.
- The digit has a stroke across its top if and only if eight is part of the number's binary composition.
Some Benefits of This Alternative
Because of these rules, if a hexadecimal digit is depicting a nibble of memory (e.g. in a hex dump program), one only has to look at a certain part of the digit to see if a particular bit is set to 1 or 0. Also, those of you who know about electronic logic gates can tell that the circuitry needed to take a four-bit input representing a number and light up the proper parts of an LED/LCD digit display would be a bit simpler these digits than with the conventional digits.
Update: I've been collaborating with Valdis Vītoliņš on a new set of alternative hexadecimal digits. They are an improvement on the digits described in this post. See this blog post.
Labels:
hexadecimal numbers
Subscribe to:
Posts (Atom)