anchor.diff:  
       (return-from fapix-forward-checking (values inferencias testes-totais))))
   
  +(defun fapix-mac (f ipix)
  +  ""
  +  (let ((testes-totais 0)
  +	(inferencias (make-hash-table :test 'eql))
  +	(lista-arcos (fapix-arcos-vizinhos-nao-atribuidos f ipix)))
  +
  +    (dolist (arco lista-arcos)
  +      (let ((v2 (first arco))
  +	    (v1 (rest arco)))
  +
  +	(multiple-value-bind (revise testes) (fapix-revise f v2 v1 inferencias)
  +	  (incf testes-totais testes)
  +	  (when revise
  +	    (multiple-value-bind (d exists) (gethash v2 inferencias)
  +	      (when exists
  +		(when (= (length d) 0)
  +		  (return-from fapix-mac (values nil testes-totais)))))
  +
  +	    (nconc lista-arcos (remove (cons v1 v2)
  +				       (fapix-arcos-vizinhos-nao-atribuidos f v2)
  +				       :test 'equal))))))
  +
  +    (return-from fapix-mac (values inferencias testes-totais))))
  +
   (defun fapix-arcos-vizinhos-nao-atribuidos (f ipix)
     ""
     (loop for relacionado in (aref (fapix-relacionados f) ipix) unless (fapix-pix-cor f relacionado)
          collect (cons relacionado ipix)))
  -
   
   (defun fapix-revise (f x y inferencias)
     ""
  
positive.code: 	 (pix-solucionavel t) ; t de talvez :D
  	 (dominio-len (make-array 3 :initial-element nil))
  	 (pix-dominio-len-p (make-array max-ipix :initial-element nil))
  	 (ipix 0))
  ;    (format t "Declarei tudo~%")
  ;    (format t "linhas:~a colunas:~a max-ipix:~a~%" linhas colunas max-ipix)
  
negative.code: 
      (return-from procura-retrocesso-fc-mrv-fapix (values nil testes-totais))))
  
  (defun procura-retrocesso-mac-mrv-fapix (f)
    ""
  ;  (format t "pr-mac-mrv~%")
    (let ((testes-totais 0))
      (when (fapix-completo-p f)
        (return-from procura-retrocesso-mac-mrv-fapix (values f testes-totais)))
  
      (let* ((ipix (fapix-mrv f))
  	   (d (fapix-pix-dominio f ipix))
  	   )
        (format t "Vou experimentar a variavel:~a cujo dominio e:~a~%" ipix (fapix-pix-dominio f ipix))
        ; TODO: heuristica de valor (media dos pixs a volta? implica mais um array)
        (when (= (length d) 2)
  	(let* ((a-volta (aref (fapix-a-volta f) ipix))
  	       (a-volta-len (length a-volta))
  	       (soma 0)
  	       (numero 0))
  
  	  (dolist (ipix-av a-volta)
  	    (let ((pix (aref (fapix-pix f) ipix-av)))
  	      (when pix (incf soma pix) (incf numero))))
  
  	  (when (and (not (= numero 0)) (= (round (round soma numero) a-volta-len) 1))
  	    (setf d (reverse d)))))
  
        (dolist (cor d)
  	(multiple-value-bind (consistente testes) (fapix-atribuicao-consistente-p f ipix cor)
  	  (incf testes-totais testes)
  	  (when consistente
  	    (format t "Atribuindo o valor:~a a variavel:~a~%" cor ipix)
  	    (fapix-adiciona-atribuicao! f ipix cor)
  	    (setf (fapix-natribuidos f) (remove ipix (fapix-natribuidos f)))
  ;	    (format t "natribuidos:~a~%" (fapix-natribuidos f))
  	    (setf (aref (fapix-dominio-len f) (length d))
  		  (remove ipix (aref (fapix-dominio-len f) (length d))))
  ;	    (format t "dominio-len:~a~%" (fapix-dominio-len f))
  ;	    (format t "Depois da atribuicao~%")
  	    (desenha-fill-a-pix (fapix->fill-a-pix f))
  	    (multiple-value-bind (inferencias testes) (fapix-mac f ipix)
  	      (format t "PR: inferencias:~a~%" inferencias)
  	      (incf testes-totais testes)
  	      (when inferencias ; teste suficiente?
  		(let ((backup (make-hash-table :test 'eql)))
  		  (maphash #'(lambda (iipix id)
  ;			       (format t "iipix:~a id:~a~%" iipix id)
  			       (setf (gethash iipix backup) (fapix-pix-dominio f iipix))
  			       (fapix-altera-dominio! f iipix id))
  			   inferencias)
  
  ;		  (format t "Depois das inferencias~%")
  ;		  (desenha-fill-a-pix (fapix->fill-a-pix f))
  
  		  (multiple-value-bind (resultado testes) (procura-retrocesso-mac-mrv-fapix f)
  		    (incf testes-totais testes)
  		    (when resultado
  		      (return-from procura-retrocesso-mac-mrv-fapix (values resultado testes-totais))))
  
  		  (maphash #'(lambda (bipix bd)
  			       (fapix-altera-dominio! f bipix bd))
  			   backup)
  
  ;		  (print "Removidas as inferencias:")
  ;		  (desenha-fill-a-pix (fapix->fill-a-pix f))
  		  ))
  
  	      (fapix-remove-atribuicao! f ipix)
  	      (push ipix (fapix-natribuidos f))
  ;;	      (push ipix (aref (fapix-dominio-len f) (length d)))
  	      (nconc (aref (fapix-dominio-len f) (length d)) (list ipix)) ; TODO:
  
  	      (print "Removendo a atribuicao:")
  	      (desenha-fill-a-pix (fapix->fill-a-pix f))
  	      )))))
  
      (return-from procura-retrocesso-mac-mrv-fapix (values nil testes-totais))))
  
  (defun fapix-forward-checking (f ipix)
    ""
  