adamjstewart / prolog

An implementation of Prolog written in OCaml
MIT License
2 stars 3 forks source link

changed ast to make conjunction a list of goals, modified parser and functions common accordingly #4

Closed ZaidQureshi closed 6 years ago

ZaidQureshi commented 6 years ago

This makes a fundamental change to our ast. Now, a Clause has a head and a body where the body is a list of exps. The list represents a conjunction between all the exps in the list. Similarly a Query is a list of exps where the lsit represents a conjunction between all the exps in the list. This is to simplify the evaluation. Disjunction has been removed. I didn't modify any of the test files.

ZaidQureshi commented 6 years ago

Fixed all of your tests for the modifications of the ast. Also removed the semicolon token from lexer, parser, and their tests. Regarding stuff from evaluator.ml, things are only "easier" if nothing is implemented and things don't work (which isn't our case). Also, restricting the type that can be passed into string_of_atom causes warnings. In fact to truly solve this issue we would need to modify our AST slightly but that isn't necessary.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.3%) to 89.868% when pulling c722dca90325b469de681efb3dcb60986fb81c3b on ast into 00d926ecee549b899471ab0e9f769d47e2dc2822 on master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.3%) to 89.868% when pulling c722dca90325b469de681efb3dcb60986fb81c3b on ast into 00d926ecee549b899471ab0e9f769d47e2dc2822 on master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.3%) to 89.868% when pulling baf5acb2a3ee580da8fda1b37595c6be339f2659 on ast into 00d926ecee549b899471ab0e9f769d47e2dc2822 on master.

adamjstewart commented 6 years ago

Could you add docstrings to every function you wrote? That would help greatly in understanding what it is supposed to do.

ZaidQureshi commented 6 years ago

Yes, also the report should help. If/when you are back in town maybe we should meet up so I can explain it.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.2%) to 90.308% when pulling af4601cb2c7d5b8483de9dcfab07d493e4b707a1 on ast into 00d926ecee549b899471ab0e9f769d47e2dc2822 on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.2%) to 90.308% when pulling af4601cb2c7d5b8483de9dcfab07d493e4b707a1 on ast into 00d926ecee549b899471ab0e9f769d47e2dc2822 on master.