IRVINE, Calif. (AP) _ Liz and Tony are married, but she's in love with Neil, whose life is then threatened by Stephano, Tony's father. Things are complicated enough when a new writer is brought in, offering an inspired turn in the soap opera plot: Could Neil fall for Tony's mother?

Stay tuned. The last twist came from a plot-concocting computer programmed by a Columbia University researcher who is studying human creativity.

''It's now at the point where it can write a few simple plot outlines,'' said Michael Lebowitz, an associate professor of computer science who discussed the project during the Cognitive Science Society's annual meeting at the University of California-Irvine.

''I can imagine someday having a computer create a script for 'Days of Our Lives,''' the New York researcher said. Computers eventually might produce serious works of literature, if programmers can learn how real authors do it.

Lebowitz works in a field known as artificial intelligence, the science of writing computer programs that do ''smart'' things such as making medical diagnoses or understanding language. To do that, programmers first must figure out, step-by-step, how people perform such tasks.

Lebowitz is trying to break the creative process of writing a soap opera into a set of standard ''formulas'' or plot fragments, such as the unhappy marriage, and rules used to assemble such fragments into an interesting story.

One rule, he said, is that melodrama characters never live happily ever after.

If the computer writes a nonsensical story by following the rules to assemble plot fragments, Lebowitz said it means his ideas of how human authors write need sharpening.

''It gives you insight into human creativity, which in artificial intelligence is one of the things we understand least,'' he said Friday. ''This form of creativity (writing soap operas) is something we perhaps can get a handle on, simpler than trying to figure out how Joyce wrote 'Ulysses.'''

The program he uses, called UNIVERSE because it contains a cast or universe of characters, uses plot fragments from NBC-TV's ''Days of Our Lives.''

Enter Liz and Tony and Neil and Stephano.

UNIVERSE ''is not just spitting back this story,'' Lebowitz explained. Instead, it was given various plot fragments in general terms: an unhappy marriage, an extramarital affair, a threat from someone who wants the marriage to stay together, collapse of the love affair and finally, collapse of the marriage.

When the program is run on the computer, it follows general rules of melodrama, as theorized by Lebowitz, to select plot fragments and characters to recreate or revise the story.

''When I was trying to get it to do this story at first, it had to pick a character to get Neil married to,'' he said. ''In one case, it decided to pick Tony's mother. It's a cute idea that has potential.''

By increasing UNIVERSE's plot options and ground rules, ''it will be able to create more and more complicated stories,'' Lebowitz said.

''This is not unlike what authors of a melodrama would tend to do. They have a lot of abstract (plot) formulas and they figure how those interact with the characters and use that to churn out stories,'' he said.

Lebowitz doubts computers will replace TV soap opera writers, but envisions ''a computer-controlled soap opera that you're a part of.''

''It would probably be on a computer with graphics or video disks,'' he said. ''The basic idea is that you would be one of the characters. The computer would control the other characters and you would tell it what to do with your character.''

He also sees practical benefits.

''If we want to teach reading or writing (to people), you can have a computer program that writes stories to help teach morals or reading,'' he said. ''Or the person could be writing a story (on a computer) and the program could analyze if it's a good story or not, as in teaching creative writing.''