Coder Social home page Coder Social logo

gel-max-sat's Introduction

GEL-MaxSAT

license MIT

A tractable Graphic EL MaxSAT solver

Install the dependencies

pip3 install -r requirements.txt

Input format

The input is an ontology in OWL format. This ontology can only contain axioms in the following form, where C, D are basic concepts, r, s, t are roles and a, b are individuals:

  • C ⊑ D
  • C ⊑ ∃r.D
  • C ≡ D
  • C ≡ ∃r.D
  • C(a)
  • r(a, b)
  • r ⊑ s
  • r ∘ s ⊑ t

Due to technical limitations, axioms of the form ∃r.C ⊑ D need to be represented as "∃r.C" ≡ ∃r.C and "∃r.C" ⊑ D.

Add a rdfs:comment to every uncertain axiom. There must be the header #! pbox-id in these comments, followed, in the next line, for its unique id.

For example:

Supose some axiom Ax0 is uncertain. You need to add one rdfs:comments to this, with the content

#! pbox-id
0 

Usage

The <inputfile> will be your OWL file with probabilistic restrictions.

python3 gel_max_sat.py <inputfile>

Experiments

The experiments (with the default values) can be made by running

python3 experiments.py [optional arguments]

Generation of random formulas

The formulas in the experiments are generated randomly. Because every Graphic EL knowledge base can be represented as a directed graph, the problem of generating a random GEL knowledge base can be reduced to the problem of generating a random graph. This process is done as follows.

We have the following fixed values:

  • n, the number of concepts;
  • m, the number of axioms;
  • p, the number of finite weighted axioms;
  • r, the number of roles.

First, we start with a graph G with zero arrows and three vertices: (the top concept), (the bottom concept) and init (the artificial initial concept). Then, we add n vertices and r roles to G. After that, we add m - p infinite weighted arrows and p finite weighted arrows. The arrows are added by chosing randomly two vertices C and D (n + 3 possibilities for each one) and creating an arrow from C to D, its role is chosen uniformly between an "is a" role (C ⊑ D) and the r other roles (C ⊑ ∃ri.D).

Note that we do not need to generate body-existential axioms (∃ri.C ⊑ D) because they can be represented by simple and existential-head axioms. Also, individual concepts are represented by every concept C such that init ⊑ C.

Finally, during and after the insertion of arrows, the graph is completed following the graph completion rules.

Plotting

The experiments can be plotted by running

python3 plot.py [optional arguments] data/experiments/<experiment>

Example

This is the plot of an experiment using default configuration:

Plot using default configuration

License

MIT

gel-max-sat's People

Contributors

andrewijano avatar

Watchers

 avatar

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.