Questions tagged [logic]

Questions related to mathematical logic and its use in computer science

This tag is used for Logic in Computer Science and Mathematical Logic questions.

Do not use this tag for digital circuit design questions, use and tags.

1000 questions
16
votes
1 answer

"Famous logicians have made embarrassing errors here," a line from SICP. What is this referring to?

Here is the context (Structure and Interpretation of Computer Programs, section 1.1.8, under heading "Local names"): A formal parameter of a procedure has a very special role in the procedure definition, in that it doesn't matter what name the…
ubadub
  • 315
  • 2
  • 15
13
votes
2 answers

What is a "contradiction" in constructive logic?

In Practical Foundations for Programming Languages, Robert Harper says If for a proposition to be true means to have a proof of it, what does it mean for a proposition to be false? It means that we have a refutation of it, showing that it cannot be…
afsmi
  • 307
  • 1
  • 6
13
votes
5 answers

Reason to learn propositional & predicate logic

I can understand the importance that computer scientists or any software development related engineers should have understood the study of basic logics as a basis. But is there any tasks/jobs that explicitly require the knowledge about these, other…
IsaacS
  • 345
  • 1
  • 3
  • 10
11
votes
1 answer

Example of Soundness & Completeness of Inference

Is the following example correct about whether an inference algorithm is sound and complete? Suppose we have needles a, b, c in a haystack, and have also an inference algorithm that is designed to find needles. sound - Only needles a, b and c are…
IsaacS
  • 345
  • 1
  • 3
  • 10
6
votes
1 answer

Why contraction and weakening rules are the upside down?

On the A taste of linear logic paper, the author claims that: A rule consists of zero or more judgements written above a line, and one judgement written below. If all the judgements above the line are derivable, then the judgement below is…
MaiaVictor
  • 4,127
  • 1
  • 17
  • 33
3
votes
1 answer

Why use logic gates in this situation? (XOR gates)

I came across this circuit that swaps logical signals: However I don't understand why would you need to use logic gates. Would it be possible to just connect the A on the left to the B on the right and the same with the B on the left (maybe add a…
Juan
  • 33
  • 4
3
votes
1 answer

Validity of this formula in WS1S logic

The following formulas are said to be defined in WS1S logic. $Closed(Z, R) := ∀x ∀y(x ∈ Z ∧ R(x, y) → y ∈ Z)$ $(z_1, z_2) ∈ R^∗ := ∀Z.(z_1 ∈ Z ∧ Closed(Z, R) → z_2 ∈ Z)$ However since WS1S formula requires bounded second order variables to be…
e_noether
  • 1,289
  • 2
  • 12
  • 19
3
votes
1 answer

Can OR be "undone"?

Suppose that $Z = X \vee Y$, where $X$, $Y$ and $Z$ are 96-bit binary numbers. If I'm given the values of $Z$ and $Y$, is it possible to work out what $X$ is? I know this is possible with XOR but can it be done with OR?
SHdotCom
  • 75
  • 1
  • 6
3
votes
1 answer

What's the purpose of ANDing a bit mask with all bits set to a value?

I'm adapting an algorithm for calculating a CRC 16-bit CCITT (XModem) value from an ASCII input. I've found some code here. I'm using the function the poster has in his question, but I've noticed at the bottom he does this: calcrc = crc And…
rory.ap
  • 133
  • 4
3
votes
2 answers

How expensive is it to verify that a gate is universal?

I know that a NAND gate is considered universal because we can use it to implement an AND, OR, and NOT gate. Given an arbitrary gate, or set of gates, how many operations would it take to verify if these gates are universal (by brute force), and…
Jlee523
  • 133
  • 5
3
votes
2 answers

Definability of Truth Assignments

I have a question about definability of truth assignments. Suppose that I am working in the context of propositional logic. Let me give some definitions first. Let $L$ be a propositional language with the set $Prop_{L}$ of propositional variables. A…
Pachara
  • 41
  • 3
3
votes
1 answer

Two questions on MSO

First question : Is the following formula a valid MSO formula? $\theta(S, r) = \exists (e_1, t_1), ... ,(e_h, t_h) \bigwedge\limits_{(e_i, e_j) \in \rho(S,r)} \mathcal{R}((e_i, t_i), (e_j, t_j))$ So my main concern here is the fact one states…
J. Schmidt
  • 807
  • 4
  • 17
3
votes
2 answers

How could a formal system ever be non-obviously unsound?

When reading discussions of Gödel's theorems one is always heeded that just because formal system $F$ proves a theorem $T$ that doesn't necessarily mean that when one applies the intended interpretation the theorem is actually true. After all, even…
Sebastian Oberhoff
  • 1,058
  • 5
  • 11
2
votes
2 answers

Subtlety of a bar in introduction rule

I am going through the following lecture notes by Frank Pfenning : http://www.cs.cmu.edu/~fp/courses/15317-f17/lectures/02-natded.pdf In page no 5 I cam across the introduction rule . The rule reads that $A$ is contained in $B$ if $B$ is true …
Sheldon Kripke
  • 567
  • 4
  • 5
2
votes
1 answer

Draw a function by only using two input NOR gates

T = (BD + A'BC'+A'CD) How can i draw this by only using NOR-Gates? This is what i have done so far: https://i.stack.imgur.com/nIujl.jpg Have I understood this right?
1
2 3 4 5