package trs

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

A library for parsing and emitting TRS.

This library provides functionality for handling the TRS format. With to_string and of_string, you can convert between a TRS string and the trs type. The specifications for the TRS format can be found here.

Types

type trs = {
  1. var : id list option;
  2. rules : rule list;
  3. comment : string option;
}

trs is the representation of TRS format. Each record field corresponds to section if TRS: VAR, RULES, and COMMENT.

and rule = term * term

rule is a rewrite rule. (left, right) represents left -> right

and term =
  1. | Var of id
  2. | App of id * term list

A term of TRS.

and id = string

Identifier in terms.

Parsers and serialisers

val of_string : string -> (trs, exn) Stdlib.result

of_string s parses s into a trs value.

val of_string_exn : string -> trs

of_string s parses s into trs. Raises Invalid_argument if there is an error.

val to_string : trs -> string

to_string trs converts a trs value into a string.

Printers

val string_of_trs : trs -> string

The same as to_string.

val string_of_rule : rule -> string
val string_of_term : term -> string
val string_of_id : id -> string
OCaml

Innovation. Community. Security.