aimacode / aima-julia

Julia implementation of algorithms from Russell And Norvig's "Artificial Intelligence - A Modern Approach"
MIT License
126 stars 50 forks source link

Add logic.jl and its respective Base.Test tests. #6

Closed mikhail-j closed 7 years ago

mikhail-j commented 7 years ago

@norvig This pull request covers symbols, variables, clauses, and algorithms in propositional logic (Chapters 7-9).

I wrote a lexicographical Expression parser that handles both infix and prefix operators in Julia to avoid relying on Julia's eval() and its corresponding lexicographical parser (Julia does not allow custom infix operator declarations such as "==>", "<=>", or "<=="). This means that "===\$==>", "*&%^", etc are evaluated as legal infix operators.

This Expression parser is different from the aima-java lexicographical parser because this parser does not look ahead, though it still uses a expression tree.

Please note that HybridWumpusAgentProgram (percept and route planning in the Wumpus Environment) and fol_fc_ask are not fully implemented yet like in aima-python (logic.py).

norvig commented 7 years ago

Very nice!

mikhail-j commented 7 years ago

@norvig Please restart the Travis-CI build for merging pull request #6.

Currently, the base repository shows "build: error" because the OSX Travis-CI build failed to set up the Julia 0.5 environment 11 hours ago.

I pulled the same merge request into my fork and the build passed (here).