Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while q <= len(atom):
- c = atom[q] #list of atoms
- for s in range(0,len(x)-1):
- atm = x[s] #Check if all atoms are found
- if c == atm:
- cnt += 1
- if cnt == len(x)-1:
- print('All atoms are true')
- break
- for k in range(0,len(A)): #check each elememt of the list with the atom
- ts = A[k] #string
- for b in range(0,len(ts)): #check each particular char in each string
- if c == ts[b]:
- if ts[b] == x: #If a solution is found done
- print('Found',ts[b])
- break
- else: #get rid of the atoms in the clause that are true
- line = A[k]
- line = line.replace(c, '')
- A[k] = line
- print('ye')
- print(A[k])
- if len(A[k]) == 1:
- atom.append(ts[1])
- q += 1
- atom[q] =A[k]
- print(atom)
- print('yes')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement