First time here? Check out the FAQ!

Ask Your Question
1

Reusing output of QEPCAD

asked 3 years ago

philipp7 gravatar image

Suppose we get a quantifier-free formula as an output from QEPCAD and we want to use that formula as an input for another call to QEPCAD. How can this be done? The naive approach does not work as the following example shows (a very trivial example as the first qepcad call does not actually do much):

sage: var("a,b")
sage: formula = qepcad(a+b==0)
sage: print(formula)
b + a = 0
sage: qepcad_formula.exists(b,formula)

yields the error

ValueError: Attempting to quantify variable which does not occur in formula

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 3 years ago

philipp7 gravatar image

Sorry, already got it. For anyone else needing this at some point, there is the function qformula which can be used. The example above then yields

sage: from sage.interfaces.qepcad import qformula
sage: var("a,b")
sage: formula = qepcad(a+b==0)
sage: qepcad_formula.exists(b,qformula(formula,frozenset(['a','b'])))
(E b)[b + a = 0]
Preview: (hide)
link

Comments

Well done. You can accept your own answer to mark the question as solved.

slelievre gravatar imageslelievre ( 3 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 3 years ago

Seen: 239 times

Last updated: Jul 01 '21