Skip to content

Clarified the inputs for the PID case study. #244

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

Merged
merged 4 commits into from
Oct 7, 2016

Conversation

theyoucheng
Copy link
Contributor

  • specify input parameters for the PID function more clearly
  • non-deterministically assign input values at each loop iteration

@kroening
Copy link
Member

The test suite seems to only need to feed inputs twice into the controller; why are 6 unwindings needed? What are the inputs used in the remaining 4 iterations?

@theyoucheng
Copy link
Contributor Author

Added the test suite for unwinding the loop six times.

22: // Vertical speed of the UAV detected by GPS sensor
23: float estimator_z_dot;
24:
25: /** PID funciton OUTPUTS */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix typo

26: float desired_gaz;
27: float desired_pitch;
28:
29: /** Accumulated error in the control */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please say that this is a state variable

64: __CPROVER_assume(estimator_z_dot>=-MAX_CLIMB && estimator_z_dot<=MAX_CLIMB);
65:
66: climb_pid_run();
67:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a __CPROVER_output for the output

Subsequently, the <code>__CPROVER_assume</code> statement in lines 60 and 61 guarantees that
their values are bounded within a range.
which repeatedly invokes the function <code>climb_pid_run</code> (line 66).
In the beginning of each loop iteration, the values of the desired speed <code>desired_climb</code>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain that these are inputs

</p>

<p class="justified">
To demonstrate the automatic test suite generation in CBMC,
we call the following command
</p>

<pre><code>cbmc pid.c --cover mcdc --unwind 25 --trace --xml-ui
<pre><code>cbmc pid.c --cover mcdc --unwind 6 --trace --xml-ui
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not told why "6" is the right number

(goal id: climb_pid_run.coverage.2)
T3: desired_climb=0.000000f, estimator_z_dot=0.000000f
(goal id: climb_pid_run.coverage.3)
T1: (desired_climb=-1.000000f, estimator_z_dot=-1.000000f)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test suite does not tell me which numbers to feed in in which iteration

@kroening kroening self-assigned this Oct 6, 2016
62: /** Range of input values */
63: __CPROVER_assume(desired_climb>=-MAX_CLIMB && desired_climb<=MAX_CLIMB);
64: __CPROVER_assume(estimator_z_dot>=-MAX_CLIMB && estimator_z_dot<=MAX_CLIMB);
65:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be two __CPROVER_input commands to record these.


/** Range of initial values of variables */
__CPROVER_assume(desired_climb>=-MAX_CLIMB && desired_climb<=MAX_CLIMB);
__CPROVER_assume(estimator_z_dot>=-MAX_CLIMB && estimator_z_dot<=MAX_CLIMB);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

climd_sum_err should be initialized explicitly

@kroening kroening merged commit f5dcd92 into diffblue:master Oct 7, 2016
@theyoucheng
Copy link
Contributor Author

Thanks Daniel. For now the test suites are manually linked to its coverage goals in this manual. I am going to add an extra script for this later.

peterschrammel added a commit that referenced this pull request May 10, 2017
Fix issue #244 - add_axioms_for_set_length
smowton pushed a commit to smowton/cbmc that referenced this pull request May 9, 2018
chrisr-diffblue added a commit to chrisr-diffblue/cbmc that referenced this pull request Aug 24, 2018
Fixup Makefile for PR#242 "Make exprt::is_zero() support bitfields"
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

Successfully merging this pull request may close these issues.

2 participants