Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7217907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T21:24:47+00:00 2026-05-28T21:24:47+00:00

I am hacking away at the problem of finding a Hamiltonian cycle in an

  • 0

I am hacking away at the problem of finding a Hamiltonian cycle in an undirected graph. But a recent experiment produced what should have been an impossible model. Here is the input:

;number of vertices = 4
;5 edges:
;e1 = 0 1
;e2 = 1 2
;e3 = 2 3
;e4 = 3 0
;e5 = 1 3

(declare-const v0 Bool)
(declare-const v1 Bool)
(declare-const v2 Bool)
(declare-const v3 Bool)

(declare-const e1 Bool)
(declare-const e2 Bool)
(declare-const e3 Bool)
(declare-const e4 Bool)
(declare-const e5 Bool)

(assert (xor (and e2 e3 e4 e5) (and e1 e3 e4 e5) (and e1 e2 e4 e5) (and e1 e2 e3 e5) (and e1 e2 e3 e4)))

(assert (and v0 v1 v2 v3))

;(assert (=> (and e2 e3 e4 e5) (and v0 v1 v2 v3)))
;(assert (=> (and e1 e3 e4 e5) (and v0 v1 v2 v3)))
;(assert (=> (and e1 e2 e4 e5) (and v0 v1 v2 v3)))
;(assert (=> (and e1 e2 e3 e5) (and v0 v1 v2 v3)))
;(assert (=> (and e1 e2 e3 e4) (and v0 v1 v2 v3)))

(assert (=> e1 (or e2 e4 e5)))
(assert (=> e2 (or e1 e3 e5)))
(assert (=> e3 (or e2 e4 e5)))
(assert (=> e4 (or e1 e3 e5)))
(assert (=> e5 (or e1 e2 e4)))

(assert (and (=> e1 e2) (=> e2 e3) (=> e3 e4) (=> e4 e1)))

(check-sat)
(get-model)

Here is the output showing all of e1, e2, e3, e4, and e5 to be true despite the xor statement in the input that specifically prohibits this:

sat
(model 
  (define-fun e2 () Bool
    true)
  (define-fun e5 () Bool
    true)
  (define-fun e3 () Bool
    true)
  (define-fun e4 () Bool
    true)
  (define-fun e1 () Bool
    true)
  (define-fun v3 () Bool
    true)
  (define-fun v2 () Bool
    true)
  (define-fun v1 () Bool
    true)
  (define-fun v0 () Bool
    true)
)

Does anyone have any opinions on what’s going wrong here?

Regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T21:24:48+00:00Added an answer on May 28, 2026 at 9:24 pm

    I don’t know what you’re trying to do, but it seems that you misused xor.

    Since (simplify (xor true true true true true)) returns true, your encoding doesn’t prohibit the current model.

    In general, to guarantee a1, a2 and a3 has exactly one true, you could do as follows:

    (assert (or a1 a2 a3)) ; at least one true
    (assert (and (=> a1 (and (not a2) (not a3))) 
                 (=> a2 (and (not a1) (not a3))) 
                 (=> a3 (and (not a1) (not a2))))); at most one true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, this is problem a stupid mistake, but I've been hacking away at it
I am hacking away at a uni assignment and have come across a problem
I'm not a DB guy, but I've been hacking away at this one for
I'm hacking away at some code which seems to have been started, at least
I have been hacking away at this all day with only a successful 'UPDATE'
I've been hacking away on a little game, just for fun, and I've run
I've been hacking around with Ruby a little and I have been wondering if
(Big edit, I got part of the way there…) I've been hacking away and
How should I create a Django app for 3rd party use? I've been hacking
I've been hacking away on an ARM based device (Freescale i.MX27 ADS) with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.