Skip to content

Automate building and maintaining custom operating systems using declarative reasoning.

License

Notifications You must be signed in to change notification settings

pvdabeel/prolog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automate building and maintaining custom operating systems using declarative reasoning.

Prolog code

This repository contains Prolog code:

  • context: An implementation of a Contextual Object Oriented Logic Programming paradigm for SWI-Prolog,
  • eapi: A DCG Grammar for reading EAPI-8 (or earlier) compliant Gentoo ebuild information into Prolog facts and rules,
  • knowledgebase: A structure to which Gentoo overlays and repositories can be registered.
  • repository: A Prolog class representing a Gentoo Portage repository. Offers datalog-style querying and Git, Rsync or Webrsync syncing.

Other interesting files:

  • An ebuild reader & parser,
  • A prover which uses declarative reasoning to compute a Model and a logic Proof for realisation of a given ebuild,
  • A planner capable of creating a build plan (Makefile) for realisation of a given ebuid proof,
  • A pretty printer for build plans,
  • A grapher capable of creating graphviz DOT files and interactive SVG files,
  • Domain-specific rules for reasoning about ebuilds and their possible configurations,

This repository also contains some bash scripts to emulate Gentoo emerge.

Some examples:

Portage SVG Graphs

The code is able to automatically generate interactive SVG graphs for all ebuilds, allowing you to walk through the Ebuild dependency graph. Dot files and corresponding SVG can be found here

Portage SVG Graphs

Contextual logic programming

The following screenshot shows a simple 'Person' class being instantiated. Private data member can be set and retrieved, but not accessed directly.

The class code:

Imgur

The instance:

Imgur

Syncing repositories

The following screenshot shows a Gentoo Portage repository and a Gentoo overlay being synced using git. Only the changed ebuilds have their Logic metadata updated.

Imgur

Reading, parsing & querying ebuilds

In the following screenshots we show Gentoo ebuilds being read, parsed and queried using Prolog

Imgur

Imgur

Imgur

Imgur

Installation instructions:

Not available at this time.

About

Automate building and maintaining custom operating systems using declarative reasoning.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages