Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Tue Dec 01, 2020 3:07 am

All times are UTC

Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Jun 19, 2019 1:44 pm 

Joined: Tue Nov 06, 2018 10:11 am
Posts: 23
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

assignment = nextAssignment

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

if (isSat):

result[ 'satisfyingAssignment'] =

return result

def solve ():

formula = readFormula()

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

return result

Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited