Package nltk :: Package sem :: Module logic
[hide private]
[frames] | no frames]

Module logic

source code

A version of first order predicate logic, built on top of the untyped lambda calculus.

Classes [hide private]
  Tokens
  Variable
  SubstituteBindingsI
An interface for classes that can perform substitutions for variables.
  Expression
This is the base abstract object for all logical expressions
  ApplicationExpression
This class is used to represent two related types of logical expressions.
  VariableExpression
This class represents a variable to be used as a predicate or entity
  IndividualVariableExpression
This class represents variables that take the form of a single lowercase character followed by zero or more digits.
  VariableBinderExpression
This an abstract class for any Expression that binds a variable in an Expression.
  LambdaExpression
  QuantifiedExpression
  ExistsExpression
  AllExpression
  NegatedExpression
  BooleanExpression
  AndExpression
This class represents conjunctions
  OrExpression
This class represents disjunctions
  ImpExpression
This class represents implications
  IffExpression
This class represents biconditionals
  EqualityExpression
This class represents equality expressions like "(x = y)".
  LogicParser
A lambda calculus expression parser.
  StringTrie
  ParseException
  UnexpectedTokenException
Functions [hide private]
 
unique_variable() source code
 
is_indvar(expr)
An individual variable must be a single lowercase character followed by zero or more digits.
source code
 
demo() source code
Variables [hide private]
  _counter = Counter()
Function Details [hide private]

is_indvar(expr)

source code 

An individual variable must be a single lowercase character followed by zero or more digits.

Parameters:
  • expr - str
Returns:
boolean True if expr is of the correct form