This is the rte Reference Manual, version 1.1.14, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 06:35:41 2024 GMT+0.
rte/rte.asd
rte/src/rte.lisp
rte/src/asdf.lisp
rte/src/expand-typedef.lisp
rte/src/list-of.lisp
rte/src/dependents.lisp
rte/src/derivative.lisp
rte/src/rte-state-machine.lisp
rte/src/dump-code.lisp
rte/src/strategy-inline.lisp
rte/src/strategy-goto.lisp
rte/src/strategy-tail-call.lisp
rte/src/strategy-trampoline.lisp
rte/src/strategy-jump-table.lisp
rte/src/re-pattern.lisp
rte/src/rte-case.lisp
rte/src/destructuring-case.lisp
rte/src/prolog.lisp
The main system appears first, followed by any subsystem dependency.
Modules are listed depth-first from the system components tree.
rte/src
rte
(system).
rte.lisp
(file).
asdf.lisp
(file).
expand-typedef.lisp
(file).
list-of.lisp
(file).
dependents.lisp
(file).
derivative.lisp
(file).
rte-state-machine.lisp
(file).
dump-code.lisp
(file).
strategy-inline.lisp
(file).
strategy-goto.lisp
(file).
strategy-tail-call.lisp
(file).
strategy-trampoline.lisp
(file).
strategy-jump-table.lisp
(file).
re-pattern.lisp
(file).
rte-case.lisp
(file).
destructuring-case.lisp
(file).
prolog.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
rte/rte.asd
rte/src/rte.lisp
rte/src/asdf.lisp
rte/src/expand-typedef.lisp
rte/src/list-of.lisp
rte/src/dependents.lisp
rte/src/derivative.lisp
rte/src/rte-state-machine.lisp
rte/src/dump-code.lisp
rte/src/strategy-inline.lisp
rte/src/strategy-goto.lisp
rte/src/strategy-tail-call.lisp
rte/src/strategy-trampoline.lisp
rte/src/strategy-jump-table.lisp
rte/src/re-pattern.lisp
rte/src/rte-case.lisp
rte/src/destructuring-case.lisp
rte/src/prolog.lisp
rte/src/rte.lisp
src
(module).
*rte-types*
(special variable).
*state-machines*
(special variable).
*type-functions*
(special variable).
rte-keyword
(type).
rte/src/expand-typedef.lisp
rte.lisp
(file).
src
(module).
expand-my-typedef
(function).
rte/src/list-of.lisp
rte.lisp
(file).
expand-typedef.lisp
(file).
src
(module).
list-of
(type).
car*-cdr-of
(type).
rte/src/dependents.lisp
rte.lisp
(file).
src
(module).
print-object
(method).
update-dependent
(method).
dependent
(class).
ndfa
(reader method).
register-dependents
(function).
rte/src/derivative.lisp
rte.lisp
(file).
src
(module).
canonicalize-pattern
(function).
canonicalize-pattern-once
(function).
derivative
(function).
rte/src/rte-state-machine.lisp
rte.lisp
(file).
src
(module).
populate-synchronized-product
(method).
print-object
(method).
rte-state-machine
(class).
rte/src/dump-code.lisp
rte-state-machine.lisp
(file).
rte.lisp
(file).
src
(module).
dump-code
(generic function).
dump-code-strategy
(class).
rte/src/strategy-inline.lisp
rte.lisp
(file).
dump-code.lisp
(file).
src
(module).
dump-code
(method).
dump-state
(generic function).
format-state-dispatch
(generic function).
goto-next-state
(generic function).
state-assoc
(generic function).
strategy-inline
(class).
rte/src/strategy-goto.lisp
rte.lisp
(file).
dump-code.lisp
(file).
strategy-inline.lisp
(file).
src
(module).
dump-state
(method).
format-state-dispatch
(method).
goto-next-state
(method).
state-assoc
(method).
strategy-goto
(class).
rte/src/strategy-tail-call.lisp
rte.lisp
(file).
dump-code.lisp
(file).
strategy-inline.lisp
(file).
src
(module).
dump-state
(method).
format-state-dispatch
(method).
goto-next-state
(method).
state-assoc
(method).
strategy-tail-call
(class).
rte/src/strategy-trampoline.lisp
rte.lisp
(file).
dump-code.lisp
(file).
strategy-inline.lisp
(file).
src
(module).
dump-state
(method).
format-state-dispatch
(method).
goto-next-state
(method).
state-assoc
(method).
strategy-trampoline
(class).
trampoline
(function).
rte/src/strategy-jump-table.lisp
rte.lisp
(file).
dump-code.lisp
(file).
src
(module).
strategy-jump-table
(class).
rte/src/re-pattern.lisp
rte.lisp
(file).
rte-state-machine.lisp
(file).
dump-code.lisp
(file).
expand-typedef.lisp
(file).
dependents.lisp
(file).
derivative.lisp
(file).
src
(module).
calc-sticky-states
(method).
defrte
(macro).
perform-some-transitions
(method).
rte
(type).
rte-reset
(function).
*dump-code-strategy*
(special variable).
*rte-hash*
(special variable).
*rte-pattern-functions*
(special variable).
alphabetize
(function).
define-rte
(function).
dump-code
(method).
dump-code
(method).
equivalent-patterns
(function).
find-state-machine
(function).
first-types
(function).
make-rte-function-name
(function).
match-sequence
(generic function).
nullable
(function).
partition-by-predicate
(function).
remember-state-machine
(function).
remove-redundant-types
(function).
rte-expand-type
(function).
rte-to-dfa
(function).
traverse-pattern
(function).
uniquify
(function).
with-expanded-type
(function).
rte/src/rte-case.lisp
rte.lisp
(file).
src
(module).
rte-case-clauses-to-dfa
(function).
rte-case-expander
(function).
rte-synchronized-product
(function).
rte/src/destructuring-case.lisp
re-pattern.lisp
(file).
src
(module).
destructuring-case
(macro).
destructuring-methods
(macro).
destructuring-case-alt
(macro).
destructuring-lambda-list-to-rte
(function).
expand-destructuring-case-alt
(function).
expand-destructuring-methods
(function).
find-key-variable
(function).
find-keyword
(function).
gather-type-declarations
(function).
swap-type-specifier-alist
(function).
test-illustrate-dfas
(function).
rte/src/prolog.lisp
rte.lisp
(file).
src
(module).
compile-and-serialize
(function).
complexity
(function).
get-patterns
(function).
serialize-functions
(function).
sort-patterns
(function).
Packages are listed by definition order.
regular-type-expression
rte
adjuvant
.
common-lisp
.
lisp-types
.
non-deterministic-finite-automata
.
canonicalize-pattern
(function).
defrte
(macro).
destructuring-case
(macro).
destructuring-methods
(macro).
list-of
(type).
rte
(type).
rte-case
(macro).
rte-ecase
(macro).
rte-reset
(function).
*dump-code-strategy*
(special variable).
*rte-hash*
(special variable).
*rte-pattern-functions*
(special variable).
*rte-types*
(special variable).
*state-machines*
(special variable).
*type-functions*
(special variable).
alphabetize
(function).
canonicalize-pattern-once
(function).
car*-cdr-of
(type).
compile-and-serialize
(function).
complexity
(function).
define-rte
(function).
dependent
(class).
derivative
(function).
destructuring-case-alt
(macro).
destructuring-lambda-list-to-rte
(function).
dump-code
(generic function).
dump-code-strategy
(class).
dump-state
(generic function).
equivalent-patterns
(function).
expand-destructuring-case-alt
(function).
expand-destructuring-methods
(function).
expand-my-typedef
(function).
find-key-variable
(function).
find-keyword
(function).
find-state-machine
(function).
first-types
(function).
format-state-dispatch
(generic function).
gather-type-declarations
(function).
get-patterns
(function).
goto-next-state
(generic function).
make-rte-function-name
(function).
match-sequence
(generic function).
ndfa
(generic reader).
nullable
(function).
partition-by-predicate
(function).
register-dependents
(function).
remember-state-machine
(function).
remove-redundant-types
(function).
rte-case-clauses-to-dfa
(function).
rte-case-expander
(function).
rte-expand-type
(function).
rte-keyword
(type).
rte-state-machine
(class).
rte-synchronized-product
(function).
rte-to-dfa
(function).
serialize-functions
(function).
sort-patterns
(function).
state-assoc
(generic function).
strategy-goto
(class).
strategy-inline
(class).
strategy-jump-table
(class).
strategy-tail-call
(class).
strategy-trampoline
(class).
swap-type-specifier-alist
(function).
test-illustrate-dfas
(function).
trampoline
(function).
traverse-pattern
(function).
uniquify
(function).
with-expanded-type
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Declare a given RTE pattern so that that it can be used when loaded from fasl or referenced symbolically be another rte.
Similar to CASE except that the object is matched against destructuring-lambda-lists and
declared type constraints. The first clauses matching the structure and types is evaluated.
Each clause is of the form (destructuring-lambda-lists &body BODY).
Where BODY may have docstring and declarations. The type constraints will
be extracted from the (declare ... (type ...)) forms.
E.g.,
(destructuring-case ’(1 2 :x 3)
((a b c)
(declare (integer a b) (symbol c))
:first)
((a &optional (b 0) &key (x 0) (y 0))
(declare (integer a b x y))
:second))
==> :second
A variant of DESTRUCTURING-CASE, but allows a call-next-method feature.
The first matching clause is executed, if it calls the call-next-method function
then the next matching method is executed.
The call-next-method function defaults to CALL-NEXT-METHOD, but may be renamed
using the :CALL-NEXT-METHOD keyword argument.
E.g.
(destructuring-methods ’(1 2 3) (:call-next-method cnm)
((a b c)
(declare (type number a b c))
(* 2 (or (cnm) 1)))
((a b c)
(declare (type fixnum a b c))
3))
OBJECT-FORM is the form to be evaluated,
CLAUSES is a list of sublists, each sublist can be destructured as: (RATIONAL-TYPE-EXPRESSION &REST BODY)
OBJECT-FORM is the form to be evaluated,
CLAUSES is a list of sublists, each sublist can be destructured as: (RATIONAL-TYPE-EXPRESSION &REST BODY)
Given a regular-type-expression, return a canonical form.
Forget all regular type expressions.
rte-state-machine
)) ¶non-deterministic-finite-automata
.
rte-state-machine
) starting-states input-sequence) ¶non-deterministic-finite-automata
.
rte-state-machine
) (sm1 rte-state-machine
) (sm2 rte-state-machine
) &key boolean-function minimize complement-transition-label merge-transition-labels final-state-callback) ¶non-deterministic-finite-automata
.
rte-state-machine
) stream) ¶standard-class
) (dep dependent
) &rest init-args) ¶sb-mop
.
Matches possibly empty list such that each element matches ELEMENT-TYPE
Matches a list whose types constitute ’words’ in a rational
language described by the given rational expression. The PATTERN must
either be a valid lisp type specifier or a list whose (car PATTERN) is
a keyword of type RTE-KEYWORD, and each element of (cdr PATTERN) is
a valid regular type expression.
:0-* – matches the types of zero or more successive list elements, E.g,
:1-* – matches the types of one or more successive list elements
:0-1 – matches the type optionally (zero or one) list element
:or – specifies a logical disjunction of rational expressions
:and – specifies a logical conjunction of rational expressions
:cat – in order concatenation of rational expressions
:permute – specifies any-order concatenation of rational expressions
(typep ’(nil x 1 y 2 z 3 (x) nil (y) nil)
’(rte (:0-1 null)
(:1-* symbol number)
(:0-* list null)))
(typep ’(nil x 1 11 y 2 22 z 3 33 (x) nil (y) nil)
’(rte (:0-1 null)
(:or (:1-* symbol number)
(:1-* symbol number number))
(:0-* list null)))
Hash table storing named rte’s for reuse by (:rte ...) within an rte pattern
List of function names created by MAKE-RTE-FUNCTION-NAME
Hash table mapping rte-pattern to lisp-type:
E.g., ((1-* SYMBOL NUMBER)) –> (AND SEQUENCE (SATISFIES " "((:1-* SYMBOL NUMBER))))
Hash table mapping rte pattern to state-machine object.
Hash tble mapping parameterized type name to function which can be used with (SATISFIES ...)
Symantically similar to CASE except that the object is matched against destructuring-lambda-lists and
optional type constraints. The first clauses matching the structure and types is evaluated.
Each clause is of the form (destructuring-lambda-lists constraint-alist &body body)
Where constraint-alist is an car/cdr alist mapping a type specifier to a list of variable
names of that type. The variables will be implicitly declared in the body.
E.g.,
(destructuring-case-alt ’(1 2 :x 3)
((a b c) ((integer a b) (symbol c))
:first)
((a &optional (b 0) &key (x 0) (y 0)) ((integer a b x y))
:second))
==> :second
non-descructively sort a list of patterns into a canonical order.
Given a regular-type-expression, return a more canonical form. This attempts to create an (:or ..) of (:and ...)’s, and removing or resolving redundant or trivial type designators. CANONICALIZE-PATTERN calls this function multiple times until a fixed point is found.
Returns the number of cons cells in the given hierarchical list
Calculate the rational derivate of the given pattern.
Generate an RTE (regular type expression) given a destructuring-lambda-list.
If TYPE-SPECIFIERS is given it should be an alist (car/cadr) mapping variables
in the lambda list to cl type specifiers. Such a list can be computed by calling
the function GATHER-TYPE-DECLARATIONS given a list whose leading elements are
zero or more (declare ...) forms some of which contain type declarations.
A destructuring lambda list has the following syntax:
reqvars::= var*
optvars::= [&optional {var | (var [init-form [supplied-p-parameter]])}*]
restvar::= [{&rest | &body} var]
keyvars::= [&key {var | ({var | (keyword-name var)} [init-form [supplied-p-parameter]])}*
[&allow-other-keys]]
auxvars::= [&aux {var | (var [init-form])}*]
wholevar::= [&whole var]
lambda-list::= (wholevar reqvars optvars restvar keyvars auxvars)
Not supporting this syntax -> (wholevar reqvars optvars . var)
OBJECT-FORM is the form to be evaluated,
CLAUSES is a list of sublists, each sublist can be destructured as: (LAMBDA-LIST CONSTRAINTS &REST BODY)
where CONSTRAINTS is a car/cdr alist mapping each type specifiers to a list of
variable names. e.g., ((number a b c) ((or string symbol) x y z))
an &key argument in a lambda list can be declared in several different ways. FIND-KEY-VARIABLE finds and returns the variable (symbol or destructuring-list) associated with the given KEYVAR form
an &key argument in a lambda list can be declared in several different ways. FIND-KEYWORD finds and returns the keyword (symbol from keyword package) associated with the given KEYVAR form
BODY is the body of some destructuring-bind form. This function, gather-type-declaration,
examines zero, one, or more declarations in the leading position of the body to find
type declarations. An assoc list (car/cadr) is returned of the form
((var1 typespec1) (var2 typespec2)...)
If the same variable is declared more than once, the resulting type is the intersection
of the individual types.
CL-SPEC> Declaration TYPE
...
CL-SPEC> If nested type declarations refer to the same variable, then the value of the
CL-SPEC> variable must be a member of the intersection of the declared types.
Given the operand list of either :or or :and, return a new operand list understand some basic logical reductions based on super-typeness.
Helper function for rte-case. Parses the clauses to compute three objects:
1) the list of unreachable-bodys
2) the dfa
3) a pair (transit boolean), the boolean indicates whether there is a transit through the
dfa which does correspond to one of the given clauses. If the boolean is TRUE
then the transit indicates a list of type specifiers of such an object.
Create and return a finite state machine (ndfa) which can be used to determine if a given list consists of values whose types match PATTERN.
Returns a sorted list of regular type expression patterns. The sorted order ensures that if pattern-B references pattern-A, then pattern-A appears earlier in the list than pattern-B. This sorting is done naively: If pattern-B references pattern-A, then the total number of cons cells of pattern-B must be larger than that of pattern-A, thus the list is sorted by complexity, otherwise the sort order is non-deterministic.
constraint-alist is an car/cdr alist mapping each type specifiers to a list of
variable names. e.g., ((number a b c) ((or string symbol) x y z))
RETURNS an alist mapping each variable name to its type specifier.
If any variable appears more than once in the given constraint-alist,
the corresponding types are intersected in the return alist.
Walk a regular type expression, stopping at nodes which designate lisp types.
The given functions F-0-*, F-1-*, etc are called on each node to continue the traversal.
The default behavior is to walk to list and copy it, however the behavior and return value actuall
depend on the choice of F-... function given.
rte-state-machine
) strategy &key var) ¶list
) strategy &key var) ¶rte-state-machine
) (strategy strategy-inline
) &key var) ¶strategy-trampoline
) state-name dumped-case) ¶strategy-tail-call
) state-name dumped-case) ¶strategy-goto
) state-name dumped-case) ¶strategy-trampoline
) initial-state-name dumped-states) ¶strategy-tail-call
) initial-state-name dumped-states) ¶strategy-goto
) initial-state-name dumped-states) ¶strategy-trampoline
) state-name) ¶strategy-tail-call
) state-name) ¶strategy-goto
) state-name) ¶strategy-trampoline
) exit-form-p states) ¶strategy-tail-call
) exit-form-p states) ¶strategy-goto
) exit-form-p states) ¶state-machine
.
non-deterministic-finite-automata
.
(function typep)
non-deterministic-finite-automata
.
t
non-deterministic-finite-automata
.
(lambda (regular-type-expression::a regular-type-expression::b) (lisp-types:type-to-dnf-bottom-up (lisp-types:bdd-reduce-lisp-type (sb-int:quasiquote (or #s(sb-impl::comma :expr regular-type-expression::a :kind 0) #s(sb-impl::comma :expr regular-type-expression::b :kind 0))))))
non-deterministic-finite-automata
.
(lambda (regular-type-expression::label) (eq nil (lisp-types:type-to-dnf-bottom-up regular-type-expression::label)))
non-deterministic-finite-automata
.
(lambda (regular-type-expression::a regular-type-expression::b &aux (regular-type-expression::a-reduc (lisp-types:type-to-dnf-bottom-up regular-type-expression::a)) (regular-type-expression::b-reduc (lisp-types:type-to-dnf-bottom-up regular-type-expression::b))) (and (subtypep regular-type-expression::a-reduc regular-type-expression::b-reduc) (subtypep regular-type-expression::b-reduc regular-type-expression::a-reduc)))
Matches non-empty list whose leading elements respectively match the leading elements of TYPES, and thereafter the list of
remaining elements matches the final element of types. E.g.,
(typep ’(1 hello nil 1 2 3 4 5) ’(car*-cdr-of number symbol null (list-of number)))
=> TRUE
Jump to: | A C D E F G M N P R S T U W |
---|
Jump to: | A C D E F G M N P R S T U W |
---|
Jump to: | *
D N S T |
---|
Jump to: | *
D N S T |
---|
Jump to: | A C D E F L M P R S T |
---|
Jump to: | A C D E F L M P R S T |
---|