logo

Expression of type Conditional

from the theory of proveit.logic.booleans.disjunction

In [1]:
import proveit
# Automation is not needed when building an expression:
proveit.defaults.automation = False # This will speed things up.
proveit.defaults.inline_pngs = False # Makes files smaller.
%load_expr # Load the stored expression as 'stored_expr'
# import Expression classes needed to build the expression
from proveit import A, B, C, Conditional, D
from proveit.logic import And, Boolean, Implies, InSet, Not, Or
In [2]:
# build up the expression from sub-expressions
expr = Conditional(Or(Not(A), Not(B)), And(InSet(A, Boolean), InSet(B, Boolean), InSet(C, Boolean), InSet(D, Boolean), Or(Not(C), Not(D)), Implies(A, C), Implies(B, D)))
expr:
In [3]:
# check that the built expression is the same as the stored expression
assert expr == stored_expr
assert expr._style_id == stored_expr._style_id
print("Passed sanity check: expr matches stored_expr")
Passed sanity check: expr matches stored_expr
In [4]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\left\{(\lnot A) \lor (\lnot B) \textrm{ if } A \in \mathbb{B} ,  B \in \mathbb{B} ,  C \in \mathbb{B} ,  D \in \mathbb{B} ,  (\lnot C) \lor (\lnot D) ,  A \Rightarrow C ,  B \Rightarrow D\right..
In [5]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
condition_delimiter'comma' or 'and'commacomma('with_comma_delimiter', 'with_conjunction_delimiter')
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Conditionalvalue: 1
condition: 2
1Operationoperator: 22
operands: 3
2Operationoperator: 4
operands: 5
3ExprTuple6, 7
4Literal
5ExprTuple8, 9, 10, 11, 12, 13, 14
6Operationoperator: 33
operand: 30
7Operationoperator: 33
operand: 31
8Operationoperator: 20
operands: 17
9Operationoperator: 20
operands: 18
10Operationoperator: 20
operands: 19
11Operationoperator: 20
operands: 21
12Operationoperator: 22
operands: 23
13Operationoperator: 25
operands: 24
14Operationoperator: 25
operands: 26
15ExprTuple30
16ExprTuple31
17ExprTuple30, 27
18ExprTuple31, 27
19ExprTuple35, 27
20Literal
21ExprTuple36, 27
22Literal
23ExprTuple28, 29
24ExprTuple30, 35
25Literal
26ExprTuple31, 36
27Literal
28Operationoperator: 33
operand: 35
29Operationoperator: 33
operand: 36
30Variable
31Variable
32ExprTuple35
33Literal
34ExprTuple36
35Variable
36Variable