Package nltk_lite :: Package semantics :: Module evaluate
[hide private]
[frames] | no frames]

Module evaluate

source code

This module provides data structures for representing first-order models.

Classes [hide private]
  Error
  Undefined
  CharFun
A dictionary which represents a curryed characteristic function.
  Valuation
A dictionary which represents a model-theoretic Valuation of non-logical constants.
  Assignment
A dictionary which represents an assignment of values to variables.
  Model
A first order model is a domain D of discourse and a valuation V.
Functions [hide private]
 
isrel(s)
Check whether a set represents a relation (of any arity).
source code
set
flatten(d)
Returns: The set of keys of a CharFun instance.
source code
int
depth(cf)
Calculate the depth of a CharFun.
source code
 
propdemo(trace=None)
Example of a propositional model.
source code
 
folmodel(trace=None)
Example of a first-order model.
source code
 
foldemo(trace=None)
Interpretation of closed expressions in a first-order model.
source code
 
satdemo(trace=None)
Satisfiers of an open formula in a first order model.
source code
 
demo(num, trace=None)
Run some demos.
source code
Variables [hide private]
  mult = 30
Function Details [hide private]

isrel(s)

source code 

Check whether a set represents a relation (of any arity).

Parameters:
  • s (set) - a set containing tuples

flatten(d)

source code 
Returns: set
The set of keys of a CharFun instance.

depth(cf)

source code 

Calculate the depth of a CharFun.

Returns: int

demo(num, trace=None)

source code 

Run some demos.

  • num = 1: propositional logic demo
  • num = 2: first order model demo (only if trace is set)
  • num = 3: first order sentences demo
  • num = 4: satisfaction of open formulas demo
  • any other value: run all the demos
Parameters:
  • trace - trace = 1, or trace = 2 for more verbose tracing