GithubHelp home page GithubHelp logo

646e62 / python-rsc-1985-c-c-46 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.36 MB

Expert system for the Criminal Code of Canada in Python

License: GNU General Public License v3.0

Python 99.63% CSS 0.37%

python-rsc-1985-c-c-46's Introduction

python-RSC-1985-c-C-46

Expert system for the Criminal Code of Canada in Python

I'm designing a program to interpret the Criminal Code of Canada. The program will translate statutes into Python functions that return true/false results when objects representing events are passed to them. The objects may be created manually or through an expert-system-style questionairre.

Any legal decision has a factual and normative component. Jon Bing, Computerized Legal Information Services: An Introduction

Operating on this hypothesis, this project proposes to implement an expert legal system using predefined legislative and jurisprudential rules that interact with factual objects.

Facts

At their base, criminal offences are premised in a factual matrix that the state alleges took place.

  1. Universal elements. Date/jurisdiction/ID, and other universal elements will need to be accounted for in a distinct function.
  2. Offence types. To be able to create a factual matrix that can then be translated into a criminal offence, it will be necessary to identify many different components. Every offence has elements, and (almost) all distinct criminal offence have distinct elements. Many will share elements in common.
  3. Direction. Rules should be adaptable to both deductive and inductive approaches.

Rules

  1. Offence elements. The most basic functionality will need rules to account for an offence's stated elements. Some offences will require digging into case law to highlight interpretive inconsistencies or additional legal tests used to establish whether a statutory condition has been met.
  2. Definitions. Some words and phrases have set meanings, either through statutory definitions or through common-law interpretation. The program will need to rely on various dictionaries to properly account for these definitions.
  3. Procedural functions. Some offences cannot be made out when there have been procedural deficiencies. The program should eventually flag procedurally unviable offences and identify the reason for the deficiency.
  4. Evidence. Much like procedural functions, some offences cannot be made out due to evidentiary issues. The program should also eventually flag these issues and identify them as the reason for the deficient prosecution.
  5. Direction. Rules should be adaptable to both deductive and inductive approaches.

TODO

Ongoing considerations

  • Probability: can the expert system account for different probabilities and evaluate offences on that basis?
  • Utility: what good will an expert system like this be able to do?
    • Trace statutory incompatibilities
    • Assess charge resolution alternatives (lesser included offences)
    • Identify case strengths and weaknesses
    • Automate minimum/maximum sentencing ranges and available non-custodial sanctions

python-rsc-1985-c-c-46's People

Contributors

646e62 avatar

Watchers

 avatar

python-rsc-1985-c-c-46's Issues

Create a Complainant class

As the high treason experiment shows, there's a need to create a class that specifically identifies complainants with distinguishing features (statutorily aggravating factors, special statuses (peace officer, the Sovereign, the country generally, etc)) for those cases where these statuses are part of the offence.

Deductive functionality

The program currently approaches legal issues by creating a set of facts and determining whether the programmed rules apply. Another approach is to start with the rule and to see if the provided facts meet its definition. The former approach will be useful for those trying to determine what offences, if any, a person's conduct gives rise to. The other will be useful for those trying to determine whether established conduct meets a charged offence's rule system.

No UI

Add a bare bones UI to enable Facts object creation.

Treason control flow

Now that the high treason control flow is running, it's time to add new rules to read through. Complete CC s 46 by finishing off the treason control flow and making corrections as needed to the underlying models.

Create Defendant class

Creating a Defendant class will solve many of the same problems that creating the Complainant class solved.

Again, the Criminal Code treason sections have been much handier than anticipated in identifying some of these needs. Some of the treason offences obtain if a defendant conspires to commit a high treason offence. Creating a Defendant with a liability value will let the rule sets manage this data point a bit more effectively.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.