GIC Logo

The progamming language forFirst Order Logic*

* You should check PROLOG out.

Powerful Features

Everything you need for logic programming, built on solid foundations

First Order Logic Parsing

Parse and process first order logic expressions with full support for quantifiers, operators, and predicates.

SLD Resolution

Leverage SLD resolution for efficient query processing on facts and rules in your logic programs.

Built-in Predicates

Extensive library of built-in predicates including list operations, arithmetic, and logical operations.

FOL-like Syntax

GIC uses a first-order logic syntax. If P is a predicate (Uppercase) and t1, ..., tn are terms (variables or function applications in lowercase), then L-Formulas are defined as:

A .gic file consists of a set of L-Formulas separated by .

You can use either ASCII operators (and, or, impl, not, exists, forall) or Unicode symbols (, , , ¬, , ) interchangeably.

Universal quantifiers (forall) may be left implicit.

Grammar

L-Formulas f ::=
    P(t1, ..., tn)   // Predicate
  | bottom           // ⊥
  | f and f          // f ∧ f
  | f or f           // f ∨ f
  | f impl f         // f ⇒ f
  | not f            // ¬ f
  | exists X. f      // ∃ X. f
  | forall X. f      // ∀ X. f

See It In Action

GIC makes it easy to work with logic programs. Here's what you can build.

Family Relations

Define and query complex relationships with logical rules.

(Father(A,B) and Father(B,C)) ⇒ Grandpa(A,C).

List Operations

Work with recursive data structures and solve constraints.

Reverse(XS,XS) ⇒ Palindrome(Xs)

Fibonacci

Express complex mathematical expressions with logic formulas.

Fib(0,0).
Fib(1,1).
(
	Gt(N,1) and
	Sub(N,1,N1) and
	Fib(N1,F1) and
	Sub(N,2,N2) and
	Fib(N2,F2) and
	Add(F1,F2,F)
) impl Fib(N,F).

Ready to Explore Logic Programming?

Download GIC, explore the examples, and start building powerful logic programs.