Skip to content

A simple script to automatically generate and solve clauses for testing the CS262 coursework

Notifications You must be signed in to change notification settings

ojcole/CS262-Tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS262 Testing Script

Setup Linux / Mac

Make sure you have swipl installed then just create the venv:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Setup Windows

Make sure you have swipl installed and in your path.

I recommend the use of git bash simply because I don't know cmd.

If you get permission denied when running python3 try python

python3 -m venv venv
source venv/Scripts/activate
pip install -r requirements.txt

Running the script

Concurrent Mode

The new concurrent mode running with --concurrent INTEGER which allows for many tests to be run at once, vastly increasing the speed of running of tests but reducing the instant feedback.

General

Ensure that your .pl file is in the directory or pass it as an argument to the script

Then run the autogenerated tests with:

python test.py

These will be solved in python and then your answer will be compared to the python solution

Or a specific test file in the tests folder using the --tests options, or elsewhere

e.g python test.py --tests tautologies.csv or python test.py --tests tests/tautologies.csv will both work.

Arguments and what they do can be found with --help

Creating own tests

Populate a CSV in the tests folder with separators of "," or elsewhere and use --tests to run it

Generating own tests

You can generate your own tests, such as the tautologies.csv test, by specfiying the --csvout option which will only print the tests and the actual solution. This can be combined with --truths to only generate tautologies. This is just printed to stdout so just pipe with > as usual.

Coursework Solutions

I cannot provide the correct answers to the coursework problems as its part of the coursework to identify them. However, if you fill your solutions into the base.csv file you can test them. They can be found by subbing into a truth table generator such as here. Where its YES iff the entire table is yes.

Regards

Hope you like it and let me (Ollie) know what you think / if you find a test you find interesting

About

A simple script to automatically generate and solve clauses for testing the CS262 coursework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages