Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Help to create a SatSolver

Featured Replies

  • Author
  • Localization

Alpha1001, posted Wed Jun 19, 2019 1:44 pm (48908)


Hi, I've made this prototype using the Python to create a SatSolver, but I cannot to implement the functions. Someone can give a tip to begin the project?
Sorry for my bad english

Here the prototype:
def readInputs ():

inputs = []

return inputs


def readClauses (inputs):

clauses = []

return clauses


def readVariables(clauses):

variables = []

return variables


def readFormula ():

inputs = readInputs()

clauses = readClauses(inputs)

variables = readVariables(clauses)

result = { 'clauses':clauses,
'variables' :variables}

return result


def nextAssignment (currentAssignment)
:

nextAssignment = []

return nextAssignment


def doSolve(clauses, assignment):

isSat = False

while (( not isSat) and '''must check
whether this is the last assignment or
not''' ):

'''does this assignment satisfy the
formula? If so, make isSat true.


if not, get the next assignment and try
again.'''

assignment = nextAssignment
(assignment)

result = { 'isSat' : isSat,
'satisfyingAssignment' : None }

if (isSat):

result[ 'satisfyingAssignment'] =
assignment


return result


def solve ():

formula = readFormula()

result = doSolve(formula[ 'clauses'],
formula[ 'variables' ])

return result
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.