Skip to content
/ rel Public

Rel-inspired Logic Programming for Factory Management

Notifications You must be signed in to change notification settings

tisocc/rel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Rel-inspired Logic Programming for Factory Management (Python)

Overview

This project implements a relational, logic-based factory management system in Python, inspired by the paper
Rel: A Programming Language for Relational Data.

Because Rel currently does not provide a freely available runtime environment, this project recreates core Rel concepts using the Python library PyDatalog. The goal is not to reimplement Rel itself, but to apply the same relational and declarative thinking principles in a practical, executable environment.

The system models machines, employees, maintenance orders, quality control, and release workflows entirely as relations and derives system state through logical rules, not imperative code.


Key Concepts

  • Everything is a relation (no classes, no objects)
  • Declarative logic instead of procedural control flow
  • Derived relations instead of mutable state
  • Implicit joins via shared variables
  • Business semantics expressed as logic rules

Technologies Used

Component Description
Language Python 3.x
Library PyDatalog
Paradigm Declarative / Logic Programming
Inspiration RelationalAI – Rel
Domain Factory / Manufacturing Management

Project Structure

Base relations:

  • machine(MachineID, Type)
  • employee(EmployeeID, Name, Role)
  • maintenance_order(OrderID, MachineID, EmployeeID, Status)
  • qc(QCID, MachineID, InspectorID, Result)
  • release(ReleaseID, WorkOrderID, QCID, Status)

Derived relations are computed using logical rules.


Example Logic Rules

Open maintenance orders:

PendingOrders(X, Y, Z) <= maintenance_order(X, Y, Z, 'pending')

Machines with failed QC:

MachinesFailedQC(M) <= qc(QCID, M, EmpID, 'failed')

Derived maintenance requirements:

NewMaintenance(QCID, M, 'E2', 'pending') <= qc(QCID, M, EmpID, 'failed')

Author

Nigel

About

Rel-inspired Logic Programming for Factory Management

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages