Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeORer does not correctly handle not literals #73

Open
gsingh93 opened this issue Apr 16, 2015 · 1 comment
Open

DeORer does not correctly handle not literals #73

gsingh93 opened this issue Apr 16, 2015 · 1 comment

Comments

@gsingh93
Copy link

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());
        }
    }
@gsingh93
Copy link
Author

Here is my implementation of deorer in Rust: https://github.com/gsingh93/ggp-rs/blob/master/src/prover/deorer.rs

If I return a list of nots, I add all those nots to the end of the original rule, remove the original literal, and add that to the list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant