Check-in [acfcbdeb7a]

Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed a bug in merging of substitutions with some arguments unbound.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:acfcbdeb7a4a3b5834bc2a0e39dd4958f937bd94
User & Date: andy 2015-04-16 22:00:29
Context
2015-04-16
22:01
Fixed demo IH to conform to the new vertical-bar encoding. check-in: 925c93ea0a user: andy tags: trunk
22:00
Fixed a bug in merging of substitutions with some arguments unbound. check-in: acfcbdeb7a user: andy tags: trunk
21:59
Fixed a bug in fill that was duplicating _'s in the to-be-copied term. check-in: a992c2ca2e user: andy tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to plsrc/subst.pl.

86
87
88
89
90
91
92


93
94
95
96
97
98
99
100
extend([V=T|Ss], (Var=Value), [V=T2|Ss2]) :-
    apply_subst([Var=Value],T,T2),
    extend(Ss,(Var=Value),Ss2).


% merge(S1,S2,Subst)
% Compose two substitutions into a new one.


merge([],S2,S2).
merge([S|Ss],S2,Subst) :-
    extend(S2,S,S3),
    merge(Ss,S3,Subst).

% get_subst(T1,T2,Subst)
% Find the substitution needed to unify T1 and T2, if possible. This is exactly
% the traditional unification procedure, just implemented on top of our notion







>
>
|







86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
extend([V=T|Ss], (Var=Value), [V=T2|Ss2]) :-
    apply_subst([Var=Value],T,T2),
    extend(Ss,(Var=Value),Ss2).


% merge(S1,S2,Subst)
% Compose two substitutions into a new one.
merge([],[],[]) :- !.
merge(S1,[],S1) :- !.
merge([],S2,S2) :- !.
merge([S|Ss],S2,Subst) :-
    extend(S2,S,S3),
    merge(Ss,S3,Subst).

% get_subst(T1,T2,Subst)
% Find the substitution needed to unify T1 and T2, if possible. This is exactly
% the traditional unification procedure, just implemented on top of our notion