ryukinix / lisp-inference

An Inference Engine based on Propositional Calculus written in Common Lisp
https://logic.manoel.dev
BSD 3-Clause "New" or "Revised" License
40 stars 1 forks source link

Fix problem about namespace issues on the printh-truth-table procedure #4

Closed ryukinix closed 6 years ago

ryukinix commented 6 years ago

Because a problem of namespace operators defined inside of https://github.com/ryukinix/lisp-inference/blob/master/src/operators.lisp are not been catched as normal operators on the eval-operations function used in printh-truth-table. The strategy is to remap all the EXP car symbols to eventual symbols defined inside of :inference package, as defined a util function here: https://github.com/ryukinix/lisp-inference/blob/e2bf222427baa0fb8df2a59ee0a544f9fd74f16b/src/truth-table.lisp#L155-L157

Related to: https://github.com/ryukinix/lisp-inference/blob/e2bf222427baa0fb8df2a59ee0a544f9fd74f16b/src/truth-table.lisp#L89-L104

The following images are examples of this bug occurying when we set different namespaces by (in-package :inference) or (in-package :cl-user)

image image image

ryukinix commented 6 years ago

Fixed image