Skip to content
/ crete Public

A symbolic first-order logic programming DSL in Scala.

Notifications You must be signed in to change notification settings

jyuhuan/crete

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Crete

Crete is a DSL in the Scala programming language for logic inference. With Crete, you can write first-order logic sentences naturally, as you would write them by hand.

Features

Sentences Made Natural

Write sentences in first order logic in the most intuitive way:

∀('p)('smokes('p) & !'drinks('p)  'cancer('p))

Inference Made Easy

Creating a knowledge base on which various kinds of queries can be performed:

val kb = Set[Sentence](
  ∀('p)('smokes('p) implies 'cancer('p)),
  ∀('p)('cancer('x) implies 'dies('p)),
  'smokes("john"),
  'smokes("mary")
)

val query1 = kb entails 'dies("john")
val query2 = 'dies("john") follows kb
val query3 = kb existentialQuery ∃('x)('smokes('x))

Replaceable Inference Algorithm Provider

The default algorithm used for entailment inference is refutation resolution. You can change this to one of other available presets like forward chaining, etc., or you can make your own inference algorithm by conforming to the typeclass TODO. As an example, an inference algorithm that provides trivially a believe-in-everything-inference can be written as:

TODO

See Also

  • CreteSoft: a probabilistic soft logic framwork built upon Crete.
  • CreteMarkov: a Markov logic network framework built upon Crete.

About

A symbolic first-order logic programming DSL in Scala.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages