%%-------------------** Term Rewriting System (TRS) **------------------------ %% %% Authors : Andre Luiz Galdino %% Universidade Federal de Goiás - Brasil %% %% and %% %% Mauricio Ayala Rincon %% Universidade de Brasília - Brasil %% %% Last Modified On: September 29, 2009 %% %%----------------------------------------------------------------------------
replacement[variable: TYPE+, symbol: TYPE+, arity: [symbol -> nat]]: THEORY BEGIN
IMPORTING subterm[variable,symbol, arity]
p, q, p1, p2, q1: VAR position
s, r, t: VAR term
i: VAR posnat
fs: VAR finseq[term]
x, y: VAR (V)
%%%% Definition: replacing the subterm of s at position p by t %%%%%%%%%%%%%%%
replaceTerm(s: term, t: term, (p: positions?(s))): RECURSIVE term =
(IF length(p) = 0 THEN
t ELSE LET st = args(s),
i = first(p),
q = rest(p),
rst = replace(replaceTerm(st(i-1), t, q), st,i-1) IN
app(f(s), rst) ENDIF) MEASURE length(p)
pos_occ_var_replace: LEMMA FORALL t, y, x, (p: positions?(t)):
Pos_var(t, x)(p) & y /= x
=> Pos_var(replaceTerm(t, y, p), x) = remove(p, Pos_var(t, x))
pos_occ_var_replace_as_diff: LEMMA FORALL t, y, x, (p: positions?(t)):
Pos_var(t, x)(p) & y /= x
=>
Pos_var(replaceTerm(t, y, p), x) = difference(Pos_var(t, x), singleton(p))
END replacement
¤ 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.0.13Bemerkung:
(vorverarbeitet)
¤
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 ist noch experimentell.