{"action":"closed","issue":{"url":"https://api.github.com/repos/modelica/ModelicaSpecification/issues/1718","repository_url":"https://api.github.com/repos/modelica/ModelicaSpecification","labels_url":"https://api.github.com/repos/modelica/ModelicaSpecification/issues/1718/labels{/name}","comments_url":"https://api.github.com/repos/modelica/ModelicaSpecification/issues/1718/comments","events_url":"https://api.github.com/repos/modelica/ModelicaSpecification/issues/1718/events","html_url":"https://github.com/modelica/ModelicaSpecification/issues/1718","id":377150214,"node_id":"MDU6SXNzdWUzNzcxNTAyMTQ=","number":1718,"title":"It is not possible to use start= or fixed= modifications with Complex","user":{"login":"modelica-trac-importer","id":22202507,"node_id":"MDQ6VXNlcjIyMjAyNTA3","avatar_url":"https://avatars1.githubusercontent.com/u/22202507?v=4","gravatar_id":"","url":"https://api.github.com/users/modelica-trac-importer","html_url":"https://github.com/modelica-trac-importer","followers_url":"https://api.github.com/users/modelica-trac-importer/followers","following_url":"https://api.github.com/users/modelica-trac-importer/following{/other_user}","gists_url":"https://api.github.com/users/modelica-trac-importer/gists{/gist_id}","starred_url":"https://api.github.com/users/modelica-trac-importer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modelica-trac-importer/subscriptions","organizations_url":"https://api.github.com/users/modelica-trac-importer/orgs","repos_url":"https://api.github.com/users/modelica-trac-importer/repos","events_url":"https://api.github.com/users/modelica-trac-importer/events{/privacy}","received_events_url":"https://api.github.com/users/modelica-trac-importer/received_events","type":"User","site_admin":false},"labels":[{"id":971423507,"node_id":"MDU6TGFiZWw5NzE0MjM1MDc=","url":"https://api.github.com/repos/modelica/ModelicaSpecification/labels/bug","name":"bug","color":"d73a4a","default":true}],"state":"closed","locked":false,"assignee":{"login":"HansOlsson","id":13217430,"node_id":"MDQ6VXNlcjEzMjE3NDMw","avatar_url":"https://avatars0.githubusercontent.com/u/13217430?v=4","gravatar_id":"","url":"https://api.github.com/users/HansOlsson","html_url":"https://github.com/HansOlsson","followers_url":"https://api.github.com/users/HansOlsson/followers","following_url":"https://api.github.com/users/HansOlsson/following{/other_user}","gists_url":"https://api.github.com/users/HansOlsson/gists{/gist_id}","starred_url":"https://api.github.com/users/HansOlsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HansOlsson/subscriptions","organizations_url":"https://api.github.com/users/HansOlsson/orgs","repos_url":"https://api.github.com/users/HansOlsson/repos","events_url":"https://api.github.com/users/HansOlsson/events{/privacy}","received_events_url":"https://api.github.com/users/HansOlsson/received_events","type":"User","site_admin":false},"assignees":[{"login":"mtiller","id":144876,"node_id":"MDQ6VXNlcjE0NDg3Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/144876?v=4","gravatar_id":"","url":"https://api.github.com/users/mtiller","html_url":"https://github.com/mtiller","followers_url":"https://api.github.com/users/mtiller/followers","following_url":"https://api.github.com/users/mtiller/following{/other_user}","gists_url":"https://api.github.com/users/mtiller/gists{/gist_id}","starred_url":"https://api.github.com/users/mtiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtiller/subscriptions","organizations_url":"https://api.github.com/users/mtiller/orgs","repos_url":"https://api.github.com/users/mtiller/repos","events_url":"https://api.github.com/users/mtiller/events{/privacy}","received_events_url":"https://api.github.com/users/mtiller/received_events","type":"User","site_admin":false},{"login":"sjoelund","id":3016460,"node_id":"MDQ6VXNlcjMwMTY0NjA=","avatar_url":"https://avatars0.githubusercontent.com/u/3016460?v=4","gravatar_id":"","url":"https://api.github.com/users/sjoelund","html_url":"https://github.com/sjoelund","followers_url":"https://api.github.com/users/sjoelund/followers","following_url":"https://api.github.com/users/sjoelund/following{/other_user}","gists_url":"https://api.github.com/users/sjoelund/gists{/gist_id}","starred_url":"https://api.github.com/users/sjoelund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjoelund/subscriptions","organizations_url":"https://api.github.com/users/sjoelund/orgs","repos_url":"https://api.github.com/users/sjoelund/repos","events_url":"https://api.github.com/users/sjoelund/events{/privacy}","received_events_url":"https://api.github.com/users/sjoelund/received_events","type":"User","site_admin":false},{"login":"casella","id":4233148,"node_id":"MDQ6VXNlcjQyMzMxNDg=","avatar_url":"https://avatars1.githubusercontent.com/u/4233148?v=4","gravatar_id":"","url":"https://api.github.com/users/casella","html_url":"https://github.com/casella","followers_url":"https://api.github.com/users/casella/followers","following_url":"https://api.github.com/users/casella/following{/other_user}","gists_url":"https://api.github.com/users/casella/gists{/gist_id}","starred_url":"https://api.github.com/users/casella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/casella/subscriptions","organizations_url":"https://api.github.com/users/casella/orgs","repos_url":"https://api.github.com/users/casella/repos","events_url":"https://api.github.com/users/casella/events{/privacy}","received_events_url":"https://api.github.com/users/casella/received_events","type":"User","site_admin":false},{"login":"MartinOtter","id":7248038,"node_id":"MDQ6VXNlcjcyNDgwMzg=","avatar_url":"https://avatars3.githubusercontent.com/u/7248038?v=4","gravatar_id":"","url":"https://api.github.com/users/MartinOtter","html_url":"https://github.com/MartinOtter","followers_url":"https://api.github.com/users/MartinOtter/followers","following_url":"https://api.github.com/users/MartinOtter/following{/other_user}","gists_url":"https://api.github.com/users/MartinOtter/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinOtter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinOtter/subscriptions","organizations_url":"https://api.github.com/users/MartinOtter/orgs","repos_url":"https://api.github.com/users/MartinOtter/repos","events_url":"https://api.github.com/users/MartinOtter/events{/privacy}","received_events_url":"https://api.github.com/users/MartinOtter/received_events","type":"User","site_admin":false},{"login":"christoff-buerger","id":7884278,"node_id":"MDQ6VXNlcjc4ODQyNzg=","avatar_url":"https://avatars2.githubusercontent.com/u/7884278?v=4","gravatar_id":"","url":"https://api.github.com/users/christoff-buerger","html_url":"https://github.com/christoff-buerger","followers_url":"https://api.github.com/users/christoff-buerger/followers","following_url":"https://api.github.com/users/christoff-buerger/following{/other_user}","gists_url":"https://api.github.com/users/christoff-buerger/gists{/gist_id}","starred_url":"https://api.github.com/users/christoff-buerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christoff-buerger/subscriptions","organizations_url":"https://api.github.com/users/christoff-buerger/orgs","repos_url":"https://api.github.com/users/christoff-buerger/repos","events_url":"https://api.github.com/users/christoff-buerger/events{/privacy}","received_events_url":"https://api.github.com/users/christoff-buerger/received_events","type":"User","site_admin":false},{"login":"HansOlsson","id":13217430,"node_id":"MDQ6VXNlcjEzMjE3NDMw","avatar_url":"https://avatars0.githubusercontent.com/u/13217430?v=4","gravatar_id":"","url":"https://api.github.com/users/HansOlsson","html_url":"https://github.com/HansOlsson","followers_url":"https://api.github.com/users/HansOlsson/followers","following_url":"https://api.github.com/users/HansOlsson/following{/other_user}","gists_url":"https://api.github.com/users/HansOlsson/gists{/gist_id}","starred_url":"https://api.github.com/users/HansOlsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HansOlsson/subscriptions","organizations_url":"https://api.github.com/users/HansOlsson/orgs","repos_url":"https://api.github.com/users/HansOlsson/repos","events_url":"https://api.github.com/users/HansOlsson/events{/privacy}","received_events_url":"https://api.github.com/users/HansOlsson/received_events","type":"User","site_admin":false},{"login":"jespermattsson","id":13779895,"node_id":"MDQ6VXNlcjEzNzc5ODk1","avatar_url":"https://avatars2.githubusercontent.com/u/13779895?v=4","gravatar_id":"","url":"https://api.github.com/users/jespermattsson","html_url":"https://github.com/jespermattsson","followers_url":"https://api.github.com/users/jespermattsson/followers","following_url":"https://api.github.com/users/jespermattsson/following{/other_user}","gists_url":"https://api.github.com/users/jespermattsson/gists{/gist_id}","starred_url":"https://api.github.com/users/jespermattsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jespermattsson/subscriptions","organizations_url":"https://api.github.com/users/jespermattsson/orgs","repos_url":"https://api.github.com/users/jespermattsson/repos","events_url":"https://api.github.com/users/jespermattsson/events{/privacy}","received_events_url":"https://api.github.com/users/jespermattsson/received_events","type":"User","site_admin":false},{"login":"henrikt-ma","id":25294143,"node_id":"MDQ6VXNlcjI1Mjk0MTQz","avatar_url":"https://avatars3.githubusercontent.com/u/25294143?v=4","gravatar_id":"","url":"https://api.github.com/users/henrikt-ma","html_url":"https://github.com/henrikt-ma","followers_url":"https://api.github.com/users/henrikt-ma/followers","following_url":"https://api.github.com/users/henrikt-ma/following{/other_user}","gists_url":"https://api.github.com/users/henrikt-ma/gists{/gist_id}","starred_url":"https://api.github.com/users/henrikt-ma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrikt-ma/subscriptions","organizations_url":"https://api.github.com/users/henrikt-ma/orgs","repos_url":"https://api.github.com/users/henrikt-ma/repos","events_url":"https://api.github.com/users/henrikt-ma/events{/privacy}","received_events_url":"https://api.github.com/users/henrikt-ma/received_events","type":"User","site_admin":false},{"login":"gkurzbach","id":25528503,"node_id":"MDQ6VXNlcjI1NTI4NTAz","avatar_url":"https://avatars1.githubusercontent.com/u/25528503?v=4","gravatar_id":"","url":"https://api.github.com/users/gkurzbach","html_url":"https://github.com/gkurzbach","followers_url":"https://api.github.com/users/gkurzbach/followers","following_url":"https://api.github.com/users/gkurzbach/following{/other_user}","gists_url":"https://api.github.com/users/gkurzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/gkurzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkurzbach/subscriptions","organizations_url":"https://api.github.com/users/gkurzbach/orgs","repos_url":"https://api.github.com/users/gkurzbach/repos","events_url":"https://api.github.com/users/gkurzbach/events{/privacy}","received_events_url":"https://api.github.com/users/gkurzbach/received_events","type":"User","site_admin":false},{"login":"svorkoetter","id":25961958,"node_id":"MDQ6VXNlcjI1OTYxOTU4","avatar_url":"https://avatars2.githubusercontent.com/u/25961958?v=4","gravatar_id":"","url":"https://api.github.com/users/svorkoetter","html_url":"https://github.com/svorkoetter","followers_url":"https://api.github.com/users/svorkoetter/followers","following_url":"https://api.github.com/users/svorkoetter/following{/other_user}","gists_url":"https://api.github.com/users/svorkoetter/gists{/gist_id}","starred_url":"https://api.github.com/users/svorkoetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svorkoetter/subscriptions","organizations_url":"https://api.github.com/users/svorkoetter/orgs","repos_url":"https://api.github.com/users/svorkoetter/repos","events_url":"https://api.github.com/users/svorkoetter/events{/privacy}","received_events_url":"https://api.github.com/users/svorkoetter/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/modelica/ModelicaSpecification/milestones/1","html_url":"https://github.com/modelica/ModelicaSpecification/milestone/1","labels_url":"https://api.github.com/repos/modelica/ModelicaSpecification/milestones/1/labels","id":3792647,"node_id":"MDk6TWlsZXN0b25lMzc5MjY0Nw==","number":1,"title":"NeedsInput","description":"These are tickets which need more external input in order to decide on further actions/progress.","creator":{"login":"modelica-trac-importer","id":22202507,"node_id":"MDQ6VXNlcjIyMjAyNTA3","avatar_url":"https://avatars1.githubusercontent.com/u/22202507?v=4","gravatar_id":"","url":"https://api.github.com/users/modelica-trac-importer","html_url":"https://github.com/modelica-trac-importer","followers_url":"https://api.github.com/users/modelica-trac-importer/followers","following_url":"https://api.github.com/users/modelica-trac-importer/following{/other_user}","gists_url":"https://api.github.com/users/modelica-trac-importer/gists{/gist_id}","starred_url":"https://api.github.com/users/modelica-trac-importer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modelica-trac-importer/subscriptions","organizations_url":"https://api.github.com/users/modelica-trac-importer/orgs","repos_url":"https://api.github.com/users/modelica-trac-importer/repos","events_url":"https://api.github.com/users/modelica-trac-importer/events{/privacy}","received_events_url":"https://api.github.com/users/modelica-trac-importer/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":5,"state":"open","created_at":"2018-11-03T10:03:02Z","updated_at":"2018-11-04T13:02:22Z","due_on":null,"closed_at":null},"comments":17,"created_at":"2018-11-04T12:58:01Z","updated_at":"2018-11-04T13:02:22Z","closed_at":"2018-11-04T13:02:22Z","author_association":"COLLABORATOR","body":"**Modified by stefanv on 12 May 2015 14:36 UTC**\nThis can be considered a weakness in either the implementation of Complex, or the specification of operator records. In short, one cannot write,\n\n```mo\n    Complex x(start=Complex(1,2),fixed=true);\n    parameter Complex C(fixed=false);\n```\n\nInstead, one must write:\n\n```mo\n    Complex x(re(start=1,fixed=true),im(start=2,fixed=true));\n    parameter Complex C(re.fixed=false,im.fixed=false);\n```\n\nThis means that the user of Complex must be aware of the internal representation of Complex.\n\nI see two possible solutions to this:\n\n1. Fix it individually in a given operator record, such as Complex, by adding `start` and `fixed` fields to the record, and defining the sub-fields' `start` and `fixed` modifications based on those of the top-level field. For example:\n\n```mo\noperator record Complex\n    parameter Complex start = Complex(0,0);\n    parameter Boolean fixed = false;\n    Real re(start=start.re, fixed=fixed);\n    Real im(start=start.im, fixed=fixed);\n    ...\nend Complex;\n```\n\n2. Somehow add this to the specification of operator records, stating, for example, that:\n\n- An operator record has an implicit `start` parameter, which can take as a modification any expression that is of that operator record type, or for which there exists a constructor to produce a value of that operator record type. For Complex, this would mean that `start=Complex(1,2)` and `start=3` are both allowed. The sub-fields of the `start` modification (e.g. `start.re` and `start.im` are then implicitly set as `start` modifications of the contained variables (e.g. `re.start` and `im.start`).\n\n- An operator record has an implicit `fixed` parameter of type Boolean, and its modification is propagated to the `fixed` parameters of the contained variables (e.g. `re.fixed` and `im.fixed`).\n\nOption 2 implicitly provides the behaviour that was explicitly implemented in option 1 above.\n\n\n----\n\n**Modified by stefanv on 12 May 2015 14:35 UTC**\nThis can be considered a weakness in either the implementation of Complex, or the specification of operator records. In short, one cannot write,\n\n```mo\n    Complex x(start=Complex(1,2),fixed=true);\n    parameter Complex C(fixed=false);\n```\n\nInstead, one must write:\n\n```mo\n    Complex x(re(start=1,fixed=true),im(start=1,fixed=true));\n    parameter Complex C(re.fixed=false,im.fixed=false);\n```\n\nThis means that the user of Complex must be aware of the internal representation of Complex.\n\nI see two possible solutions to this:\n\n1. Fix it individually in a given operator record, such as Complex, by adding `start` and `fixed` fields to the record, and defining the sub-fields' `start` and `fixed` modifications based on those of the top-level field. For example:\n\n```mo\noperator record Complex\n    parameter Complex start = Complex(0,0);\n    parameter Boolean fixed = false;\n    Real re(start=start.re, fixed=fixed);\n    Real im(start=start.im, fixed=fixed);\n    ...\nend Complex;\n```\n\n2. Somehow add this to the specification of operator records, stating, for example, that:\n\n- An operator record has an implicit `start` parameter, which can take as a modification any expression that is of that operator record type, or for which there exists a constructor to produce a value of that operator record type. For Complex, this would mean that `start=Complex(1,2)` and `start=3` are both allowed. The sub-fields of the `start` modification (e.g. `start.re` and `start.im` are then implicitly set as `start` modifications of the contained variables (e.g. `re.start` and `im.start`).\n\n- An operator record has an implicit `fixed` parameter of type Boolean, and its modification is propagated to the `fixed` parameters of the contained variables (e.g. `re.fixed` and `im.fixed`).\n\nOption 2 implicitly provides the behaviour that was explicitly implemented in option 1 above.\n\n\n----\n\n**Reported by stefanv on 12 May 2015 14:27 UTC**\nThis can be considered a weakness in either the implementation of Complex, or the specification of operator records. In short, one cannot write,\n\n```mo\n    Complex x(start=Complex(1,2),fixed=true);\n    parameter Complex C(fixed=false);\n```\n\nInstead, one must write:\n\n```mo\n    Complex x(start=Complex(1,2),re.fixed=true,im.fixed=true);\n    parameter Complex C(re.fixed=false,im.fixed=false);\n```\n\nThis means that the user of Complex must be aware of the internal representation of Complex.\n\nActually, I'm quite sure that `start=Complex(1,2)` is not legal either, but this currently is currently supported in MapleSim due to the way we handle array slicing and record \"slicing\" in an analogous way.\n\nI see two possible solutions to this:\n\n1. Fix it individually in a given operator record, such as Complex, by adding `start` and `fixed` fields to the record, and defining the sub-fields' `start` and `fixed` modifications based on those of the top-level field. For example:\n\n```mo\noperator record Complex\n    parameter Complex start = Complex(0,0);\n    parameter Boolean fixed = false;\n    Real re(start=start.re, fixed=fixed);\n    Real im(start=start.im, fixed=fixed);\n    ...\nend Complex;\n```\n\n2. Somehow add this to the specification of operator records, stating, for example, that:\n\n- An operator record has an implicit `start` parameter, which can take as a modification any expression that is of that operator record type, or for which there exists a constructor to produce a value of that operator record type. For Complex, this would mean that `start=Complex(1,2)` and `start=3` are both allowed. The sub-fields of the `start` modification (e.g. `start.re` and `start.im` are then implicitly set as `start` modifications of the contained variables (e.g. `re.start` and `im.start`).\n\n- An operator record has an implicit `fixed` parameter of type Boolean, and its modification is propagated to the `fixed` parameters of the contained variables (e.g. `re.fixed` and `im.fixed`).\n\nOption 2 implicitly provides the behaviour that was explicitly implemented in option 1 above.\n\n----\n\nMigrated-From: https://trac.modelica.org/Modelica/ticket/1718"}}
{"actor":{"display_login":"modelica-trac-importer"}}