progress on rewrite
substitute properly in negation
missing case in extract port. still not compiling talk-fw right