ShotTo

ShotTo is an Elixir implementation of NCPO-LNF — the βη-long-normal Computability Path Order of Niederhauser and Middeldorp, NCPO goes Beta-Eta-Long Normal Form (2025) — for ordering terms of Church's simple type theory as represented by the shot_ds library.

ShotTo is developed at the University of Bamberg, Chair for AI Systems Engineering, primarily as an orientation order for a higher-order tableau prover.

What it does

Given two terms s and t in βη-long normal form and a choice of ordering parameters, ShotTo decides the boolean predicate $s >^1_\tau t$ of Definition 8 of the paper. It is a drop-in decision procedure rather than an SMT-constraint generator: the parameters (precedences, statuses, accessibility, basicness) are fixed inputs supplied by the caller, not unknowns.

import ShotDs.Hol.Dsl
import ShotDs.Hol.Definitions
alias ShotDs.Stt.TermFactory, as: TF
alias ShotTo.Parameters

params = Parameters.new(const_precedence: %{"f" => 1, "c" => 0})
f  = TF.make_const_term("f", Type.new(:i, :i))
c  = TF.make_const_term("c", type_i())
fc = app(f, c)

ShotTo.gt?(fc, c, params)       # => true   (by ⟨F▷⟩: c is a subterm of f(c))
ShotTo.gt?(c, fc, params)       # => false
ShotTo.compare(fc, c, params)   # => :greater

API surface

ShotTo

ShotTo.Parameters

A struct with fields

Helpers:

Defaults are permissive: all sorts equivalent and basic, all positions accessible, all constants equivalent with :lex status. Under these defaults NCPO-LNF reduces to the simple subterm order plus lexicographic-in-the-same-head comparison, which is rarely what you want; at a minimum supply a const_precedence.

Status and caveats

Installation

Add shot_to to your dependencies:

def deps do
  [
    {:shot_to, "~> 0.1"}
  ]
end

License

MIT.