Your code kind of defeats the whole purpose of using SymPy. You are
creating one single Symbol that represents your entire expression.
Symbol is supposed to represent variables, and expressions should be
made with the various expression classes, like sympy.And, sympy.Or,
sympy.Implies, and sympy.Equivalent, or the equivalent logical
operators like & and |. If you have a single symbol named "x⟷y" then
you can't do anything with it, but if you have Equivalent(Symbol('x'),
Symbol('y')) then you can perform logical operations on it. See
https://docs.sympy.org/latest/modules/logic.htmlAs a general rule of thumb, if you find yourself doing mathematical operations using string manipulation, that means you are using SymPy wrong. SymPy is designed to do mathematical operations directly, and doesn't work by operating on strings. Aaron Meurer On Sun, Jul 23, 2023 at 2:41 AM Nick <[email protected]> wrote: > > I am trying to expand my program that accelerates my ability to solve math > and logical problems by hand by generating not too complicated problems to > practice on. The use case of my program is demonstrated on my twitter and the > working code is my github. > > I think my issue lies at line like 40 and 43. > > Broken Code Pastebin > > As you can see, I can generate and display logical equations in LaTeX using > binary literals. The trouble is expanding these simple generations into more > complex expressions. I am trying to rewrite a new Symbol using previously > generated Symbols by string slicing. > > -Nick > > > Reference: > > Chang and Lee . Computer Science and Applied Mathematics. "Symbolic Logic and > > Mechanical Theorem Proving." Academic Press, Inc. 1973. Page 13-15. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/ca70ada2-e57e-4ed9-bf89-ddba72cf38b7n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6Lzrf7q%3DOr%2BkU5_mCtoWTgBSQ2asuWHJZ86xVtJz24u%2Bw%40mail.gmail.com.
