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

Tree algo #2

Merged
merged 2 commits into from
Aug 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

The project receives an **input file** as the first parameter.



The file should describe a set of rules, initial facts and queries.

```
Expand Down Expand Up @@ -51,10 +49,16 @@ A **tree** represents a set of rules. It is composed of nodes divided in two typ
Each **connector** and **atom** are represented uniquely, meaning that we **will never have any duplication**. Also a `!node` will be the same as `!node`.

```python
AtomNode('A') # Never two times the same
```
AtomNode('A') # No duplicated

# Only one '&' ConnectorNode for:
(A & B)
!(A & B)

# Different '&' ConnectorNode for:
(A & B)
(!A & B)
```

For example you will never find two `A` atoms, but also never find two times the same exact `ConnectorNode` instance ` *(more detail for what connectors are after)*.

Expand Down Expand Up @@ -82,7 +86,7 @@ A child represents the left part of the equation. So **if one your child is true
An `AtomNode` represents one fact. It's presentation is an uppercase character.

```python
node_a = AtomNode('A')
AtomNode('A')
```

#### The connector class
Expand Down Expand Up @@ -151,3 +155,10 @@ TODO (a & !a) impossible
TODO (a XOR !a) always true, (a XOR a) always false

TODO Since a child is equivalent to a OR Two childs a or !a always true

```python
(A & B) => C
(!A & B)=> C # should detect impossible
```