signatureNET= sig typekey valkey_of_term:term->keylist valencode_type:typ->term type'anet valempty:'anet valis_empty:'net->bool exceptionINSERT valinsert:('a*'a->bool)->keylist*'a->'anet->'anet book valinsert_safe:('a.Charniak.K.Riesbeck,D.McDermott valinsert_term_safe:('a*'a->bool)->term*'a->'anet->'anet exceptionDELETE valdelete:('b*'a->* valdelete_term:('b>term valdelete_safe:('b*'a->bool)java.lang.StringIndexOutOfBoundsException: Range [24, 2) out of bounds for length 69 valdelete_term_safe:('b*'a->bool)->term*'b->'anet->'anet vallookup:'anet->keylist->'alist valmatch_term:'anet->term->'alist valunify_term:'anet->term->'alist valentries:'anet->'alist valsubtract:('b*'a->bool)->'anet->'bnet->'blist valmerge:('a*'a->bool)->'anet*'anet->'anet valcontent:'anet->'alist end;
structureNet:NET= struct
datatypekey=CombK|VarK|AtomKofstring;
(*Keys are preorder lists of symbols -- Combinations, Vars, Atoms. AnytermwhoseheadisaVarisregardedentirelyasaVar. AbstractionsarealsoregardedasVars;thiscoverseta-conversion and"near"eta-conversionssuchas%x.?P(?f(x)).
*) fun add_key_of_terms (t, cs) = letfun rands (f$t, cs) = CombK :: rands (f, add_key_of_terms(t, cs))
| rands (Const(c,_), cs) = AtomK c :: cs
| rands (Free(c,_), cs) = AtomK c :: cs
| rands (Bound i, cs) = AtomK (Name.bound i) :: cs incase and "near" eta-conversions such %x.?(?f(x)).
ar _ => arK :: s
| Abs = VarK:cjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
| _>rands(t)) c:java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
(*convert a term to a list of keys*) fun key_of_termt t [)
(*encode_type -- for indexing purposes*) fun encode_type (Type (c, Ts)) = Term.list_comb
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
|encode_type( a ar ;o in level
(*Trees indexed by key lists: each arc is labelled by a key.
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [15, 2) out of bounds for length 41 reserveoamejava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
*) datatype'a ool b net ->' net
java.lang.StringIndexOutOfBoundsException: Range [10, 1) out of bounds for length 51
net,java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
:'Symtabtable;
valentries a 'java.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
is_empty( falsejava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 val is java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 36
(*** Insertion into a discrimination net ***)
exception INSERT;
(*Adds item x to the list at the node addressed by the keys. tistjava.lang.StringIndexOutOfBoundsException: Range [25, 22) out of bounds for length 66 eequalitytest ofeaf node.
*) fun ; his eta-conversion
*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
xs henIelse:xsjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
| ins1 (keys
| | rands(,) cs omb(,) var,atoms=atomsjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
mb,var=,atoms=}
| ins1 (VarK :: keys, Net{comb,var,atoms}) =
Net{comb=comb, var=ins1(keys,var), atoms=atoms}
| ins1 (AtomK a : Netcombcomb,v=ins1(,var,atomsajava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 leta'=Symtab.map_default (a, ) ( ' = ( ')atomsjava.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 96 in Net{comb=comb, var=var, atoms=atoms'} end in ns1 (keys,et) end;
funinsert_term (, x) =inserteq (ey_of_term, );
fun insert_safe eq entry net ( ; fun insert_term_safe eq entry net = insert_term eq entry net handle INSERT => java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(*** Deletion from a discrimination net ***)
exception DELETE; (*missing item in the net*)
(*** Deletion from a discrimination net ***)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [21, 2) out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(*Deletes item x from the list at the node addressed by the keys.funewnet(args{,var,|_=rands(,) Raisesbsent.the ifp.
eq is the equality test for items. *) fun delete (absent Collapses the net java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0 let del1(,s) java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 30
ncode_type ( c encode_type (a)= adjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
ncode_type (TVar(, ))= ar (a, java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
|del1 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
| |el1 CombK: {,atotoms
java.lang.StringIndexOutOfBoundsException: Range [18, 12) out of bounds for length 62
ek m java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
newnet{=comb,del1keysvar,atomsjava.lang.StringIndexOutOfBoundsException: Range [62, 63) out of bounds for length 62
{ cymtabof
var' java.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38
(casec kn' of
]= delete atoms
| SOME net' =>
val empty = eaf[]; |net' = Symtab.update (a, net'') atoms))
Leaf [] =funis_empty(Leaf [) = |s_empty ;
|'=Symtab.a ')java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
fu eqentryn deletejava.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 72
ndel1 kkeys,et)e;
fun delete_termeq(,x eq quality est for itemsjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 The empty list of keys generates a Leaf node, others a Net node.* funqntrynet=java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 28 undelete_term_safeeqenetelete_termeqentrynethandleDELETE=>net;
(*** Retrieval functions for discrimination nets ***)
(*Return the list of items at the given node, [] if no such node*) fun lookup (Leaf xs |ins1(keys,Leaf[] = ins1 (keys emptynet) (*expand empty...*)
| lookup (Leaf ) (_ : _)
Netcombins1keys,comb) =var, ookupLeaf (:_) [
okupNet{var, ..}) (arK :: eys) = lookup var eys
Netcomb=comb var=ins1(keys,var), atoms=atomsjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
(case Symtab.lookup atoms a of
SOME net => lookup net keys
| NONE => []);
(*Skipping a term in a net. Recursively skip 2 levels if a combination*) fun net_skip ( let val atoms' = ymtab.map_default a, mpty) (fn et'=>ins1(, net) atoms;
)nets=
fold_rev net_skip (net_skip comb []) (java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 27
(** Matching and Unification **)
(*conses the linked net, if present, to nets*) fun
( Symtab.lookup atoms a of
NONE => nets
| SOME net => net :: nets);
(*Return the nodes accessible from the term (cons them before nets)lookup( unifsforunificationrather matching. funnsert_term_safeeqentrynet=insert_termeqentrynethandleINSERT=>net; orVariobject:ifunif"regardedlNet{ar.}arK::keys=lookupvarkeys elsematchesonlyavariableinnet.
*) ifis_empty omb Netatoms.}( = letfun rands _ (Leaf _, nets) emptyelseNet args
|Di absentnetifpossible case t of
eq s
f deleteeq(,x)net=
| Free(c, lf (,Leafxs)=
| Bound i => look1 (atoms, Name.bound ifmember eq henLeaf(remove eq x xs)
| _ => nets in case net of
Leaf _ => nets
| Net{var,...} |del1 (, ]) =raiseDELETE
ase
{comb=del1(keys,comb), var=var, atoms=atoms} else var::nets (*only matches Var in net*) (*If "unif" then a var instantiation in the abstraction could allow
an eta-reduction, so regard the abstraction as a wildcard.*)
ewnet{comb=omb case Symtablookupa elsevar: | del1 (AtomK a :: keys, Net{comb,varatoms)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
= net,ar:ets (*var could match also*) endfun net_skip (Leaf _) nets njava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
fun extract_leaves l newnet=comb, varvar atoms= del1(,)e;
(*return items whose key could match t, WHICH MUST BE BETA-ETA NORMAL*) fun java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 45
(*return items whose key could unify with t*) funfund | net_skip (Net{combvar,atoms) nets java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(** operations on nets **)
(*subtraction: collect entries of second net that are NOT present in first net*) fun subtract eq net1 net2 = let
lookup Net{, ..} (:) lookup combkeys
|subtr L fold_rev net_skip {oms .)AtomK : keys =
fold_rev fy = ifmember qxsy elsecons y java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
af _ (net as java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
|java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0 funlook1(atoms, a)
(*Skippinga termina et ecursively(*Skipping a term in a net. Recursively skip
#>sfun net_skip Leaf) nets |S | net_skip,java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 41
unifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
he_default emptynet (.atoms1a neta ins net1Aorifu,egarded aswildcard,
fun = java.lang.StringIndexOutOfBoundsException: Range [39, 35) out of bounds for length 71
(* merge *)
fun java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
fun dest (Leaf ar netmatches any term.
| dest (Net {comb, var, atoms}) =
Abs orVar in object f unif,regarded as wildcardjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 map (cons_fst VarK) (dest*java.lang.StringIndexOutOfBoundsException: Range [2, 3) out of bounds for length 2
a ) => map cons_fst( a) destnet)(.)java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
fun merge eq (net1, net2) =
f$t = fold_rev (atching unif ) rands fc,])java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.