Download 1. INTRODUCTION Automatic Goal-Directed Progrem

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Pattern language wikipedia , lookup

Speech-generating device wikipedia , lookup

Human–computer interaction wikipedia , lookup

Wizard of Oz experiment wikipedia , lookup

Existential risk from artificial general intelligence wikipedia , lookup

Ecological interface design wikipedia , lookup

Transcript
From: AAAI-80 Proceedings. Copyright © 1980, AAAI (www.aaai.org). All rights reserved.
Automatic
Goal-Directed
Stephen
Progrem
‘bvnsformetion
Fickas
USC/Information
Sciences Institute*
Marina del Rey, CA 90291
1. INTRODUCTION
This
paper
focuses
on a major
semi-automatic,
system:
to
take
automating
of
is
low
some
portions
system
of the
a large
specialized
high level
library
research
program
(or
refining
level
carried
out
which
both
to apply
[8]
by
transformation.
point
the
first
into
and
for
to apply
ensures
the
left
a facility
in
hand
side
applies
the
for
sequence
In using
small
the
TI system,
of
high
programmers
level
which
of
lines
only
transformations
final
sequence
applicability
a
relatively
are
employed
is
conditions
generally
of
small
in a typical
quite
employ
only
a conceptual
steps
or
include
position
to
the
conditionals,loops)
the
Jittering
ways:
it disrupts
to a myriad
his
high
of details.
some
sections
actually
process
it consumes
or
There
all
will
discuss
implement
such
a
level
of
the
is
the
types
a
system
as the Jitterer).
a
invoked
inputs
are
goal state
G corresponding
a library
of
Jltterer’s
return
state
value
from
state
This
L which
possibly
and applied
then
some
in
remains
a high priority
of
in C will
item for future
result
its
STRIPS
determined
and unbale
proposed
[9]
in S.
from
a simple
Improving
Sacerdoti
a
S.
in some
inefficient
or
of instantiated
be removed
each
techniques
(see
process.
message
in state
problems.
the
domains
jittering
currently
in solving
jittering
solvers
started
user.
C, 2) a
state
a sequence
as specified
can be both
certain
other
a failure
of sub-goals
approach
using
is either
Tk will
the
LHS of Tk, and 3)
in the
when
is unable
by
program
L to use
then
is employed
for
current
G and
is successful,
approach
order.
the TI system
Tk selected
to the mismatched
S matching
Jltterer
solwtlons
1) the
transformations
If G is a conjunction
like
whenever
for
to find
this
process,
by
problem
a survey),
research.
conceptual
Because
transformation
out
LHS of a transformation
Jitterer’s
suspended
ones
TI development,
lengthy.
to
low level
equivalent.
automating
following
is initially
the
transformations
transformations,
of
The
used
I call these
statements
kth
(eg.
in several
for
BOX DESCRIPTION
If the
number
the
where
SYSTEM
carry
him to attend
4.1. BLACK
The
that produce
a large refinement
or optimization.
Examples
are
changing a control structure
from iterative
to recursive,
merging
a number of loops into one, maintaining a set incrementally,
or
making
non-determinism
these
explicit.
Typically
transformations
have complex effects on the program; they may
even have to interact with the user.
Although
from
and effort;
known
The
reverting
from
alternative
generally
time
thenceforth
to match
AND JITTERING
“conceptual”
jittering
statements
to
motivation
process.
program
number
difficult
JITTERING
by forcing
The Jitterer
reasoning.
3. CONCEPTUAL TRANSFORMATIONS
TRANSFORMATIONS
adjacent
level
states
of quite
two
two loop generators
his
mechanisms
into
to prove,
lower
program
a programmer
and actually
various
a
to
and the context
that
provides
explore
to
in that
is applicable
can
purpose)
of
of
program
Examples
a block
two
his performance
strong
Jittering
program
and optimization
transformations
is semi-automatic
in the development
programmer
this
planning
then
More
programmer
portion
up of
can be applied.
steps.
within
merging
from
the
commuting
blocks.
one, or making
large
in a high
GIST
massage
of properties
is made
transformations
a statement
the
a number
sequence
include
position,
detracls
of
involves
written
the
used
the transformation
point
context
with
“jittering”
nested
moving
It
Implementation
LISP). Refinement
TI system
steps
Requiring
to programming
specification
is being
The TI system
previous
level
a larger
(Currently,
applying
it; the
of
Transformational
leg.
(LHS) of the transformation
to some
low
which
4. AN AUTOMATIC
part
a program
process
choose
environment
usually
development
steps
unfolding
the
in a real
generalized
TI approach
language
This
is
language
language
base
fragments.
must
the
and optimizing
particular
are
here
through
21. Briefly,
specification
run
of
the
jittering
A prototype
goal state.
of
preparatory
by
program
specialized,
much
the set of conceptual
it is
user
knowledge
a given
both
the
sequence.
employs
will
of
that
quite
transformations
TO PROGRAM DEVELOPMENT
discussed
specification
of a
transformations.
development
TI) [I,
of
user
argue
off
development
a system
2. THE TI APPROACH
The
I will
burden
in achieving
such
containing
this
by the
program-development
details.
which
domain
that
level
of
introduced
transformation
is assumed
faced
transformation-based
management
feasible
problem
may
the
4.2. THE GOAL LANGUAGE
the
Contained
be
in the TI system
[53. The Differencer
goal
9;
This research was supported by Defense Advaked Research Projects Agency
contract DAHCIS 72 C 0308
Views and conclusions contained in this document are
fhooe of the authors and should not be interpreted as repreeenting
the official
opinion or policy of DARPA, the U.S. Government, or any other person or agency
connected wilh them.
pattern,
between
element
detail,
68
the
and
two
of the list
and is written
takes
is a subsystem
as input
returns
(an
empty
a
list
list
is a description
called
a current
of
for
taken
in a goal language
the Differencer
state
pattern
and a
difference-descriptions
an
exact
match).
at a particular
I call GLl.
For
Each
level
of
example,
suppose
that
current
the
Differencer
pattern,
notation
and
SX stands
statement).
context;
any
to
to
produce
position
J, J being
descriptions
slightly
wider
the
returns
narrow
Other
of
GLl
not
used
Dlfferencer
FOLD
to
5. JiTTERIf’&
the
more
between
plans
to
by
the
is
the
by
the
Jitterer,
three
or
3)
pattern2,
pattern
Similar
jittering
the
This
for
goal
is
a
extract
2) extract
pattern1
Here,
of
pattern2.
we
of the
two
goals of the example.
can be defined
to Ai+l
for
for
the
all but
plans
form
(see
a particular
Each
[4],
goal
I call a STRATEGY.
[7]
STRATEGY
for
similar
the
The
been
are
transformation’s
takes
the
constructs
. . .
Tactic(n)
...
a match
for
the
attempt
expected
bound.
that
to change
both
We would
STRATEGY
plans
CHANGE-PREDICATE
Suppose
that
the three
of
of
we wanted
True
goal
into
scope
STRATEGY
untried
be
cases
header:
change-predicate-from-a-to-b
NOT (Predl=True
NOT (Predl-Fa
h
I se
Pred2=Fa
A
I se)
on
ordered
goal.
Lcngfh
A
by
69
goal.
the
the
Transformations
is then
state
as achieved
the
with
define
fashion:
called
by the
a
once
are bound
and
in to see if
and the
is a mismatch,
by
instantiated
application
of
then
the
disjunction
will
be
marked
Differencer
as
SCHEDULER
goal
might
is called
(ones
is posted
it
in.
a list
solve
the
has been
not
to
methods
(transformations
and
it.
It
this
the
is
The Scheduler
with
at least
to employ.
Scheduler
at
first
one
achieved),
point
must decide
untried
the
that
among
all
which
to
method)
it must decide
A set of domain
make
be
which
of the
dependent
metrics
decision
in both
an intelligent
identified.
among competing
of path: the types
Ti do
(marked
of
Once a goal IS chosen,
methods
help
transformation
Pred2=True)
along
construct,
chaining
current
if there
which
6.1. Choosing
Pred2)
the
G is marked
to
on next.
which
(Predl
functions
a goal G, variables
The Differencer
between
attaches
work
to
Relevant-god:
CHANGE-PREDICATE
.&n!:cability-conditions:
similar
and in disjunctive
jittering,
STRATEGY
backward
produced
goals
and that
parameters
STRATEGY
move
an arbitrarily
a particular
RHS matches
active
to False or False to True,
for
the
for solving
a new
Scheduler
informally
on goals
get the following
actions
do not
the STRATEGY’S
available
through
6. THE JITTERlNG
to rule out working
CHANGE-PREDICATE’s
exist
of
be
OR.
achievement.
Whenever
a
to achieve
in
sub-goals
awaiting
described
list
or
CHAINING
transformation.
Tactics)
let us package
we
to take
exists
Jitterer
To illustrate,
construcl.
in parallel
the LHS is instantiated.
in
Relevant-goal:
goal
the strategy
matches
Applicability-condition:
used
to narrow
solving
of actions
an Action can specify
LHS. If so, then
Tactic(l)
the
a sequence
applied
the
strategy’s
bind
any unbound
goal
parameter
6
execute
to
AND
POST(G), then
There
available
plans
name
Default-bindings:
I 1
a sub-goal
either
achieved.
transformations
have
construct
G as
to
G has been
5.2. BACKWARD
most
domains.):
STRATEGY
says
form
In general,
Each of the
planning
goal
match
An)
executing
methods
solving
as a Tactic.
known
following
for
a construct
the
will
...
Tactics introduced
available
(Predl
1
second
AND TACTICS
into
A2
list of actions
goals of GLl.
5.1. STRATEGY
mark
if Ai is of the
until
form.
Since in our case
rule
limit
goal.
NOT (VARIABLE
POST (EXTRACT tPred2
Predl)
says
SEQUENCE(A1
more
can
further
matching
formally
*ANY-PRED
scqucntlally;
something
out
POST(G)
achieved.
pattern1
in
the
SEQ (POST (EMBED (Predl
(#ANY-PRED
fr Pred211)
POST (EXTRACT tPred2
(#ANY-PRED
Predl
Pred21
specific
this
which
achieving
change-predicate-from-a-to-b
it
many
solving
in patternil,
for the other
plans
Q).
plans
variable,
exist
example
embed
and then
plans
become
Each
Tactic (31 embed-and-then-extract
Applicabihy-condition:
none
Action:
goal CHANGE-PREDICATE(pattern1
basic
first
is a simple
for
of solving
of a set of constraints
Tactics
Toceic
or
goal.
Taceic(2)
extract
Applicability-condition:
include
GLl
plans
CHANGE-PREDICATE
Tactic (1) enlbed
Applicabhty-condition:
none
Action: POST (EMBED (Predl
Pred21)
a
DISTRIBUTE,
differences
are capable
1) embed pattern1
goal:
organized
plans
the two.
we take
general
are
the
and an Actron for
STRATEGY
- ._ .1
goal and
example
Because
states
CHANGE-PREDICATE(P
In general,
above
pattern
goal
Suppose
containing
other
Our three
control
higher
1
t various
tactics
the individual
jittering
is composed
three
attempts
achieve
applicability
at
gives
then
COMMUTE,
UNFOLD.
desired
of jittering
There
detailed
in the
describe
interface
pattern2,
plan.
Jitterer
the next
ADD,
of GLl.
of
general
above
of which
define
Action:
section
pattern2).
from
$A”
will
PLANS
number
instance
the
to solve
and
both
acts as a common
goals
Q then
The
each
its
surrounding
If it is successful,
included
and describe
previous
goals,
Currently
DELETE,
PROVE-PROPERTY,
A small
“if
must
construct
from
current
$A” J), ie. use
the
Differencer.
of
goal first.
EXTRACT,
language
at
which
0);
the
now
the list is exhausted.
goals
EMBED,
of
Q then
matching
by the
to TI. If not, it attempts
each
out
We
following
SA”), ie. change
looking
a conditional
perspective.
most
so on until
is
including
a disjunction
a single
be the
none
(The
CHANGE-PREDICATE(P
without going
De fault-bindings:
FOO” as a
pattern
matching
would
FOO” “if Q then
bound
form
P then
a goal
pattern
GLl:
another
necessary,
context,
solve
“if
PRODUCE-ACTION-AT-POSITION(“if
means
The
a variable
P then
conditional
passed
SA” as
of the Differencer
in
CHANGE-ACTION(“if
one
was
Q then
for
The output
descriptions
three
the
“if
generally
steps.
goals
of problems
involve
Clcnce,
presented
a large
as
a
(over
path
to the
.litterer
10) number
of
(sequence
of
transformations)
continuing
Conflict
a fixed
threshold,
the desirability
of
8. FURTHER
There
with high level motivation: if the
determine
the
user’s
rule out certain
is known
current
goal
states
a number
to achieve
would
continue
the
which
be given
of achieving:
attached
no easy
way
another
by
taking
the
is made
5 give
some
be able
to
Even
so, in some
cases
Jitterer
will
if it
acceptable
structure
Such
minimum
exactly
that
cost
estimate
the
final
any method
the
user
a
of
cost
the
cost
to
there
associated
the
has
been
user
among competing
Ease of application:
method
may
complex
a rough
be to
is the
apply.
User
assistance:
needed
user
static
case
many
of
of how
properties
methods
The
call
preference
difficult
the
a transformation,
must
how many sub-goals
some
information.
estimate
In the
LHS (eg, how
In the case of a Tactic,
for
methods
the
is to
avoid
to
Neil
supply
which
a large
pattern
to “flatten”
hand,
something
which
matching
nothing
a goal
over
large
to produce
the
a current
has very
surrounding
besides
of
knowledge
Ordering takes
TactdN)
when
type
for
Goldman
their
reasoning
when
proposes
type
can
in
solution
the
such
a
transformation
be
are being
jittering
until
obtained.
Both
actively
studied
systems.
have
Bob Balzer,
Martin
contributions
provided
Ill implementation
little
2. Balzer,
Information
On the other
statement
into
side-effect;
context.
Prefer
it
to
willing
Feather,
this
and
Phil London
work.
able
Lee
and
Erman
assistance
and
to
the
effort.
known
to the
“Try
STRATEGY
at match
Tactic(J) before
The
Scheduler
among
competing
makes
use
Tactic(K)”
of
this
time
4.
Research
Report
RR-79-79,
1979.
P., Williams, C. Hearsay-Ill:
A
for Expert Systems.
First
Intelligence,
1980.
J. GOAL: A Coal Oriented Command language
Proff Constructlorr. Ph.D. Th., Computer
Science
Standford
University,
1979.
Bulrss-Rozas,
for Int ractue
Dept.,
and
5. Chiu, W. Structure
Comparison
and Semantic Interpretation
of
Differences.
First National Conference
on Artificial
Intelligence,
,
1980.
or “Try
information
tactics for a particular
R. TI: An example.
Sciences Institute,
3. Aalzcr, R., Erman, L., London,
Domain-Independent
Framework
National Conference
on Artificial
small
ones.
the form
last”.
choosing
solutions.
guidance
[6]
to
and allow
ie. it tends
Tactic ordering rules: a STRATEGY writer may provide rules for
form
ordering
the
Tactics.
These
take
rules
“if Condition then Ordering”, where Condition can refer
to any
piece
solution
may be to “delay”
jittering
the
user
1. Balzer, R., Goldman, N., and Wile, D. On the Transformational
Implementation
Approach
to programming.
Second International
Conference
on Software
Engineering,
October,
1976.
a method
a certain
side effect,
of the program.
changes
pattern
the
take
For instance,
a large
structure
simply
to disturb
side effects
body
as having
the functional
will a method
judgment)?
procedure
is seen
a method
does
actions
one (a qualitative
unfolds
and delayed
in future
until
an incorrect
jittering
information
one
the
subsequent
until
fold/unfold
approach
allow
not
the
9, REFERENCES
Side effects: What undesirable
of goal
a
(and
solutions
to
(Feather
contextual
like to thank
Wile
Hearsay
as much as possible.
the desired
guidance
for
to wait
give
for
another
level
inclusion
Dave
bothering
invoked
Still
high
I would
be proven)?
user
but
initially
is
them.
a solution
approach
a particular
the search
want
produce
presenting
jittering
in ordering
Acknowledgments
how
must be achieved?
for
not
a given
help
minded
approach
like about
mechanism
system).
will lead to a solution.
may
keep
better
presented,
is
guidance
with
is to
A
to guide
user
Jitterer
is
A simple
he didn’t
information
fact,
more
6.2. Choosing
employed)
what
the
user.
ik satisfied.
specify
untried
because
to the
currently
to try
loop.
of
achieving
of section
lhts
estimate
of
ways
The metrics
his control
still
many
goal.
For example,
to optimize
to it. This is a rough
or in fact
it may
RESEARCH
generally
to
low priority.
to compute
any method,
goal,
are
is able
into one, it may be unwise
produces
A rough
goal
methods
level
Scheduler
as un-productive.
of loops
a sub-goal
sub-goal
high
the user is trying
that
by merging
Ease
over
grows
it decreases.
goal.
Feather, M. A System For Developing Programs by
Transformatron.
Ph.D. Th., Dept. of Artificial
Intelligence,
University
of Edinburgh,
1979.
6.
7. CONCLUSION
The
purpose
Jitterer
the
of
with
types
of
environment.
being
this
enough
jittering
The
implemented
language
[3]
paper
systems
will
deal
example
the next
been
knowledge
problems
prototype
in the
and
has
domain
much
typically
Jitterer
Hearsay-ill
represents
more
to
a
with
present
a prototype
to deal competently
encountered
described
knowledge
is
in
7. Friedland,
P. Knowledge-based Hierarchical Planning in
Molecular Genetics. Ph.D. Th., Computer Science Dept., Stanford
University,
1979.
with
a TI
currently
representation
preliminary
system.
performance
issues
8. Goldman, N., and Wile, D. A Data Base specification.
International
Conference
on the Kntity-Relational
Approach
Systems Analysis and Design,
UCLA, 1979.
Future
(see
for
section).
9. Sacerdoti,
E. Problem
SRI, July
1979.
70
Solving
Tactics.
Technical
Note
to
189,