Skip to content
Open
Show file tree
Hide file tree
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
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ to cherry-pick a few interesting functions to generate the corresponding test ca

Klara can be installed via `pip` tool by using:

```shell
pip install klara
```

## Usage

Expand Down Expand Up @@ -111,7 +113,9 @@ with klara.MANAGER.initialize_z3_var_from_func(tree.body[0]):

Will print out:

``` python
[2, 3]
```

Because `z = 1` is not possible due to `v1 > 4` and `v1 < 3` is unsatisfiable

Expand Down Expand Up @@ -231,7 +235,7 @@ def test_main_0():

Which is only 2 combinations of `nnn_right`

Because Klara can't dynamically execute the code, it will provide extension to specify how to infer
Because Klara can't dynamically execute the code, it will provide extension to specify how to infer
specific ast node or user defined type to make Klara \'smarter\'. It\'s described in
[extending](https://klara-py.readthedocs.io/en/latest/extending.html), [extending user
type](https://klara-py.readthedocs.io/en/latest/extending_user_type.html) and [customize coverage
Expand All @@ -242,18 +246,22 @@ strategy](https://klara-py.readthedocs.io/en/latest/customize_coverage_strategy.
We use [Poetry](https://python-poetry.org/docs/) to manage dependencies.
After poetry is installed, run:

$ poetry shell
$ poetry install
```shell
poetry shell
poetry install
```

To run the test case, do:

$ poetry run pytest test
```shell
poetry run pytest test
```

## Acknowledgements

- The architecture of the inference system is largely inspired by [Astroid](https://github.com/PyCQA/astroid).
- Special thanks to Dr. Poh for guiding the early stages of the project.


## License

This project is licensed under the terms of the GNU Lesser General
Expand Down
9 changes: 0 additions & 9 deletions klara/core/_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

_ast3 = _ast2 = None

try:
import typed_ast.ast3 as _ast3
import typed_ast.ast27 as _ast2
from typed_ast import conversions
except ImportError:
pass


def get_parser_module():
return _ast3 or ast
Expand All @@ -17,6 +10,4 @@ def get_parser_module():
def parse(string, py2=False):
parse_mod = (_ast2 if py2 else _ast3) or ast
tree = parse_mod.parse(string)
if py2:
tree = conversions.py2to3(tree)
return tree
Loading