Skip to content
bsommersPublic

About

OntoLogic First Order Logic (FOL) ontology language and system for creating BFOs and Domain Ontologies

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OntoLogic

  ______           __           __                      __            
 /      \         /  |         /  |                    /  |           
/$$$$$$  |_______ $$ |_ ______ $$ |  ______   ______  $$/   _______   
$$ |  $$ |/      \$$   /      \$$ | /      \ /      \ /  | /       |  
$$ |  $$ |$$$$$$  |$$ |$$$$$$  |$$ |/$$$$$$  /$$$$$$  |$$ |/$$$$$$/   
$$ |  $$ |$$ |  $$ |$$ |$$ |  $$ |$$ |$$ |  $$ |$$ |  $$ |$$ |$$ |    
$$ \__$$ |$$ |  $$ |$$ |$$ \__$$ |$$ |$$ \__$$ |$$ \__$$ |$$ |$$ \_____ 
$$    $$/ $$ |  $$ |$$ |$$    $$/ $$ |$$    $$/ $$    $$ |$$ |$$       |
 $$$$$$/  $$/   $$/ $$/  $$$$$$/  $$/  $$$$$$/   $$$$$$$ |$$/  $$$$$$$/ 
                                                /  \__$$ |            
                                                $$    $$/             
                                                 $$$$$$/              

Logic-as-Code compiler, ontology transpiler and SMT solver engine.

OntoLogic is a first-order logic (FOL) domain-specific language, multi-target compiler, theorem-prover bridge and REPL written in Haskell. Write a formal ontology once, check it for consistency with Z3, CVC5 or Vampire, and compile it into code, API contracts, database schemas, knowledge-graph formats and diagrams.

CI License: Apache 2.0

Project site: https://bsommers.github.io/OntoLogic/ | Rationale: docs/purpose.md

Quickstart

stack build                                              # 1. build
stack exec ontologic-exe -- -i examples/smart_factory.logic -t lint     # 2. lint
stack exec ontologic-exe -- -i examples/smart_factory.logic -t solve    # 3. check consistency (SMT)
stack exec ontologic-exe -- -i examples/smart_factory.logic -t ts -o ./generated/ts   # 4. emit TypeScript/Zod
stack exec ontologic-exe -- --repl                       # 5. interactive REPL

Full walkthrough: docs/user-guide/quickstart.md. Install options: docs/user-guide/installation.md.

Features

  • FOL DSL with typed properties, binary relations, quantifiers and inheritance.
  • Modular namespaces: import, namespace, cycle detection and a standard library lookup path.
  • Semantic linter: symbol resolution, circular inheritance, duplicates and axiom contradictions.
  • Multi-prover solver: consistency, subsumption proofs, unsatisfiable-concept detection and counterexamples (Z3, CVC5, Vampire or auto).
  • Language server and VS Code extension (ontologic-lsp, editors/vscode).
  • Interactive REPL with :load, :solve, :prove, :unsat, :emit <target>.
  • Many emitters from one shared intermediate representation (ModelIR).

Targets

Select with -t <target>; see --help for the full list and docs/user-guide/targets-and-emitters.md for details.

Category Targets
Application code ts (Zod), java, python (Pydantic v2), rust, go, cpp
API and data contracts openapi, graphql, jsonschema, protobuf, sql
Knowledge graphs owl, shacl, neo4j
Provers smt (SMT-LIB2), tptp, solve
Diagrams mermaid, d2 (add --render for images); see docs/user-guide/visualization.md
Tooling lint, repl, lsp

Documentation

Standard library and domain examples

The bundled libraries live in ontologic-lib/; see docs/standard-library.md. Worked examples across many domains: docs/domains/README.md.

Build and test

stack build --ghc-options="-Wall -Werror"
stack test

License

Apache License 2.0. See LICENSE.

About

OntoLogic First Order Logic (FOL) ontology language and system for creating BFOs and Domain Ontologies

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages