Simulate computes improper result with action description

Bug #1413793 reported by Tim Hinrichs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
congress
Fix Released
High
Tim Hinrichs

Bug Description

When we made the move to multiple theories, we put in place the restriction that the heads of rules cannot contain policy names. But for action descriptions, this restriction does not work since we want to be able to say that executing some action adds a row to say the nova:servers table, thereby requiring nova:servers+ to appear in the head of the rule.

This oversight causes the policy engine to malfunction when processing action theories, since it assumed the policy name in the head of the rule was always None. There was a test, but that test also had a bug.

For example, here is an action description policy.

nova:p+(x) :- q(x)
action('q')

When simulating action q(1), the policy engine fails to compute that nova:p+(1) is true. In fact, it queries p+(x) instead of nova:p+(x).

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to congress (master)

Fix proposed to branch: master
Review: https://review.openstack.org/149431

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to congress (master)

Reviewed: https://review.openstack.org/149431
Committed: https://git.openstack.org/cgit/stackforge/congress/commit/?id=8cc3ff035d50e239445886ec531e4590843397ec
Submitter: Jenkins
Branch: master

commit 8cc3ff035d50e239445886ec531e4590843397ec
Author: Tim Hinrichs <email address hidden>
Date: Thu Jan 22 15:18:07 2015 -0800

    Fix multipolicy simulation bug

    Previously, there was a bug in the simulation functionality when
    using action descriptions. The simulation functionality simply failed
    to compute the proper updates given an action instance, thereby the results
    of simulation were wrong.

    This bug fix does a number of things
    1) Only allows policies to appear in the tablenames in the head of a rule
    within an ActionTheory if that tablename is an update (i.e. has a + or -
    at the end of the tablename).

    2) Changes the policy evaluation algorithms to treat an update literal
    as a local table even if the literal references a separate policy.

    3) Changes the implementation of simulation (the consequences
    routine in particular) so that it would generate the appropriate
    queries for computing proper updates caused by an action instance.

    4) Changes the routine for get_arity to take a theory as an argument
    and enable a local_only option so that we compute the arity from
    the proper policy in the case of updates.

    Change-Id: I27564891e0ea4cc463127f1811edd275c27d568f
    Closes-bug: 1413793

Changed in congress:
status: In Progress → Fix Committed
Tim Hinrichs (thinrichs)
Changed in congress:
milestone: none → kilo-3
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.