nuXmv empty initial set of states for LTL formula - model-checking

I'm using nuXmv 1.1.1 to model check the following finite state machine.
MODULE main
VAR
node : {_0_0,_1_0,_1_1,_1_2,_1_3,_2_0};
DEFINE
setParentThis_r_ := case
TRUE : FALSE;
esac;
setParent_r_ := case
node=_1_3 :TRUE;
TRUE : FALSE;
esac;
ASSIGN
init(node) := _2_0 ;
next(node) := case
node =_0_0:{_0_0};
node =_1_0:{_1_1};
node =_1_1:{_1_2};
node =_1_2:{_1_3};
node =_1_3:{_0_0};
node =_2_0:{_1_0};
esac;
With the following CTL specification
SPEC
A[(!(setParent_r_)) U (setParentThis_r_ -> AX(AG(!(setParent_r_))))]
nuXmv yields that the specification is true.
With the following LTL specfication
LTLSPEC
(!(setParent_r_)) U (setParentThis_r_ -> X(G(!(setParent_r_))))
nuXmv produces the following warning
******** WARNING ******** The initial states set of the finite state machine is empty. This might make results of model checking not
trustable.
******** END WARNING ********
I understand the warning, but I do not understand why does it appear.
In my opinion, it should appear with both specifications or do not appear at all.
Does anyone have an explanation ?

Related

ArangoDB: Traversal condition on related document

Been stuck for days with this concern, trying to accomplish this:
See the provided picture.
The black is the start vertex. Trying to get:
1: All child parts OUTBOUND (from) the start vertex
2: Condition: The children MUST have the INBOUND edge"types" and the other end a document with a variable set to "true" and of the type "type".
3: When a document of type "part" fails to met up the requirements with INBOUND document of type "type" with a attribute to "true", it stops the expand for that path then and there.
4: The documents who failed isn't included in the result either.
5: Should be compatible with any depths.
6: No subqueries (if possible without).
Example of graph
With the given information, the data model seems questionable. Why are there true and false vertices instead of a boolean edge attribute per partScrew? Is there a reason why it is modeled like this?
Using this data model, I don't see how this would be possible without subqueries. The traversal down a path can be stopped early with PRUNE, but that does not support subqueries. That only leaves FILTER for post-filtering as option, but be careful, you need to check all vertices on the path and not just the emitted vertex whether it has an inbound false type.
Not sure if it works as expected in all cases, but here is what I came up with and the query result, which looks good to me:
LET startScrew = FIRST(FOR doc IN screw LIMIT 1 RETURN doc) // Screw A
FOR v,e,p IN 1..2 OUTBOUND startScrew partScrew
FILTER (
FOR v_id IN SHIFT(p.vertices[*]._id) // ignore start vertex
FOR v2 IN 1..1 INBOUND v_id types
RETURN v2.value
) NONE == false
RETURN {
path: CONCAT_SEPARATOR(" -- ", p.vertices[*].value)
}
path
Screw A -- Part D
Screw A -- Part E
Screw A -- Part E -- Part F
Dump with test data: https://gist.github.com/Simran-B/6bd9b154d1d1e2e74638caceff42c44f

Is it possible to report error on a condition with terraform 0.12?

Original reference - Quit condition on Terraform blueprint
Is it still possible to make conditional check like in the above question
resource "null_resource" "condition_checker" {
count = "${var.variable == 1 ? 0 : 1}"
"Insert your custom error message" = true
}
Similar format does not work in terraform 0.12 and 0.13 and I could not find any reference to removal of this feature. Is it possible to make a check like this 0.12 or 0.13?
Currently it is still not possible to validate inputs that require access to more than a variable. (The validation block only allows access to the validated variable.)
A hacky validation is still possible using the external data source:
data "external" "check_valid" {
count = var.to_test == true && some_other_condition ? 1 : 0
program = ["sh", "-c", ">&2 echo Condition must be satisfied when to_test is true; exit 1"]
}
This condition is checked before terraform asks for approval of a plan.
On the output it looks like this:
Error: failed to execute "sh": Condition must be satisfied when to_test is true
on variables.tf line 1, in data "external" "check_valid":
1: data "external" "check_valid" {
What you're referring to here was never an actual Terraform feature, but rather an example of exploiting a bug in an earlier version of Terraform to get a result that Terraform had no explicit support for.
With that said, modern versions of Terraform have support for custom variable validation rules which allow you to write out variable validation checks directly inside the corresponding variable block. For example:
variable "variable" {
type = number
validation {
condition = var.variable == 1
error_message = "Variable value must always be 1."
}
}
With that said, I just copied your contrived example from the question here, so this would require some adaptation for a real example. Note also that variable validation rules can only depend on the variable value and other constants, so you can't use this for more complicated checks such as those which involve two different variables. For that sort of situation, I'd recommend refactoring so that the values that are related arrive in a single variable of a object type, and then the validation can be for whether that object is valid.

Indeterminate register values in hdl simulation

I am trying to simulate an AXI4(Full) master using Vivado. It is supposed to write the following values on the slave side(which, in my case, is gonna be some registers in my zedboard PS)
0x0000fe01 to 0xe000a204
0x0000fe01 to 0xe000a208
0x00000001 to 0xe000a040
I checked the AXI protocol and this the FSM that I have to implement.
Here is the block level design.
When I run behavioural synthesis, It works.
However when I try to run post synthesis functional simulation (Which is supposedly closer to the actual design and includes gate delays), I am getting some indeterminate values
Here is the complete project and the master IP if you need to check it.
vivado project(using vivado 2015.2)
axi_controller
Here are the individual verilog files(just for ease of access) in the top down order:
axi_controller_testbench.v
design_1_wrapper.v
design_1.v
axi_controller_v1_1.v(This is where I make the state calculation for the FSM I send the state to the interface unit so it can assign proper values to the ports)
axi_controller_v1_1_M00_AXI.v(This is the interface unit in the IP)
I have narrowed the problem down to this part in my code.
//state updation
always #(posedge m00_axi_aclk) begin
if(m00_axi_aresetn==1'b0) begin
cur<=t_0;
next<=t_0;
end
else begin
cur<=next;
end
end
//state calculation
always #(*) begin
case(cur)
t_0: begin
if(m00_axi_init_axi_txn) next=t_1;
else next=t_0;
end
t_1: begin
next=t_2;
end
t_2: begin
if(m00_axi_awready) begin
if(m00_axi_wready) next=t_4;
else next=t_3;
end
else next=t_2;
end
t_3: begin
if(m00_axi_wready) next=t_4;
else next=t_3;
end
t_4: begin
if(m00_axi_awready) begin
if(m00_axi_wready) next=t_6;
else next=t_5;
end
else next=t_4;
end
t_5: begin
if(m00_axi_wready) next=t_6;
else next=t_5;
end
t_6: begin
next=t_6;
end
default next=t_0;
endcase
end
where,
parameter t_0=3'b000,
parameter t_1=3'b001,
parameter t_2=3'b010,
parameter t_3=3'b011,
parameter t_4=3'b100,
parameter t_5=3'b101,
parameter t_6=3'b110,
At 100ns when INIT_AXI_TRANS changes from 0 to 1 next becomes 00x
since cur is 000 (or t_0) the first case should be implemented. As next becomes 00x, I think it's unable to find whether INIT_AXI_TRANS is 0 or 1. This effect is then propagating through the rest of the circuit.
Can anyone please help me find out how i can fix this.
Thanks in advance.
I did what was suggested in the first comment, and have updated the code here and in the git repository. Sadly, it seems that was not the problem as I am still getting the same result.
You are assigning a value to next in multiple processes. In the reset process and in state change process.

Inno Setup function CheckItem syntax and usage

Following on from my question Inno Setup disable component selection when a specific component is selected, I think there may be a way to get this to work without the problem of checked states set in code being permanent (though use of the Checked property) by instead using:
function CheckItem(const Index: Integer; const AOperation: TCheckItemOperation): Boolean;
in TNewCheckListBox, however I am having trouble getting the syntax correct. I am trying:
CheckItem(CompIndexSync, coUncheck) := Checked[CompIndexClient];
where the CompIndexes are constants assigned to the indexes for the component values. I get an Identifier Expected error at compile. Can someone advise how to correctly use this function and what I am doing wrong?
The CheckItem member of the TNewCheckListBox class is a method of type function which updates the checked state by the AOperation operation and returns True if any changes were made to the state of the item at Index, or any of its children. Here is its prototype (source):
function TNewCheckListBox.CheckItem(const Index: Integer;
const AOperation: TCheckItemOperation): Boolean;
The problem was that you were trying to assign a value to the function result. That's not what you can do in Pascal language in general.
What you want to do with the item(s) is passed by the AOperation parameter. In pseudocode e.g.:
var
CheckList: TNewCheckListBox;
Operation: TCheckItemOperation;
begin
...
if ShouldCheck then
Operation := coCheck
else
Operation := coUncheck;
if CheckList.CheckItem(ItemIndex, Operation) then
MsgBox('An item has changed its state.', mbInformation, MB_OK);
end;

Inno Setup crashes in appendChild msxml

I want to modify xml file in Inno Setup - but installer crashes. I tried different things, and as result got sample code with problem
procedure testXml();
var
xmlDocLocal, nodeLocal: Variant;
begin
try
xmlDocLocal := CreateOleObject('MSXML2.DOMDocument');
xmlDocLocal.async := False;
xmlDocLocal.resolveExternals := False;
xmlDocLocal.loadXML('<root></root>');
nodeLocal := xmlDocLocal.CreateElement('element1');
xmlDocLocal.documentElement.appendChild(nodeLocal);
except
end;
end;
During second call, installer crashes on the appendChild method. What am I doing wrong ?
Three ideas: first, we're using InnoSetup, but for us the OleObject needs to be created with another string ending with the specific version 6.0:
try
XMLDoc := CreateOleObject('MSXML2.DOMDocument.6.0');
except
RaiseException('Please install MSXML first.'#13#13'(Error ''' + GetExceptionMessage + ''' occurred)');
end;
Second idea: try adding an xml header to the XML string you have in your code. Like this:
xmlDocLocal.loadXML('<?xml version="1.0" encoding="UTF-8" ?><root></root>');
Third idea: try checking for errors (as I already showed in the first snippet). That might give you a pretty good idea what goes wrong. This is how we do it (and it works):
XMLDoc.load(XMLFileName);
if XMLDoc.parseError.errorCode <> 0 then
XMLDoc.load(XMLFileName2);
if XMLDoc.parseError.errorCode <> 0 then
RaiseException('Error on line ' + IntToStr(XMLDoc.parseError.line) + ', position ' + IntToStr(XMLDoc.parseError.linepos) + ': ' + XMLDoc.parseError.reason);
Hope this helps you. Hard to solve an unknown issue ;-)
Though this is an old issue, I would like to bring it up once more. I am using InnoSetup 6 and have spent two days working on this until I found this stackoverflow issue. For me it seems that the problem is still there. My installer keeps crashing with an Access Violation and I boilt it down to a very similar example like the one above. It makes no difference if I use createElement or createNode.
xmlDocument := CreateOleObject('MSXML2.DOMDocument.6.0');
xmlDocument.async := false;
xmlDocument.resolveExternals := false;
xmlDocument.loadXML('<broker><web bind="http://localhost:8161"></web></broker>');
//xmlDocument.setProperty('SelectionLanguage', 'XPath');
// Select the <web> node
node := xmlDocument.selectSingleNode('/broker/web');
// save attribute value into variable
bind := node.getAttribute('bind');
// remove legacy attribute
node.removeAttribute('bind');
// add new <binding> element as first child of <web>
//newNode := xmlDocument.createNode(1, 'binding', '');
newNode := xmlDocument.createElement('binding');
newNode.setAttribute('uri', bind);
Log(Format('### Appending %s as first child of %s', [newNode.xml, node.xml]));
node.appendChild(newNode);
Log(Format('### Inserted %s as first child of %s', [newNode.xml, node.xml]));
xmlDocument.Save(bootConfig);
All I see when running the code above is this:
The difference with createElement and createNode is, that createElement creates the exception message above and createNode simply kills the installer silently.
The last I see in the logs is this line:
2022-04-25 13:44:47.597 ### Appending <binding uri="http://localhost:8161"/> as first child of <web></web>
2022-04-25 13:44:47.597 CurStepChanged raised an exception.
2022-04-25 13:44:47.597 Exception message:
2022-04-25 13:44:47.597 Message box (OK):
Runtime error (at 211:2827):
Access violation at address 03CC8380. Execution of address 03CC8380.
Has this been addressed in some way? I cannot see from Russel Jordan's site that there has been any bugfix for this.

Resources