Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

funçao para converter sentença em CNF #31

Open
hcrespo opened this issue May 27, 2015 · 7 comments
Open

funçao para converter sentença em CNF #31

hcrespo opened this issue May 27, 2015 · 7 comments

Comments

@hcrespo
Copy link
Contributor

hcrespo commented May 27, 2015

função que converte qq formula em FOL para CNF. Potencialmente usada depois por #26 para transformar a KB em listas de listas.

@arademaker
Copy link
Owner

no 21eb13f aceitei sugestões para to-cnf mas ainda resta tratar variáveis e quantificadores. Várias otimizações possíveis, remoção de implication não precisa tratar outros casos, apenas quando car é implicação acontece algo, nos demais casos apenas passa a chamada.

@hcrespo
Copy link
Contributor Author

hcrespo commented May 28, 2015

Tratei outros casos considerando que poderia ter uma implicação dentro da sentença, por exemplo (or A (implies B C)).

@arademaker
Copy link
Owner

Vide 6773696 a idéia.

@hcrespo
Copy link
Contributor Author

hcrespo commented May 28, 2015

Entendi

@arademaker
Copy link
Owner

Além disso, veja que sua versão introduziria um bug se chamada antes da preproc que trata de transformar (and A B C) em (and A (and B C)). Queremos que as transformações sejam independentes.

@hcrespo
Copy link
Contributor Author

hcrespo commented May 28, 2015

Fiz dessa forma pois se o 'or tivesse mais de uma argumento iria complicar para fazer as trocas dos 'and e 'or

@arademaker
Copy link
Owner

Pessoal,

fol> (skolemization '(exists ?x (forall ?y (or (implies (Q ?x) (P ?x ?y))))))
(forall ?y (or (implies (Q #:g539) (P #:g539 ?y)) nil))
fol> (to-cnf (skolemization '(exists ?x (forall ?y (or (implies (Q ?x) (P ?x ?y)))))))
nil
fol> (to-cnf '(implies (Q ?x) (P ?x ?y)))
(or nil nil)
fol> (to-cnf (skolemization '(exists ?x (forall ?y (or (implies (Q ?x) (P ?x ?y)))))))
nil

Vamos fechar este issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants