Questions tagged [logic]

Questions on use and formulation of logical operations, including both functions for programming and for mathematical operations.

156 questions
Filter by
Sorted by
Tagged with
205 views

How to solve this geometric problem with Mathematica?

I try to solve the following problem, making use of 14.0 on Windows 10 Let a triangle $\Delta$ (a contour with its interior) be chosen in the unit square $S$. To prove that the closure of the ...
• 26.7k
127 views

Simplifying a logical expression with multivariate polynomials

I have several expressions similar to a (a b + c d) != 0 || b (a b + c d) != 0 || c (a b + c d) != 0 || d (a b + c d) != 0 and I would like to reduce them ...
• 2,066
125 views

Can we find validity proofs by means of rules of inference with FindEquationalProof?

Can we find proofs such as: Using FindEquationalProof? My guess is "yes" but I don't know what would be the "axioms" here nor how would we write this in Mathematica.
• 5,401
99 views

Why does FindInstance require specifying variables, and how to transform a list of logical expressions into the list of its variables [duplicate]

It would be convenient to have a function VarsfromLogical which out of {a+b>c,c+d==a} outputs {a,b,c,d} Incidentally, I use ...
• 1,798
1 vote
45 views

Performing logical reasoning to find minimum function between two functions

Consider the following two expressions: f[x_,y_] := (1+x) g[x_,y_] := (1+x*y^2) x,y are bounded in a unit hypercube. (Ignore ...
• 1,888
1k views

Can Mathematica perform logical reasoning?

The question goes like this: Ms. Li has just moved into a new home and plans to buy several potted plants at once. Her thoughts are as follows: Buy either Green Radish or Podocarpus. Buy at least ...
• 4,315
60 views

FromLetterNumber and "" bug or intended behaviour

DigitQ behaviour appears consistent "" is treated as 0 by DigitQ` ...
74 views

• 1,005
178 views

Axiomatizing naturals

Trying to implement the naturals in Mathematica, I follow E. Mendelson, Introduction to Mathematical Logic, Ch. 3, Par. 1. Here is my code for the axioms (exept the induction axiom) ...
• 26.7k
212 views

How to check if solution to NSolve exists?

I'm trying to created a table where the entries are values of x, either given by x/.NSolve[...][[1]] or a fixed value x0 if there is no numerical solution. Is there a way to find the truth value for ...
68 views

perform logical or on sublist of a list efficiently

Given a huge list x of 0s and 1s and an increasing list i...
• 1,155
171 views

First Order/Higher Order Logical Forward reasoning in Mathematica (Mathematica for FOL/HOL knowledge base)?

I am trying to develop Artificial Intelligence system that can automatically discover and apply reasoning patterns, templates, strategies (there is even theory for that - Cognitive Task Analysis). ...
• 101
245 views

Natural deduction with FindEquationalProof

Out of curiosity, I'm trying to implement a natural deduction prover in Mathematica using FindEquationalProof. So far, I've implemented a few of the easier rules: <...
• 998
1 vote
96 views

Solving a ForAll optimization problem in Mathematica

I am trying to solve the following optimization problem in Mathematica: Minimize[{y0 + y2 m2, ForAll[x, y0+y2 x^2 >= Boole[x>0]]}, {y0,y2}] Unfortunately, ...
• 513
459 views

count conditional items in list

I have a list of the form: {1,1, (1 if x>y, -1 if y>=x), -1} I want to count the number of 1's in the list. The output I'm looking for is something of the ...
• 343
1 vote
Suppose that I have a list of depth $k$, and I want to apply a function $f$ to all elements at level $n$ - e.g. \$f,\{\{\{a,b\},\{b,c\}\},\{\{c,d\}\}\},3\mapsto\{\{\{f(a),f(b)\},\{f(b),f(c)\}\},\{\{f(c)...