File: scalarset-put.m

package info (click to toggle)
rumur 2020.12.20-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,292 kB
  • sloc: cpp: 17,090; ansic: 2,537; objc: 1,542; python: 1,120; sh: 538; yacc: 536; lex: 229; lisp: 15; makefile: 5
file content (33 lines) | stat: -rw-r--r-- 785 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
-- checker_output: None if self.xml else re.compile(r'^y:\s*Undefined$(.|\n)*?^y:\s*t_9$', re.MULTILINE)

-- Test that we can print a scalarset variable. The initial implementation of
-- scalarset remapping caused code to be emitted in an order that had put
-- statements calling a function that had not yet been defined. This caused a
-- compilation failure of the generated verifier. If this problem has been
-- re-introduced, the code generated from this model will fail to compile.

type
  t: scalarset(10);
var
  x: boolean;
  y: t;

startstate begin
  -- print it while it is undefined
  put y;

  -- assign it a value
  for z: t do y := z; end;

  -- print it now that it has a value
  put y;

  x := true;
end;

rule begin
  -- print it during a rule
  put y;

  x := !x;
end;