
A Logic Calculator - sundarurfriend
http://somerby.net/mack/logic/
======
mackwai
Hey all, I'm they guy that developed this app. There are a few things I'd like
to say, if I may:

1) I really do want to improve this app and help anyone who is using it, so
please do send me comments, criticisms and questions. There's a "contact" link
on the app for that purpose.

2) Yes, the app's language is a language that I made up which isn't used
anywhere else. I know it's not a good thing I'm making people learn a new
language, but I really, really want the app to have a language that is easy to
type. If you're trying to learn it, just keep in mind that has most of the
elements that are in conventional symbolic logic, it just uses different
symbols for them, e.g. AND is "&", "for all x, " is "x,", "there exist an x
such that" is "3x,".

3) sundarurfriend: Thanks for posting this link. It's a pleasant surprise to
see this app getting some attention.

------
sundarurfriend
'Decides statements in propositional logic, modal logic, unary (monadic)
predicate logic and term logic' \- description on the project's github
repo[1].

There is a blog post[2] from the creator introducing the tool in 2014, with an
example use case. Not exactly written for amateur laymen though, it dives deep
quickly.

[1]
[https://github.com/mackwai/UnaryPredicateLogic](https://github.com/mackwai/UnaryPredicateLogic)
[2] [http://mackwai.blogspot.in/2014/03/investigating-logical-
arg...](http://mackwai.blogspot.in/2014/03/investigating-logical-arguments-
with.html)

------
Aardwolf
In the "A Categorycal Syllogism" example, the socrates example, it returns
"true".

If I change the last line from "Ms" to "~Ms", why does it return "contingent"?

From what I understood, I expected this to return "false" (or maybe "self-
contradictory", does "false" exist in this application?).

Because if every man is mortal, and socrates is a man, then saying "socrates
is not mortal" is false, right? Not unknown or anything.

~~~
kmill
It is indeed contingent. The intuitive problem is that "a -> ~b" is not
logically equivalent to "~(a -> b)".

The "Counterexample" button shows a world in which the modified statement is
false: there is a single man (Socrates) and he is mortal.

Unfortunately, the program doesn't have an "Example" button to show why it is
contingent! The empty world is an example, though. This is because the
hypothesis (which includes that there is a Socrates) is false, so the
statement is vacuously true.

~~~
Aardwolf
After more trying, I don't actually understand its syntax despite looking at
the quick reference and instructions and the language

    
    
      x,Hx->Mx  
      Hs  
      ->  
      Ms
    

returns: necessarily true

    
    
      x,Hx->Mx
      Hs->Ms
    

returns: contingent

The only change is newlines. The quick reference says nothing about newlines.
What's going on?

To do ~(Hs->Ms) instead of Hs->~Ms I have no choice but to put it on one line,
if I try to use parenthesis on a multiline statement it gives errors. So how
can I compare the multiline Hs->~Ms with a ~(Hs->Ms) that has the same newline
behavior?

It could really use more examples, starting as simple as possible, e.g.
something with fruits and colors with all simple combinations of true and
contingent and self-contradictory things...

Is this syntax based on the syntax used in some scientific field? I also know
some things about logic, but in the field of electronics with logic gates, CPU
instructions, bit twiddling and programming languages :)

EDIT: update for hacker news itself destroying newlines

~~~
kmill
> So how can I compare the multiline Hs->~Ms with a ~(Hs->Ms) that has the
> same newline behavior?

I was wondering about that, too, but I could only figure out putting it all on
one line.

> Is this syntax based on the syntax used in some scientific field?

I think the quantifier notation is vaguely Peano's original notation, and I
think the idea of having HYPOTHESES -> CONCLUSIONS is sort of a Coq-like
"above-the-line and below-the-line" thing, or maybe it's that way because it's
optimized for syllogisms. Other than that, I've never seen a logic language
quite like this one before.

Something I'd like to see someday is a Scratch-like snap-together logic and
proof language. I toyed with the idea when I was teaching a discrete math
course, but I didn't have time to develop one.

~~~
cachvico
It's the propositional calculus -
[https://en.wikipedia.org/wiki/Propositional_calculus](https://en.wikipedia.org/wiki/Propositional_calculus)

~~~
kmill
It has quantifiers so it would be predicate calculus (first-order logic) -
[https://en.wikipedia.org/wiki/First-
order_logic](https://en.wikipedia.org/wiki/First-order_logic)

I thought the question was more about the syntax of the logic language (which
I think is rather idiosyncratic), but I can see that maybe they were asking
about the relevant part of math.

(It might be worth noting that the webapp is not exactly first-order logic
because it has some extra operators from modal logic.)

