specware 1.2.13__tar.gz → 1.2.14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: specware
3
- Version: 1.2.13
3
+ Version: 1.2.14
4
4
  Summary: Provides utilities to specify software.
5
5
  Keywords: certification,documentation,markdown,qualification,requirements-management,traceability
6
6
  Author: The specware Authors
@@ -20,7 +20,7 @@ Classifier: Topic :: Software Development :: Quality Assurance
20
20
  Classifier: Topic :: Software Development :: Testing :: Acceptance
21
21
  Classifier: Topic :: Text Processing :: Markup
22
22
  Classifier: Typing :: Typed
23
- Requires-Dist: specitems>=1.6.5
23
+ Requires-Dist: specitems>=1.6.9
24
24
  Requires-Python: >=3.11
25
25
  Project-URL: Source Code, https://github.com/specthings/specware
26
26
  Project-URL: Bug Tracker, https://github.com/specthings/specware/issues
@@ -4,7 +4,7 @@
4
4
 
5
5
  [project]
6
6
  name = "specware"
7
- version = "1.2.13"
7
+ version = "1.2.14"
8
8
  description = "Provides utilities to specify software."
9
9
  authors = [
10
10
  {name = "The specware Authors", email = "specthings@embedded-brains.de"}
@@ -13,7 +13,7 @@ license = "BSD-2-Clause"
13
13
  readme = "README.md"
14
14
  requires-python = ">=3.11"
15
15
  dependencies = [
16
- "specitems >=1.6.5",
16
+ "specitems >=1.6.9",
17
17
  ]
18
18
  keywords = [
19
19
  "certification",
@@ -590,7 +590,7 @@ def get_value_hash(ctx: ItemGetValueContext) -> Any:
590
590
 
591
591
  def get_value_params(ctx: ItemGetValueContext) -> Any:
592
592
  """ Get the value formatted as a parameter. """
593
- return f"``{ctx.value[ctx.key]}``"
593
+ return f"`{ctx.value[ctx.key]}`"
594
594
 
595
595
 
596
596
  def forward_declaration(item: Item) -> str:
@@ -378,19 +378,6 @@ class TransitionMap:
378
378
  map_idx //= count
379
379
  return ", ".join(reversed(conditions))
380
380
 
381
- def map_idx_to_unconditional_pre_co_states(
382
- self, map_idx: int) -> tuple[int, ...]:
383
- """
384
- Map the transition map index and the associated pre-condition state
385
- indices.
386
- """
387
- co_states = []
388
- for condition in reversed(self._item["pre-conditions"]):
389
- count = len(condition["states"])
390
- co_states.append(int(map_idx % count))
391
- map_idx //= count
392
- return tuple(reversed(co_states))
393
-
394
381
  def map_idx_to_pre_co_states(
395
382
  self, map_idx: int, pre_cond_na: tuple[int,
396
383
  ...]) -> tuple[int, ...]:
@@ -492,10 +479,20 @@ class TransitionMap:
492
479
  f"{{{self._map_index_to_pre_conditions(map_idx)}}}")
493
480
 
494
481
  def _make_pre_cond_na(self, map_idx: int, the_pre_cond_na: Any,
495
- skip: list[int]) -> int:
482
+ skip: list[int],
483
+ resolved_pre_cond_na: tuple[int, ...]) -> int:
496
484
  if isinstance(the_pre_cond_na, int):
497
485
  return the_pre_cond_na
498
- pre_co_states = self.map_idx_to_unconditional_pre_co_states(map_idx)
486
+ # Use the pre-condition states already resolved for earlier
487
+ # pre-conditions (in declaration order) so that a pre-condition
488
+ # which is N/A because of one of its ancestors is seen as N/A here
489
+ # as well, even if this pre-condition's own applicable/
490
+ # not-applicable/skip clause only names its direct parent. This
491
+ # way, the N/A status transitively propagates along the whole
492
+ # dependency chain instead of having to be repeated in every
493
+ # dependent clause.
494
+ pre_co_states = self.map_idx_to_pre_co_states(map_idx,
495
+ resolved_pre_cond_na)
499
496
  ctx = _CondExpContext(self, map_idx, pre_co_states, tuple(), -1, None)
500
497
  if _cond_bool_exp(
501
498
  ctx,
@@ -513,11 +510,12 @@ class TransitionMap:
513
510
  # pylint: disable=too-many-arguments
514
511
  # pylint: disable=too-many-positional-arguments
515
512
  skip = [skip_post_cond[0]]
516
- pre_cond_na = tuple(
517
- self._make_pre_cond_na(map_idx, the_pre_cond_na, skip)
518
- for the_pre_cond_na in pre_cond_na)
519
- variant = Transition(desc_idx, enabled_by, skip[0], pre_cond_na,
520
- skip_post_cond[1:])
513
+ resolved_pre_cond_na = [0] * len(pre_cond_na)
514
+ for co_idx, the_pre_cond_na in enumerate(pre_cond_na):
515
+ resolved_pre_cond_na[co_idx] = self._make_pre_cond_na(
516
+ map_idx, the_pre_cond_na, skip, tuple(resolved_pre_cond_na))
517
+ variant = Transition(desc_idx, enabled_by, skip[0],
518
+ tuple(resolved_pre_cond_na), skip_post_cond[1:])
521
519
  for co_idx in range(len(variant.post_cond)):
522
520
  variant = self._map_post_cond(map_idx, co_idx, variant)
523
521
  return variant
@@ -38,9 +38,9 @@ from specitems import (create_unique_link, Item, ItemCache,
38
38
 
39
39
  from .build import get_build_base_directory
40
40
  from .contentc import (CContent, CInclude, enabled_by_to_exp, ExpressionMapper,
41
- GenericContent, get_integer_type, get_value_params,
42
- get_value_doxygen_group, get_value_doxygen_function,
43
- get_value_unspecified_type)
41
+ GenericContent, get_integer_type, get_value_compound,
42
+ get_value_params, get_value_doxygen_group,
43
+ get_value_doxygen_function, get_value_unspecified_type)
44
44
  from .transitionmap import TransitionMap
45
45
 
46
46
  _CaseToSuite = dict[str, list["_TestItem"]]
@@ -82,6 +82,8 @@ class _Mapper(ItemMapper):
82
82
  self.add_get_value("interface/group:/name", get_value_doxygen_group)
83
83
  self.add_get_value("interface/macro:/name", get_value_doxygen_function)
84
84
  self.add_get_value("interface/macro:/params/name", get_value_params)
85
+ self.add_get_value("interface/struct:/name", get_value_compound)
86
+ self.add_get_value("interface/union:/name", get_value_compound)
85
87
  self.add_get_value("interface/unspecified-function:/name",
86
88
  get_value_doxygen_function)
87
89
  self.add_get_value("interface/unspecified-struct:/name",
@@ -422,7 +424,7 @@ class _TestItem:
422
424
  content.add_description_block(
423
425
  self.substitute_text(info["brief"]),
424
426
  self.substitute_text(info["description"]))
425
- content.add(f"{info['member'].strip()};")
427
+ content.add(self.substitute_code(f"{info['member'].strip()};"))
426
428
  gap = content.gap
427
429
  content.gap = gap
428
430
  content.add(default_members)
File without changes