package
0.2.0
Repository: https://github.com/google/mangle.git
Documentation: pkg.go.dev

# README

Grammar


rule ::= atom '.'
       | atom  ':-' rhs

rhs ::= litOrFml (',' litOrFml)* '.'
      | litOrFml (',' litOrFml)* '|>' transforms

transforms ::= stmts '.'
             | 'do' apply-expr ',' stmts '.'

stmts ::= stmt (',' stmt)*
stmt ::= 'let' var '=' expr

litOrFml ::= atom | '!' atom | cmp

atom ::= pred-ident '(' exprs? ')'

expr ::= apply-expr
       | constant
       | var

exprs ::= expr (',' expr)*

apply-expr ::= fn-ident '(' exprs? ')'
             | [ exprs? ]

cmp ::= expr op expr

op ::= '=' | '!=' | '<' | '>'

constant   ::= name, number or string constant
fn-ident   ::= ident (starting with 'fn:')
pred-ident ::= ident (not starting with 'fn:')

# Packages

No description provided by the author

# Functions

Atom parses an Atom from given string.
BaseTerm parses a BaseTerm from given string.
Clause parses a single clause.
LiteralOrFormula parses a single Term, an equality or inequality from a given string.
PredicateName parses a predicate name.
Term parses a Term from given string.
Unit parses a source unit (clauses and decls).

# Structs

Error represents a parser error messages, without location.
Parser represents an object that can be used for parsing.
SourceUnit consists of decls and clauses.