Skip to content

DeORer does not correctly handle not literals #73

@gsingh93

Description

@gsingh93

Given the GDL (<= p (not (or a b))), I'd expect this to de-or to (<= p (not a) (not b)), due to De Morgan's law, i.e., the negation of a disjunction is the conjunction of the negated terms in the disjunction. However, the DeORer class prints out ( <= p ( not a ) ) ( <= p ( not b ) ).

The following code is an example:

    public static void main(String[] args) {
        ArrayList<Gdl> l = new ArrayList<>();
        GdlConstant p = GdlPool.getConstant("p");
        GdlConstant a = GdlPool.getConstant("a");
        GdlConstant b = GdlPool.getConstant("b");

        l.add(GdlPool.getRule(GdlPool.getProposition(p),
                new GdlLiteral[] { GdlPool.getNot(GdlPool.getOr(
                        new GdlLiteral[] { GdlPool.getProposition(a), GdlPool.getProposition(b)})) }));

        List<Gdl> res = DeORer.run(l);
        for (Gdl g : res) {
            System.out.println(g.toString());
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions